Dataset Viewer
Auto-converted to Parquet Duplicate
i
int64
0
599
src_path
stringlengths
12
12
pyc_path
stringlengths
13
13
input
stringlengths
363
29.3k
expected
stringlengths
82
9.32k
provenance
dict
license
dict
csn_repo
stringclasses
117 values
csn_func
stringlengths
2
53
n_instr
int64
19
1.62k
has_annotation
bool
2 classes
0
src/00000.py
pyc/00000.pyc
CODE <module>() RESUME 0 LOAD_CONST <code __msgc_step3_discontinuity_localization> MAKE_FUNCTION 0 STORE_NAME __msgc_step3_discontinuity_localization RETURN_CONST None END CODE __msgc_step3_discontinuity_localization(self) DOC 'pass' RESUME 0 LOAD_CONST 0 LOAD_CONST None IMPORT_NAME scipy STORE_FA...
def __msgc_step3_discontinuity_localization(self): """pass""" import scipy start = self._start_time seg = 1 - self.segmentation.astype(np.int8) self.stats['low level object voxels'] = np.sum(seg) self.stats['low level image voxels'] = np.prod(seg.shape) seg_border = scipy.ndimage.filters.lap...
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.__msgc_step3_discontinuity_localization", "line_start": 323, "line_end": 372, "permalink": "https://github.com/mji...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.__msgc_step3_discontinuity_localization
162
false
1
src/00001.py
pyc/00001.pyc
CODE <module>() RESUME 0 LOAD_CONST <code __multiscale_gc_lo2hi_run> MAKE_FUNCTION 0 STORE_NAME __multiscale_gc_lo2hi_run RETURN_CONST None END CODE __multiscale_gc_lo2hi_run(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + _msgc_lo2hi_resize_init CALL 0 POP_TOP LOAD_FAST self LO...
def __multiscale_gc_lo2hi_run(self): """pass""" self._msgc_lo2hi_resize_init() self.__msgc_step0_init() hard_constraints = self.__msgc_step12_low_resolution_segmentation() seg = self.__msgc_step3_discontinuity_localization() self.stats['t3.1'] = time.time() - self._start_time graph = Graph(s...
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.__multiscale_gc_lo2hi_run", "line_start": 526, "line_end": 606, "permalink": "https://github.com/mjirik/imcut/blob...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.__multiscale_gc_lo2hi_run
268
false
2
src/00002.py
pyc/00002.pyc
CODE <module>() RESUME 0 LOAD_CONST <code __multiscale_gc_hi2lo_run> MAKE_FUNCTION 0 STORE_NAME __multiscale_gc_hi2lo_run RETURN_CONST None END CODE __multiscale_gc_hi2lo_run(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + __msgc_step0_init CALL 0 POP_TOP LOAD_FAST self LOAD_ATT...
def __multiscale_gc_hi2lo_run(self): """pass""" self.__msgc_step0_init() hard_constraints = self.__msgc_step12_low_resolution_segmentation() seg = self.__msgc_step3_discontinuity_localization() nlinks, unariesalt2, msinds = self.__msgc_step45678_hi2lo_construct_graph(hard_constraints, seg) self....
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.__multiscale_gc_hi2lo_run", "line_start": 608, "line_end": 626, "permalink": "https://github.com/mjirik/imcut/blob...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.__multiscale_gc_hi2lo_run
39
false
3
src/00003.py
pyc/00003.pyc
CODE <module>() RESUME 0 LOAD_CONST <code __ordered_values_by_indexes> MAKE_FUNCTION 0 STORE_NAME __ordered_values_by_indexes RETURN_CONST None END CODE __ordered_values_by_indexes(self, data, inds) DOC 'pass' RESUME 0 LOAD_CONST None BUILD_LIST 1 LOAD_GLOBAL np LOAD_ATTR NULL|self + max LOAD_FA...
def __ordered_values_by_indexes(self, data, inds): """pass""" values = [None] * (np.max(inds) + 1) linear_inds = inds.ravel() linear_data = data.ravel() for i in range(0, len(linear_inds)): if values[linear_inds[i]] is None: values[linear_inds[i]] = linear_data[i] elif va...
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.__ordered_values_by_indexes", "line_start": 628, "line_end": 678, "permalink": "https://github.com/mjirik/imcut/bl...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.__ordered_values_by_indexes
84
false
4
src/00004.py
pyc/00004.pyc
CODE <module>() RESUME 0 LOAD_CONST <code __hi2lo_multiscale_indexes> MAKE_FUNCTION 0 STORE_NAME __hi2lo_multiscale_indexes RETURN_CONST None END CODE __hi2lo_multiscale_indexes(self, mask, orig_shape) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + zoom_to_shape LOAD_FAST mask LOAD_FAST orig_shape LOAD_GL...
def __hi2lo_multiscale_indexes(self, mask, orig_shape): """pass""" mask_orig = zoom_to_shape(mask, orig_shape, dtype=np.int8) inds_small = np.arange(mask.size).reshape(mask.shape) inds_small_in_orig = zoom_to_shape(inds_small, orig_shape, dtype=np.int8) inds_orig = np.arange(np.prod(orig_shape)).res...
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.__hi2lo_multiscale_indexes", "line_start": 680, "line_end": 721, "permalink": "https://github.com/mjirik/imcut/blo...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.__hi2lo_multiscale_indexes
88
false
5
src/00005.py
pyc/00005.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, None) LOAD_CONST <code interactivity> MAKE_FUNCTION defaults STORE_NAME interactivity RETURN_CONST None END CODE interactivity(self, min_val, max_val, qt_app) DOC 'pass' RESUME 0 LOAD_CONST 1 LOAD_CONST ('QTSeedEditor',) IMPORT_NAME seed_editor_qt ...
def interactivity(self, min_val=None, max_val=None, qt_app=None): """pass""" from .seed_editor_qt import QTSeedEditor from PyQt4.QtGui import QApplication if min_val is None: min_val = np.min(self.img) if max_val is None: max_val = np.max(self.img) window_c = (max_val + min_val) ...
{ "repo": "mjirik/imcut", "repo_url": "https://github.com/mjirik/imcut", "file_path": "imcut/pycut.py", "commit_sha": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "func_name": "ImageGraphCut.interactivity", "line_start": 723, "line_end": 753, "permalink": "https://github.com/mjirik/imcut/blob/1b38e7cd18a...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "3d9cc0c2d06e5e5bce43ab7d37bebf4930f90d66", "resolved_at_commit": "1b38e7cd18a7a38fe683c1cabe1222fe5fa03aa3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
mjirik/imcut
ImageGraphCut.interactivity
90
false
6
src/00006.py
pyc/00006.pyc
CODE <module>() RESUME 0 LOAD_CONST <code expand> MAKE_FUNCTION 0 STORE_NAME expand RETURN_CONST None END CODE expand(self, expression) DOC 'pass' MAKE_CELL self RESUME 0 LOAD_DEREF self LOAD_ATTR logger LOAD_ATTR NULL|self + debug LOAD_CONST 'expand : expression %s' LOAD_GLOBAL NULL + str L...
def expand(self, expression): """pass""" self.logger.debug('expand : expression %s', str(expression)) if not is_string(expression): return expression result = self._pattern.sub(lambda var: str(self._variables[var.group(1)]), expression) result = result.strip() self.logger.debug('expand :...
{ "repo": "chitamoor/Rester", "repo_url": "https://github.com/chitamoor/Rester", "file_path": "rester/manifest.py", "commit_sha": "1865b17f70b7c597aeadde2d0907cb1b59f10c0f", "func_name": "Variables.expand", "line_start": 34, "line_end": 52, "permalink": "https://github.com/chitamoor/Rester/blob/1865b17f...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.txt", "blob_sha": "020f87acd2ee80cc5231be814bb10c06dcc213f9", "resolved_at_commit": "1865b17f70b7c597aeadde2d0907cb1b59f10c0f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
chitamoor/Rester
Variables.expand
95
false
7
src/00007.py
pyc/00007.pyc
CODE <module>() DOC 'default' RESUME 0 LOAD_CONST 'default' LOAD_NAME CLIENT_CACHE BUILD_TUPLE 2 LOAD_CONST <code get_gutter_client> MAKE_FUNCTION defaults STORE_NAME get_gutter_client RETURN_CONST None END CODE get_gutter_client(alias, cache, **kwargs) DOC 'pass' RESUME 0 LOAD_CONST 0 LOAD_CO...
def get_gutter_client(alias='default', cache=CLIENT_CACHE, **kwargs): """pass""" from gutter.client.models import Manager if not alias: return Manager(**kwargs) elif alias not in cache: cache[alias] = Manager(**kwargs) return cache[alias]
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/__init__.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "get_gutter_client", "line_start": 17, "line_end": 42, "permalink": "https://github.com/disqus/gutter/blob/d686fa3cd...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
get_gutter_client
50
false
8
src/00008.py
pyc/00008.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _modulo> MAKE_FUNCTION 0 STORE_NAME _modulo RETURN_CONST None END CODE _modulo(self, decimal_argument) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _context LOAD_ATTR NULL|self + divmod LOAD_FAST decimal_argument LOAD_CONST 100 CALL 2 UNPACK_SEQUENCE...
def _modulo(self, decimal_argument): """pass""" _times, remainder = self._context.divmod(decimal_argument, 100) return remainder if remainder >= 0 else remainder + 100
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/operators/misc.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "PercentRange._modulo", "line_start": 16, "line_end": 29, "permalink": "https://github.com/disqus/gutter/blob/...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
PercentRange._modulo
30
false
9
src/00009.py
pyc/00009.pyc
CODE <module>() RESUME 0 LOAD_CONST <code enabled_for> MAKE_FUNCTION 0 STORE_NAME enabled_for RETURN_CONST None END CODE enabled_for(self, inpt) DOC 'pass' MAKE_CELL inpt RESUME 0 LOAD_GLOBAL signals LOAD_ATTR switch_checked LOAD_ATTR NULL|self + call LOAD_FAST self CALL 1 POP_TOP LOAD_GLO...
def enabled_for(self, inpt): """pass""" signals.switch_checked.call(self) signal_decorated = partial(self.__signal_and_return, inpt) if self.state is self.states.GLOBAL: return signal_decorated(True) elif self.state is self.states.DISABLED: return signal_decorated(False) conditio...
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/models.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "Switch.enabled_for", "line_start": 150, "line_end": 187, "permalink": "https://github.com/disqus/gutter/blob/d686fa3c...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
Switch.enabled_for
119
false
10
src/00010.py
pyc/00010.pyc
CODE <module>() RESUME 0 LOAD_CONST <code call> MAKE_FUNCTION 0 STORE_NAME call RETURN_CONST None END CODE call(self, inpt) DOC 'pass' RESUME 0 LOAD_FAST inpt LOAD_GLOBAL Manager LOAD_ATTR NONE_INPUT IS_OP 0 POP_JUMP_IF_FALSE L1 RETURN_CONST False L1: LOAD_FAST self LOAD_ATTR NULL|self + a...
def call(self, inpt): """pass""" if inpt is Manager.NONE_INPUT: return False argument_instance = self.argument(inpt) if not argument_instance.applies: return False application = self.__apply(argument_instance, inpt) if self.negative: application = not application retu...
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/models.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "Condition.call", "line_start": 333, "line_end": 362, "permalink": "https://github.com/disqus/gutter/blob/d686fa3cd055...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
Condition.call
42
false
11
src/00011.py
pyc/00011.pyc
CODE <module>() RESUME 0 LOAD_CONST <code switches> MAKE_FUNCTION 0 STORE_NAME switches RETURN_CONST None END CODE switches(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR storage LOAD_ATTR NULL|self + iteritems CALL 0 GET_ITER LOAD_FAST_AND_CLEAR name LOAD_FAST_AND_CLEAR switch SWAP 3 ...
def switches(self): """pass""" results = [switch for name, switch in self.storage.iteritems() if name.startswith(self.__joined_namespace)] return results
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/models.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "Manager.switches", "line_start": 438, "line_end": 447, "permalink": "https://github.com/disqus/gutter/blob/d686fa3cd0...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
Manager.switches
55
false
12
src/00012.py
pyc/00012.pyc
CODE <module>() RESUME 0 LOAD_CONST <code switch> MAKE_FUNCTION 0 STORE_NAME switch RETURN_CONST None END CODE switch(self, name) DOC 'pass' RESUME 0 NOP L1: LOAD_FAST self LOAD_ATTR storage LOAD_FAST self LOAD_ATTR NULL|self + __namespaced LOAD_FAST name CALL 1 BINARY_SUBSCR STORE_FAST ...
def switch(self, name): """pass""" try: switch = self.storage[self.__namespaced(name)] except KeyError: if not self.autocreate: raise ValueError("No switch named '%s' registered in '%s'" % (name, self.namespace)) switch = self.__create_and_register_disabled_switch(name) ...
{ "repo": "disqus/gutter", "repo_url": "https://github.com/disqus/gutter", "file_path": "gutter/client/models.py", "commit_sha": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "func_name": "Manager.switch", "line_start": 449, "line_end": 468, "permalink": "https://github.com/disqus/gutter/blob/d686fa3cd055...
{ "spdx": "Apache-2.0", "name": "Apache License 2.0", "file": "LICENSE", "blob_sha": "880b1df83cfc7c832f2dd27de0d5432b0d4ca9ed", "resolved_at_commit": "d686fa3cd0551cacfc5630c8e7b5fa75e6dcfdf5", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
disqus/gutter
Manager.switch
65
false
13
src/00013.py
pyc/00013.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code when> MAKE_FUNCTION defaults STORE_NAME when RETURN_CONST None END CODE when(obj, strict) DOC 'pass' MAKE_CELL strict MAKE_CELL theMock RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_FAST obj LOAD_GLOBAL str CALL 2 POP_JUMP_IF_FALSE...
def when(obj, strict=None): """pass""" if isinstance(obj, str): obj = get_obj(obj) if strict is None: strict = True theMock = _get_mock(obj, strict=strict) class When(object): def __getattr__(self, method_name): return invocation.StubbedInvocation(theMock, metho...
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "when", "line_start": 151, "line_end": 227, "permalink": "https://github.com/kaste/mockito-python/blob/d6b22b...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
when
77
false
14
src/00014.py
pyc/00014.pyc
CODE <module>() RESUME 0 LOAD_CONST <code when2> MAKE_FUNCTION 0 STORE_NAME when2 RETURN_CONST None END CODE when2(fn, *args, **kwargs) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + get_obj_attr_tuple LOAD_FAST fn CALL 1 UNPACK_SEQUENCE 2 STORE_FAST obj STORE_FAST name LOAD_GLOBAL NULL + _get_mock ...
def when2(fn, *args, **kwargs): """pass""" obj, name = get_obj_attr_tuple(fn) theMock = _get_mock(obj, strict=True) return invocation.StubbedInvocation(theMock, name)(*args, **kwargs)
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "when2", "line_start": 230, "line_end": 250, "permalink": "https://github.com/kaste/mockito-python/blob/d6b22...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
when2
33
false
15
src/00015.py
pyc/00015.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code patch> MAKE_FUNCTION defaults STORE_NAME patch RETURN_CONST None END CODE patch(fn, attr_or_replacement, replacement) DOC 'pass' RESUME 0 LOAD_FAST replacement POP_JUMP_IF_NOT_NONE L1 LOAD_FAST attr_or_replacement STORE_FAST replacemen...
def patch(fn, attr_or_replacement, replacement=None): """pass""" if replacement is None: replacement = attr_or_replacement return when2(fn, Ellipsis).thenAnswer(replacement) else: obj, name = (fn, attr_or_replacement) theMock = _get_mock(obj, strict=True) return invoc...
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "patch", "line_start": 253, "line_end": 280, "permalink": "https://github.com/kaste/mockito-python/blob/d6b22...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
patch
47
false
16
src/00016.py
pyc/00016.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, None, None, None) LOAD_CONST <code expect> MAKE_FUNCTION defaults STORE_NAME expect RETURN_CONST None END CODE expect(obj, strict, times, atleast, atmost, between) DOC 'pass' MAKE_CELL strict MAKE_CELL theMock MAKE_CELL verification_fn RESUME 0 LO...
def expect(obj, strict=None, times=None, atleast=None, atmost=None, between=None): """pass""" if strict is None: strict = True theMock = _get_mock(obj, strict=strict) verification_fn = _get_wanted_verification(times=times, atleast=atleast, atmost=atmost, between=between) class Expect(object...
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "expect", "line_start": 284, "line_end": 317, "permalink": "https://github.com/kaste/mockito-python/blob/d6b2...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
expect
79
false
17
src/00017.py
pyc/00017.pyc
CODE <module>() RESUME 0 LOAD_CONST <code unstub> MAKE_FUNCTION 0 STORE_NAME unstub RETURN_CONST None END CODE unstub(*objs) DOC 'pass' RESUME 0 LOAD_FAST objs POP_JUMP_IF_FALSE L3 LOAD_FAST objs GET_ITER L1: FOR_ITER L2 STORE_FAST obj LOAD_GLOBAL mock_registry LOAD_ATTR NULL|self + unstub...
def unstub(*objs): """pass""" if objs: for obj in objs: mock_registry.unstub(obj) else: mock_registry.unstub_all()
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "unstub", "line_start": 321, "line_end": 336, "permalink": "https://github.com/kaste/mockito-python/blob/d6b2...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
unstub
32
false
18
src/00018.py
pyc/00018.pyc
CODE <module>() RESUME 0 LOAD_CONST <code verifyZeroInteractions> MAKE_FUNCTION 0 STORE_NAME verifyZeroInteractions RETURN_CONST None END CODE verifyZeroInteractions(*objs) DOC 'pass' RESUME 0 LOAD_FAST objs GET_ITER L1: FOR_ITER L3 STORE_FAST obj LOAD_GLOBAL NULL + _get_mock_or_raise LOAD_FAS...
def verifyZeroInteractions(*objs): """pass""" for obj in objs: theMock = _get_mock_or_raise(obj) if len(theMock.invocations) > 0: raise VerificationError('\nUnwanted interaction: %s' % theMock.invocations[0])
{ "repo": "kaste/mockito-python", "repo_url": "https://github.com/kaste/mockito-python", "file_path": "mockito/mockito.py", "commit_sha": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "func_name": "verifyZeroInteractions", "line_start": 364, "line_end": 379, "permalink": "https://github.com/kaste/mockito-...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3b9dd7fd84f9903ccc2358f3d1fcd85d081459ee", "resolved_at_commit": "d6b22b003f56ee5b156dbd9d8ba209faf35b6713", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
kaste/mockito-python
verifyZeroInteractions
40
false
19
src/00019.py
pyc/00019.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_templates> MAKE_FUNCTION 0 STORE_NAME get_templates RETURN_CONST None END CODE get_templates(model) DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_GLOBAL templates LOAD_ATTR NULL|self + items CALL 0 GET_ITER L2: FOR_ITER L5 UNPACK_SEQUEN...
def get_templates(model): """pass""" for template_name, template in templates.items(): if issubclass(template.model, model): yield (template_name, template.layout._meta.verbose_name)
{ "repo": "developersociety/django-glitter", "repo_url": "https://github.com/developersociety/django-glitter", "file_path": "glitter/templates.py", "commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87", "func_name": "get_templates", "line_start": 26, "line_end": 30, "permalink": "https://github.com/d...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "bebaae13ae43fb578ddc5707cdf193f8bc23ceaa", "resolved_at_commit": "2c0280ec83afee80deee94ee3934fc54239c2e87", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
developersociety/django-glitter
get_templates
49
false
20
src/00020.py
pyc/00020.pyc
CODE <module>() RESUME 0 LOAD_CONST <code attach> MAKE_FUNCTION 0 STORE_NAME attach RETURN_CONST None END CODE attach(*layouts, **kwargs) DOC 'pass' MAKE_CELL layouts RESUME 0 LOAD_CLOSURE layouts BUILD_TUPLE 1 LOAD_CONST <code attach.<locals>._model_admin_wrapper> MAKE_FUNCTION closure STORE_...
def attach(*layouts, **kwargs): """pass""" def _model_admin_wrapper(layout_class): register(layout_class, layouts[0]) return layout_class return _model_admin_wrapper
{ "repo": "developersociety/django-glitter", "repo_url": "https://github.com/developersociety/django-glitter", "file_path": "glitter/templates.py", "commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87", "func_name": "attach", "line_start": 38, "line_end": 51, "permalink": "https://github.com/develope...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "bebaae13ae43fb578ddc5707cdf193f8bc23ceaa", "resolved_at_commit": "2c0280ec83afee80deee94ee3934fc54239c2e87", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
developersociety/django-glitter
attach
31
false
21
src/00021.py
pyc/00021.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_api_envs> MAKE_FUNCTION 0 STORE_NAME get_api_envs RETURN_CONST None END CODE get_api_envs() DOC 'pass' RESUME 0 LOAD_GLOBAL os LOAD_ATTR environ LOAD_ATTR NULL|self + get LOAD_CONST 'CLIENT_ID' CALL 1 STORE_FAST client_id LOAD_GLOBAL os LOAD_AT...
def get_api_envs(): """pass""" client_id = os.environ.get('CLIENT_ID') user_id = os.environ.get('USER_ID') if not client_id or not user_id: raise ValueError('API keys are not found in the environment') return (client_id, user_id)
{ "repo": "quizl/quizler", "repo_url": "https://github.com/quizl/quizler", "file_path": "quizler/lib.py", "commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46", "func_name": "get_api_envs", "line_start": 8, "line_end": 14, "permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e7013ffde8147...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "ebfdcbd6ac269a994ad3c7e913800882b6c895b4", "resolved_at_commit": "44b3fd91f7074e7013ffde8147455f45ebdccc46", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
quizl/quizler
get_api_envs
36
false
22
src/00022.py
pyc/00022.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, None) LOAD_CONST <code api_call> MAKE_FUNCTION defaults STORE_NAME api_call RETURN_CONST None END CODE api_call(method, end_point, params, client_id, access_token) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + bool LOAD_FAST client_id CALL 1 LOAD_GLOBAL ...
def api_call(method, end_point, params=None, client_id=None, access_token=None): """pass""" if bool(client_id) == bool(access_token): raise ValueError('Either client_id or access_token') url = 'https://api.quizlet.com/2.0/{}'.format(end_point) if not params: params = {} if client_id:...
{ "repo": "quizl/quizler", "repo_url": "https://github.com/quizl/quizler", "file_path": "quizler/lib.py", "commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46", "func_name": "api_call", "line_start": 17, "line_end": 55, "permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e7013ffde8147455...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "ebfdcbd6ac269a994ad3c7e913800882b6c895b4", "resolved_at_commit": "44b3fd91f7074e7013ffde8147455f45ebdccc46", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
quizl/quizler
api_call
152
false
23
src/00023.py
pyc/00023.pyc
CODE <module>() RESUME 0 LOAD_NAME threading LOAD_ATTR Lock BUILD_TUPLE 1 LOAD_CONST <code exclusive> MAKE_FUNCTION defaults STORE_NAME exclusive RETURN_CONST None END CODE exclusive(via) DOC 'pass' MAKE_CELL via RESUME 0 LOAD_CLOSURE via BUILD_TUPLE 1 LOAD_CONST <code exclusive.<locals>.mak...
def exclusive(via=threading.Lock): """pass""" def make_exclusive(fnc): fnc_guard = via() @functools.wraps(fnc) def exclusive_call(*args, **kwargs): if fnc_guard.acquire(blocking=False): try: return fnc(*args, **kwargs) fin...
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/guard.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "exclusive", "line_start": 5, "line_end": 29, "permalink": "https://github.com/MatterMiners/cobald/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
exclusive
87
false
24
src/00024.py
pyc/00024.pyc
CODE <module>() RESUME 0 LOAD_CONST <code service> MAKE_FUNCTION 0 STORE_NAME service RETURN_CONST None END CODE service(flavour) DOC 'pass' MAKE_CELL flavour RESUME 0 LOAD_CLOSURE flavour BUILD_TUPLE 1 LOAD_CONST <code service.<locals>.service_unit_decorator> MAKE_FUNCTION closure STORE_FAST ...
def service(flavour): """pass""" def service_unit_decorator(raw_cls): __new__ = raw_cls.__new__ def __new_service__(cls, *args, **kwargs): if __new__ is object.__new__: self = __new__(cls) else: self = __new__(cls, *args, **kwargs) ...
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/service.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "service", "line_start": 54, "line_end": 82, "permalink": "https://github.com/MatterMiners/cobald...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
service
85
false
25
src/00025.py
pyc/00025.pyc
CODE <module>() DOC 'flavour' RESUME 0 LOAD_CONST 'flavour' LOAD_NAME ModuleType BUILD_TUPLE 2 LOAD_CONST <code execute> MAKE_FUNCTION annotations STORE_NAME execute RETURN_CONST None END CODE execute(self, payload, *args, flavour, **kwargs) DOC 'pass' RESUME 0 LOAD_FAST args POP_JUMP_IF_TRUE ...
def execute(self, payload, *args, flavour: ModuleType, **kwargs): """pass""" if args or kwargs: payload = functools.partial(payload, *args, **kwargs) return self._meta_runner.run_payload(payload, flavour=flavour)
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/service.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "ServiceRunner.execute", "line_start": 97, "line_end": 105, "permalink": "https://github.com/Matt...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
ServiceRunner.execute
40
true
26
src/00026.py
pyc/00026.pyc
CODE <module>() DOC 'flavour' RESUME 0 LOAD_CONST 'flavour' LOAD_NAME ModuleType BUILD_TUPLE 2 LOAD_CONST <code adopt> MAKE_FUNCTION annotations STORE_NAME adopt RETURN_CONST None END CODE adopt(self, payload, *args, flavour, **kwargs) DOC 'pass' RESUME 0 LOAD_FAST args POP_JUMP_IF_TRUE L1 L...
def adopt(self, payload, *args, flavour: ModuleType, **kwargs): """pass""" if args or kwargs: payload = functools.partial(payload, *args, **kwargs) self._meta_runner.register_payload(payload, flavour=flavour)
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/service.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "ServiceRunner.adopt", "line_start": 107, "line_end": 115, "permalink": "https://github.com/Matte...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
ServiceRunner.adopt
41
true
27
src/00027.py
pyc/00027.pyc
CODE <module>() RESUME 0 LOAD_CONST <code accept> MAKE_FUNCTION 0 STORE_NAME accept RETURN_CONST None END CODE accept(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _meta_runner POP_JUMP_IF_FALSE L1 LOAD_GLOBAL NULL + RuntimeError LOAD_CONST 'payloads scheduled for %s before being started' ...
def accept(self): """pass""" if self._meta_runner: raise RuntimeError('payloads scheduled for %s before being started' % self) self._must_shutdown = False self._logger.info('%s starting', self.__class__.__name__) gc.collect() self._adopt_services() self.adopt(self._accept_services, f...
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/service.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "ServiceRunner.accept", "line_start": 118, "line_end": 133, "permalink": "https://github.com/Matt...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
ServiceRunner.accept
54
false
28
src/00028.py
pyc/00028.pyc
CODE <module>() RESUME 0 LOAD_CONST <code shutdown> MAKE_FUNCTION 0 STORE_NAME shutdown RETURN_CONST None END CODE shutdown(self) DOC 'pass' RESUME 0 LOAD_CONST True LOAD_FAST self STORE_ATTR _must_shutdown LOAD_FAST self LOAD_ATTR _is_shutdown LOAD_ATTR NULL|self + wait CALL 0 POP_TOP L...
def shutdown(self): """pass""" self._must_shutdown = True self._is_shutdown.wait() self._meta_runner.stop()
{ "repo": "MatterMiners/cobald", "repo_url": "https://github.com/MatterMiners/cobald", "file_path": "cobald/daemon/runners/service.py", "commit_sha": "264138de4382d1c9b53fabcbc6660e10b33a914d", "func_name": "ServiceRunner.shutdown", "line_start": 135, "line_end": 139, "permalink": "https://github.com/Ma...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a3276b559d2735c2d906e3e01f59dbcfd321e71d", "resolved_at_commit": "264138de4382d1c9b53fabcbc6660e10b33a914d", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
MatterMiners/cobald
ServiceRunner.shutdown
24
false
29
src/00029.py
pyc/00029.pyc
CODE <module>() RESUME 0 LOAD_CONST <code milestones> MAKE_FUNCTION 0 STORE_NAME milestones RETURN_CONST None END CODE milestones(ctx, list, close) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + get_repos LOAD_FAST ctx LOAD_ATTR parent LOAD_ATTR agile LOAD_ATTR NULL|self + get LOAD_CONST 'labels' CA...
def milestones(ctx, list, close): """pass""" repos = get_repos(ctx.parent.agile.get('labels')) if list: _list_milestones(repos) elif close: click.echo('Closing milestones "%s"' % close) _close_milestone(repos, close) else: click.echo(ctx.get_help())
{ "repo": "quantmind/agile-toolkit", "repo_url": "https://github.com/quantmind/agile-toolkit", "file_path": "agiletoolkit/github/milestones.py", "commit_sha": "96028e36a842c57b171907c20583a60d1045fec1", "func_name": "milestones", "line_start": 13, "line_end": 23, "permalink": "https://github.com/quantmi...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "56a28a34396fd37dbe2c0dc6c292fa8fffadffaa", "resolved_at_commit": "96028e36a842c57b171907c20583a60d1045fec1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
quantmind/agile-toolkit
milestones
51
false
30
src/00030.py
pyc/00030.pyc
CODE <module>() RESUME 0 BUILD_MAP 0 BUILD_TUPLE 1 LOAD_CONST <code start_console> MAKE_FUNCTION defaults STORE_NAME start_console RETURN_CONST None END CODE start_console(local_vars) DOC 'pass' RESUME 0 LOAD_CONST True LOAD_GLOBAL transforms STORE_ATTR CONSOLE_ACTIVE LOAD_GLOBAL transforms ...
def start_console(local_vars={}): """pass""" transforms.CONSOLE_ACTIVE = True transforms.remove_not_allowed_in_console() sys.ps1 = prompt console = ExperimentalInteractiveConsole(locals=local_vars) console.interact(banner=banner)
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/console.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "start_console", "line_start": 66, "line_end": 72, "permalink": "https://github.com/aroberge/expe...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
start_console
34
false
31
src/00031.py
pyc/00031.pyc
CODE <module>() RESUME 0 LOAD_CONST <code push> MAKE_FUNCTION 0 STORE_NAME push RETURN_CONST None END CODE push(self, line) DOC 'pass' RESUME 0 LOAD_GLOBAL transforms LOAD_ATTR FROM_EXPERIMENTAL LOAD_ATTR NULL|self + match LOAD_FAST line CALL 1 POP_JUMP_IF_FALSE L1 LOAD_GLOBAL transforms L...
def push(self, line): """pass""" if transforms.FROM_EXPERIMENTAL.match(line): transforms.add_transformers(line) self.buffer.append('\n') else: self.buffer.append(line) add_pass = False if line.rstrip(' ').endswith(':'): add_pass = True source = '\n'.join(self.buff...
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/console.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "ExperimentalInteractiveConsole.push", "line_start": 21, "line_end": 63, "permalink": "https://gi...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
ExperimentalInteractiveConsole.push
137
false
32
src/00032.py
pyc/00032.pyc
CODE <module>() RESUME 0 LOAD_NAME LIC_DIR BUILD_TUPLE 1 LOAD_CONST <code license_loader> MAKE_FUNCTION defaults STORE_NAME license_loader RETURN_CONST None END CODE license_loader(lic_dir) DOC 'pass' RESUME 0 BUILD_LIST 0 STORE_FAST lics LOAD_GLOBAL os LOAD_ATTR NULL|self + listdir LOAD_FAS...
def license_loader(lic_dir=LIC_DIR): """pass""" lics = [] for ln in os.listdir(lic_dir): lp = os.path.join(lic_dir, ln) with open(lp) as lf: txt = lf.read() lic = License(txt) lics.append(lic) return lics
{ "repo": "alixedi/palal", "repo_url": "https://github.com/alixedi/palal", "file_path": "palal/license.py", "commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837", "func_name": "license_loader", "line_start": 46, "line_end": 55, "permalink": "https://github.com/alixedi/palal/blob/325359f66ac48a9f96efe...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1cde7b521df8bf744ab73927aae16c8e1681d4e9", "resolved_at_commit": "325359f66ac48a9f96efea0489aec353f8a40837", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
alixedi/palal
license_loader
77
false
33
src/00033.py
pyc/00033.pyc
CODE <module>() RESUME 0 LOAD_CONST (3,) LOAD_CONST <code get_vector> MAKE_FUNCTION defaults STORE_NAME get_vector RETURN_CONST None END CODE get_vector(self, max_choice) DOC 'pass' MAKE_CELL max_choice RESUME 0 BUILD_MAP 0 STORE_FAST vec LOAD_CONST ('forbidden', 'required', 'permitted') GET_I...
def get_vector(self, max_choice=3): """pass""" vec = {} for dim in ['forbidden', 'required', 'permitted']: if self.meta[dim] is None: continue dim_vec = map(lambda x: (x, max_choice), self.meta[dim]) vec[dim] = dict(dim_vec) return vec
{ "repo": "alixedi/palal", "repo_url": "https://github.com/alixedi/palal", "file_path": "palal/license.py", "commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837", "func_name": "License.get_vector", "line_start": 35, "line_end": 43, "permalink": "https://github.com/alixedi/palal/blob/325359f66ac48a9f9...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1cde7b521df8bf744ab73927aae16c8e1681d4e9", "resolved_at_commit": "325359f66ac48a9f96efea0489aec353f8a40837", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
alixedi/palal
License.get_vector
56
false
34
src/00034.py
pyc/00034.pyc
CODE <module>() DOC 'WMAP5' RESUME 0 LOAD_CONST ('WMAP5',) LOAD_CONST <code runcommand> MAKE_FUNCTION defaults STORE_NAME runcommand RETURN_CONST None END CODE runcommand(cosmology) DOC 'pass' RESUME 0 BUILD_LIST 0 LOAD_CONST (100000000.0, 1000000000.0, 10000000000.0) LIST_EXTEND 1 STORE_FAST ...
def runcommand(cosmology='WMAP5'): """pass""" Mi = [100000000.0, 1000000000.0, 10000000000.0] zi = 0 print('Concentrations for haloes of mass %s at z=%s' % (Mi, zi)) output = commah.run(cosmology=cosmology, zi=zi, Mi=Mi) print(output['c'].flatten()) Mi = [100000000.0, 1000000000.0, 100000000...
{ "repo": "astroduff/commah", "repo_url": "https://github.com/astroduff/commah", "file_path": "examples.py", "commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "func_name": "runcommand", "line_start": 9, "line_end": 90, "permalink": "https://github.com/astroduff/commah/blob/3ec70338c5123a053c79dd...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "0c8a6cbe1c103c52103bfeea0e231c6d4d424d24", "resolved_at_commit": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
astroduff/commah
runcommand
385
false
35
src/00035.py
pyc/00035.pyc
CODE <module>() DOC 'WMAP5' RESUME 0 LOAD_CONST ('WMAP5', None) LOAD_CONST <code plotcommand> MAKE_FUNCTION defaults STORE_NAME plotcommand RETURN_CONST None END CODE plotcommand(cosmology, plotname) DOC 'pass' RESUME 0 LOAD_CONST 10 LOAD_GLOBAL np LOAD_ATTR NULL|self + arange LOAD_CONST 1 L...
def plotcommand(cosmology='WMAP5', plotname=None): """pass""" xarray = 10 ** np.arange(1, 15, 0.2) yval = 'c' zarray = np.arange(0, 5, 0.5) xtitle = 'Halo Mass (M$_{sol}$)' ytitle = 'Concentration' linelabel = 'z=' fig = plt.figure() ax = fig.add_subplot(111) ax.set_xlabel(xtitle...
{ "repo": "astroduff/commah", "repo_url": "https://github.com/astroduff/commah", "file_path": "examples.py", "commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "func_name": "plotcommand", "line_start": 93, "line_end": 466, "permalink": "https://github.com/astroduff/commah/blob/3ec70338c5123a053c7...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "0c8a6cbe1c103c52103bfeea0e231c6d4d424d24", "resolved_at_commit": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
astroduff/commah
plotcommand
1,622
false
36
src/00036.py
pyc/00036.pyc
CODE <module>() RESUME 0 LOAD_CONST <code add_transformers> MAKE_FUNCTION 0 STORE_NAME add_transformers RETURN_CONST None END CODE add_transformers(line) DOC 'pass' RESUME 0 LOAD_GLOBAL FROM_EXPERIMENTAL LOAD_ATTR NULL|self + match LOAD_FAST line CALL 1 POP_JUMP_IF_TRUE L1 LOAD_ASSERTION_ERROR...
def add_transformers(line): """pass""" assert FROM_EXPERIMENTAL.match(line) line = FROM_EXPERIMENTAL.sub(' ', line) line = line.split('#')[0] for trans in line.replace(' ', '').split(','): import_transformer(trans)
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/transforms.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "add_transformers", "line_start": 19, "line_end": 31, "permalink": "https://github.com/aroberg...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
add_transformers
51
false
37
src/00037.py
pyc/00037.pyc
CODE <module>() RESUME 0 LOAD_CONST <code import_transformer> MAKE_FUNCTION 0 STORE_NAME import_transformer RETURN_CONST None END CODE import_transformer(name) DOC 'pass' RESUME 0 LOAD_FAST name LOAD_GLOBAL transformers CONTAINS_OP 0 POP_JUMP_IF_FALSE L1 LOAD_GLOBAL transformers LOAD_FAST name...
def import_transformer(name): """pass""" if name in transformers: return transformers[name] hook = sys.meta_path[0] sys.meta_path = sys.meta_path[1:] try: transformers[name] = __import__(name) if CONSOLE_ACTIVE: if hasattr(transformers[name], 'NO_CONSOLE'): ...
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/transforms.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "import_transformer", "line_start": 34, "line_end": 70, "permalink": "https://github.com/arobe...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
import_transformer
150
false
38
src/00038.py
pyc/00038.pyc
CODE <module>() RESUME 0 LOAD_CONST <code extract_transformers_from_source> MAKE_FUNCTION 0 STORE_NAME extract_transformers_from_source RETURN_CONST None END CODE extract_transformers_from_source(source) DOC 'pass' RESUME 0 LOAD_FAST source LOAD_ATTR NULL|self + split LOAD_CONST '\n' CALL 1 STOR...
def extract_transformers_from_source(source): """pass""" lines = source.split('\n') linenumbers = [] for number, line in enumerate(lines): if FROM_EXPERIMENTAL.match(line): add_transformers(line) linenumbers.insert(0, number) for number in linenumbers: del lin...
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/transforms.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "extract_transformers_from_source", "line_start": 72, "line_end": 89, "permalink": "https://gi...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
extract_transformers_from_source
62
false
39
src/00039.py
pyc/00039.pyc
CODE <module>() RESUME 0 LOAD_CONST <code remove_not_allowed_in_console> MAKE_FUNCTION 0 STORE_NAME remove_not_allowed_in_console RETURN_CONST None END CODE remove_not_allowed_in_console() DOC 'pass' RESUME 0 BUILD_LIST 0 STORE_FAST not_allowed_in_console LOAD_GLOBAL CONSOLE_ACTIVE POP_JUMP_IF_FAL...
def remove_not_allowed_in_console(): """pass""" not_allowed_in_console = [] if CONSOLE_ACTIVE: for name in transformers: tr_module = import_transformer(name) if hasattr(tr_module, 'NO_CONSOLE'): not_allowed_in_console.append((name, tr_module)) for name...
{ "repo": "aroberge/experimental", "repo_url": "https://github.com/aroberge/experimental", "file_path": "experimental/core/transforms.py", "commit_sha": "031a9be10698b429998436da748b8fdb86f18b47", "func_name": "remove_not_allowed_in_console", "line_start": 91, "line_end": 111, "permalink": "https://gith...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "29dffca1837ff303e9da7215422a71c36e242a10", "resolved_at_commit": "031a9be10698b429998436da748b8fdb86f18b47", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
aroberge/experimental
remove_not_allowed_in_console
63
false
40
src/00040.py
pyc/00040.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _match> MAKE_FUNCTION 0 STORE_NAME _match RETURN_CONST None END CODE _match(self, request, response) DOC 'pass' RESUME 0 LOAD_CONST 'text/html' LOAD_FAST response LOAD_ATTR NULL|self + get LOAD_CONST 'Content-Type' LOAD_CONST '' CALL 2 CONTAINS_OP 0 ...
def _match(self, request, response): """pass""" is_html = 'text/html' in response.get('Content-Type', '') if is_html and hasattr(response, 'rendered_content'): correct_path = PATH_MATCHER.match(request.path) is not None not_included = self.include_flag not in response.rendered_content ...
{ "repo": "bradmontgomery/django-chosenadmin", "repo_url": "https://github.com/bradmontgomery/django-chosenadmin", "file_path": "chosenadmin/middleware.py", "commit_sha": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "func_name": "ChosenAdminMiddleware._match", "line_start": 24, "line_end": 36, "permalink...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.txt", "blob_sha": "7cf244c4ab6f36a86ba781436293aed1bd76f080", "resolved_at_commit": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
bradmontgomery/django-chosenadmin
ChosenAdminMiddleware._match
48
false
41
src/00041.py
pyc/00041.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _chosen_css> MAKE_FUNCTION 0 STORE_NAME _chosen_css RETURN_CONST None END CODE _chosen_css(self) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + render_to_string LOAD_FAST self LOAD_ATTR css_template BUILD_MAP 0 CALL 2 STORE_FAST css LOAD_FAST self LOAD_ATT...
def _chosen_css(self): """pass""" css = render_to_string(self.css_template, {}) for sprite in self.chosen_sprites: css = css.replace(sprite, settings.STATIC_URL + 'img/' + sprite) return css
{ "repo": "bradmontgomery/django-chosenadmin", "repo_url": "https://github.com/bradmontgomery/django-chosenadmin", "file_path": "chosenadmin/middleware.py", "commit_sha": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "func_name": "ChosenAdminMiddleware._chosen_css", "line_start": 38, "line_end": 44, "perm...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.txt", "blob_sha": "7cf244c4ab6f36a86ba781436293aed1bd76f080", "resolved_at_commit": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
bradmontgomery/django-chosenadmin
ChosenAdminMiddleware._chosen_css
38
false
42
src/00042.py
pyc/00042.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _embed> MAKE_FUNCTION 0 STORE_NAME _embed RETURN_CONST None END CODE _embed(self, request, response) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + _match LOAD_FAST request LOAD_FAST response CALL 2 POP_JUMP_IF_FALSE L1 LOAD_GLOBAL NULL + r...
def _embed(self, request, response): """pass""" if self._match(request, response): head = render_to_string('chosenadmin/_head_css.html', {'chosen_css': self._chosen_css()}) body = render_to_string('chosenadmin/_script.html', {'chosen_js': self._chosen_js()}) content = response.rendered_c...
{ "repo": "bradmontgomery/django-chosenadmin", "repo_url": "https://github.com/bradmontgomery/django-chosenadmin", "file_path": "chosenadmin/middleware.py", "commit_sha": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "func_name": "ChosenAdminMiddleware._embed", "line_start": 50, "line_end": 68, "permalink...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.txt", "blob_sha": "7cf244c4ab6f36a86ba781436293aed1bd76f080", "resolved_at_commit": "23fad0151d1175d751599a7ee3a1ff35b2d61299", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
bradmontgomery/django-chosenadmin
ChosenAdminMiddleware._embed
55
false
43
src/00043.py
pyc/00043.pyc
CODE <module>() RESUME 0 LOAD_CONST <code clean_up> MAKE_FUNCTION 0 STORE_NAME clean_up RETURN_CONST None END CODE clean_up(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR log LOAD_ATTR NULL|self + debug LOAD_CONST 'Closing I2C bus for address: 0x%02X' LOAD_FAST self LOAD_ATTR address BIN...
def clean_up(self): """pass""" self.log.debug('Closing I2C bus for address: 0x%02X' % self.address) self.bus.close()
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.clean_up", "line_start": 30, "line_end": 35, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a74182373da0...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.clean_up
25
false
44
src/00044.py
pyc/00044.pyc
CODE <module>() RESUME 0 LOAD_CONST <code write_quick> MAKE_FUNCTION 0 STORE_NAME write_quick RETURN_CONST None END CODE write_quick(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bus LOAD_ATTR NULL|self + write_quick LOAD_FAST self LOAD_ATTR address CALL 1 POP_TOP LOAD_FAST self LOA...
def write_quick(self): """pass""" self.bus.write_quick(self.address) self.log.debug('write_quick: Sent the read / write bit')
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.write_quick", "line_start": 39, "line_end": 44, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a74182373...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.write_quick
24
false
45
src/00045.py
pyc/00045.pyc
CODE <module>() RESUME 0 LOAD_CONST <code write_byte> MAKE_FUNCTION 0 STORE_NAME write_byte RETURN_CONST None END CODE write_byte(self, cmd, value) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bus LOAD_ATTR NULL|self + write_byte_data LOAD_FAST self LOAD_ATTR address LOAD_FAST cmd LOAD_FAST ...
def write_byte(self, cmd, value): """pass""" self.bus.write_byte_data(self.address, cmd, value) self.log.debug('write_byte: Wrote 0x%02X to command register 0x%02X' % (value, cmd))
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.write_byte", "line_start": 46, "line_end": 55, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a74182373d...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.write_byte
30
false
46
src/00046.py
pyc/00046.pyc
CODE <module>() RESUME 0 LOAD_CONST <code write_word> MAKE_FUNCTION 0 STORE_NAME write_word RETURN_CONST None END CODE write_word(self, cmd, value) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bus LOAD_ATTR NULL|self + write_word_data LOAD_FAST self LOAD_ATTR address LOAD_FAST cmd LOAD_FAST ...
def write_word(self, cmd, value): """pass""" self.bus.write_word_data(self.address, cmd, value) self.log.debug('write_word: Wrote 0x%04X to command register 0x%02X' % (value, cmd))
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.write_word", "line_start": 57, "line_end": 66, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a74182373d...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.write_word
30
false
47
src/00047.py
pyc/00047.pyc
CODE <module>() RESUME 0 LOAD_CONST <code write_raw_byte> MAKE_FUNCTION 0 STORE_NAME write_raw_byte RETURN_CONST None END CODE write_raw_byte(self, value) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bus LOAD_ATTR NULL|self + write_byte LOAD_FAST self LOAD_ATTR address LOAD_FAST value CALL 2...
def write_raw_byte(self, value): """pass""" self.bus.write_byte(self.address, value) self.log.debug('write_raw_byte: Wrote 0x%02X' % value)
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.write_raw_byte", "line_start": 68, "line_end": 73, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a74182...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.write_raw_byte
27
false
48
src/00048.py
pyc/00048.pyc
CODE <module>() RESUME 0 LOAD_CONST <code write_block_data> MAKE_FUNCTION 0 STORE_NAME write_block_data RETURN_CONST None END CODE write_block_data(self, cmd, block) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bus LOAD_ATTR NULL|self + write_i2c_block_data LOAD_FAST self LOAD_ATTR address LOA...
def write_block_data(self, cmd, block): """pass""" self.bus.write_i2c_block_data(self.address, cmd, block) self.log.debug('write_block_data: Wrote [%s] to command register 0x%02X' % (', '.join(['0x%02X' % x for x in block]), cmd))
{ "repo": "fchorney/rpI2C", "repo_url": "https://github.com/fchorney/rpI2C", "file_path": "rpI2C.py", "commit_sha": "7c60f82fa8c91496a74182373da0b95a13919d6e", "func_name": "I2C.write_block_data", "line_start": 75, "line_end": 86, "permalink": "https://github.com/fchorney/rpI2C/blob/7c60f82fa8c91496a741...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1b15871e96b6deb8aab65fb0968819dc21928979", "resolved_at_commit": "7c60f82fa8c91496a74182373da0b95a13919d6e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
fchorney/rpI2C
I2C.write_block_data
59
false
49
src/00049.py
pyc/00049.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code get_formset> MAKE_FUNCTION defaults STORE_NAME get_formset RETURN_CONST None END CODE get_formset(self, request, obj, **kwargs) DOC 'pass' RESUME 0 PUSH_NULL LOAD_GLOBAL NULL + super CALL 0 LOAD_ATTR get_formset LOAD_FAST request L...
def get_formset(self, request, obj=None, **kwargs): """pass""" data = super().get_formset(request, obj, **kwargs) if obj: data.form.base_fields['user'].initial = request.user.id return data
{ "repo": "developersociety/django-glitter", "repo_url": "https://github.com/developersociety/django-glitter", "file_path": "glitter/reminders/admin.py", "commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87", "func_name": "ReminderInline.get_formset", "line_start": 15, "line_end": 20, "permalink": "h...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "bebaae13ae43fb578ddc5707cdf193f8bc23ceaa", "resolved_at_commit": "2c0280ec83afee80deee94ee3934fc54239c2e87", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
developersociety/django-glitter
ReminderInline.get_formset
37
false
50
src/00050.py
pyc/00050.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code process_actions> MAKE_FUNCTION defaults STORE_NAME process_actions RETURN_CONST None END CODE process_actions(action_ids) DOC 'pass' RESUME 0 LOAD_CONST 0 STORE_FAST actions_taken LOAD_GLOBAL PublishAction LOAD_ATTR objects LOAD_ATTR...
def process_actions(action_ids=None): """pass""" actions_taken = 0 action_list = PublishAction.objects.prefetch_related('content_object').filter(scheduled_time__lte=timezone.now()) if action_ids is not None: action_list = action_list.filter(id__in=action_ids) for action in action_list: ...
{ "repo": "developersociety/django-glitter", "repo_url": "https://github.com/developersociety/django-glitter", "file_path": "glitter/publisher/utils.py", "commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87", "func_name": "process_actions", "line_start": 7, "line_end": 28, "permalink": "https://githu...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "bebaae13ae43fb578ddc5707cdf193f8bc23ceaa", "resolved_at_commit": "2c0280ec83afee80deee94ee3934fc54239c2e87", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
developersociety/django-glitter
process_actions
56
false
51
src/00051.py
pyc/00051.pyc
CODE <module>() RESUME 0 LOAD_CONST <code celery_enabled> MAKE_FUNCTION 0 STORE_NAME celery_enabled RETURN_CONST None END CODE celery_enabled() DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + getattr LOAD_GLOBAL settings LOAD_CONST 'GLITTER_PUBLISHER_CELERY' LOAD_CONST None CALL 3 STORE_FAST enabled ...
def celery_enabled(): """pass""" enabled = getattr(settings, 'GLITTER_PUBLISHER_CELERY', None) if enabled is None: try: import celery enabled = True except ImportError: enabled = False return enabled
{ "repo": "developersociety/django-glitter", "repo_url": "https://github.com/developersociety/django-glitter", "file_path": "glitter/publisher/utils.py", "commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87", "func_name": "celery_enabled", "line_start": 31, "line_end": 48, "permalink": "https://githu...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "bebaae13ae43fb578ddc5707cdf193f8bc23ceaa", "resolved_at_commit": "2c0280ec83afee80deee94ee3934fc54239c2e87", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
developersociety/django-glitter
celery_enabled
53
false
52
src/00052.py
pyc/00052.pyc
CODE <module>() DOC 'infile' RESUME 0 LOAD_CONST 'infile' LOAD_NAME typing LOAD_ATTR IO LOAD_NAME str BINARY_SUBSCR LOAD_CONST 'return' LOAD_NAME int BUILD_TUPLE 4 LOAD_CONST <code do_command_line> MAKE_FUNCTION annotations STORE_NAME do_command_line RETURN_CONST None END CODE do_command_lin...
def do_command_line(infile: typing.IO[str]) -> int: """pass""" lines = infile.readlines() tree = ast.parse(''.join(lines)) checker = Checker(tree, lines, infile.name) checker.load() errors = [] for func in checker.all_funcs(skip_noqa=True): try: errors = list(func.check_a...
{ "repo": "jamescooke/flake8-aaa", "repo_url": "https://github.com/jamescooke/flake8-aaa", "file_path": "src/flake8_aaa/command_line.py", "commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794", "func_name": "do_command_line", "line_start": 8, "line_end": 30, "permalink": "https://github.com/jamescooke...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "cba57a5a97d59d58c99e33b6ac7f226d081f6c42", "resolved_at_commit": "29938b96845fe32ced4358ba66af3b3be2a37794", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
jamescooke/flake8-aaa
do_command_line
111
true
53
src/00053.py
pyc/00053.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _izip> MAKE_FUNCTION 0 STORE_NAME _izip RETURN_CONST None END CODE _izip(*iterables) DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_GLOBAL NULL + map LOAD_GLOBAL iter LOAD_FAST iterables CALL 2 STORE_FAST iterators LOAD_FAST iterators POP_...
def _izip(*iterables): """pass""" iterators = map(iter, iterables) while iterators: yield tuple(map(next, iterators))
{ "repo": "astroduff/commah", "repo_url": "https://github.com/astroduff/commah", "file_path": "commah/commah.py", "commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "func_name": "_izip", "line_start": 17, "line_end": 24, "permalink": "https://github.com/astroduff/commah/blob/3ec70338c5123a053c79d...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "0c8a6cbe1c103c52103bfeea0e231c6d4d424d24", "resolved_at_commit": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
astroduff/commah
_izip
43
false
54
src/00054.py
pyc/00054.pyc
CODE <module>() RESUME 0 LOAD_CONST (False, None) LOAD_CONST <code _checkinput> MAKE_FUNCTION defaults STORE_NAME _checkinput RETURN_CONST None END CODE _checkinput(zi, Mi, z, verbose) DOC 'pass' RESUME 0 LOAD_GLOBAL np LOAD_ATTR NULL|self + array LOAD_FAST zi LOAD_CONST 1 LOAD_GLOBAL float ...
def _checkinput(zi, Mi, z=False, verbose=None): """pass""" zi = np.array(zi, ndmin=1, dtype=float) Mi = np.array(Mi, ndmin=1, dtype=float) if zi.size > 1 and Mi.size > 1: if zi.size != Mi.size: print('Error ambiguous request') print('Need individual redshifts for all halo...
{ "repo": "astroduff/commah", "repo_url": "https://github.com/astroduff/commah", "file_path": "commah/commah.py", "commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "func_name": "_checkinput", "line_start": 27, "line_end": 67, "permalink": "https://github.com/astroduff/commah/blob/3ec70338c5123a0...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "0c8a6cbe1c103c52103bfeea0e231c6d4d424d24", "resolved_at_commit": "3ec70338c5123a053c79ddcf2cb3beac26bc9137", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
astroduff/commah
_checkinput
150
false
End of preview. Expand in Data Studio

Data card — CSN-3.12-licensed decompilation benchmark

600 real Python functions from GitHub, compiled to Python 3.12 bytecode, each paired with the source that produced it. Every row carries full provenance and a licence resolved at the exact commit. Built 2026-08-04 by tools/build_csn_licensed.py.

Redistributable, provided NOTICES.md ships alongside. That file is not optional: MIT, BSD and Apache-2.0 require the notice to travel with the copy.


The set

Rows 600
Source repositories 117
Max rows from any one repo 6 (1.00%)
Median rows per repo 6
Distinct commit SHAs 117
Rows with complete provenance 600 / 600
Rows with a resolved SPDX identifier 600 / 600
Disassembly length mean 87.3 lines, median 59, max 1,622
Rows with annotations 63
Python 3.12, optimize=0

Licences, all resolved at the row's own commit:

SPDX rows share
MIT 391 65.2%
BSD-3-Clause 118 19.7%
Apache-2.0 64 10.7%
BSD-2-Clause 15 2.5%
ISC 12 2.0%

Why this replaces the previous 400-row set

The first CSN benchmark drew 400 rows from 24 repositories with 15% from one (Karaage-Cluster/python-tldap), recorded no commit SHA, and captured no licence. Auditing it afterwards: 180 of its 400 rows (45%) cannot be redistributed — 83 GPL-3.0 (including all 60 from that top repository) and 97 from repositories publishing no licence at all. Concentration at that level also means per-repository idiosyncrasy was a large fraction of what the benchmark measured. Details in ../../LICENSING-DETERMINATION.md §2.

The cap was set at 6 rows per repo — about 1% of the set — chosen so that no single codebase can move the headline number by more than a rounding error, while still admitting enough rows per repo to be worth resolving a licence for. At n=600 the 95% confidence interval on an accuracy near 93% is roughly ±2.0 points, against ±2.5 at n=400.


Per-row fields

{
  "i": 0,
  "input":  "CODE <module>()\n  RESUME 0\n ...",   // model input: normalised disassembly
  "expected": "def f(x):\n    ...",                 // reference source
  "src_path": "src/00000.py",                       // RELATIVE to this directory
  "pyc_path": "pyc/00000.pyc",
  "provenance": {
    "repo": "owner/name",
    "repo_url": "https://github.com/owner/name",
    "file_path": "pkg/module.py",                   // path within the repo
    "commit_sha": "1b38e7cd...",                    // the commit the function was taken at
    "func_name": "Class.method",
    "line_start": 323, "line_end": 372,
    "permalink": "https://github.com/.../blob/<sha>/pkg/module.py#L323-L372",
    "dataset": "code-search-net/code_search_net (python, train split)"
  },
  "license": {
    "spdx": "BSD-3-Clause",
    "file": "LICENSE", "blob_sha": "3d9cc0c2...",
    "resolved_at_commit": "1b38e7cd...",
    "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
  },
  "n_instr": 49, "has_annotation": false
}

Paths are relative, so the set works from any checkout location. Nothing points at /tmp.

How rows were selected

Source: code-search-net/code_search_net, python train split, read in file order from a local parquet copy (tools/fetch_csn.sh; sha256 ad9e3a4ab10c2c1d8926d2b26ca2bfcc3aadda1477ba29a933391f93806b9fed).

3,138 rows were read to keep 600. In order:

Gate Effect
Repo cap (6) 1,838 rows skipped — the mechanism that spreads the set across 117 repos
Repo blacklisted on licence 668 rows skipped, from the 25 repos rejected below
Licence not permissive / not resolvable 25 repos rejected
Train-contamination (identifier-blind fingerprint) 3 rows dropped
Unparseable 4 rows dropped

Repos rejected on licence: GPL-3.0 ×8, no licence file at that commit ×7, AGPL-3.0 ×3, LGPL-3.0 ×2, GPL-2.0 ×2, NOASSERTION ×2, LGPL-2.1 ×1.

A licence is resolved, never guessed. GET /repos/{owner}/{repo}/license?ref={sha} must return a concrete SPDX identifier on the allowlist (tools/resolve_licenses.py:ALLOWED_SPDX). NOASSERTION and Other count as unresolved and the row is dropped. We never infer a licence from a README, a setup.py classifier, or a package index.

Normalisation

Each function is reduced to a normal form before compiling: every docstring is replaced by the literal 'pass', then the tree is re-emitted with ast.unparse. Idempotence is checked per row and a row that is not a fixed point is dropped.

This build uses tools/normalize.py, a stdlib-only implementation. The GPL-3.0 tool that built the previous benchmark is not in this pipeline. The two agree byte-for-byte on 400/400 rows of the previous benchmark (tools/verify_equivalence.py); the reasoning is in ../../LICENSING-DETERMINATION.md §1.

Because docstrings are normalised away, this benchmark measures nothing about docstring recoverysamples_with_real_docstring is 0 by construction. Use the held-out set for that.

Compilation

py_compile at optimize=0 for the reference .pyc, and compile(..., dont_inherit=True, optimize=0) for the model's input. dont_inherit is deliberate: the training corpus was compiled with PEP-563 stringised annotations inherited, and real .pyc files are not. Handing the model its training-time distribution would flatter it, so we do not. See ../../DATA-CARD-training-corpus.md §7.

Harness soundness on this set

grade.py --self-test-only: pre-flight 600/600 = 100%, mutation kill rate 116/116 = 100%, 0 survivors. Both are prerequisites for quoting any score — but note that pre-flight is trivial by construction and proves nothing about soundness (it compares compile(x) with compile(x)). See ../../ORACLE-LIMITS.md §1.

Unit size — read this before comparing scores against another benchmark

An aggregate on this set is largely a statement about small units, so the size distribution is part of the result rather than a footnote to it. Size is measured in representation lines — the number of lines in the input field, i.e. the disassembly text a model is actually given.

min p25 median p75 p90 p99 max
19 39 59 101 167 478 1,622

Certification falls off sharply with size (v3 greedy, this set; intervals omitted below 30 rows / 10 repositories rather than printed at a misleading width):

rep lines rows v3 greedy 95% CI v3 best-of-32 95% CI
0–49 224 95.98% [93.01, 98.51] 98.21% [96.31, 99.58]
50–99 224 89.73% [85.17, 93.93] 98.21% [96.26, 99.57]
100–199 112 65.18% [55.36, 74.14] 85.71% [77.57, 92.98]
200–299 27 51.85% 77.78%
300–399 5 60.00% 100.00%
400–599 5 0.00% 0.00%
600+ 3 0.00% 0.00%

96.64% of v3's greedy certifications on this set (95.37% at best-of-32) come from units under 200 rep lines, and above ~400 rep lines nothing certified even at 32 samples. The 300–399 bucket reading above the one below it is n=5 noise, not a recovery. Recompute all of it with harness/size_curve.py; the stored output is ../../results/size_curve_csn600.json.

Limitations

  • Measured scores (2026-08-04, L1 strict oracle): PyBytecode v3 greedy 506/600 = 84.33%, repo-clustered 95% CI [80.48, 87.94]; verified best-of-32 562/600 = 93.67%, CI [90.86, 96.08]. Untuned Qwen2.5-Coder-1.5B-Instruct control: 4/600 = 0.67%, CI [0.16, 1.35]. Per-row verdicts: ../../results/rows_with_base.jsonl.
  • GitHub's licence detection is repository-level. A repository can vendor third-party files under other terms; we do not detect that, and no automated tool reliably does.
  • A licence resolved at a commit is the licence of that repository snapshot. It does not prove the specific file was contributed under it.
  • CodeSearchNet is a 2019-era snapshot, so the code skews toward pre-3.7 idiom. It contains no match statements, no walrus operators, and few modern typing constructs.
  • Rows are capped, not sampled uniformly at random: the set is the first 6 admissible functions per repository in dataset order. That is reproducible and unbiased with respect to difficulty, but it is not a random sample of Python.
  • 117 repositories is enough to defeat single-repo dominance; it is not a representative sample of the language ecosystem.

Provenance and licence of this benchmark

Derived from CodeSearchNet (code-search-net/code_search_net). The underlying functions remain under their original licences and copyright, listed per row and reproduced in full in NOTICES.md (117 repositories, 272 KB of licence text). The assembly, normalisation and disassembly are ours.

Downloads last month
12