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 |
55 | src/00055.py | pyc/00055.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code getcosmo>
MAKE_FUNCTION 0
STORE_NAME getcosmo
RETURN_CONST None
END
CODE getcosmo(cosmology)
DOC 'pass'
RESUME 0
LOAD_GLOBAL cg
LOAD_ATTR NULL|self + DRAGONS
CALL 0
LOAD_GLOBAL cg
LOAD_ATTR NULL|self + WMAP1_Mill
CALL 0
LOAD_GLOBAL cg
LOAD_ATTR NUL... | def getcosmo(cosmology):
"""pass"""
defaultcosmologies = {'dragons': cg.DRAGONS(), 'wmap1': cg.WMAP1_Mill(), 'wmap3': cg.WMAP3_ML(), 'wmap5': cg.WMAP5_mean(), 'wmap7': cg.WMAP7_ML(), 'wmap9': cg.WMAP9_ML(), 'wmap1_lss': cg.WMAP1_2dF_mean(), 'wmap3_mean': cg.WMAP3_mean(), 'wmap5_ml': cg.WMAP5_ML(), 'wmap5_lss': ... | {
"repo": "astroduff/commah",
"repo_url": "https://github.com/astroduff/commah",
"file_path": "commah/commah.py",
"commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137",
"func_name": "getcosmo",
"line_start": 70,
"line_end": 108,
"permalink": "https://github.com/astroduff/commah/blob/3ec70338c5123a053... | {
"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 | getcosmo | 154 | false |
56 | src/00056.py | pyc/00056.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _getcosmoheader>
MAKE_FUNCTION 0
STORE_NAME _getcosmoheader
RETURN_CONST None
END
CODE _getcosmoheader(cosmo)
DOC 'pass'
RESUME 0
LOAD_CONST '# Cosmology (flat) Om:{0:.3f}, Ol:{1:.3f}, h:{2:.2f}, sigma8:{3:.3f}, ns:{4:.2f}'
LOAD_ATTR NULL|self + format
LOAD_... | def _getcosmoheader(cosmo):
"""pass"""
cosmoheader = '# Cosmology (flat) Om:{0:.3f}, Ol:{1:.3f}, h:{2:.2f}, sigma8:{3:.3f}, ns:{4:.2f}'.format(cosmo['omega_M_0'], cosmo['omega_lambda_0'], cosmo['h'], cosmo['sigma_8'], cosmo['n'])
return cosmoheader | {
"repo": "astroduff/commah",
"repo_url": "https://github.com/astroduff/commah",
"file_path": "commah/commah.py",
"commit_sha": "3ec70338c5123a053c79ddcf2cb3beac26bc9137",
"func_name": "_getcosmoheader",
"line_start": 111,
"line_end": 119,
"permalink": "https://github.com/astroduff/commah/blob/3ec70338c... | {
"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 | _getcosmoheader | 31 | false |
57 | src/00057.py | pyc/00057.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code tag>
MAKE_FUNCTION 0
STORE_NAME tag
RETURN_CONST None
END
CODE tag(self, tag)
DOC 'pass'
RESUME 0
LOAD_FAST self
FORMAT_VALUE str
LOAD_CONST '/tags/'
LOAD_FAST tag
FORMAT_VALUE str
BUILD_STRING 3
STORE_FAST url
LOAD_FAST self
LOAD_ATTR http
LOA... | def tag(self, tag):
"""pass"""
url = '%s/tags/%s' % (self, tag)
response = self.http.get(url, auth=self.auth)
response.raise_for_status()
return response.json() | {
"repo": "quantmind/agile-toolkit",
"repo_url": "https://github.com/quantmind/agile-toolkit",
"file_path": "agiletoolkit/api/releases.py",
"commit_sha": "96028e36a842c57b171907c20583a60d1045fec1",
"func_name": "Releases.tag",
"line_start": 37,
"line_end": 43,
"permalink": "https://github.com/quantmind/... | {
"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 | Releases.tag | 34 | false |
58 | src/00058.py | pyc/00058.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code release_assets>
MAKE_FUNCTION 0
STORE_NAME release_assets
RETURN_CONST None
END
CODE release_assets(self, release)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + as_id
LOAD_FAST release
CALL 1
STORE_FAST release
LOAD_FAST self
LOAD_ATTR NUL... | def release_assets(self, release):
"""pass"""
release = self.as_id(release)
return self.get_list(url='%s/%s/assets' % (self, release)) | {
"repo": "quantmind/agile-toolkit",
"repo_url": "https://github.com/quantmind/agile-toolkit",
"file_path": "agiletoolkit/api/releases.py",
"commit_sha": "96028e36a842c57b171907c20583a60d1045fec1",
"func_name": "Releases.release_assets",
"line_start": 53,
"line_end": 57,
"permalink": "https://github.com... | {
"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 | Releases.release_assets | 27 | false |
59 | src/00059.py | pyc/00059.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code upload>
MAKE_FUNCTION defaults
STORE_NAME upload
RETURN_CONST None
END
CODE upload(self, release, filename, content_type)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + as_id
LOAD_FAST release
CALL 1
STORE_FAST release
LO... | def upload(self, release, filename, content_type=None):
"""pass"""
release = self.as_id(release)
name = os.path.basename(filename)
if not content_type:
content_type, _ = mimetypes.guess_type(name)
if not content_type:
raise ValueError('content_type not known')
inputs = {'name': n... | {
"repo": "quantmind/agile-toolkit",
"repo_url": "https://github.com/quantmind/agile-toolkit",
"file_path": "agiletoolkit/api/releases.py",
"commit_sha": "96028e36a842c57b171907c20583a60d1045fec1",
"func_name": "Releases.upload",
"line_start": 59,
"line_end": 84,
"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 | Releases.upload | 95 | false |
60 | src/00060.py | pyc/00060.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code validate_tag>
MAKE_FUNCTION defaults
STORE_NAME validate_tag
RETURN_CONST None
END
CODE validate_tag(self, tag_name, prefix)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + semantic_version
LOAD_FAST tag_name
CALL 1
STORE_FAST new_version
LOA... | def validate_tag(self, tag_name, prefix=None):
"""pass"""
new_version = semantic_version(tag_name)
current = self.latest()
if current:
tag_name = current['tag_name']
if prefix:
tag_name = tag_name[len(prefix):]
tag_name = semantic_version(tag_name)
if tag_name... | {
"repo": "quantmind/agile-toolkit",
"repo_url": "https://github.com/quantmind/agile-toolkit",
"file_path": "agiletoolkit/api/releases.py",
"commit_sha": "96028e36a842c57b171907c20583a60d1045fec1",
"func_name": "Releases.validate_tag",
"line_start": 86,
"line_end": 111,
"permalink": "https://github.com/... | {
"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 | Releases.validate_tag | 74 | false |
61 | src/00061.py | pyc/00061.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code is_related_to>
MAKE_FUNCTION defaults
STORE_NAME is_related_to
RETURN_CONST None
END
CODE is_related_to(item, app_id, app_ver)
DOC 'pass'
RESUME 0
LOAD_FAST item
LOAD_ATTR NULL|self + get
LOAD_CONST 'versionRange'
CALL 1
STORE_FAST v... | def is_related_to(item, app_id, app_ver=None):
"""pass"""
versionRange = item.get('versionRange')
if not versionRange:
return True
for vR in versionRange:
if not vR.get('targetApplication'):
return True
if get_related_targetApplication(vR, app_id, app_ver) is not None... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "is_related_to",
"line_start": 46,
"line_end": 57,
"permalink": "https://github.com/mozilla-se... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | is_related_to | 46 | false |
62 | src/00062.py | pyc/00062.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_related_targetApplication>
MAKE_FUNCTION 0
STORE_NAME get_related_targetApplication
RETURN_CONST None
END
CODE get_related_targetApplication(vR, app_id, app_ver)
DOC 'pass'
RESUME 0
LOAD_FAST vR
LOAD_ATTR NULL|self + get
LOAD_CONST 'targetApplication'
... | def get_related_targetApplication(vR, app_id, app_ver):
"""pass"""
targetApplication = vR.get('targetApplication')
if not targetApplication:
return None
for tA in targetApplication:
guid = tA.get('guid')
if not guid or guid == app_id:
if not app_ver:
r... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "get_related_targetApplication",
"line_start": 60,
"line_end": 78,
"permalink": "https://githu... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | get_related_targetApplication | 65 | false |
63 | src/00063.py | pyc/00063.pyc | CODE <module>()
RESUME 0
LOAD_CONST (3, None)
LOAD_CONST <code write_addons_items>
MAKE_FUNCTION defaults
STORE_NAME write_addons_items
RETURN_CONST None
END
CODE write_addons_items(xml_tree, records, app_id, api_ver, app_ver)
DOC 'pass'
RESUME 0
LOAD_FAST records
POP_JUMP_IF_TRUE L1
RETURN_CONST ... | def write_addons_items(xml_tree, records, app_id, api_ver=3, app_ver=None):
"""pass"""
if not records:
return
emItems = etree.SubElement(xml_tree, 'emItems')
groupby = {}
for item in records:
if is_related_to(item, app_id, app_ver):
if item['guid'] in groupby:
... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "write_addons_items",
"line_start": 88,
"line_end": 143,
"permalink": "https://github.com/mozi... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | write_addons_items | 181 | false |
64 | src/00064.py | pyc/00064.pyc | CODE <module>()
RESUME 0
LOAD_CONST (3, None)
LOAD_CONST <code write_plugin_items>
MAKE_FUNCTION defaults
STORE_NAME write_plugin_items
RETURN_CONST None
END
CODE write_plugin_items(xml_tree, records, app_id, api_ver, app_ver)
DOC 'pass'
RESUME 0
LOAD_FAST records
POP_JUMP_IF_TRUE L1
RETURN_CONST ... | def write_plugin_items(xml_tree, records, app_id, api_ver=3, app_ver=None):
"""pass"""
if not records:
return
pluginItems = etree.SubElement(xml_tree, 'pluginItems')
for item in records:
for versionRange in item.get('versionRange', []):
if not versionRange.get('targetApplicat... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "write_plugin_items",
"line_start": 152,
"line_end": 182,
"permalink": "https://github.com/moz... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | write_plugin_items | 80 | false |
65 | src/00065.py | pyc/00065.pyc | CODE <module>()
RESUME 0
LOAD_CONST (3,)
LOAD_CONST <code write_gfx_items>
MAKE_FUNCTION defaults
STORE_NAME write_gfx_items
RETURN_CONST None
END
CODE write_gfx_items(xml_tree, records, app_id, api_ver)
DOC 'pass'
RESUME 0
LOAD_FAST records
POP_JUMP_IF_TRUE L1
RETURN_CONST None
L1:
LOAD_GLOBAL ... | def write_gfx_items(xml_tree, records, app_id, api_ver=3):
"""pass"""
if not records:
return
gfxItems = etree.SubElement(xml_tree, 'gfxItems')
for item in records:
is_record_related = 'guid' not in item or item['guid'] == app_id
if is_record_related:
entry = etree.Sub... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "write_gfx_items",
"line_start": 276,
"line_end": 323,
"permalink": "https://github.com/mozill... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | write_gfx_items | 163 | false |
66 | src/00066.py | pyc/00066.pyc | CODE <module>()
RESUME 0
LOAD_CONST (3, None, None)
LOAD_CONST <code write_cert_items>
MAKE_FUNCTION defaults
STORE_NAME write_cert_items
RETURN_CONST None
END
CODE write_cert_items(xml_tree, records, api_ver, app_id, app_ver)
DOC 'pass'
RESUME 0
LOAD_FAST records
POP_JUMP_IF_FALSE L1
LOAD_GLOBAL ... | def write_cert_items(xml_tree, records, api_ver=3, app_id=None, app_ver=None):
"""pass"""
if not records or not should_include_certs(app_id, app_ver):
return
certItems = etree.SubElement(xml_tree, 'certItems')
for item in records:
if item.get('subject') and item.get('pubKeyHash'):
... | {
"repo": "mozilla-services/amo2kinto",
"repo_url": "https://github.com/mozilla-services/amo2kinto",
"file_path": "amo2kinto/exporter.py",
"commit_sha": "1ec40647e77cf89badbea4a58d328243daed49a9",
"func_name": "write_cert_items",
"line_start": 326,
"line_end": 352,
"permalink": "https://github.com/mozil... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "8f71f43fee3f78649d238238cbde51e6d7055c82",
"resolved_at_commit": "1ec40647e77cf89badbea4a58d328243daed49a9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozilla-services/amo2kinto | write_cert_items | 82 | false |
67 | src/00067.py | pyc/00067.pyc | CODE <module>()
RESUME 0
LOAD_CONST (True,)
LOAD_CONST <code label>
MAKE_FUNCTION defaults
STORE_NAME label
RETURN_CONST None
END
CODE label(self, name, color, update)
DOC 'pass'
RESUME 0
LOAD_CONST '%s/labels'
LOAD_FAST self
BINARY_OP %
STORE_FAST url
LOAD_GLOBAL NULL + dict
LOAD_FAST name
... | def label(self, name, color, update=True):
"""pass"""
url = '%s/labels' % self
data = dict(name=name, color=color)
response = self.http.post(url, json=data, auth=self.auth, headers=self.headers)
if response.status_code == 201:
return True
elif response.status_code == 422 and update:
... | {
"repo": "quantmind/agile-toolkit",
"repo_url": "https://github.com/quantmind/agile-toolkit",
"file_path": "agiletoolkit/api/repo.py",
"commit_sha": "96028e36a842c57b171907c20583a60d1045fec1",
"func_name": "GitRepo.label",
"line_start": 25,
"line_end": 41,
"permalink": "https://github.com/quantmind/agi... | {
"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 | GitRepo.label | 72 | false |
68 | src/00068.py | pyc/00068.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_interval_timedelta>
MAKE_FUNCTION 0
STORE_NAME get_interval_timedelta
RETURN_CONST None
END
CODE get_interval_timedelta(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL timezone
LOAD_ATTR NULL|self + now
CALL 0
STORE_FAST now_datetime
LOAD_GLOBAL NULL + monthra... | def get_interval_timedelta(self):
"""pass"""
now_datetime = timezone.now()
current_month_days = monthrange(now_datetime.year, now_datetime.month)[1]
if self.interval == reminders_choices.INTERVAL_2_WEEKS:
interval_timedelta = datetime.timedelta(days=14)
elif self.interval == reminders_choice... | {
"repo": "developersociety/django-glitter",
"repo_url": "https://github.com/developersociety/django-glitter",
"file_path": "glitter/reminders/models.py",
"commit_sha": "2c0280ec83afee80deee94ee3934fc54239c2e87",
"func_name": "Reminder.get_interval_timedelta",
"line_start": 34,
"line_end": 63,
"permalin... | {
"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 | Reminder.get_interval_timedelta | 113 | false |
69 | src/00069.py | pyc/00069.pyc | CODE <module>()
DOC 'classes'
RESUME 0
LOAD_CONST 'classes'
LOAD_NAME Sequence
LOAD_NAME type
BINARY_SUBSCR
LOAD_CONST 'return'
LOAD_NAME Tuple
LOAD_NAME Mapping
LOAD_NAME type
LOAD_NAME Sequence
LOAD_NAME type
BINARY_SUBSCR
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_NAME Mapping
LOAD_NAME type
... | def _build_mappings(self, classes: Sequence[type]) -> Tuple[Mapping[type, Sequence[type]], Mapping[type, Sequence[type]]]:
"""pass"""
parents_to_children: MutableMapping[type, Set[type]] = {}
children_to_parents: MutableMapping[type, Set[type]] = {}
visited_classes: Set[type] = set()
class_stack = l... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/apis/InheritanceGraph.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "InheritanceGraph._build_mappings",
"line_start": 347,
"line_end": 385,
"permal... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | InheritanceGraph._build_mappings | 215 | true |
70 | src/00070.py | pyc/00070.pyc | CODE <module>()
RESUME 0
LOAD_CONST (True,)
LOAD_CONST 'package_paths'
LOAD_NAME Sequence
LOAD_NAME str
BINARY_SUBSCR
LOAD_CONST 'recurse_subpackages'
LOAD_NAME bool
LOAD_CONST 'return'
LOAD_NAME Sequence
LOAD_NAME type
BINARY_SUBSCR
BUILD_TUPLE 6
LOAD_CONST <code _collect_classes>
MAKE_FU... | def _collect_classes(self, package_paths: Sequence[str], recurse_subpackages: bool=True) -> Sequence[type]:
"""pass"""
import uqbar.apis
classes = []
initial_source_paths: Set[str] = set()
for path in package_paths:
try:
module = importlib.import_module(path)
if hasat... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/apis/InheritanceGraph.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "InheritanceGraph._collect_classes",
"line_start": 387,
"line_end": 422,
"perma... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | InheritanceGraph._collect_classes | 191 | true |
71 | src/00071.py | pyc/00071.pyc | CODE <module>()
DOC 'paths'
RESUME 0
LOAD_CONST 'paths'
LOAD_NAME Sequence
LOAD_NAME Union
LOAD_NAME str
LOAD_NAME pathlib
LOAD_ATTR Path
BUILD_TUPLE 2
BINARY_SUBSCR
BINARY_SUBSCR
LOAD_CONST 'return'
LOAD_NAME Optional
LOAD_NAME pathlib
LOAD_ATTR Path
BINARY_SUBSCR
BUILD_TUPLE 4
LOAD... | def find_common_prefix(paths: Sequence[Union[str, pathlib.Path]]) -> Optional[pathlib.Path]:
"""pass"""
counter: collections.Counter = collections.Counter()
for path in paths:
path = pathlib.Path(path)
counter.update([path])
counter.update(path.parents)
valid_paths = sorted([path... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/io/__init__.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "find_common_prefix",
"line_start": 16,
"line_end": 48,
"permalink": "https://github.com/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | find_common_prefix | 119 | true |
72 | src/00072.py | pyc/00072.pyc | CODE <module>()
DOC 'name'
RESUME 0
LOAD_NAME os
LOAD_ATTR X_OK
BUILD_TUPLE 1
LOAD_CONST 'name'
LOAD_NAME str
LOAD_CONST 'return'
LOAD_NAME List
LOAD_NAME str
BINARY_SUBSCR
BUILD_TUPLE 4
LOAD_CONST <code find_executable>
MAKE_FUNCTION defaults, annotations
STORE_NAME find_executable
RETU... | def find_executable(name: str, flags=os.X_OK) -> List[str]:
"""pass"""
result = []
extensions = [x for x in os.environ.get('PATHEXT', '').split(os.pathsep) if x]
path = os.environ.get('PATH', None)
if path is None:
return []
for path in os.environ.get('PATH', '').split(os.pathsep):
... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/io/__init__.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "find_executable",
"line_start": 51,
"line_end": 71,
"permalink": "https://github.com/jos... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | find_executable | 138 | true |
73 | src/00073.py | pyc/00073.pyc | CODE <module>()
DOC 'source_path'
RESUME 0
LOAD_CONST 'source_path'
LOAD_NAME Union
LOAD_NAME str
LOAD_NAME pathlib
LOAD_ATTR Path
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'target_path'
LOAD_NAME Union
LOAD_NAME str
LOAD_NAME pathlib
LOAD_ATTR Path
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST ... | def relative_to(source_path: Union[str, pathlib.Path], target_path: Union[str, pathlib.Path]) -> pathlib.Path:
"""pass"""
source_path = pathlib.Path(source_path).absolute()
if source_path.is_file():
source_path = source_path.parent
target_path = pathlib.Path(target_path).absolute()
common_pr... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/io/__init__.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "relative_to",
"line_start": 74,
"line_end": 114,
"permalink": "https://github.com/josiah... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | relative_to | 89 | true |
74 | src/00074.py | pyc/00074.pyc | CODE <module>()
RESUME 0
LOAD_CONST (True,)
LOAD_CONST 'root_path'
LOAD_NAME Union
LOAD_NAME str
LOAD_NAME pathlib
LOAD_ATTR Path
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'top_down'
LOAD_NAME bool
LOAD_CONST 'return'
LOAD_NAME Generator
LOAD_NAME Tuple
LOAD_NAME pathlib
LOAD_ATTR Path
LO... | def walk(root_path: Union[str, pathlib.Path], top_down: bool=True) -> Generator[Tuple[pathlib.Path, Sequence[pathlib.Path], Sequence[pathlib.Path]], None, None]:
"""pass"""
root_path = pathlib.Path(root_path)
directory_paths, file_paths = ([], [])
for path in sorted(root_path.iterdir()):
if path... | {
"repo": "josiah-wolf-oberholtzer/uqbar",
"repo_url": "https://github.com/josiah-wolf-oberholtzer/uqbar",
"file_path": "uqbar/io/__init__.py",
"commit_sha": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"func_name": "walk",
"line_start": 117,
"line_end": 143,
"permalink": "https://github.com/josiah-wolf-... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "39ed67b9f4cd5f490237502c8b61978187c07d33",
"resolved_at_commit": "eca7fefebbbee1e2ae13bf5d6baa838be66b1db6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | josiah-wolf-oberholtzer/uqbar | walk | 137 | true |
75 | src/00075.py | pyc/00075.pyc | CODE <module>()
DOC 'return'
RESUME 0
LOAD_CONST 'return'
LOAD_NAME Generator
LOAD_NAME Tuple
LOAD_NAME int
LOAD_NAME int
LOAD_NAME str
LOAD_NAME type
BUILD_TUPLE 4
BINARY_SUBSCR
LOAD_CONST None
LOAD_CONST None
BUILD_TUPLE 3
BINARY_SUBSCR
BUILD_TUPLE 2
LOAD_CONST <code run>
MAKE_FUNC... | def run(self) -> Generator[Tuple[int, int, str, type], None, None]:
"""pass"""
if is_test_file(self.filename):
self.load()
for func in self.all_funcs():
try:
for error in func.check_all():
yield (error.line_number, error.offset, error.text, Checker... | {
"repo": "jamescooke/flake8-aaa",
"repo_url": "https://github.com/jamescooke/flake8-aaa",
"file_path": "src/flake8_aaa/checker.py",
"commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794",
"func_name": "Checker.run",
"line_start": 42,
"line_end": 54,
"permalink": "https://github.com/jamescooke/flake8-... | {
"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 | Checker.run | 117 | true |
76 | src/00076.py | pyc/00076.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code make_driver>
MAKE_FUNCTION defaults
STORE_NAME make_driver
RETURN_CONST None
END
CODE make_driver(loop)
DOC 'pass'
MAKE_CELL loop
MAKE_CELL stop
RESUME 0
LOAD_DEREF loop
COPY 1
POP_JUMP_IF_TRUE L1
POP_TOP
LOAD_GLOBAL asyncio
LO... | def make_driver(loop=None):
"""pass"""
loop = loop or asyncio.get_event_loop()
def stop(i=None):
loop.stop()
def driver(sink):
"""pass"""
sink.control.subscribe(on_next=stop, on_error=stop, on_completed=stop)
return None
return Component(call=driver, input=Sink) | {
"repo": "MainRo/cyclotron-aio",
"repo_url": "https://github.com/MainRo/cyclotron-aio",
"file_path": "cyclotron_aio/stop.py",
"commit_sha": "4401076aafe4a72de1d3c4ad6bb7ffa648506f7e",
"func_name": "make_driver",
"line_start": 8,
"line_end": 40,
"permalink": "https://github.com/MainRo/cyclotron-aio/blob... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "de282d266f4bc12cd4812434bbf2c5d7286a6790",
"resolved_at_commit": "4401076aafe4a72de1d3c4ad6bb7ffa648506f7e",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | MainRo/cyclotron-aio | make_driver | 63 | false |
77 | src/00077.py | pyc/00077.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _stdin_>
MAKE_FUNCTION 0
STORE_NAME _stdin_
RETURN_CONST None
END
CODE _stdin_(p)
DOC 'pass'
RESUME 0
LOAD_GLOBAL sys
LOAD_ATTR version
LOAD_CONST 0
BINARY_SUBSCR
STORE_FAST _v
LOAD_FAST _v
LOAD_CONST '3'
IS_OP 0
POP_JUMP_IF_FALSE L1
LOAD_GLOBA... | def _stdin_(p):
"""pass"""
_v = sys.version[0]
return input(p) if _v is '3' else raw_input(p) | {
"repo": "alixedi/palal",
"repo_url": "https://github.com/alixedi/palal",
"file_path": "palal/survey.py",
"commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837",
"func_name": "_stdin_",
"line_start": 28,
"line_end": 31,
"permalink": "https://github.com/alixedi/palal/blob/325359f66ac48a9f96efea0489aec... | {
"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 | _stdin_ | 28 | false |
78 | src/00078.py | pyc/00078.pyc | CODE <module>()
RESUME 0
LOAD_NAME SUR_DIR
LOAD_NAME SUR_FILE
BUILD_TUPLE 2
LOAD_CONST <code survey_loader>
MAKE_FUNCTION defaults
STORE_NAME survey_loader
RETURN_CONST None
END
CODE survey_loader(sur_dir, sur_file)
DOC 'pass'
RESUME 0
LOAD_GLOBAL os
LOAD_ATTR path
LOAD_ATTR NULL|self + join
... | def survey_loader(sur_dir=SUR_DIR, sur_file=SUR_FILE):
"""pass"""
survey_path = os.path.join(sur_dir, sur_file)
survey = None
with open(survey_path) as survey_file:
survey = Survey(survey_file.read())
return survey | {
"repo": "alixedi/palal",
"repo_url": "https://github.com/alixedi/palal",
"file_path": "palal/survey.py",
"commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837",
"func_name": "survey_loader",
"line_start": 105,
"line_end": 111,
"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 | survey_loader | 61 | false |
79 | src/00079.py | pyc/00079.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code format_choices>
MAKE_FUNCTION 0
STORE_NAME format_choices
RETURN_CONST None
END
CODE format_choices(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + enumerate
LOAD_FAST self
LOAD_ATTR choices
CALL 1
STORE_FAST ce
LOAD_CONST <code format_choices.<locals>.<l... | def format_choices(self):
"""pass"""
ce = enumerate(self.choices)
f = lambda i, c: '%s (%d)' % (c, i + 1)
toks = [f(i, c) for i, c in ce] + ['Help (?)']
return ' '.join(toks) | {
"repo": "alixedi/palal",
"repo_url": "https://github.com/alixedi/palal",
"file_path": "palal/survey.py",
"commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837",
"func_name": "Survey.format_choices",
"line_start": 51,
"line_end": 57,
"permalink": "https://github.com/alixedi/palal/blob/325359f66ac48a9... | {
"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 | Survey.format_choices | 72 | false |
80 | src/00080.py | pyc/00080.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code is_answer_valid>
MAKE_FUNCTION 0
STORE_NAME is_answer_valid
RETURN_CONST None
END
CODE is_answer_valid(self, ans)
DOC 'pass'
RESUME 0
LOAD_FAST ans
LOAD_GLOBAL NULL + range
LOAD_GLOBAL NULL + len
LOAD_FAST self
LOAD_ATTR choices
CALL 1
CALL 1
GET_I... | def is_answer_valid(self, ans):
"""pass"""
return ans in [str(i + 1) for i in range(len(self.choices))] | {
"repo": "alixedi/palal",
"repo_url": "https://github.com/alixedi/palal",
"file_path": "palal/survey.py",
"commit_sha": "325359f66ac48a9f96efea0489aec353f8a40837",
"func_name": "Survey.is_answer_valid",
"line_start": 59,
"line_end": 61,
"permalink": "https://github.com/alixedi/palal/blob/325359f66ac48a... | {
"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 | Survey.is_answer_valid | 47 | false |
81 | src/00081.py | pyc/00081.pyc | CODE <module>()
DOC 'span'
RESUME 0
LOAD_CONST 'span'
LOAD_NAME typing
LOAD_ATTR Tuple
LOAD_NAME int
LOAD_NAME int
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'line_type'
LOAD_NAME LineType
LOAD_CONST 'return'
LOAD_CONST None
BUILD_TUPLE 6
LOAD_CONST <code update>
MAKE_FUNCTION annotations
... | def update(self, span: typing.Tuple[int, int], line_type: LineType) -> None:
"""pass"""
first_block_line, last_block_line = span
for i in range(first_block_line, last_block_line + 1):
try:
self.__setitem__(i, line_type)
except ValueError as error:
raise ValidationErro... | {
"repo": "jamescooke/flake8-aaa",
"repo_url": "https://github.com/jamescooke/flake8-aaa",
"file_path": "src/flake8_aaa/line_markers.py",
"commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794",
"func_name": "LineMarkers.update",
"line_start": 50,
"line_end": 69,
"permalink": "https://github.com/jamesc... | {
"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 | LineMarkers.update | 84 | true |
82 | src/00082.py | pyc/00082.pyc | CODE <module>()
DOC 'return'
RESUME 0
LOAD_CONST 'return'
LOAD_NAME typing
LOAD_ATTR Generator
LOAD_NAME AAAError
LOAD_CONST None
LOAD_CONST None
BUILD_TUPLE 3
BINARY_SUBSCR
BUILD_TUPLE 2
LOAD_CONST <code check_arrange_act_spacing>
MAKE_FUNCTION annotations
STORE_NAME check_arrange_act_spaci... | def check_arrange_act_spacing(self) -> typing.Generator[AAAError, None, None]:
"""pass"""
yield from self.check_block_spacing(LineType.arrange, LineType.act, 'AAA03 expected 1 blank line before Act block, found {}') | {
"repo": "jamescooke/flake8-aaa",
"repo_url": "https://github.com/jamescooke/flake8-aaa",
"file_path": "src/flake8_aaa/line_markers.py",
"commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794",
"func_name": "LineMarkers.check_arrange_act_spacing",
"line_start": 71,
"line_end": 80,
"permalink": "https:... | {
"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 | LineMarkers.check_arrange_act_spacing | 54 | true |
83 | src/00083.py | pyc/00083.pyc | CODE <module>()
DOC 'return'
RESUME 0
LOAD_CONST 'return'
LOAD_NAME typing
LOAD_ATTR Generator
LOAD_NAME AAAError
LOAD_CONST None
LOAD_CONST None
BUILD_TUPLE 3
BINARY_SUBSCR
BUILD_TUPLE 2
LOAD_CONST <code check_act_assert_spacing>
MAKE_FUNCTION annotations
STORE_NAME check_act_assert_spacing... | def check_act_assert_spacing(self) -> typing.Generator[AAAError, None, None]:
"""pass"""
yield from self.check_block_spacing(LineType.act, LineType._assert, 'AAA04 expected 1 blank line before Assert block, found {}') | {
"repo": "jamescooke/flake8-aaa",
"repo_url": "https://github.com/jamescooke/flake8-aaa",
"file_path": "src/flake8_aaa/line_markers.py",
"commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794",
"func_name": "LineMarkers.check_act_assert_spacing",
"line_start": 82,
"line_end": 91,
"permalink": "https:/... | {
"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 | LineMarkers.check_act_assert_spacing | 54 | true |
84 | src/00084.py | pyc/00084.pyc | CODE <module>()
DOC 'first_block_type'
RESUME 0
LOAD_CONST 'first_block_type'
LOAD_NAME LineType
LOAD_CONST 'second_block_type'
LOAD_NAME LineType
LOAD_CONST 'error_message'
LOAD_NAME str
LOAD_CONST 'return'
LOAD_NAME typing
LOAD_ATTR Generator
LOAD_NAME AAAError
LOAD_CONST None
LOAD_CONST N... | def check_block_spacing(self, first_block_type: LineType, second_block_type: LineType, error_message: str) -> typing.Generator[AAAError, None, None]:
"""pass"""
numbered_lines = list(enumerate(self))
first_block_lines = filter(lambda l: l[1] is first_block_type, numbered_lines)
try:
first_block_... | {
"repo": "jamescooke/flake8-aaa",
"repo_url": "https://github.com/jamescooke/flake8-aaa",
"file_path": "src/flake8_aaa/line_markers.py",
"commit_sha": "29938b96845fe32ced4358ba66af3b3be2a37794",
"func_name": "LineMarkers.check_block_spacing",
"line_start": 93,
"line_end": 141,
"permalink": "https://git... | {
"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 | LineMarkers.check_block_spacing | 234 | true |
85 | src/00085.py | pyc/00085.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_access_token>
MAKE_FUNCTION 0
STORE_NAME get_access_token
RETURN_CONST None
END
CODE get_access_token(self, code)
DOC 'pass'
RESUME 0
NOP
L1:
LOAD_GLOBAL NULL + super
CALL 0
LOAD_ATTR NULL|self + fetch_token
LOAD_GLOBAL MINUT_TOKEN_URL
LOAD_FAST se... | def get_access_token(self, code):
"""pass"""
try:
self._token = super().fetch_token(MINUT_TOKEN_URL, client_id=self._client_id, client_secret=self._client_secret, code=code)
except MissingTokenError as error:
_LOGGER.debug('Token issues: %s', error)
return self._token | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession.get_access_token",
"line_start": 76,
"line_end": 88,
"permalink": "https://github.com/fredrike/pypoint... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession.get_access_token | 65 | false |
86 | src/00086.py | pyc/00086.pyc | CODE <module>()
DOC 'GET'
RESUME 0
LOAD_CONST ('GET',)
LOAD_CONST <code _request>
MAKE_FUNCTION defaults
STORE_NAME _request
RETURN_CONST None
END
CODE _request(self, url, request_type, **params)
DOC 'pass'
RESUME 0
NOP
L1:
LOAD_GLOBAL _LOGGER
LOAD_ATTR NULL|self + debug
LOAD_CONST 'Request %s... | def _request(self, url, request_type='GET', **params):
"""pass"""
try:
_LOGGER.debug('Request %s %s', url, params)
response = self.request(request_type, url, timeout=TIMEOUT.seconds, **params)
response.raise_for_status()
_LOGGER.debug('Response %s %s %.200s', response.status_code... | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession._request",
"line_start": 90,
"line_end": 104,
"permalink": "https://github.com/fredrike/pypoint/blob/b... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession._request | 105 | false |
87 | src/00087.py | pyc/00087.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _request_devices>
MAKE_FUNCTION 0
STORE_NAME _request_devices
RETURN_CONST None
END
CODE _request_devices(self, url, _type)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + _request
LOAD_FAST url
CALL 1
STORE_FAST res
LOAD_FAST res
POP_JUMP_I... | def _request_devices(self, url, _type):
"""pass"""
res = self._request(url)
return res.get(_type) if res else {} | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession._request_devices",
"line_start": 106,
"line_end": 109,
"permalink": "https://github.com/fredrike/pypoi... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession._request_devices | 25 | false |
88 | src/00088.py | pyc/00088.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code read_sensor>
MAKE_FUNCTION 0
STORE_NAME read_sensor
RETURN_CONST None
END
CODE read_sensor(self, device_id, sensor_uri)
DOC 'pass'
RESUME 0
LOAD_GLOBAL MINUT_DEVICES_URL
LOAD_CONST '/{device_id}/{sensor_uri}'
LOAD_ATTR NULL|self + format
LOAD_FAST device_i... | def read_sensor(self, device_id, sensor_uri):
"""pass"""
url = MINUT_DEVICES_URL + '/{device_id}/{sensor_uri}'.format(device_id=device_id, sensor_uri=sensor_uri)
res = self._request(url, request_type='GET', data={'limit': 1})
if not res.get('values'):
return None
return res.get('values')[-1]... | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession.read_sensor",
"line_start": 111,
"line_end": 118,
"permalink": "https://github.com/fredrike/pypoint/bl... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession.read_sensor | 46 | false |
89 | src/00089.py | pyc/00089.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _register_webhook>
MAKE_FUNCTION 0
STORE_NAME _register_webhook
RETURN_CONST None
END
CODE _register_webhook(self, webhook_url, events)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + _request
LOAD_GLOBAL MINUT_WEBHOOKS_URL
LOAD_CONST 'POST'
LOA... | def _register_webhook(self, webhook_url, events):
"""pass"""
response = self._request(MINUT_WEBHOOKS_URL, request_type='POST', json={'url': webhook_url, 'events': events})
return response | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession._register_webhook",
"line_start": 129,
"line_end": 139,
"permalink": "https://github.com/fredrike/pypo... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession._register_webhook | 23 | false |
90 | src/00090.py | pyc/00090.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code remove_webhook>
MAKE_FUNCTION 0
STORE_NAME remove_webhook
RETURN_CONST None
END
CODE remove_webhook(self)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR _webhook
LOAD_ATTR NULL|self + get
LOAD_CONST 'hook_id'
CALL 1
POP_JUMP_IF_FALSE L1
LOAD_FAST self
... | def remove_webhook(self):
"""pass"""
if self._webhook.get('hook_id'):
self._request('{}/{}'.format(MINUT_WEBHOOKS_URL, self._webhook['hook_id']), request_type='DELETE') | {
"repo": "fredrike/pypoint",
"repo_url": "https://github.com/fredrike/pypoint",
"file_path": "pypoint/__init__.py",
"commit_sha": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"func_name": "PointSession.remove_webhook",
"line_start": 141,
"line_end": 147,
"permalink": "https://github.com/fredrike/pypoint... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "213076547a70e14317340c05f9879b77b092f89f",
"resolved_at_commit": "b5c9a701d2b7e24d796aa7f8c410360b61d8ec8a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | fredrike/pypoint | PointSession.remove_webhook | 33 | false |
91 | src/00091.py | pyc/00091.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _get_ip>
MAKE_FUNCTION 0
STORE_NAME _get_ip
RETURN_CONST None
END
CODE _get_ip()
DOC 'pass'
RESUME 0
LOAD_CONST 'netstat'
LOAD_CONST '-nr'
BUILD_LIST 2
STORE_FAST cmd_netstat
LOAD_GLOBAL subprocess
LOAD_ATTR NULL|self + Popen
LOAD_FAST cmd_netstat
... | def _get_ip():
"""pass"""
cmd_netstat = ['netstat', '-nr']
p1 = subprocess.Popen(cmd_netstat, stdout=subprocess.PIPE)
cmd_grep = ['grep', '^0\\.0\\.0\\.0']
p2 = subprocess.Popen(cmd_grep, stdin=p1.stdout, stdout=subprocess.PIPE)
cmd_awk = ['awk', '{ print $2 }']
p3 = subprocess.Popen(cmd_awk... | {
"repo": "bgruening/galaxy_ie_helpers",
"repo_url": "https://github.com/bgruening/galaxy_ie_helpers",
"file_path": "galaxy_ie_helpers/__init__.py",
"commit_sha": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"func_name": "_get_ip",
"line_start": 18,
"line_end": 29,
"permalink": "https://github.com/bgruen... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "f5b82b8f80cbeae174561060b1a3a4cfabba6b06",
"resolved_at_commit": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | bgruening/galaxy_ie_helpers | _get_ip | 63 | false |
92 | src/00092.py | pyc/00092.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None, True)
LOAD_CONST <code get_galaxy_connection>
MAKE_FUNCTION defaults
STORE_NAME get_galaxy_connection
RETURN_CONST None
END
CODE get_galaxy_connection(history_id, obj)
DOC 'pass'
RESUME 0
LOAD_FAST history_id
COPY 1
POP_JUMP_IF_TRUE L1
POP_TOP
LOAD_GL... | def get_galaxy_connection(history_id=None, obj=True):
"""pass"""
history_id = history_id or os.environ['HISTORY_ID']
key = os.environ['API_KEY']
galaxy_ip = _get_ip()
url = Template(os.environ['GALAXY_URL']).safe_substitute({'DOCKER_HOST': galaxy_ip})
gi = _test_url(url, key, history_id, obj=obj... | {
"repo": "bgruening/galaxy_ie_helpers",
"repo_url": "https://github.com/bgruening/galaxy_ie_helpers",
"file_path": "galaxy_ie_helpers/__init__.py",
"commit_sha": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"func_name": "get_galaxy_connection",
"line_start": 50,
"line_end": 99,
"permalink": "https://git... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "f5b82b8f80cbeae174561060b1a3a4cfabba6b06",
"resolved_at_commit": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | bgruening/galaxy_ie_helpers | get_galaxy_connection | 127 | false |
93 | src/00093.py | pyc/00093.pyc | CODE <module>()
DOC 'auto'
RESUME 0
LOAD_CONST ('auto', None)
LOAD_CONST <code put>
MAKE_FUNCTION defaults
STORE_NAME put
RETURN_CONST None
END
CODE put(filenames, file_type, history_id)
DOC 'pass'
RESUME 0
LOAD_FAST history_id
COPY 1
POP_JUMP_IF_TRUE L1
POP_TOP
LOAD_GLOBAL os
LOAD_ATTR en... | def put(filenames, file_type='auto', history_id=None):
"""pass"""
history_id = history_id or os.environ['HISTORY_ID']
gi = get_galaxy_connection(history_id=history_id)
for filename in filenames:
log.debug('Uploading gx=%s history=%s localpath=%s ft=%s', gi, history_id, filename, file_type)
... | {
"repo": "bgruening/galaxy_ie_helpers",
"repo_url": "https://github.com/bgruening/galaxy_ie_helpers",
"file_path": "galaxy_ie_helpers/__init__.py",
"commit_sha": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"func_name": "put",
"line_start": 102,
"line_end": 113,
"permalink": "https://github.com/bgruenin... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "f5b82b8f80cbeae174561060b1a3a4cfabba6b06",
"resolved_at_commit": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | bgruening/galaxy_ie_helpers | put | 58 | false |
94 | src/00094.py | pyc/00094.pyc | CODE <module>()
DOC 'hid'
RESUME 0
LOAD_CONST ('hid', None)
LOAD_CONST <code get>
MAKE_FUNCTION defaults
STORE_NAME get
RETURN_CONST None
END
CODE get(datasets_identifiers, identifier_type, history_id)
DOC 'pass'
RESUME 0
LOAD_FAST history_id
COPY 1
POP_JUMP_IF_TRUE L1
POP_TOP
LOAD_GLOBAL os... | def get(datasets_identifiers, identifier_type='hid', history_id=None):
"""pass"""
history_id = history_id or os.environ['HISTORY_ID']
gi = get_galaxy_connection(history_id=history_id, obj=False)
for dataset_identifier in datasets_identifiers:
file_path = '/import/%s' % dataset_identifier
... | {
"repo": "bgruening/galaxy_ie_helpers",
"repo_url": "https://github.com/bgruening/galaxy_ie_helpers",
"file_path": "galaxy_ie_helpers/__init__.py",
"commit_sha": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"func_name": "get",
"line_start": 116,
"line_end": 143,
"permalink": "https://github.com/bgruenin... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "f5b82b8f80cbeae174561060b1a3a4cfabba6b06",
"resolved_at_commit": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | bgruening/galaxy_ie_helpers | get | 127 | false |
95 | src/00095.py | pyc/00095.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code get_user_history>
MAKE_FUNCTION defaults
STORE_NAME get_user_history
RETURN_CONST None
END
CODE get_user_history(history_id)
DOC 'pass'
RESUME 0
LOAD_FAST history_id
COPY 1
POP_JUMP_IF_TRUE L1
POP_TOP
LOAD_GLOBAL os
LOAD_ATTR envir... | def get_user_history(history_id=None):
"""pass"""
history_id = history_id or os.environ['HISTORY_ID']
gi = get_galaxy_connection(history_id=history_id, obj=False)
hc = HistoryClient(gi)
history = hc.show_history(history_id, visible=True, contents=True)
return history | {
"repo": "bgruening/galaxy_ie_helpers",
"repo_url": "https://github.com/bgruening/galaxy_ie_helpers",
"file_path": "galaxy_ie_helpers/__init__.py",
"commit_sha": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"func_name": "get_user_history",
"line_start": 145,
"line_end": 154,
"permalink": "https://github... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "f5b82b8f80cbeae174561060b1a3a4cfabba6b06",
"resolved_at_commit": "22d0f77d9e35297e0e6ca4136d5057409699d137",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | bgruening/galaxy_ie_helpers | get_user_history | 41 | false |
96 | src/00096.py | pyc/00096.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_user_sets>
MAKE_FUNCTION 0
STORE_NAME get_user_sets
RETURN_CONST None
END
CODE get_user_sets(client_id, user_id)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + api_call
LOAD_CONST 'get'
LOAD_CONST 'users/{}/sets'
LOAD_ATTR NULL|self + format
LOAD_FAST user_i... | def get_user_sets(client_id, user_id):
"""pass"""
data = api_call('get', 'users/{}/sets'.format(user_id), client_id=client_id)
return [WordSet.from_dict(wordset) for wordset in data] | {
"repo": "quizl/quizler",
"repo_url": "https://github.com/quizl/quizler",
"file_path": "quizler/utils.py",
"commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46",
"func_name": "get_user_sets",
"line_start": 10,
"line_end": 13,
"permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e7013ffde... | {
"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_user_sets | 49 | false |
97 | src/00097.py | pyc/00097.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code print_user_sets>
MAKE_FUNCTION 0
STORE_NAME print_user_sets
RETURN_CONST None
END
CODE print_user_sets(wordsets, print_terms)
DOC 'pass'
RESUME 0
LOAD_FAST wordsets
POP_JUMP_IF_TRUE L1
LOAD_GLOBAL NULL + print
LOAD_CONST 'No sets found'
CALL 1
POP_TOP
... | def print_user_sets(wordsets, print_terms):
"""pass"""
if not wordsets:
print('No sets found')
else:
print('Found sets: {}'.format(len(wordsets)))
for wordset in wordsets:
print(' {}'.format(wordset))
if print_terms:
for term in wordset.term... | {
"repo": "quizl/quizler",
"repo_url": "https://github.com/quizl/quizler",
"file_path": "quizler/utils.py",
"commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46",
"func_name": "print_user_sets",
"line_start": 16,
"line_end": 29,
"permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e7013ff... | {
"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 | print_user_sets | 63 | false |
98 | src/00098.py | pyc/00098.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_common_terms>
MAKE_FUNCTION 0
STORE_NAME get_common_terms
RETURN_CONST None
END
CODE get_common_terms(*api_envs)
DOC 'pass'
RESUME 0
BUILD_LIST 0
STORE_FAST common_terms
LOAD_GLOBAL NULL + get_user_sets
LOAD_FAST api_envs
CALL_FUNCTION_EX 0
STORE_F... | def get_common_terms(*api_envs):
"""pass"""
common_terms = []
wordsets = get_user_sets(*api_envs)
for wordset1, wordset2 in combinations(wordsets, 2):
common = wordset1.has_common(wordset2)
if common:
common_terms.append((wordset1.title, wordset2.title, common))
return co... | {
"repo": "quizl/quizler",
"repo_url": "https://github.com/quizl/quizler",
"file_path": "quizler/utils.py",
"commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46",
"func_name": "get_common_terms",
"line_start": 32,
"line_end": 44,
"permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e7013f... | {
"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_common_terms | 50 | false |
99 | src/00099.py | pyc/00099.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code print_common_terms>
MAKE_FUNCTION 0
STORE_NAME print_common_terms
RETURN_CONST None
END
CODE print_common_terms(common_terms)
DOC 'pass'
RESUME 0
LOAD_FAST common_terms
POP_JUMP_IF_TRUE L1
LOAD_GLOBAL NULL + print
LOAD_CONST 'No duplicates'
CALL 1
POP_... | def print_common_terms(common_terms):
"""pass"""
if not common_terms:
print('No duplicates')
else:
for set_pair in common_terms:
set1, set2, terms = set_pair
print('{} and {} have in common:'.format(set1, set2))
for term in terms:
print(' ... | {
"repo": "quizl/quizler",
"repo_url": "https://github.com/quizl/quizler",
"file_path": "quizler/utils.py",
"commit_sha": "44b3fd91f7074e7013ffde8147455f45ebdccc46",
"func_name": "print_common_terms",
"line_start": 47,
"line_end": 58,
"permalink": "https://github.com/quizl/quizler/blob/44b3fd91f7074e701... | {
"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 | print_common_terms | 55 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.