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
300
src/00300.py
pyc/00300.pyc
CODE <module>() RESUME 0 LOAD_CONST <code override_djconfig> MAKE_FUNCTION 0 STORE_NAME override_djconfig RETURN_CONST None END CODE override_djconfig(**new_cache_values) DOC 'pass' MAKE_CELL new_cache_values RESUME 0 LOAD_CLOSURE new_cache_values BUILD_TUPLE 1 LOAD_CONST <code override_djconfig.<...
def override_djconfig(**new_cache_values): """pass""" def decorator(func): @wraps(func) def func_wrapper(*args, **kw): old_cache_values = {key: getattr(conf.config, key) for key in new_cache_values} conf.config._set_many(new_cache_values) try: ...
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "djconfig/utils.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "override_djconfig", "line_start": 17, "line_end": 56, "permalink": "https://github.com/nitely/django-djco...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
override_djconfig
107
false
301
src/00301.py
pyc/00301.pyc
CODE <module>() RESUME 0 LOAD_CONST <code serialize> MAKE_FUNCTION 0 STORE_NAME serialize RETURN_CONST None END CODE serialize(value, field) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_FAST field LOAD_GLOBAL forms LOAD_ATTR Field CALL 2 POP_JUMP_IF_TRUE L1 LOAD_ASSERTION_ERROR R...
def serialize(value, field): """pass""" assert isinstance(field, forms.Field) if isinstance(field, forms.ModelMultipleChoiceField): return json.dumps([v.pk for v in value]) if isinstance(value, models.Model): return value.pk return value
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "djconfig/utils.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "serialize", "line_start": 59, "line_end": 73, "permalink": "https://github.com/nitely/django-djconfig/blo...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
serialize
68
false
302
src/00302.py
pyc/00302.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_version> MAKE_FUNCTION 0 STORE_NAME get_version RETURN_CONST None END CODE get_version(package) DOC 'pass' RESUME 0 LOAD_GLOBAL io LOAD_ATTR NULL|self + open LOAD_GLOBAL os LOAD_ATTR path LOAD_ATTR NULL|self + join LOAD_GLOBAL BASE_DIR LOAD_FAST ...
def get_version(package): """pass""" with io.open(os.path.join(BASE_DIR, package, '__init__.py'), encoding='utf-8') as fh: return [l.split('=', 1)[1].strip().strip("'").strip('"') for l in fh.readlines() if '__version__' in l][0]
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "setup.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "get_version", "line_start": 14, "line_end": 20, "permalink": "https://github.com/nitely/django-djconfig/blob/5e79a...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
get_version
104
false
303
src/00303.py
pyc/00303.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _check_backend> MAKE_FUNCTION 0 STORE_NAME _check_backend RETURN_CONST None END CODE _check_backend() DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + set LOAD_GLOBAL NULL + getattr LOAD_GLOBAL settings LOAD_CONST 'MIDDLEWARE' LOAD_CONST None CALL 3 COPY 1 P...
def _check_backend(): """pass""" middleware = set(getattr(settings, 'MIDDLEWARE', None) or getattr(settings, 'MIDDLEWARE_CLASSES', None) or []) if 'djconfig.middleware.DjConfigLocMemMiddleware' in middleware: return if 'djconfig.middleware.DjConfigMiddleware' in middleware: return ra...
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "djconfig/conf.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "_check_backend", "line_start": 23, "line_end": 45, "permalink": "https://github.com/nitely/django-djconfig...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
_check_backend
47
false
304
src/00304.py
pyc/00304.pyc
CODE <module>() RESUME 0 LOAD_CONST (True,) LOAD_CONST <code _register> MAKE_FUNCTION defaults STORE_NAME _register RETURN_CONST None END CODE _register(self, form_class, check_middleware) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + issubclass LOAD_FAST form_class LOAD_GLOBAL _ConfigFormBase CALL 2 ...
def _register(self, form_class, check_middleware=True): """pass""" if not issubclass(form_class, _ConfigFormBase): raise ValueError('The form does not inherit from `forms.ConfigForm`') self._registry.add(form_class) if check_middleware: _check_backend()
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "djconfig/conf.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "Config._register", "line_start": 83, "line_end": 100, "permalink": "https://github.com/nitely/django-djcon...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
Config._register
35
false
305
src/00305.py
pyc/00305.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _reload> MAKE_FUNCTION 0 STORE_NAME _reload RETURN_CONST None END CODE _reload(self) DOC 'pass' RESUME 0 LOAD_GLOBAL apps LOAD_ATTR NULL|self + get_model LOAD_CONST 'djconfig.Config' CALL 1 STORE_FAST ConfigModel BUILD_MAP 0 STORE_FAST cache LOAD_G...
def _reload(self): """pass""" ConfigModel = apps.get_model('djconfig.Config') cache = {} data = dict(ConfigModel.objects.all().values_list('key', 'value')) for form_class in self._registry: empty_form = form_class() cache.update({name: field.initial for name, field in empty_form.fiel...
{ "repo": "nitely/django-djconfig", "repo_url": "https://github.com/nitely/django-djconfig", "file_path": "djconfig/conf.py", "commit_sha": "5e79a048ef5c9529075cad947b0c309115035d7e", "func_name": "Config._reload", "line_start": 102, "line_end": 142, "permalink": "https://github.com/nitely/django-djconf...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "09b5ac37d65c005c50746c91ca964bc5642b2a27", "resolved_at_commit": "5e79a048ef5c9529075cad947b0c309115035d7e", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nitely/django-djconfig
Config._reload
265
false
306
src/00306.py
pyc/00306.pyc
CODE <module>() RESUME 0 LOAD_CONST <code Mixed> MAKE_FUNCTION 0 STORE_NAME Mixed RETURN_CONST None END CODE Mixed(*types) DOC 'pass' MAKE_CELL types MAKE_CELL MixedType RESUME 0 LOAD_GLOBAL NULL + len LOAD_DEREF types CALL 1 LOAD_CONST 2 COMPARE_OP < POP_JUMP_IF_FALSE L1 LOAD_GLOBAL NUL...
def Mixed(*types): """pass""" if len(types) < 2: raise ValueError('Mixed type requires at least 2 specific types') types = set(types) class MixedType(type): def __instancecheck__(cls, instance): """pass""" for mtype in types: if isinstance(instan...
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/extension_types.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "Mixed", "line_start": 1, "line_end": 28, "permalink": "https://github.com/gamechanger/schemer/blob/1d1...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
Mixed
99
false
307
src/00307.py
pyc/00307.pyc
CODE <module>() RESUME 0 LOAD_CONST <code one_of> MAKE_FUNCTION 0 STORE_NAME one_of RETURN_CONST None END CODE one_of(*args) DOC 'pass' MAKE_CELL items RESUME 0 LOAD_GLOBAL NULL + len LOAD_FAST args CALL 1 LOAD_CONST 1 COMPARE_OP == POP_JUMP_IF_FALSE L1 LOAD_GLOBAL NULL + isinstance LOAD...
def one_of(*args): """pass""" if len(args) == 1 and isinstance(args[0], list): items = args[0] else: items = list(args) def validate(value): if not value in items: return e('{} is not in the list {}', value, items) return validate
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/validators.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "one_of", "line_start": 8, "line_end": 21, "permalink": "https://github.com/gamechanger/schemer/blob/1d1dd7d...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
one_of
58
false
308
src/00308.py
pyc/00308.pyc
CODE <module>() RESUME 0 LOAD_CONST <code gte> MAKE_FUNCTION 0 STORE_NAME gte RETURN_CONST None END CODE gte(min_value) DOC 'pass' MAKE_CELL min_value RESUME 0 LOAD_CLOSURE min_value BUILD_TUPLE 1 LOAD_CONST <code gte.<locals>.validate> MAKE_FUNCTION closure STORE_FAST validate LOAD_FAST val...
def gte(min_value): """pass""" def validate(value): if value < min_value: return e('{} is not greater than or equal to {}', value, min_value) return validate
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/validators.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "gte", "line_start": 24, "line_end": 32, "permalink": "https://github.com/gamechanger/schemer/blob/1d1dd7da4...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
gte
34
false
309
src/00309.py
pyc/00309.pyc
CODE <module>() RESUME 0 LOAD_CONST <code lte> MAKE_FUNCTION 0 STORE_NAME lte RETURN_CONST None END CODE lte(max_value) DOC 'pass' MAKE_CELL max_value RESUME 0 LOAD_CLOSURE max_value BUILD_TUPLE 1 LOAD_CONST <code lte.<locals>.validate> MAKE_FUNCTION closure STORE_FAST validate LOAD_FAST val...
def lte(max_value): """pass""" def validate(value): if value > max_value: return e('{} is not less than or equal to {}', value, max_value) return validate
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/validators.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "lte", "line_start": 35, "line_end": 43, "permalink": "https://github.com/gamechanger/schemer/blob/1d1dd7da4...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
lte
34
false
310
src/00310.py
pyc/00310.pyc
CODE <module>() RESUME 0 LOAD_CONST <code gt> MAKE_FUNCTION 0 STORE_NAME gt RETURN_CONST None END CODE gt(gt_value) DOC 'pass' MAKE_CELL gt_value RESUME 0 LOAD_CLOSURE gt_value BUILD_TUPLE 1 LOAD_CONST <code gt.<locals>.validate> MAKE_FUNCTION closure STORE_FAST validate LOAD_FAST validate ...
def gt(gt_value): """pass""" def validate(value): if value <= gt_value: return e('{} is not greater than {}', value, gt_value) return validate
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/validators.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "gt", "line_start": 46, "line_end": 54, "permalink": "https://github.com/gamechanger/schemer/blob/1d1dd7da43...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
gt
34
false
311
src/00311.py
pyc/00311.pyc
CODE <module>() RESUME 0 LOAD_CONST <code lt> MAKE_FUNCTION 0 STORE_NAME lt RETURN_CONST None END CODE lt(lt_value) DOC 'pass' MAKE_CELL lt_value RESUME 0 LOAD_CLOSURE lt_value BUILD_TUPLE 1 LOAD_CONST <code lt.<locals>.validate> MAKE_FUNCTION closure STORE_FAST validate LOAD_FAST validate ...
def lt(lt_value): """pass""" def validate(value): if value >= lt_value: return e('{} is not less than {}', value, lt_value) return validate
{ "repo": "gamechanger/schemer", "repo_url": "https://github.com/gamechanger/schemer", "file_path": "schemer/validators.py", "commit_sha": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "func_name": "lt", "line_start": 57, "line_end": 65, "permalink": "https://github.com/gamechanger/schemer/blob/1d1dd7da43...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "e1313f2f40329748d7735c105db1ac43cc6dfc5e", "resolved_at_commit": "1d1dd7da433d3b84ce5a80ded5a84ab4a65825ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
gamechanger/schemer
lt
34
false
312
src/00312.py
pyc/00312.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None) LOAD_CONST <code load_config> MAKE_FUNCTION defaults STORE_NAME load_config RETURN_CONST None END CODE load_config(path, defaults) DOC 'pass' RESUME 0 LOAD_FAST defaults POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL DEFAULT_FILES STORE_FAST defaults L1: L...
def load_config(path=None, defaults=None): """pass""" if defaults is None: defaults = DEFAULT_FILES config = ConfigParser(allow_no_value=True) if defaults: config.read(defaults) if path: with open(path) as fh: config.read_file(fh) return config
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/settings.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "load_config", "line_start": 37, "line_end": 61, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c6166b18e...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
load_config
72
false
313
src/00313.py
pyc/00313.pyc
CODE <module>() RESUME 0 LOAD_CONST <code as_dict> MAKE_FUNCTION 0 STORE_NAME as_dict RETURN_CONST None END CODE as_dict(config) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + defaultdict LOAD_CONST <code as_dict.<locals>.<lambda>> MAKE_FUNCTION 0 CALL 1 STORE_FAST settings LOAD_FAST config LOAD_ATT...
def as_dict(config): """pass""" settings = defaultdict(lambda: {}) for section in config.sections(): for key, val in config.items(section): settings[section][key] = val return settings
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/settings.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "as_dict", "line_start": 85, "line_end": 96, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c6166b18ee0dc...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
as_dict
51
false
314
src/00314.py
pyc/00314.pyc
CODE <module>() RESUME 0 LOAD_CONST <code initialize> MAKE_FUNCTION 0 STORE_NAME initialize RETURN_CONST None END CODE initialize(self, timeouts) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR bind LOAD_CONST True IS_OP 0 POP_JUMP_IF_FALSE L1 LOAD_FAST self LOAD_ATTR socket LOAD_ATTR NULL|se...
def initialize(self, timeouts): """pass""" if self.bind is True: self.socket.bind(self.address) else: self.socket.connect(self.address) self._set_timeouts(timeouts)
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint.initialize", "line_start": 67, "line_end": 77, "permalink": "https://github.com/walkr/nanoservice/blob/e...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint.initialize
38
false
315
src/00315.py
pyc/00315.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _set_timeouts> MAKE_FUNCTION 0 STORE_NAME _set_timeouts RETURN_CONST None END CODE _set_timeouts(self, timeouts) DOC 'pass' RESUME 0 LOAD_CONST (None, None) UNPACK_SEQUENCE 2 STORE_FAST send_timeout STORE_FAST recv_timeout NOP L1: LOAD_FAST timeouts ...
def _set_timeouts(self, timeouts): """pass""" send_timeout, recv_timeout = (None, None) try: send_timeout, recv_timeout = timeouts except TypeError: raise EndpointError('`timeouts` must be a pair of numbers (2, 3) which represent the timeout values for send and receive respectively') ...
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint._set_timeouts", "line_start": 79, "line_end": 97, "permalink": "https://github.com/walkr/nanoservice/blo...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint._set_timeouts
67
false
316
src/00316.py
pyc/00316.pyc
CODE <module>() RESUME 0 LOAD_CONST <code send> MAKE_FUNCTION 0 STORE_NAME send RETURN_CONST None END CODE send(self, payload) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + encode LOAD_FAST payload CALL 1 STORE_FAST payload LOAD_FAST self LOAD_ATTR NULL|self + sign LOAD_FAST pay...
def send(self, payload): """pass""" payload = self.encode(payload) payload = self.sign(payload) self.socket.send(payload)
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint.send", "line_start": 99, "line_end": 103, "permalink": "https://github.com/walkr/nanoservice/blob/e20989...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint.send
27
false
317
src/00317.py
pyc/00317.pyc
CODE <module>() RESUME 0 LOAD_CONST (True,) LOAD_CONST <code receive> MAKE_FUNCTION defaults STORE_NAME receive RETURN_CONST None END CODE receive(self, decode) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR socket LOAD_ATTR NULL|self + recv CALL 0 STORE_FAST payload LOAD_FAST self LOAD_ATTR...
def receive(self, decode=True): """pass""" payload = self.socket.recv() payload = self.verify(payload) if decode: payload = self.decode(payload) return payload
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint.receive", "line_start": 105, "line_end": 111, "permalink": "https://github.com/walkr/nanoservice/blob/e2...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint.receive
31
false
318
src/00318.py
pyc/00318.pyc
CODE <module>() RESUME 0 LOAD_CONST <code sign> MAKE_FUNCTION 0 STORE_NAME sign RETURN_CONST None END CODE sign(self, payload) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR authenticator POP_JUMP_IF_FALSE L1 LOAD_FAST self LOAD_ATTR authenticator LOAD_ATTR NULL|self + signed LOAD_FAST payload...
def sign(self, payload): """pass""" if self.authenticator: return self.authenticator.signed(payload) return payload
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint.sign", "line_start": 113, "line_end": 117, "permalink": "https://github.com/walkr/nanoservice/blob/e2098...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint.sign
22
false
319
src/00319.py
pyc/00319.pyc
CODE <module>() RESUME 0 LOAD_CONST <code verify> MAKE_FUNCTION 0 STORE_NAME verify RETURN_CONST None END CODE verify(self, payload) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR authenticator POP_JUMP_IF_TRUE L1 LOAD_FAST payload RETURN_VALUE L1: NOP L2: LOAD_FAST self LOAD_ATTR authentica...
def verify(self, payload): """pass""" if not self.authenticator: return payload try: self.authenticator.auth(payload) return self.authenticator.unsigned(payload) except AuthenticatorInvalidSignature: raise except Exception as exception: raise AuthenticateError...
{ "repo": "walkr/nanoservice", "repo_url": "https://github.com/walkr/nanoservice", "file_path": "nanoservice/core.py", "commit_sha": "e2098986b1baa5f283167ae487d14f3c6c21961a", "func_name": "Endpoint.verify", "line_start": 119, "line_end": 129, "permalink": "https://github.com/walkr/nanoservice/blob/e20...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "b9f25e26a91fb71287fb4f533fc10c78e757a332", "resolved_at_commit": "e2098986b1baa5f283167ae487d14f3c6c21961a", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
walkr/nanoservice
Endpoint.verify
65
false
320
src/00320.py
pyc/00320.pyc
CODE <module>() RESUME 0 BUILD_LIST 0 BUILD_TUPLE 1 LOAD_CONST <code get_summary> MAKE_FUNCTION defaults STORE_NAME get_summary RETURN_CONST None END CODE get_summary(list_all, **kwargs) DOC 'pass' RESUME 0 BUILD_LIST 0 STORE_FAST all_summary LOAD_FAST list_all GET_ITER L1: EXTENDED_ARG 1 ...
def get_summary(list_all=[], **kwargs): """pass""" all_summary = [] for module in list_all: summary = {'module_name': module['Name'], 'show_all': kwargs.get('show_all', True), 'project_name': kwargs.get('proj_name', 'TestProject'), 'home_page': kwargs.get('home_page', __about__.HOME_PAGE), 'start_ti...
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_report.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "HtmlReporter.get_summary", "line_start": 134, "line_end": 193, "permalink": "https://github.com/RockFeng0/rtsf/blob/fbc0d5...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
HtmlReporter.get_summary
274
false
321
src/00321.py
pyc/00321.pyc
CODE <module>() DOC 'TestModule' RESUME 0 BUILD_LIST 0 LOAD_CONST 'TestModule' BUILD_TUPLE 2 LOAD_CONST <code add_report_data> MAKE_FUNCTION defaults STORE_NAME add_report_data RETURN_CONST None END CODE add_report_data(list_all, module_name, **kwargs) DOC 'pass' RESUME 0 LOAD_FAST kwargs LOAD...
def add_report_data(list_all=[], module_name='TestModule', **kwargs): """pass""" start_at = kwargs.get('start_at') case_name = kwargs.get('case_name', 'TestCase') raw_case_name = kwargs.get('raw_case_name', 'TestCase') exec_date_time = time.localtime(start_at) execdate = time.strftime('%Y-%m-%d'...
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_report.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "HtmlReporter.add_report_data", "line_start": 196, "line_end": 241, "permalink": "https://github.com/RockFeng0/rtsf/blob/fb...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
HtmlReporter.add_report_data
140
false
322
src/00322.py
pyc/00322.pyc
CODE <module>() DOC 'DEFAULT' RESUME 0 LOAD_CONST ('DEFAULT',) LOAD_CONST <code get_webpack> MAKE_FUNCTION defaults STORE_NAME get_webpack RETURN_CONST None END CODE get_webpack(request, name) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + hasattr LOAD_FAST request LOAD_CONST '_webpack_map' CALL 2 P...
def get_webpack(request, name='DEFAULT'): """pass""" if not hasattr(request, '_webpack_map'): request._webpack_map = {} wp = request._webpack_map.get(name) if wp is None: wp = request._webpack_map[name] = Webpack(request, name) return wp
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "get_webpack", "line_start": 212, "line_end": 223, "permalink": "https://github.com/stevearc...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
get_webpack
42
false
323
src/00323.py
pyc/00323.pyc
CODE <module>() RESUME 0 LOAD_CONST <code includeme> MAKE_FUNCTION 0 STORE_NAME includeme RETURN_CONST None END CODE includeme(config) DOC 'pass' RESUME 0 LOAD_FAST config LOAD_ATTR registry LOAD_ATTR settings STORE_FAST settings LOAD_FAST config LOAD_ATTR root_package LOAD_ATTR __name__ S...
def includeme(config): """pass""" settings = config.registry.settings root_package_name = config.root_package.__name__ config.registry.webpack = {'DEFAULT': WebpackState(settings, root_package_name)} for extra_config in aslist(settings.get('webpack.configs', [])): state = WebpackState(settin...
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "includeme", "line_start": 226, "line_end": 244, "permalink": "https://github.com/stevearc/p...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
includeme
90
false
324
src/00324.py
pyc/00324.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, True) LOAD_CONST <code _get_setting> MAKE_FUNCTION defaults STORE_NAME _get_setting RETURN_CONST None END CODE _get_setting(self, setting, default, name, inherit) DOC 'pass' RESUME 0 LOAD_FAST name POP_JUMP_IF_NOT_NONE L1 LOAD_FAST self LOAD_ATTR ...
def _get_setting(self, setting, default=None, name=None, inherit=True): """pass""" if name is None: name = self.name if name == 'DEFAULT': return self._settings.get('webpack.{0}'.format(setting), default) else: val = self._settings.get('webpack.{0}.{1}'.format(name, setting), SEN...
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "WebpackState._get_setting", "line_start": 93, "line_end": 108, "permalink": "https://github...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
WebpackState._get_setting
62
false
325
src/00325.py
pyc/00325.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None) LOAD_CONST <code load_stats> MAKE_FUNCTION defaults STORE_NAME load_stats RETURN_CONST None END CODE load_stats(self, cache, wait) DOC 'pass' RESUME 0 LOAD_FAST cache POP_JUMP_IF_NOT_NONE L1 LOAD_FAST self LOAD_ATTR debug UNARY_NOT STORE_FAST ...
def load_stats(self, cache=None, wait=None): """pass""" if cache is None: cache = not self.debug if wait is None: wait = self.debug if not cache or self._stats is None: self._stats = self._load_stats() start = time.time() while wait and self._stats.get('status') =...
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "WebpackState.load_stats", "line_start": 110, "line_end": 125, "permalink": "https://github....
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
WebpackState.load_stats
97
false
326
src/00326.py
pyc/00326.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _load_stats> MAKE_FUNCTION 0 STORE_NAME _load_stats RETURN_CONST None END CODE _load_stats(self) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + range LOAD_CONST 0 LOAD_CONST 3 CALL 2 GET_ITER L1: FOR_ITER L6 STORE_FAST attempt NOP L2: LOAD_FAST self LO...
def _load_stats(self): """pass""" for attempt in range(0, 3): try: with self.stats_file.open() as f: return json.load(f) except ValueError: if attempt < 2: time.sleep(attempt * 0.2) else: raise except IOE...
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "WebpackState._load_stats", "line_start": 127, "line_end": 144, "permalink": "https://github...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
WebpackState._load_stats
112
false
327
src/00327.py
pyc/00327.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _chunk_filter> MAKE_FUNCTION 0 STORE_NAME _chunk_filter RETURN_CONST None END CODE _chunk_filter(self, extensions) DOC 'pass' MAKE_CELL self MAKE_CELL extensions RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_DEREF extensions LOAD_GLOBAL six LOAD_ATTR str...
def _chunk_filter(self, extensions): """pass""" if isinstance(extensions, six.string_types): extensions = extensions.split() def _filter(chunk): """pass""" name = chunk['name'] if extensions is not None: if not any((name.endswith(e) for e in extensions)): ...
{ "repo": "stevearc/pyramid_webpack", "repo_url": "https://github.com/stevearc/pyramid_webpack", "file_path": "pyramid_webpack/__init__.py", "commit_sha": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "func_name": "Webpack._chunk_filter", "line_start": 163, "line_end": 181, "permalink": "https://github.co...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d584adbc26dc39bd150cd349e11e4c034d59fa15", "resolved_at_commit": "4fcad26271fd6e8c270e19c7943240fea6d8c484", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
stevearc/pyramid_webpack
Webpack._chunk_filter
119
false
328
src/00328.py
pyc/00328.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _unique_names> MAKE_FUNCTION 0 STORE_NAME _unique_names RETURN_CONST None END CODE _unique_names() DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_CONST 'abcdefghijklmnopqrstuvwxyz0123456789' STORE_FAST characters LOAD_GLOBAL NULL + irange LOAD_G...
def _unique_names(): """pass""" characters = 'abcdefghijklmnopqrstuvwxyz0123456789' characters = [characters[i:i + 1] for i in irange(len(characters))] rng = random.Random() while True: letters = [rng.choice(characters) for i in irange(10)] yield ''.join(letters)
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "_unique_names", "line_start": 31, "line_end": 40, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6bdeb650b46cf...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
_unique_names
99
false
329
src/00329.py
pyc/00329.pyc
CODE <module>() RESUME 0 LOAD_CONST <code escape_queue> MAKE_FUNCTION 0 STORE_NAME escape_queue RETURN_CONST None END CODE escape_queue(s) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_FAST s LOAD_GLOBAL PosixPath CALL 2 POP_JUMP_IF_FALSE L1 LOAD_GLOBAL NULL + unicode_ LOAD_FAST s ...
def escape_queue(s): """pass""" if isinstance(s, PosixPath): s = unicode_(s) elif isinstance(s, bytes): s = s.decode('utf-8') if s.startswith('~/'): return '~/' + shell_escape(s[2:]) else: return shell_escape(s)
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "escape_queue", "line_start": 52, "line_end": 62, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6bdeb650b46cfe...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
escape_queue
51
false
330
src/00330.py
pyc/00330.pyc
CODE <module>() RESUME 0 LOAD_CONST <code parse_ssh_destination> MAKE_FUNCTION 0 STORE_NAME parse_ssh_destination RETURN_CONST None END CODE parse_ssh_destination(destination) DOC 'pass' RESUME 0 LOAD_GLOBAL _re_ssh LOAD_ATTR NULL|self + match LOAD_FAST destination CALL 1 STORE_FAST match LOAD...
def parse_ssh_destination(destination): """pass""" match = _re_ssh.match(destination) if not match: raise InvalidDestination('Invalid destination: %s' % destination) user, password, host, port = match.groups() info = {} if user: info['username'] = user else: info['use...
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "parse_ssh_destination", "line_start": 75, "line_end": 93, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6bdeb...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
parse_ssh_destination
71
false
331
src/00331.py
pyc/00331.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _ssh_client> MAKE_FUNCTION 0 STORE_NAME _ssh_client RETURN_CONST None END CODE _ssh_client(self) DOC 'pass' RESUME 0 LOAD_GLOBAL paramiko LOAD_ATTR NULL|self + SSHClient CALL 0 STORE_FAST ssh LOAD_FAST ssh LOAD_ATTR NULL|self + load_system_host_keys ...
def _ssh_client(self): """pass""" ssh = paramiko.SSHClient() ssh.load_system_host_keys() ssh.set_missing_host_key_policy(paramiko.RejectPolicy()) return ssh
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "RemoteQueue._ssh_client", "line_start": 201, "line_end": 207, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
RemoteQueue._ssh_client
27
false
332
src/00332.py
pyc/00332.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _connect> MAKE_FUNCTION 0 STORE_NAME _connect RETURN_CONST None END CODE _connect(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + _ssh_client CALL 0 STORE_FAST ssh LOAD_GLOBAL logger LOAD_ATTR NULL|self + debug LOAD_CONST 'Connecting w...
def _connect(self): """pass""" ssh = self._ssh_client() logger.debug('Connecting with %s', ', '.join(('%s=%r' % (k, v if k != 'password' else '***') for k, v in iteritems(self.destination)))) ssh.connect(**self.destination) logger.debug('Connected to %s', self.destination['hostname']) self._ssh ...
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "RemoteQueue._connect", "line_start": 209, "line_end": 218, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6bde...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
RemoteQueue._connect
91
false
333
src/00333.py
pyc/00333.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_client> MAKE_FUNCTION 0 STORE_NAME get_client RETURN_CONST None END CODE get_client(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _ssh POP_JUMP_IF_NOT_NONE L1 LOAD_FAST self LOAD_ATTR NULL|self + _connect CALL 0 POP_TOP LOAD_FAST self LO...
def get_client(self): """pass""" if self._ssh is None: self._connect() return self._ssh else: try: chan = self._ssh.get_transport().open_session() except (socket.error, paramiko.SSHException): logger.warning('Lost connection, reconnecting...') ...
{ "repo": "VisTrails/tej", "repo_url": "https://github.com/VisTrails/tej", "file_path": "tej/submission.py", "commit_sha": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "func_name": "RemoteQueue.get_client", "line_start": 220, "line_end": 238, "permalink": "https://github.com/VisTrails/tej/blob/b8dedaeb6b...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE.txt", "blob_sha": "2b8fcc794ba386a2a56a5cb47bd4584fc052a437", "resolved_at_commit": "b8dedaeb6bdeb650b46cfe6d85e5aa9284fc7f0b", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
VisTrails/tej
RemoteQueue.get_client
76
false
334
src/00334.py
pyc/00334.pyc
CODE <module>() RESUME 0 LOAD_CONST <code activate> MAKE_FUNCTION 0 STORE_NAME activate RETURN_CONST None END CODE activate(lancet, method, project) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + taskstatus LOAD_CONST 'Looking up project' CALL 1 BEFORE_WITH L1: STORE_FAST ts LOAD_FAST method LOAD_CO...
def activate(lancet, method, project): """pass""" with taskstatus('Looking up project') as ts: if method == 'key': func = get_project_keys elif method == 'dir': func = get_project_keys for key, project_path in func(lancet): if key.lower() == project.lo...
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/commands/workflow.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "activate", "line_start": 24, "line_end": 56, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c61...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
activate
154
false
335
src/00335.py
pyc/00335.pyc
CODE <module>() RESUME 0 LOAD_CONST <code workon> MAKE_FUNCTION 0 STORE_NAME workon RETURN_CONST None END CODE workon(ctx, issue_id, new, base_branch) DOC 'pass' RESUME 0 LOAD_FAST ctx LOAD_ATTR obj STORE_FAST lancet LOAD_FAST issue_id POP_JUMP_IF_TRUE L1 LOAD_FAST new POP_JUMP_IF_TRUE L1 ...
def workon(ctx, issue_id, new, base_branch): """pass""" lancet = ctx.obj if not issue_id and (not new): raise click.UsageError('Provide either an issue ID or the --new flag.') elif issue_id and new: raise click.UsageError('Provide either an issue ID or the --new flag, but not both.') ...
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/commands/workflow.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "workon", "line_start": 78, "line_end": 135, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c616...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
workon
192
false
336
src/00336.py
pyc/00336.pyc
CODE <module>() RESUME 0 LOAD_CONST <code time> MAKE_FUNCTION 0 STORE_NAME time RETURN_CONST None END CODE time(lancet, issue) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + get_issue LOAD_FAST lancet LOAD_FAST issue CALL 2 STORE_FAST issue LOAD_GLOBAL NULL + taskstatus LOAD_CONST 'Starting harvest ...
def time(lancet, issue): """pass""" issue = get_issue(lancet, issue) with taskstatus('Starting harvest timer') as ts: lancet.timer.start(issue) ts.ok('Started harvest timer')
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/commands/workflow.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "time", "line_start": 141, "line_end": 153, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c6166...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
time
57
false
337
src/00337.py
pyc/00337.pyc
CODE <module>() RESUME 0 LOAD_CONST <code pause> MAKE_FUNCTION 0 STORE_NAME pause RETURN_CONST None END CODE pause(ctx) DOC 'pass' RESUME 0 LOAD_FAST ctx LOAD_ATTR obj STORE_FAST lancet LOAD_FAST lancet LOAD_ATTR config LOAD_ATTR NULL|self + get LOAD_CONST 'tracker' LOAD_CONST 'paused_stat...
def pause(ctx): """pass""" lancet = ctx.obj paused_status = lancet.config.get('tracker', 'paused_status') issue = get_issue(lancet) transition = get_transition(ctx, lancet, issue, paused_status) set_issue_status(lancet, issue, paused_status, transition) with taskstatus('Pausing harvest timer...
{ "repo": "GaretJax/lancet", "repo_url": "https://github.com/GaretJax/lancet", "file_path": "lancet/commands/workflow.py", "commit_sha": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "func_name": "pause", "line_start": 158, "line_end": 179, "permalink": "https://github.com/GaretJax/lancet/blob/cf438c5c616...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "8ccf3392d3da083fb6838dd5cfe53355b2defc38", "resolved_at_commit": "cf438c5c6166b18ee0dc5ffce55220793019bb95", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
GaretJax/lancet
pause
79
false
338
src/00338.py
pyc/00338.pyc
CODE <module>() RESUME 0 LOAD_CONST <code raisefrom> MAKE_FUNCTION 0 STORE_NAME raisefrom RETURN_CONST None END CODE raisefrom(exc_type, message, exc) DOC 'pass' RESUME 0 LOAD_GLOBAL sys LOAD_ATTR version_info LOAD_CONST None LOAD_CONST 2 BINARY_SLICE LOAD_CONST (3, 2) COMPARE_OP >= POP_JU...
def raisefrom(exc_type, message, exc): """pass""" if sys.version_info[:2] >= (3, 2): six.raise_from(exc_type(message), exc) else: six.reraise(exc_type, '%s - %s' % (message, exc), sys.exc_info()[2])
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/__init__.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "raisefrom", "line_start": 7, "line_end": 23, "permalink": "https://github.com/O...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
raisefrom
46
false
339
src/00339.py
pyc/00339.pyc
CODE <module>() RESUME 0 LOAD_CONST <code init_runner> MAKE_FUNCTION 0 STORE_NAME init_runner RETURN_CONST None END CODE init_runner(self, parser, tracers, projinfo) DOC 'pass' RESUME 0 LOAD_FAST parser LOAD_FAST self STORE_ATTR parser LOAD_FAST tracers LOAD_FAST self STORE_ATTR tracers LOAD...
def init_runner(self, parser, tracers, projinfo): """pass""" self.parser = parser self.tracers = tracers self.proj_info = projinfo
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_executer.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "Runner.init_runner", "line_start": 227, "line_end": 243, "permalink": "https://github.com/RockFeng0/rtsf/blob/fbc0d57eda...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
Runner.init_runner
20
false
340
src/00340.py
pyc/00340.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _run_grid_multiprocess> MAKE_FUNCTION 0 STORE_NAME _run_grid_multiprocess RETURN_CONST None END CODE _run_grid_multiprocess(self, func, iterables) DOC 'pass' RESUME 0 LOAD_GLOBAL multiprocessing LOAD_ATTR NULL|self + freeze_support CALL 0 POP_TOP LOAD_GL...
def _run_grid_multiprocess(self, func, iterables): """pass""" multiprocessing.freeze_support() pool = multiprocessing.Pool() pool_tracers = pool.map(func, iterables) pool.close() pool.join() self.tracers = dict(zip(self._default_devices, pool_tracers))
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_executer.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "Runner._run_grid_multiprocess", "line_start": 282, "line_end": 294, "permalink": "https://github.com/RockFeng0/rtsf/blob...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
Runner._run_grid_multiprocess
42
false
341
src/00341.py
pyc/00341.pyc
CODE <module>() RESUME 0 LOAD_CONST <code _run_grid_multithread> MAKE_FUNCTION 0 STORE_NAME _run_grid_multithread RETURN_CONST None END CODE _run_grid_multithread(self, func, iterables) DOC 'pass' MAKE_CELL func RESUME 0 LOAD_CLOSURE func BUILD_TUPLE 1 LOAD_CONST <code _run_grid_multithread.<local...
def _run_grid_multithread(self, func, iterables): """pass""" f = lambda x: threading.Thread(target=func, args=(x,)) threads = map(f, iterables) for thread in threads: thread.setDaemon(True) thread.start() thread.join()
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_executer.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "Runner._run_grid_multithread", "line_start": 296, "line_end": 307, "permalink": "https://github.com/RockFeng0/rtsf/blob/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
Runner._run_grid_multithread
55
false
342
src/00342.py
pyc/00342.pyc
CODE <module>() DOC 'Automation' RESUME 0 LOAD_CONST ('Automation', None, 'utf-8', False) LOAD_CONST <code init_project_env> MAKE_FUNCTION defaults STORE_NAME init_project_env RETURN_CONST None END CODE init_project_env(subject, proj_path, sysencoding, debug) DOC 'pass' RESUME 0 LOAD_FAST proj_path ...
def init_project_env(subject='Automation', proj_path=None, sysencoding='utf-8', debug=False): """pass""" if not proj_path: try: executable_file_path = os.path.dirname(os.path.abspath(inspect.stack()[-1][1])) except: executable_file_path = os.path.dirname(sys.path[0]) ...
{ "repo": "RockFeng0/rtsf", "repo_url": "https://github.com/RockFeng0/rtsf", "file_path": "rtsf/p_common.py", "commit_sha": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "func_name": "init_project_env", "line_start": 76, "line_end": 111, "permalink": "https://github.com/RockFeng0/rtsf/blob/fbc0d57edaeca86...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "a50a2156b2097d447d2aeff5b2c155ce9cb42312", "resolved_at_commit": "fbc0d57edaeca86418af3942472fcc6d3e9ce591", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
RockFeng0/rtsf
init_project_env
203
false
343
src/00343.py
pyc/00343.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_long_description> MAKE_FUNCTION 0 STORE_NAME get_long_description RETURN_CONST None END CODE get_long_description() DOC 'pass' RESUME 0 LOAD_GLOBAL os LOAD_ATTR path LOAD_ATTR NULL|self + abspath LOAD_GLOBAL os LOAD_ATTR path LOAD_ATTR NULL|self + ...
def get_long_description(): """pass""" here = os.path.abspath(os.path.dirname(__file__)) with copen(os.path.join(here, 'DESCRIPTION.rst'), encoding='utf-8') as description: return description.read()
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "setup.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "get_long_description", "line_start": 14, "line_end": 19, "permalink": "https://github.com/getmillipe...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
get_long_description
62
false
344
src/00344.py
pyc/00344.pyc
CODE <module>() DOC 'nested_list' RESUME 0 LOAD_CONST 'nested_list' LOAD_NAME list LOAD_CONST 'return' LOAD_NAME list BUILD_TUPLE 4 LOAD_CONST <code flatten> MAKE_FUNCTION annotations STORE_NAME flatten RETURN_CONST None END CODE flatten(nested_list) DOC 'pass' MAKE_CELL nested_list RESUME 0...
def flatten(nested_list: list) -> list: """pass""" return list(sorted(filter(lambda y: y is not None, list(map(lambda x: nested_list.extend(x) if isinstance(x, list) else x, nested_list)))))
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/structure.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "flatten", "line_start": 14, "line_end": 19, "permalink": "https://github.com/IzunaDevs/SnekChek/blob/fdb01bdf...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
flatten
59
true
345
src/00345.py
pyc/00345.pyc
CODE <module>() DOC 'dir_name' RESUME 0 LOAD_CONST 'dir_name' LOAD_NAME str LOAD_CONST 'return' LOAD_NAME list BUILD_TUPLE 4 LOAD_CONST <code get_py_files> MAKE_FUNCTION annotations STORE_NAME get_py_files RETURN_CONST None END CODE get_py_files(dir_name) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL...
def get_py_files(dir_name: str) -> list: """pass""" return flatten([x for x in [['{0}/{1}'.format(path, f) for f in files if f.endswith('.py')] for path, _, files in os.walk(dir_name) if not path.startswith('./build')] if x])
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/structure.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "get_py_files", "line_start": 22, "line_end": 29, "permalink": "https://github.com/IzunaDevs/SnekChek/blob/fdb...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
get_py_files
137
true
346
src/00346.py
pyc/00346.pyc
CODE <module>() DOC 'return' RESUME 0 LOAD_CONST ('return', None) LOAD_CONST <code exit> MAKE_FUNCTION annotations STORE_NAME exit RETURN_CONST None END CODE exit(self) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + sum LOAD_CONST <code exit.<locals>.<genexpr>> MAKE_FUNCTION 0 LOAD_FAST self LOAD_AT...
def exit(self) -> None: """pass""" total = sum((len(logs) for logs in self.logs.values())) if self.json: self.logs['total'] = total print(json.dumps(self.logs, indent=self.indent)) else: for name, log in self.logs.items(): if not log or self.parser[name].as_bool('quie...
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/structure.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "CheckHandler.exit", "line_start": 82, "line_end": 101, "permalink": "https://github.com/IzunaDevs/SnekChek/bl...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
CheckHandler.exit
133
true
347
src/00347.py
pyc/00347.pyc
CODE <module>() DOC 'return' RESUME 0 LOAD_CONST ('return', None) LOAD_CONST <code run_linter> MAKE_FUNCTION annotations STORE_NAME run_linter RETURN_CONST None END CODE run_linter(self, linter) DOC 'pass' MAKE_CELL self RESUME 0 LOAD_FAST linter LOAD_ATTR name LOAD_DEREF self STORE_ATTR cur...
def run_linter(self, linter) -> None: """pass""" self.current = linter.name if linter.name not in self.parser['all'].as_list('linters') or linter.base_pyversion > sys.version_info: return if any((x not in self.installed for x in linter.requires_install)): raise ModuleNotInstalled(linter....
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/structure.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "CheckHandler.run_linter", "line_start": 103, "line_end": 117, "permalink": "https://github.com/IzunaDevs/Snek...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
CheckHandler.run_linter
114
true
348
src/00348.py
pyc/00348.pyc
CODE <module>() RESUME 0 LOAD_CONST <code read_rcfile> MAKE_FUNCTION 0 STORE_NAME read_rcfile RETURN_CONST None END CODE read_rcfile() DOC 'pass' RESUME 0 LOAD_CONST '{}/.millipederc' LOAD_ATTR NULL|self + format LOAD_GLOBAL os LOAD_ATTR environ LOAD_ATTR NULL|self + get LOAD_CONST 'HOME' CA...
def read_rcfile(): """pass""" files = ['{}/.millipederc'.format(os.environ.get('HOME')), '/usr/local/etc/millipederc', '/etc/millipederc'] for filepath in files: if os.path.isfile(filepath): with open(filepath) as rcfile: return parse_rcfile(rcfile) return {}
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "millipede/__init__.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "read_rcfile", "line_start": 18, "line_end": 31, "permalink": "https://github.com/getmil...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
read_rcfile
76
false
349
src/00349.py
pyc/00349.pyc
CODE <module>() RESUME 0 LOAD_CONST <code parse_rcfile> MAKE_FUNCTION 0 STORE_NAME parse_rcfile RETURN_CONST None END CODE parse_rcfile(rcfile) DOC 'pass' RESUME 0 LOAD_CONST <code parse_rcfile.<locals>.parse_bool> MAKE_FUNCTION 0 STORE_FAST parse_bool LOAD_GLOBAL int LOAD_GLOBAL str LOAD_GLOB...
def parse_rcfile(rcfile): """pass""" def parse_bool(value): """pass""" value = value.lower() if value in ['yes', 'true']: return True elif value in ['no', 'false']: return False else: raise ValueError("Can't parse {}".format(value)) ...
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "millipede/__init__.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "parse_rcfile", "line_start": 33, "line_end": 72, "permalink": "https://github.com/getmi...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
parse_rcfile
147
false
350
src/00350.py
pyc/00350.pyc
CODE <module>() RESUME 0 LOAD_CONST <code compute_settings> MAKE_FUNCTION 0 STORE_NAME compute_settings RETURN_CONST None END CODE compute_settings(args, rc_settings) DOC 'pass' RESUME 0 BUILD_MAP 0 STORE_FAST settings LOAD_FAST args LOAD_ATTR NULL|self + items CALL 0 GET_ITER L1: FOR_ITER L...
def compute_settings(args, rc_settings): """pass""" settings = {} for key, value in args.items(): if key in ['reverse', 'opposite']: settings[key] = value ^ rc_settings.get(key, False) else: settings[key] = value or rc_settings.get(key) if not settings['size']: ...
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "millipede/__init__.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "compute_settings", "line_start": 75, "line_end": 88, "permalink": "https://github.com/g...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
compute_settings
63
false
351
src/00351.py
pyc/00351.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, False, 'default', 0, False) LOAD_CONST <code millipede> MAKE_FUNCTION defaults STORE_NAME millipede RETURN_CONST None END CODE millipede(size, comment, reverse, template, position, opposite) DOC 'pass' RESUME 0 BUILD_LIST 0 LOAD_CONST (2, 1, 0, 1, 2, 3, 4, ...
def millipede(size, comment=None, reverse=False, template='default', position=0, opposite=False): """pass""" padding_offsets = [2, 1, 0, 1, 2, 3, 4, 4, 3] padding_suite_length = len(padding_offsets) head_padding_extra_offset = 2 if opposite: padding_offsets.reverse() position = position ...
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "millipede/__init__.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "millipede", "line_start": 92, "line_end": 158, "permalink": "https://github.com/getmill...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
millipede
232
false
352
src/00352.py
pyc/00352.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None) LOAD_CONST <code api_post> MAKE_FUNCTION defaults STORE_NAME api_post RETURN_CONST None END CODE api_post(message, url, name, http_data, auth) DOC 'pass' RESUME 0 NOP L1: LOAD_CONST 0 LOAD_CONST None IMPORT_NAME requests STORE_FAST requests L2: ...
def api_post(message, url, name, http_data=None, auth=None): """pass""" try: import requests except ImportError: print('requests is required to do api post.', file=sys.stderr) sys.exit(1) data = {name: message} if http_data: for var in http_data: key, valu...
{ "repo": "getmillipede/millipede-python", "repo_url": "https://github.com/getmillipede/millipede-python", "file_path": "millipede/__init__.py", "commit_sha": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "func_name": "api_post", "line_start": 161, "line_end": 184, "permalink": "https://github.com/getmill...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "c4c7a43ec6cd3dc37c5f46a6546eb594ba4f37c6", "resolved_at_commit": "ae4f1fe388906c140d12c21fee260f2338f5b9df", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
getmillipede/millipede-python
api_post
93
false
353
src/00353.py
pyc/00353.pyc
CODE <module>() RESUME 0 LOAD_CONST (True,) LOAD_CONST 'args' LOAD_NAME argparse LOAD_ATTR Namespace LOAD_CONST 'return' LOAD_CONST None BUILD_TUPLE 4 LOAD_CONST <code run_main> MAKE_FUNCTION defaults, annotations STORE_NAME run_main RETURN_CONST None END CODE run_main(args, do_exit) DOC 'pass...
def run_main(args: argparse.Namespace, do_exit=True) -> None: """pass""" if args.init: generate() return None handler = CheckHandler(file=args.config_file, out_json=args.json, files=args.files) for style in get_stylers(): handler.run_linter(style()) for linter in get_linters(...
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/__main__.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "run_main", "line_start": 39, "line_end": 72, "permalink": "https://github.com/IzunaDevs/SnekChek/blob/fdb01bdf...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
run_main
123
true
354
src/00354.py
pyc/00354.pyc
CODE <module>() DOC 'return' RESUME 0 LOAD_CONST ('return', None) LOAD_CONST <code main> MAKE_FUNCTION annotations STORE_NAME main RETURN_CONST None END CODE main() DOC 'pass' RESUME 0 LOAD_GLOBAL argparse LOAD_ATTR NULL|self + ArgumentParser CALL 0 STORE_FAST parser LOAD_FAST parser LOAD_...
def main() -> None: """pass""" parser = argparse.ArgumentParser() parser.add_argument('--json', help='output in JSON format', action='store_true', default=False) parser.add_argument('--config-file', help='Select config file to use', default='.snekrc') parser.add_argument('files', metavar='file', nar...
{ "repo": "IzunaDevs/SnekChek", "repo_url": "https://github.com/IzunaDevs/SnekChek", "file_path": "snekchek/__main__.py", "commit_sha": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "func_name": "main", "line_start": 75, "line_end": 96, "permalink": "https://github.com/IzunaDevs/SnekChek/blob/fdb01bdf1ec8...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "6e6b3483909a542b01c56c2035ae90da85c3c793", "resolved_at_commit": "fdb01bdf1ec8e79d9aae2a11d96bfb27e53a97a9", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
IzunaDevs/SnekChek
main
61
true
355
src/00355.py
pyc/00355.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, None) LOAD_CONST <code get_session> MAKE_FUNCTION defaults STORE_NAME get_session RETURN_CONST None END CODE get_session(user_agent, user_agent_config_yaml, user_agent_lookup, **kwargs) DOC 'pass' RESUME 0 LOAD_GLOBAL requests LOAD_ATTR NULL|self + Se...
def get_session(user_agent=None, user_agent_config_yaml=None, user_agent_lookup=None, **kwargs): """pass""" s = requests.Session() ua = kwargs.get('full_agent') if not ua: ua = UserAgent.get(user_agent, user_agent_config_yaml, user_agent_lookup, **kwargs) s.headers['User-Agent'] = ua ext...
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/session.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "get_session", "line_start": 22, "line_end": 131, "permalink": "https://github.co...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
get_session
353
false
356
src/00356.py
pyc/00356.pyc
CODE <module>() RESUME 0 LOAD_CONST <code connect> MAKE_FUNCTION 0 STORE_NAME connect RETURN_CONST None END CODE connect(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR connection_type LOAD_ATTR NULL|self + lower CALL 0 LOAD_CONST 'ssl' COMPARE_OP == POP_JUMP_IF_FALSE L1 LOAD_GLOBAL smt...
def connect(self): """pass""" if self.connection_type.lower() == 'ssl': self.server = smtplib.SMTP_SSL(host=self.host, port=self.port, local_hostname=self.local_hostname, timeout=self.timeout, source_address=self.source_address) elif self.connection_type.lower() == 'lmtp': self.server = smtp...
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/email.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "Email.connect", "line_start": 106, "line_end": 124, "permalink": "https://github.c...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
Email.connect
85
false
357
src/00357.py
pyc/00357.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None) LOAD_CONST <code send> MAKE_FUNCTION defaults STORE_NAME send RETURN_CONST None END CODE send(self, recipients, subject, text_body, html_body, sender, **kwargs) DOC 'pass' RESUME 0 LOAD_FAST sender POP_JUMP_IF_NOT_NONE L1 LOAD_FAST self LOAD_ATTR ...
def send(self, recipients, subject, text_body, html_body=None, sender=None, **kwargs): """pass""" if sender is None: sender = self.sender v = validate_email(sender, check_deliverability=False) sender = v['email'] normalised_recipients = list() for recipient in recipients: v = val...
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/email.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "Email.send", "line_start": 137, "line_end": 180, "permalink": "https://github.com/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
Email.send
123
false
358
src/00358.py
pyc/00358.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_session> MAKE_FUNCTION 0 STORE_NAME get_session RETURN_CONST None END CODE get_session(db_url) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + create_engine LOAD_FAST db_url LOAD_GLOBAL NullPool LOAD_CONST False KW_NAMES ('poolclass', 'echo') CALL 3 STORE...
def get_session(db_url): """pass""" engine = create_engine(db_url, poolclass=NullPool, echo=False) Session = sessionmaker(bind=engine) Base.metadata.create_all(engine) return Session()
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/database.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "Database.get_session", "line_start": 83, "line_end": 97, "permalink": "https://...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
Database.get_session
32
false
359
src/00359.py
pyc/00359.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_params_from_sqlalchemy_url> MAKE_FUNCTION 0 STORE_NAME get_params_from_sqlalchemy_url RETURN_CONST None END CODE get_params_from_sqlalchemy_url(db_url) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + urlsplit LOAD_FAST db_url CALL 1 STORE_FAST result LOAD_FAS...
def get_params_from_sqlalchemy_url(db_url): """pass""" result = urlsplit(db_url) return {'database': result.path[1:], 'host': result.hostname, 'port': result.port, 'username': result.username, 'password': result.password, 'driver': result.scheme}
{ "repo": "OCHA-DAP/hdx-python-utilities", "repo_url": "https://github.com/OCHA-DAP/hdx-python-utilities", "file_path": "src/hdx/utilities/database.py", "commit_sha": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "func_name": "Database.get_params_from_sqlalchemy_url", "line_start": 100, "line_end": 112, "...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "5c0be7f3c7055e1dc5dfe3eca657c650909b54c4", "resolved_at_commit": "9c89e0aa5afac2c002b02a2d8f0e5b91eeb3d2a3", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
OCHA-DAP/hdx-python-utilities
Database.get_params_from_sqlalchemy_url
32
false
360
src/00360.py
pyc/00360.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_unset_cache> MAKE_FUNCTION 0 STORE_NAME get_unset_cache RETURN_CONST None END CODE get_unset_cache(self) DOC 'pass' RESUME 0 BUILD_LIST 0 STORE_FAST caches LOAD_FAST self LOAD_ATTR _cached_api_global_response POP_JUMP_IF_NOT_NONE L1 LOAD_FAST cache...
def get_unset_cache(self): """pass""" caches = [] if self._cached_api_global_response is None: caches.append('global') if self._cached_api_ticker_response is None: caches.append('ticker') return (len(caches), caches)
{ "repo": "lucaoflaif/pyCoinMarketCapAPI", "repo_url": "https://github.com/lucaoflaif/pyCoinMarketCapAPI", "file_path": "coinmarketcapapi/cache.py", "commit_sha": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "func_name": "Cache.get_unset_cache", "line_start": 77, "line_end": 85, "permalink": "https://git...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d342dca71a60e32eb0a37ee986556ba20b3428cd", "resolved_at_commit": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
lucaoflaif/pyCoinMarketCapAPI
Cache.get_unset_cache
36
false
361
src/00361.py
pyc/00361.pyc
CODE <module>() RESUME 0 LOAD_CONST <code dicts_filter> MAKE_FUNCTION 0 STORE_NAME dicts_filter RETURN_CONST None END CODE dicts_filter(dicts_object, field_to_filter, value_of_filter) DOC 'pass' MAKE_CELL field_to_filter MAKE_CELL value_of_filter RESUME 0 LOAD_CLOSURE field_to_filter LOAD_CLOSURE ...
def dicts_filter(dicts_object, field_to_filter, value_of_filter): """pass""" lambda_query = lambda value: value[field_to_filter] == value_of_filter filtered_coin = filter(lambda_query, dicts_object) selected_coins = list(filtered_coin) return selected_coins
{ "repo": "lucaoflaif/pyCoinMarketCapAPI", "repo_url": "https://github.com/lucaoflaif/pyCoinMarketCapAPI", "file_path": "coinmarketcapapi/utils.py", "commit_sha": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "func_name": "dicts_filter", "line_start": 4, "line_end": 14, "permalink": "https://github.com/lu...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d342dca71a60e32eb0a37ee986556ba20b3428cd", "resolved_at_commit": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
lucaoflaif/pyCoinMarketCapAPI
dicts_filter
39
false
362
src/00362.py
pyc/00362.pyc
CODE <module>() DOC 'ticker' RESUME 0 LOAD_CONST ('ticker', None) LOAD_CONST <code send_request> MAKE_FUNCTION defaults STORE_NAME send_request RETURN_CONST None END CODE send_request(self, endpoint, coin_name, **kwargs) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR NULL|self + _make_url LOAD_FAS...
def send_request(self, endpoint='ticker', coin_name=None, **kwargs): """pass""" built_url = self._make_url(endpoint, coin_name) payload = dict(**kwargs) self._process_request(endpoint, built_url, payload)
{ "repo": "lucaoflaif/pyCoinMarketCapAPI", "repo_url": "https://github.com/lucaoflaif/pyCoinMarketCapAPI", "file_path": "coinmarketcapapi/core.py", "commit_sha": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "func_name": "CoinMarketCapAPI.send_request", "line_start": 78, "line_end": 88, "permalink": "http...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d342dca71a60e32eb0a37ee986556ba20b3428cd", "resolved_at_commit": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
lucaoflaif/pyCoinMarketCapAPI
CoinMarketCapAPI.send_request
33
false
363
src/00363.py
pyc/00363.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code get_response> MAKE_FUNCTION defaults STORE_NAME get_response RETURN_CONST None END CODE get_response(self, data_type) DOC 'pass' RESUME 0 LOAD_FAST data_type POP_JUMP_IF_TRUE L2 LOAD_FAST self LOAD_ATTR cache LOAD_ATTR NULL|self + ge...
def get_response(self, data_type=None): """pass""" if not data_type: return self.cache.get_response(r_type='ticker') or self.cache.get_response(r_type='global') elif data_type == 'ticker': return self.cache.get_response(r_type='ticker') return self.cache.get_response(r_type='global')
{ "repo": "lucaoflaif/pyCoinMarketCapAPI", "repo_url": "https://github.com/lucaoflaif/pyCoinMarketCapAPI", "file_path": "coinmarketcapapi/core.py", "commit_sha": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "func_name": "CoinMarketCapAPI.get_response", "line_start": 90, "line_end": 100, "permalink": "htt...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "d342dca71a60e32eb0a37ee986556ba20b3428cd", "resolved_at_commit": "a6ab1fa57c0610e8abf3a03e9144379bf9e49907", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
lucaoflaif/pyCoinMarketCapAPI
CoinMarketCapAPI.get_response
50
false
364
src/00364.py
pyc/00364.pyc
CODE <module>() RESUME 0 LOAD_CONST <code iso_639_alpha3> MAKE_FUNCTION 0 STORE_NAME iso_639_alpha3 RETURN_CONST None END CODE iso_639_alpha3(code) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + normalize_code LOAD_FAST code CALL 1 STORE_FAST code LOAD_GLOBAL ISO3_MAP LOAD_ATTR NULL|self + get LOAD_...
def iso_639_alpha3(code): """pass""" code = normalize_code(code) code = ISO3_MAP.get(code, code) if code in ISO3_ALL: return code
{ "repo": "alephdata/languagecodes", "repo_url": "https://github.com/alephdata/languagecodes", "file_path": "languagecodes/__init__.py", "commit_sha": "123d9e534fd31fcc69f9de68a067f95588c04ea2", "func_name": "iso_639_alpha3", "line_start": 8, "line_end": 17, "permalink": "https://github.com/alephdata/la...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "ddd693ea49e7a1d0f6c6361b1e9c9eb18b37d749", "resolved_at_commit": "123d9e534fd31fcc69f9de68a067f95588c04ea2", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
alephdata/languagecodes
iso_639_alpha3
28
false
365
src/00365.py
pyc/00365.pyc
CODE <module>() RESUME 0 LOAD_CONST (True,) LOAD_CONST <code list_to_alpha3> MAKE_FUNCTION defaults STORE_NAME list_to_alpha3 RETURN_CONST None END CODE list_to_alpha3(languages, synonyms) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + set BUILD_LIST 0 CALL 1 STORE_FAST codes LOAD_GLOBAL NULL + ensure...
def list_to_alpha3(languages, synonyms=True): """pass""" codes = set([]) for language in ensure_list(languages): code = iso_639_alpha3(language) if code is None: continue codes.add(code) if synonyms: codes.update(expand_synonyms(code)) return codes
{ "repo": "alephdata/languagecodes", "repo_url": "https://github.com/alephdata/languagecodes", "file_path": "languagecodes/__init__.py", "commit_sha": "123d9e534fd31fcc69f9de68a067f95588c04ea2", "func_name": "list_to_alpha3", "line_start": 29, "line_end": 41, "permalink": "https://github.com/alephdata/l...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "ddd693ea49e7a1d0f6c6361b1e9c9eb18b37d749", "resolved_at_commit": "123d9e534fd31fcc69f9de68a067f95588c04ea2", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
alephdata/languagecodes
list_to_alpha3
51
false
366
src/00366.py
pyc/00366.pyc
CODE <module>() RESUME 0 LOAD_CONST (False,) LOAD_CONST 'item' LOAD_NAME Any LOAD_CONST 'reverse' LOAD_NAME bool LOAD_CONST 'return' LOAD_NAME Generator LOAD_NAME Any LOAD_CONST None LOAD_CONST None BUILD_TUPLE 3 BINARY_SUBSCR BUILD_TUPLE 6 LOAD_CONST <code _search_generator> MAKE_FUNCTI...
def _search_generator(self, item: Any, reverse: bool=False) -> Generator[Any, None, None]: """pass""" results = 0 for _, x in self.enumerate(item, reverse=reverse): yield x results += 1 if results == 0: raise SearchError(str(item))
{ "repo": "meraki-analytics/merakicommons", "repo_url": "https://github.com/meraki-analytics/merakicommons", "file_path": "merakicommons/container.py", "commit_sha": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "func_name": "SearchableList._search_generator", "line_start": 108, "line_end": 115, "permalin...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3022b732142b53ac6304ae05a8d3fcb54c8b051a", "resolved_at_commit": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
meraki-analytics/merakicommons
SearchableList._search_generator
67
true
367
src/00367.py
pyc/00367.pyc
CODE <module>() DOC 'item' RESUME 0 LOAD_CONST 'item' LOAD_NAME Any LOAD_CONST 'return' LOAD_NAME Generator LOAD_NAME Any LOAD_CONST None LOAD_CONST None BUILD_TUPLE 3 BINARY_SUBSCR BUILD_TUPLE 4 LOAD_CONST <code _search_generator> MAKE_FUNCTION annotations STORE_NAME _search_generator R...
def _search_generator(self, item: Any) -> Generator[Any, None, None]: """pass""" results = 0 for x in self.enumerate(item): yield x results += 1 if results == 0: raise SearchError(str(item))
{ "repo": "meraki-analytics/merakicommons", "repo_url": "https://github.com/meraki-analytics/merakicommons", "file_path": "merakicommons/container.py", "commit_sha": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "func_name": "SearchableSet._search_generator", "line_start": 175, "line_end": 182, "permalink...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3022b732142b53ac6304ae05a8d3fcb54c8b051a", "resolved_at_commit": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
meraki-analytics/merakicommons
SearchableSet._search_generator
61
true
368
src/00368.py
pyc/00368.pyc
CODE <module>() DOC 'item' RESUME 0 LOAD_CONST 'item' LOAD_NAME Any LOAD_CONST 'return' LOAD_NAME Generator LOAD_NAME Tuple LOAD_NAME Any LOAD_NAME Any BUILD_TUPLE 2 BINARY_SUBSCR LOAD_CONST None LOAD_CONST None BUILD_TUPLE 3 BINARY_SUBSCR BUILD_TUPLE 4 LOAD_CONST <code _search_generat...
def _search_generator(self, item: Any) -> Generator[Tuple[Any, Any], None, None]: """pass""" results = 0 for key, value in self.enumerate(item): yield (key, value) results += 1 if results == 0: raise SearchError(str(item))
{ "repo": "meraki-analytics/merakicommons", "repo_url": "https://github.com/meraki-analytics/merakicommons", "file_path": "merakicommons/container.py", "commit_sha": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "func_name": "SearchableDictionary._search_generator", "line_start": 243, "line_end": 250, "pe...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3022b732142b53ac6304ae05a8d3fcb54c8b051a", "resolved_at_commit": "d0c8ade8f4619a34ca488336c44722ed1aeaf7ef", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
meraki-analytics/merakicommons
SearchableDictionary._search_generator
69
true
369
src/00369.py
pyc/00369.pyc
CODE <module>() RESUME 0 LOAD_CONST <code serialize> MAKE_FUNCTION 0 STORE_NAME serialize RETURN_CONST None END CODE serialize(obj) DOC 'pass' RESUME 0 LOAD_CONST 0 LOAD_CONST ('datetime', 'date', 'time') IMPORT_NAME datetime IMPORT_FROM datetime STORE_FAST datetime IMPORT_FROM date STORE_FA...
def serialize(obj): """pass""" from datetime import datetime, date, time if isinstance(obj, date) and (not isinstance(obj, datetime)): obj = datetime.combine(obj, time.min) if isinstance(obj, datetime): return obj.isoformat()
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "serialize", "line_start": 48, "line_end": 54, "permalink": "https://github.com/amcat/amcatclient/blob/bda5...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
serialize
49
false
370
src/00370.py
pyc/00370.pyc
CODE <module>() RESUME 0 LOAD_CONST (200, None) LOAD_CONST <code check> MAKE_FUNCTION defaults STORE_NAME check RETURN_CONST None END CODE check(response, expected_status, url) DOC 'pass' MAKE_CELL err RESUME 0 LOAD_FAST response LOAD_ATTR status_code LOAD_FAST expected_status COMPARE_OP != ...
def check(response, expected_status=200, url=None): """pass""" if response.status_code != expected_status: if url is None: url = response.url try: err = response.json() except: err = {} if all((x in err for x in ('status', 'message', 'descripti...
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "check", "line_start": 94, "line_end": 132, "permalink": "https://github.com/amcat/amcatclient/blob/bda525f...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
check
237
false
371
src/00371.py
pyc/00371.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None) LOAD_CONST <code _get_auth> MAKE_FUNCTION defaults STORE_NAME _get_auth RETURN_CONST None END CODE _get_auth(self, user, password) DOC 'pass' RESUME 0 LOAD_GLOBAL os LOAD_ATTR path LOAD_ATTR NULL|self + expanduser LOAD_GLOBAL AUTH_FILE CALL 1 ...
def _get_auth(self, user=None, password=None): """pass""" fn = os.path.expanduser(AUTH_FILE) if os.path.exists(fn): for i, line in enumerate(csv.reader(open(fn))): if len(line) != 3: log.warning('Cannot parse line {i} in {fn}'.format(**locals())) continue ...
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "AmcatAPI._get_auth", "line_start": 170, "line_end": 195, "permalink": "https://github.com/amcat/amcatclien...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
AmcatAPI._get_auth
135
false
372
src/00372.py
pyc/00372.pyc
CODE <module>() DOC 'get' RESUME 0 LOAD_CONST ('get', 'json', None, None, None, True) LOAD_CONST <code request> MAKE_FUNCTION defaults STORE_NAME request RETURN_CONST None END CODE request(self, url, method, format, data, expected_status, headers, use_xpost, **options) DOC 'pass' RESUME 0 LOAD_FAST ...
def request(self, url, method='get', format='json', data=None, expected_status=None, headers=None, use_xpost=True, **options): """pass""" if expected_status is None: if method == 'get': expected_status = 200 elif method == 'post': expected_status = 201 else: ...
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "AmcatAPI.request", "line_start": 211, "line_end": 250, "permalink": "https://github.com/amcat/amcatclient/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
AmcatAPI.request
172
true
373
src/00373.py
pyc/00373.pyc
CODE <module>() RESUME 0 LOAD_CONST (1, 100, False) LOAD_CONST <code get_pages> MAKE_FUNCTION defaults STORE_NAME get_pages RETURN_CONST None END CODE get_pages(self, url, page, page_size, yield_pages, **filters) DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_CONST 0 STORE_FAST n LOAD_G...
def get_pages(self, url, page=1, page_size=100, yield_pages=False, **filters): """pass""" n = 0 for page in itertools.count(page): r = self.request(url, page=page, page_size=page_size, **filters) n += len(r['results']) log.debug('Got {url} page {page} / {pages}'.format(url=url, **r))...
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "AmcatAPI.get_pages", "line_start": 254, "line_end": 275, "permalink": "https://github.com/amcat/amcatclien...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
AmcatAPI.get_pages
99
false
374
src/00374.py
pyc/00374.pyc
CODE <module>() RESUME 0 LOAD_CONST (100, False) LOAD_CONST <code get_scroll> MAKE_FUNCTION defaults STORE_NAME get_scroll RETURN_CONST None END CODE get_scroll(self, url, page_size, yield_pages, **filters) DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_CONST 0 STORE_FAST n LOAD_GLOBAL ...
def get_scroll(self, url, page_size=100, yield_pages=False, **filters): """pass""" n = 0 options = dict(page_size=page_size, **filters) format = filters.get('format') while True: r = self.request(url, use_xpost=False, **options) n += len(r['results']) log.debug('Got {} {n}/{t...
{ "repo": "amcat/amcatclient", "repo_url": "https://github.com/amcat/amcatclient", "file_path": "amcatclient/amcatclient.py", "commit_sha": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "func_name": "AmcatAPI.get_scroll", "line_start": 277, "line_end": 301, "permalink": "https://github.com/amcat/amcatclie...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "3301f8bf21a8b5b4c456ff5c429be5249c4cb4b7", "resolved_at_commit": "bda525f7ace0c26a09fa56d2baf7550f639e62ee", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
amcat/amcatclient
AmcatAPI.get_scroll
117
false
375
src/00375.py
pyc/00375.pyc
CODE <module>() RESUME 0 LOAD_CONST (True, None) LOAD_CONST <code get_error> MAKE_FUNCTION defaults STORE_NAME get_error RETURN_CONST None END CODE get_error(self, block, timeout) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _error_queue LOAD_ATTR NULL|self + get LOAD_FAST block LOAD_FAST time...
def get_error(self, block=True, timeout=None): """pass""" return self._error_queue.get(block=block, timeout=timeout)
{ "repo": "martinkou/applepushnotification", "repo_url": "https://github.com/martinkou/applepushnotification", "file_path": "applepushnotification/service.py", "commit_sha": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "func_name": "NotificationService.get_error", "line_start": 162, "line_end": 167, "per...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "17ab82a37399893128c81b2ba2a9b92af0cb3e89", "resolved_at_commit": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
martinkou/applepushnotification
NotificationService.get_error
19
false
376
src/00376.py
pyc/00376.pyc
CODE <module>() RESUME 0 LOAD_CONST (True, None) LOAD_CONST <code get_feedback> MAKE_FUNCTION defaults STORE_NAME get_feedback RETURN_CONST None END CODE get_feedback(self, block, timeout) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _feedback_greenlet POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL gevent ...
def get_feedback(self, block=True, timeout=None): """pass""" if self._feedback_greenlet is None: self._feedback_greenlet = gevent.spawn(self._feedback_loop) return self._feedback_queue.get(block=block, timeout=timeout)
{ "repo": "martinkou/applepushnotification", "repo_url": "https://github.com/martinkou/applepushnotification", "file_path": "applepushnotification/service.py", "commit_sha": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "func_name": "NotificationService.get_feedback", "line_start": 169, "line_end": 176, "...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "17ab82a37399893128c81b2ba2a9b92af0cb3e89", "resolved_at_commit": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
martinkou/applepushnotification
NotificationService.get_feedback
30
false
377
src/00377.py
pyc/00377.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code wait_send> MAKE_FUNCTION defaults STORE_NAME wait_send RETURN_CONST None END CODE wait_send(self, timeout) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _send_queue_cleared LOAD_ATTR NULL|self + clear CALL 0 POP_TOP LOAD_FAST self ...
def wait_send(self, timeout=None): """pass""" self._send_queue_cleared.clear() self._send_queue_cleared.wait(timeout=timeout)
{ "repo": "martinkou/applepushnotification", "repo_url": "https://github.com/martinkou/applepushnotification", "file_path": "applepushnotification/service.py", "commit_sha": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "func_name": "NotificationService.wait_send", "line_start": 178, "line_end": 181, "per...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "17ab82a37399893128c81b2ba2a9b92af0cb3e89", "resolved_at_commit": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
martinkou/applepushnotification
NotificationService.wait_send
24
false
378
src/00378.py
pyc/00378.pyc
CODE <module>() RESUME 0 LOAD_CONST <code start> MAKE_FUNCTION 0 STORE_NAME start RETURN_CONST None END CODE start(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _send_greenlet POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL gevent LOAD_ATTR NULL|self + spawn LOAD_FAST self LOAD_ATTR _send_loop CA...
def start(self): """pass""" if self._send_greenlet is None: self._send_greenlet = gevent.spawn(self._send_loop)
{ "repo": "martinkou/applepushnotification", "repo_url": "https://github.com/martinkou/applepushnotification", "file_path": "applepushnotification/service.py", "commit_sha": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "func_name": "NotificationService.start", "line_start": 183, "line_end": 186, "permali...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "17ab82a37399893128c81b2ba2a9b92af0cb3e89", "resolved_at_commit": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
martinkou/applepushnotification
NotificationService.start
23
false
379
src/00379.py
pyc/00379.pyc
CODE <module>() RESUME 0 LOAD_CONST (10.0,) LOAD_CONST <code stop> MAKE_FUNCTION defaults STORE_NAME stop RETURN_CONST None END CODE stop(self, timeout) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR _send_greenlet POP_JUMP_IF_NONE L1 LOAD_FAST self LOAD_ATTR _send_queue LOAD_ATTR NULL|self + ...
def stop(self, timeout=10.0): """pass""" if self._send_greenlet is not None and self._send_queue.qsize() > 0: self.wait_send(timeout=timeout) if self._send_greenlet is not None: gevent.kill(self._send_greenlet) self._send_greenlet = None if self._error_greenlet is not None: ...
{ "repo": "martinkou/applepushnotification", "repo_url": "https://github.com/martinkou/applepushnotification", "file_path": "applepushnotification/service.py", "commit_sha": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "func_name": "NotificationService.stop", "line_start": 188, "line_end": 210, "permalin...
{ "spdx": "BSD-3-Clause", "name": "BSD 3-Clause \"New\" or \"Revised\" License", "file": "LICENSE", "blob_sha": "17ab82a37399893128c81b2ba2a9b92af0cb3e89", "resolved_at_commit": "43ebe5963fa9c48990dd57f6aaba6056a1e7470f", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
martinkou/applepushnotification
NotificationService.stop
74
false
380
src/00380.py
pyc/00380.pyc
CODE <module>() RESUME 0 LOAD_CONST <code convert_to_ssml> MAKE_FUNCTION 0 STORE_NAME convert_to_ssml RETURN_CONST None END CODE convert_to_ssml(text, text_format) DOC 'pass' RESUME 0 LOAD_FAST text_format POP_JUMP_IF_NOT_NONE L1 LOAD_FAST text RETURN_VALUE L1: LOAD_FAST text_format LOAD_CONST...
def convert_to_ssml(text, text_format): """pass""" if text_format is None: return text elif text_format == 'plain': return plain_to_ssml(text) elif text_format == 'html': return html_to_ssml(text) else: raise ValueError(text_format + ': text format not found.')
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/ssml.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "convert_to_ssml", "line_start": 19, "line_end": 37, "permalink": "https://github.com/nbedi/typecaster/blob/09eee6d4f...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
convert_to_ssml
39
false
381
src/00381.py
pyc/00381.pyc
CODE <module>() RESUME 0 LOAD_CONST <code html_to_ssml> MAKE_FUNCTION 0 STORE_NAME html_to_ssml RETURN_CONST None END CODE html_to_ssml(text) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + reduce LOAD_CONST <code html_to_ssml.<locals>.<lambda>> MAKE_FUNCTION 0 LOAD_GLOBAL html_to_ssml_maps LOAD_FAST tex...
def html_to_ssml(text): """pass""" ssml_text = reduce(lambda x, y: x.replace(y, html_to_ssml_maps[y]), html_to_ssml_maps, text) return ssml_text
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/ssml.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "html_to_ssml", "line_start": 48, "line_end": 53, "permalink": "https://github.com/nbedi/typecaster/blob/09eee6d4fbad...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
html_to_ssml
30
false
382
src/00382.py
pyc/00382.pyc
CODE <module>() RESUME 0 LOAD_CONST (False,) LOAD_CONST <code iexpand> MAKE_FUNCTION defaults STORE_NAME iexpand RETURN_CONST None END CODE iexpand(string, keep_escapes) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_FAST string LOAD_GLOBAL bytes CALL 2 POP_JUMP_IF_FALSE L1 LOAD_CONS...
def iexpand(string, keep_escapes=False): """pass""" if isinstance(string, bytes): is_bytes = True string = string.decode('latin-1') else: is_bytes = False if is_bytes: return (entry.encode('latin-1') for entry in ExpandBrace(keep_escapes).expand(string)) else: ...
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "iexpand", "line_start": 50, "line_end": 64, "permalink": "https://github.com/facelessuser/bracex/blob/1fdf83e2...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
iexpand
101
false
383
src/00383.py
pyc/00383.pyc
CODE <module>() RESUME 0 LOAD_CONST <code set_expanding> MAKE_FUNCTION 0 STORE_NAME set_expanding RETURN_CONST None END CODE set_expanding(self) DOC 'pass' RESUME 0 LOAD_FAST self LOAD_ATTR expanding UNARY_NOT STORE_FAST status LOAD_FAST status POP_JUMP_IF_FALSE L1 LOAD_CONST True LOAD_FAS...
def set_expanding(self): """pass""" status = not self.expanding if status: self.expanding = True return status
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "ExpandBrace.set_expanding", "line_start": 140, "line_end": 146, "permalink": "https://github.com/facelessuser/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
ExpandBrace.set_expanding
22
false
384
src/00384.py
pyc/00384.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_escape> MAKE_FUNCTION 0 STORE_NAME get_escape RETURN_CONST None END CODE get_escape(self, c, i) DOC 'pass' RESUME 0 NOP L1: LOAD_GLOBAL NULL + next LOAD_FAST i CALL 1 STORE_FAST escaped L2: LOAD_FAST self LOAD_ATTR keep_escapes POP_JUMP_IF_FALS...
def get_escape(self, c, i): """pass""" try: escaped = next(i) except StopIteration: escaped = '' return c + escaped if self.keep_escapes else escaped
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "ExpandBrace.get_escape", "line_start": 159, "line_end": 166, "permalink": "https://github.com/facelessuser/bra...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
ExpandBrace.get_escape
47
false
385
src/00385.py
pyc/00385.pyc
CODE <module>() RESUME 0 LOAD_CONST <code squash> MAKE_FUNCTION 0 STORE_NAME squash RETURN_CONST None END CODE squash(self, a, b) DOC 'pass' RESUME 0 LOAD_CONST <code squash.<locals>.<genexpr>> MAKE_FUNCTION 0 LOAD_GLOBAL itertools LOAD_ATTR NULL|self + product LOAD_FAST a LOAD_FAST b CALL 2...
def squash(self, a, b): """pass""" return (''.join(x) if isinstance(x, tuple) else x for x in itertools.product(a, b))
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "ExpandBrace.squash", "line_start": 168, "line_end": 177, "permalink": "https://github.com/facelessuser/bracex/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
ExpandBrace.squash
55
false
386
src/00386.py
pyc/00386.pyc
CODE <module>() RESUME 0 LOAD_CONST <code get_literals> MAKE_FUNCTION 0 STORE_NAME get_literals RETURN_CONST None END CODE get_literals(self, c, i, depth) DOC 'pass' RESUME 0 LOAD_CONST '' BUILD_LIST 1 STORE_FAST result LOAD_CONST False STORE_FAST is_dollar NOP L1: LOAD_FAST c POP_JUMP_IF_...
def get_literals(self, c, i, depth): """pass""" result = [''] is_dollar = False try: while c: ignore_brace = is_dollar is_dollar = False if c == '$': is_dollar = True elif c == '\\': c = [self.get_escape(c, i)] ...
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "ExpandBrace.get_literals", "line_start": 179, "line_end": 227, "permalink": "https://github.com/facelessuser/b...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
ExpandBrace.get_literals
226
false
387
src/00387.py
pyc/00387.pyc
CODE <module>() RESUME 0 LOAD_CONST <code combine> MAKE_FUNCTION 0 STORE_NAME combine RETURN_CONST None END CODE combine(self, a, b) DOC 'pass' RETURN_GENERATOR POP_TOP L1: RESUME 0 LOAD_FAST a LOAD_FAST b BUILD_TUPLE 2 GET_ITER L2: FOR_ITER L5 STORE_FAST l LOAD_FAST l GET_ITER L3: F...
def combine(self, a, b): """pass""" for l in (a, b): for x in l: yield x
{ "repo": "facelessuser/bracex", "repo_url": "https://github.com/facelessuser/bracex", "file_path": "bracex/__init__.py", "commit_sha": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "func_name": "ExpandBrace.combine", "line_start": 229, "line_end": 234, "permalink": "https://github.com/facelessuser/bracex...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE.md", "blob_sha": "881057771c5d76b6567b779a345df75d7cfdf899", "resolved_at_commit": "1fdf83e2bdfb939e78ba9966bcef80cd7a5c8534", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
facelessuser/bracex
ExpandBrace.combine
40
false
388
src/00388.py
pyc/00388.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, None, 'watson', None, '. ') LOAD_CONST <code add_episode> MAKE_FUNCTION defaults STORE_NAME add_episode RETURN_CONST None END CODE add_episode(self, text, text_format, title, author, summary, publish_date, synthesizer, synth_args, sentence_break) DOC 'pass' RES...
def add_episode(self, text, text_format, title, author, summary=None, publish_date=None, synthesizer='watson', synth_args=None, sentence_break='. '): """pass""" if title in self.episodes: raise ValueError('"' + title + '" already exists as an episode title.') link = self.output_path + '/' + title.re...
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/models.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "Podcast.add_episode", "line_start": 70, "line_end": 101, "permalink": "https://github.com/nbedi/typecaster/blob/09...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
Podcast.add_episode
64
false
389
src/00389.py
pyc/00389.pyc
CODE <module>() RESUME 0 LOAD_CONST (None, 'watson', None, '. ') LOAD_CONST <code add_scheduled_job> MAKE_FUNCTION defaults STORE_NAME add_scheduled_job RETURN_CONST None END CODE add_scheduled_job(self, text_source, cron_args, text_format, title, author, summary, synthesizer, synth_args, sentence_break) ...
def add_scheduled_job(self, text_source, cron_args, text_format, title, author, summary=None, synthesizer='watson', synth_args=None, sentence_break='. '): """pass""" if not callable(text_source): raise TypeError('Argument "text" must be a function') def add_episode(): episode_text = text_so...
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/models.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "Podcast.add_scheduled_job", "line_start": 103, "line_end": 150, "permalink": "https://github.com/nbedi/typecaster/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
Podcast.add_scheduled_job
106
false
390
src/00390.py
pyc/00390.pyc
CODE <module>() RESUME 0 LOAD_CONST <code publish> MAKE_FUNCTION 0 STORE_NAME publish RETURN_CONST None END CODE publish(self, titles) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + isinstance LOAD_FAST titles LOAD_GLOBAL Sequence CALL 2 POP_JUMP_IF_FALSE L3 LOAD_GLOBAL NULL + isinstance LOAD_FAST t...
def publish(self, titles): """pass""" if isinstance(titles, Sequence) and (not isinstance(titles, six.string_types)): for title in titles: self.episodes[title].publish() elif isinstance(titles, six.string_types): self.episodes[titles].publish() else: raise TypeError('...
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/models.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "Podcast.publish", "line_start": 152, "line_end": 168, "permalink": "https://github.com/nbedi/typecaster/blob/09eee...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
Podcast.publish
63
false
391
src/00391.py
pyc/00391.pyc
CODE <module>() RESUME 0 LOAD_CONST <code render_audio> MAKE_FUNCTION 0 STORE_NAME render_audio RETURN_CONST None END CODE render_audio(self) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + text_to_speech LOAD_FAST self LOAD_ATTR _text LOAD_FAST self LOAD_ATTR synthesizer LOAD_FAST self LOAD_ATTR syn...
def render_audio(self): """pass""" segment = text_to_speech(self._text, self.synthesizer, self.synth_args, self.sentence_break) milli = len(segment) seconds = '{0:.1f}'.format(float(milli) / 1000 % 60).zfill(2) minutes = '{0:.0f}'.format(milli / (1000 * 60) % 60).zfill(2) hours = '{0:.0f}'.forma...
{ "repo": "nbedi/typecaster", "repo_url": "https://github.com/nbedi/typecaster", "file_path": "typecaster/models.py", "commit_sha": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "func_name": "Episode.render_audio", "line_start": 261, "line_end": 274, "permalink": "https://github.com/nbedi/typecaster/blob/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "4c9d4fe89144dae5a2ea7cb04de392bfeaefe832", "resolved_at_commit": "09eee6d4fbad9f70c90364ea89ab39917f903afc", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
nbedi/typecaster
Episode.render_audio
91
false
392
src/00392.py
pyc/00392.pyc
CODE <module>() RESUME 0 LOAD_CONST <code remove_exponent> MAKE_FUNCTION 0 STORE_NAME remove_exponent RETURN_CONST None END CODE remove_exponent(d) DOC 'pass' RESUME 0 LOAD_FAST d LOAD_FAST d LOAD_ATTR NULL|self + to_integral CALL 0 COMPARE_OP == POP_JUMP_IF_FALSE L1 LOAD_FAST d LOAD_ATTR ...
def remove_exponent(d): """pass""" return d.quantize(Decimal(1)) if d == d.to_integral() else d.normalize()
{ "repo": "azaitsev/millify", "repo_url": "https://github.com/azaitsev/millify", "file_path": "millify/__init__.py", "commit_sha": "69f83ad6e15b79f073fcdec21358f255473eb518", "func_name": "remove_exponent", "line_start": 11, "line_end": 13, "permalink": "https://github.com/azaitsev/millify/blob/69f83ad6...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1c2e02744300ce96e5995c6443d819c925bbc8a6", "resolved_at_commit": "69f83ad6e15b79f073fcdec21358f255473eb518", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
azaitsev/millify
remove_exponent
28
false
393
src/00393.py
pyc/00393.pyc
CODE <module>() RESUME 0 LOAD_CONST 0 LOAD_CONST True BUILD_LIST 0 BUILD_TUPLE 3 LOAD_CONST <code millify> MAKE_FUNCTION defaults STORE_NAME millify RETURN_CONST None END CODE millify(n, precision, drop_nulls, prefixes) DOC 'pass' RESUME 0 BUILD_LIST 0 LOAD_CONST ('', 'k', 'M', 'B', 'T', 'P', ...
def millify(n, precision=0, drop_nulls=True, prefixes=[]): """pass""" millnames = ['', 'k', 'M', 'B', 'T', 'P', 'E', 'Z', 'Y'] if prefixes: millnames = [''] millnames.extend(prefixes) n = float(n) millidx = max(0, min(len(millnames) - 1, int(math.floor(0 if n == 0 else math.log10(abs...
{ "repo": "azaitsev/millify", "repo_url": "https://github.com/azaitsev/millify", "file_path": "millify/__init__.py", "commit_sha": "69f83ad6e15b79f073fcdec21358f255473eb518", "func_name": "millify", "line_start": 16, "line_end": 28, "permalink": "https://github.com/azaitsev/millify/blob/69f83ad6e15b79f0...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1c2e02744300ce96e5995c6443d819c925bbc8a6", "resolved_at_commit": "69f83ad6e15b79f073fcdec21358f255473eb518", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
azaitsev/millify
millify
96
false
394
src/00394.py
pyc/00394.pyc
CODE <module>() DOC ',' RESUME 0 LOAD_CONST (',',) LOAD_CONST <code prettify> MAKE_FUNCTION defaults STORE_NAME prettify RETURN_CONST None END CODE prettify(amount, separator) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + str LOAD_FAST amount CALL 1 STORE_FAST orig LOAD_GLOBAL re LOAD_ATTR NULL|s...
def prettify(amount, separator=','): """pass""" orig = str(amount) new = re.sub('^(-?\\d+)(\\d{3})', '\\g<1>{0}\\g<2>'.format(separator), str(amount)) if orig == new: return new else: return prettify(new)
{ "repo": "azaitsev/millify", "repo_url": "https://github.com/azaitsev/millify", "file_path": "millify/__init__.py", "commit_sha": "69f83ad6e15b79f073fcdec21358f255473eb518", "func_name": "prettify", "line_start": 31, "line_end": 38, "permalink": "https://github.com/azaitsev/millify/blob/69f83ad6e15b79f...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "1c2e02744300ce96e5995c6443d819c925bbc8a6", "resolved_at_commit": "69f83ad6e15b79f073fcdec21358f255473eb518", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
azaitsev/millify
prettify
39
false
395
src/00395.py
pyc/00395.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code load_json> MAKE_FUNCTION defaults STORE_NAME load_json RETURN_CONST None END CODE load_json(json_data, decoder) DOC 'pass' RESUME 0 LOAD_FAST decoder POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL DateTimeDecoder STORE_FAST decoder L1: LOAD_GLO...
def load_json(json_data, decoder=None): """pass""" if decoder is None: decoder = DateTimeDecoder return json.loads(json_data, object_hook=decoder.decode)
{ "repo": "the01/python-flotils", "repo_url": "https://github.com/the01/python-flotils", "file_path": "flotils/loadable.py", "commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1", "func_name": "load_json", "line_start": 131, "line_end": 144, "permalink": "https://github.com/the01/python-flotils/blob/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "7f35a7e27e432daea8be39264ceeeb2e2897ee8c", "resolved_at_commit": "5954712776bb590107e5b2f4362d010bf74f77a1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
the01/python-flotils
load_json
24
false
396
src/00396.py
pyc/00396.pyc
CODE <module>() RESUME 0 LOAD_CONST (None,) LOAD_CONST <code load_json_file> MAKE_FUNCTION defaults STORE_NAME load_json_file RETURN_CONST None END CODE load_json_file(file, decoder) DOC 'pass' RESUME 0 LOAD_FAST decoder POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL DateTimeDecoder STORE_FAST decoder L1: ...
def load_json_file(file, decoder=None): """pass""" if decoder is None: decoder = DateTimeDecoder if not hasattr(file, 'read'): with io.open(file, 'r', encoding='utf-8') as f: return json.load(f, object_hook=decoder.decode) return json.load(file, object_hook=decoder.decode)
{ "repo": "the01/python-flotils", "repo_url": "https://github.com/the01/python-flotils", "file_path": "flotils/loadable.py", "commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1", "func_name": "load_json_file", "line_start": 147, "line_end": 163, "permalink": "https://github.com/the01/python-flotils/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "7f35a7e27e432daea8be39264ceeeb2e2897ee8c", "resolved_at_commit": "5954712776bb590107e5b2f4362d010bf74f77a1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
the01/python-flotils
load_json_file
73
false
397
src/00397.py
pyc/00397.pyc
CODE <module>() RESUME 0 LOAD_CONST (False, True, None) LOAD_CONST <code save_json> MAKE_FUNCTION defaults STORE_NAME save_json RETURN_CONST None END CODE save_json(val, pretty, sort, encoder) DOC 'pass' RESUME 0 LOAD_FAST encoder POP_JUMP_IF_NOT_NONE L1 LOAD_GLOBAL DateTimeEncoder STORE_FAST en...
def save_json(val, pretty=False, sort=True, encoder=None): """pass""" if encoder is None: encoder = DateTimeEncoder if pretty: data = json.dumps(val, indent=4, separators=(',', ': '), sort_keys=sort, cls=encoder) else: data = json.dumps(val, separators=(',', ':'), sort_keys=sort,...
{ "repo": "the01/python-flotils", "repo_url": "https://github.com/the01/python-flotils", "file_path": "flotils/loadable.py", "commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1", "func_name": "save_json", "line_start": 166, "line_end": 201, "permalink": "https://github.com/the01/python-flotils/blob/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "7f35a7e27e432daea8be39264ceeeb2e2897ee8c", "resolved_at_commit": "5954712776bb590107e5b2f4362d010bf74f77a1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
the01/python-flotils
save_json
58
false
398
src/00398.py
pyc/00398.pyc
CODE <module>() RESUME 0 LOAD_CONST (False, True, True, None) LOAD_CONST <code save_json_file> MAKE_FUNCTION defaults STORE_NAME save_json_file RETURN_CONST None END CODE save_json_file(file, val, pretty, compact, sort, encoder) DOC 'pass' RESUME 0 LOAD_FAST encoder POP_JUMP_IF_NOT_NONE L1 LOAD_GL...
def save_json_file(file, val, pretty=False, compact=True, sort=True, encoder=None): """pass""" if encoder is None: encoder = DateTimeEncoder opened = False if not hasattr(file, 'write'): file = io.open(file, 'w', encoding='utf-8') opened = True try: if pretty: ...
{ "repo": "the01/python-flotils", "repo_url": "https://github.com/the01/python-flotils", "file_path": "flotils/loadable.py", "commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1", "func_name": "save_json_file", "line_start": 204, "line_end": 257, "permalink": "https://github.com/the01/python-flotils/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "7f35a7e27e432daea8be39264ceeeb2e2897ee8c", "resolved_at_commit": "5954712776bb590107e5b2f4362d010bf74f77a1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
the01/python-flotils
save_json_file
120
false
399
src/00399.py
pyc/00399.pyc
CODE <module>() RESUME 0 LOAD_CONST <code load_yaml_file> MAKE_FUNCTION 0 STORE_NAME load_yaml_file RETURN_CONST None END CODE load_yaml_file(file) DOC 'pass' RESUME 0 LOAD_GLOBAL NULL + hasattr LOAD_FAST file LOAD_CONST 'read' CALL 2 POP_JUMP_IF_TRUE L3 LOAD_GLOBAL io LOAD_ATTR NULL|self + ...
def load_yaml_file(file): """pass""" if not hasattr(file, 'read'): with io.open(file, 'r', encoding='utf-8') as f: return yaml.load(f, yaml.FullLoader) return yaml.load(file, yaml.FullLoader)
{ "repo": "the01/python-flotils", "repo_url": "https://github.com/the01/python-flotils", "file_path": "flotils/loadable.py", "commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1", "func_name": "load_yaml_file", "line_start": 272, "line_end": 284, "permalink": "https://github.com/the01/python-flotils/...
{ "spdx": "MIT", "name": "MIT License", "file": "LICENSE", "blob_sha": "7f35a7e27e432daea8be39264ceeeb2e2897ee8c", "resolved_at_commit": "5954712776bb590107e5b2f4362d010bf74f77a1", "resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}" }
the01/python-flotils
load_yaml_file
65
false