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 |
|---|---|---|---|---|---|---|---|---|---|---|
400 | src/00400.py | pyc/00400.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code save_yaml_file>
MAKE_FUNCTION 0
STORE_NAME save_yaml_file
RETURN_CONST None
END
CODE save_yaml_file(file, val)
DOC 'pass'
RESUME 0
LOAD_CONST False
STORE_FAST opened
LOAD_GLOBAL NULL + hasattr
LOAD_FAST file
LOAD_CONST 'write'
CALL 2
POP_JUMP_IF_TRUE... | def save_yaml_file(file, val):
"""pass"""
opened = False
if not hasattr(file, 'write'):
file = io.open(file, 'w', encoding='utf-8')
opened = True
try:
yaml.dump(val, file)
finally:
if opened:
file.close() | {
"repo": "the01/python-flotils",
"repo_url": "https://github.com/the01/python-flotils",
"file_path": "flotils/loadable.py",
"commit_sha": "5954712776bb590107e5b2f4362d010bf74f77a1",
"func_name": "save_yaml_file",
"line_start": 299,
"line_end": 318,
"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_yaml_file | 63 | false |
401 | src/00401.py | pyc/00401.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_embedded_yara>
MAKE_FUNCTION 0
STORE_NAME get_embedded_yara
RETURN_CONST None
END
CODE get_embedded_yara(self, iocid)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR iocs
LOAD_FAST iocid
BINARY_SUBSCR
STORE_FAST ioc_obj
LOAD_GLOBAL NULL + set
BUILD_... | def get_embedded_yara(self, iocid):
"""pass"""
ioc_obj = self.iocs[iocid]
ids_to_process = set([])
signatures = ''
for elem in ioc_obj.top_level_indicator.xpath('.//IndicatorItem[Context/@search = "Yara/Yara"]'):
signature = elem.findtext('Content')
signatures = signatures + '\n' + s... | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "examples/openioc_to_yara/openioc_to_yara.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "YaraIOCManager.get_embedded_yara",
"line_start": 122,
"line_end": 135,
"permalink": "... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | YaraIOCManager.get_embedded_yara | 53 | false |
402 | src/00402.py | pyc/00402.pyc | CODE <module>()
DOC ''
RESUME 0
LOAD_CONST ('', 'or')
LOAD_CONST <code get_yara_condition_string>
MAKE_FUNCTION defaults
STORE_NAME get_yara_condition_string
RETURN_CONST None
END
CODE get_yara_condition_string(self, indicator_node, parameters_node, ids_to_process, condition_string, joining_value)
DOC '... | def get_yara_condition_string(self, indicator_node, parameters_node, ids_to_process, condition_string='', joining_value='or'):
"""pass"""
indicator_node_id = str(indicator_node.get('id'))
if indicator_node_id not in ids_to_process:
msg = 'Entered into get_yara_condition_string with a invalid node to... | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "examples/openioc_to_yara/openioc_to_yara.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "YaraIOCManager.get_yara_condition_string",
"line_start": 174,
"line_end": 349,
"perma... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | YaraIOCManager.get_yara_condition_string | 725 | false |
403 | src/00403.py | pyc/00403.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code write_yara>
MAKE_FUNCTION 0
STORE_NAME write_yara
RETURN_CONST None
END
CODE write_yara(self, output_file)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + open
LOAD_FAST output_file
LOAD_CONST 'wb'
CALL 2
STORE_FAST fout
LOAD_FAST fout
LOAD_ATTR NULL|self + w... | def write_yara(self, output_file):
"""pass"""
fout = open(output_file, 'wb')
fout.write('\n')
for iocid in self.yara_signatures:
signature = self.yara_signatures[iocid]
fout.write(signature)
fout.write('\n')
fout.close()
return True | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "examples/openioc_to_yara/openioc_to_yara.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "YaraIOCManager.write_yara",
"line_start": 430,
"line_end": 443,
"permalink": "https:/... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | YaraIOCManager.write_yara | 49 | false |
404 | src/00404.py | pyc/00404.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code safe_makedirs>
MAKE_FUNCTION 0
STORE_NAME safe_makedirs
RETURN_CONST None
END
CODE safe_makedirs(fdir)
DOC 'pass'
RESUME 0
LOAD_GLOBAL os
LOAD_ATTR path
LOAD_ATTR NULL|self + isdir
LOAD_FAST fdir
CALL 1
POP_JUMP_IF_FALSE L1
NOP
RETURN_CONST True
L1... | def safe_makedirs(fdir):
"""pass"""
if os.path.isdir(fdir):
pass
else:
try:
os.makedirs(fdir)
except WindowsError as e:
if 'Cannot create a file when that file already exists' in e:
log.debug('relevant dir already exists')
else:
... | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "ioc_writer/utils/__init__.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "safe_makedirs",
"line_start": 23,
"line_end": 41,
"permalink": "https://github.com/mandiant/ioc_writ... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | safe_makedirs | 71 | false |
405 | src/00405.py | pyc/00405.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code convert_to_10>
MAKE_FUNCTION 0
STORE_NAME convert_to_10
RETURN_CONST None
END
CODE convert_to_10(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + len
LOAD_FAST self
CALL 1
LOAD_CONST 1
COMPARE_OP <
POP_JUMP_IF_FALSE L1
LOAD_GLOBAL log
LOAD_ATTR NULL|se... | def convert_to_10(self):
"""pass"""
if len(self) < 1:
log.error('no iocs available to modify')
return False
log.info('Converting IOCs from 1.1 to 1.0.')
errors = []
for iocid in self.iocs:
pruned = False
ioc_obj_11 = self.iocs[iocid]
metadata = ioc_obj_11.meta... | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "ioc_writer/managers/downgrade_11.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "DowngradeManager.convert_to_10",
"line_start": 89,
"line_end": 226,
"permalink": "https://git... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | DowngradeManager.convert_to_10 | 608 | false |
406 | src/00406.py | pyc/00406.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code convert_branch>
MAKE_FUNCTION defaults
STORE_NAME convert_branch
RETURN_CONST None
END
CODE convert_branch(self, old_node, new_node, ids_to_skip, comment_dict)
DOC 'pass'
RESUME 0
LOAD_CONST 'Indicator'
STORE_FAST expected_tag
LOAD_FAST ... | def convert_branch(self, old_node, new_node, ids_to_skip, comment_dict=None):
"""pass"""
expected_tag = 'Indicator'
if old_node.tag != expected_tag:
raise DowngradeError('old_node expected tag is [%s]' % expected_tag)
if not comment_dict:
comment_dict = {}
for node in old_node.getchi... | {
"repo": "mandiant/ioc_writer",
"repo_url": "https://github.com/mandiant/ioc_writer",
"file_path": "ioc_writer/managers/downgrade_11.py",
"commit_sha": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"func_name": "DowngradeManager.convert_branch",
"line_start": 228,
"line_end": 291,
"permalink": "https://g... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "062dc113865789f6dcb211cd7f976bb43f671d0d",
"resolved_at_commit": "712247f3a10bdc2584fa18ac909fc763f71df21a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mandiant/ioc_writer | DowngradeManager.convert_branch | 225 | false |
407 | src/00407.py | pyc/00407.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code create>
MAKE_FUNCTION 0
STORE_NAME create
RETURN_CONST None
END
CODE create(self, permission)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_FAST self
LOAD_ATTR parent_object
LOAD_ATTR _manager
LOAD_ATTR _URL_K... | def create(self, permission):
"""pass"""
parent_url = self.client.get_url(self.parent_object._manager._URL_KEY, 'GET', 'single', {'id': self.parent_object.id})
target_url = parent_url + self.client.get_url_path(self._URL_KEY, 'POST', 'single')
r = self.client.request('POST', target_url, json=permission.... | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/permissions.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "PermissionManager.create",
"line_start": 35,
"line_end": 44,
"permalink": "https://github.... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | PermissionManager.create | 56 | false |
408 | src/00408.py | pyc/00408.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code set>
MAKE_FUNCTION 0
STORE_NAME set
RETURN_CONST None
END
CODE set(self, permissions)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_FAST self
LOAD_ATTR parent_object
LOAD_ATTR _manager
LOAD_ATTR _URL_KEY
LOA... | def set(self, permissions):
"""pass"""
parent_url = self.client.get_url(self.parent_object._manager._URL_KEY, 'GET', 'single', {'id': self.parent_object.id})
target_url = parent_url + self.client.get_url_path(self._URL_KEY, 'PUT', 'multi')
r = self.client.request('PUT', target_url, json=permissions)
... | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/permissions.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "PermissionManager.set",
"line_start": 46,
"line_end": 57,
"permalink": "https://github.com... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | PermissionManager.set | 68 | false |
409 | src/00409.py | pyc/00409.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code list>
MAKE_FUNCTION 0
STORE_NAME list
RETURN_CONST None
END
CODE list(self)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_FAST self
LOAD_ATTR parent_object
LOAD_ATTR _manager
LOAD_ATTR _URL_KEY
LOAD_CONST 'G... | def list(self):
"""pass"""
parent_url = self.client.get_url(self.parent_object._manager._URL_KEY, 'GET', 'single', {'id': self.parent_object.id})
target_url = parent_url + self.client.get_url_path(self._URL_KEY, 'GET', 'multi')
return base.Query(self, target_url) | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/permissions.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "PermissionManager.list",
"line_start": 59,
"line_end": 65,
"permalink": "https://github.co... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | PermissionManager.list | 43 | false |
410 | src/00410.py | pyc/00410.pyc | CODE <module>()
RESUME 0
BUILD_LIST 0
BUILD_TUPLE 1
LOAD_CONST <code get>
MAKE_FUNCTION defaults
STORE_NAME get
RETURN_CONST None
END
CODE get(self, permission_id, expand)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_FAST self
LOAD_ATTR parent_object... | def get(self, permission_id, expand=[]):
"""pass"""
parent_url = self.client.get_url(self.parent_object._manager._URL_KEY, 'GET', 'single', {'id': self.parent_object.id})
target_url = parent_url + self.client.get_url_path(self._URL_KEY, 'GET', 'single', {'permission_id': permission_id})
return self._get... | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/permissions.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "PermissionManager.get",
"line_start": 67,
"line_end": 76,
"permalink": "https://github.com... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | PermissionManager.get | 49 | false |
411 | src/00411.py | pyc/00411.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_config>
MAKE_FUNCTION 0
STORE_NAME get_config
RETURN_CONST None
END
CODE get_config()
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_configpath
CALL 0
STORE_FAST configpath
LOAD_FAST configpath
LOAD_ATTR NULL|self + exists
CALL 0
POP_JUMP_IF_TRUE L1
... | def get_config():
"""pass"""
configpath = get_configpath()
if not configpath.exists():
raise IOError('Config file {} not found.'.format(str(configpath)))
else:
config = configparser.ConfigParser()
config.read(str(configpath))
return config | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/io.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "get_config",
"line_start": 23,
"line_end": 37,
"permalink": "https://github.com/michaelaye/pyciss/blob/019256424466060ba... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | get_config | 40 | false |
412 | src/00412.py | pyc/00412.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code set_database_path>
MAKE_FUNCTION 0
STORE_NAME set_database_path
RETURN_CONST None
END
CODE set_database_path(dbfolder)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_configpath
CALL 0
STORE_FAST configpath
NOP
L1:
LOAD_GLOBAL NULL + get_config
CALL 0
STO... | def set_database_path(dbfolder):
"""pass"""
configpath = get_configpath()
try:
d = get_config()
except IOError:
d = configparser.ConfigParser()
d['pyciss_db'] = {}
d['pyciss_db']['path'] = dbfolder
with configpath.open('w') as f:
d.write(f)
print('Saved databa... | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/io.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "set_database_path",
"line_start": 53,
"line_end": 70,
"permalink": "https://github.com/michaelaye/pyciss/blob/0192564244... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | set_database_path | 96 | false |
413 | src/00413.py | pyc/00413.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_db_root>
MAKE_FUNCTION 0
STORE_NAME get_db_root
RETURN_CONST None
END
CODE get_db_root()
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_config
CALL 0
STORE_FAST d
LOAD_GLOBAL NULL + Path
LOAD_FAST d
LOAD_CONST 'pyciss_db'
BINARY_SUBSCR
LOAD_CONST '... | def get_db_root():
"""pass"""
d = get_config()
dbroot = Path(d['pyciss_db']['path'])
dbroot.mkdir(exist_ok=True)
return dbroot | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/io.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "get_db_root",
"line_start": 81,
"line_end": 86,
"permalink": "https://github.com/michaelaye/pyciss/blob/019256424466060b... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | get_db_root | 29 | false |
414 | src/00414.py | pyc/00414.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code print_db_stats>
MAKE_FUNCTION 0
STORE_NAME print_db_stats
RETURN_CONST None
END
CODE print_db_stats()
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_db_root
CALL 0
STORE_FAST dbroot
LOAD_GLOBAL NULL + len
LOAD_GLOBAL NULL + list
LOAD_FAST dbroot
LOAD_ATT... | def print_db_stats():
"""pass"""
dbroot = get_db_root()
n_ids = len(list(dbroot.glob('[N,W]*')))
print('Number of WACs and NACs in database: {}'.format(n_ids))
print('These kind of data are in the database: (returning pd.DataFrame)')
d = {}
for key, val in PathManager.extensions.items():
... | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/io.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "print_db_stats",
"line_start": 89,
"line_end": 104,
"permalink": "https://github.com/michaelaye/pyciss/blob/019256424466... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | print_db_stats | 67 | false |
415 | src/00415.py | pyc/00415.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code is_lossy>
MAKE_FUNCTION 0
STORE_NAME is_lossy
RETURN_CONST None
END
CODE is_lossy(label)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + getkey
LOAD_FAST label
LOAD_CONST 'INST_CMPRS_TYPE'
KW_NAMES ('from_', 'keyword')
CALL 2
LOAD_ATTR NULL|self + decode
CALL... | def is_lossy(label):
"""pass"""
val = getkey(from_=label, keyword='INST_CMPRS_TYPE').decode().strip()
if val == 'LOSSY':
return True
else:
return False | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/io.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "is_lossy",
"line_start": 237,
"line_end": 243,
"permalink": "https://github.com/michaelaye/pyciss/blob/019256424466060ba... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | is_lossy | 27 | false |
416 | src/00416.py | pyc/00416.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code download_and_calibrate_parallel>
MAKE_FUNCTION defaults
STORE_NAME download_and_calibrate_parallel
RETURN_CONST None
END
CODE download_and_calibrate_parallel(list_of_ids, n)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + setup_cluster
LOAD_FAST n
... | def download_and_calibrate_parallel(list_of_ids, n=None):
"""pass"""
setup_cluster(n_cores=n)
c = Client()
lbview = c.load_balanced_view()
lbview.map_async(download_and_calibrate, list_of_ids)
subprocess.Popen(['ipcluster', 'stop', '--quiet']) | {
"repo": "michaelaye/pyciss",
"repo_url": "https://github.com/michaelaye/pyciss",
"file_path": "pyciss/downloader.py",
"commit_sha": "019256424466060babead7edab86736c881b0831",
"func_name": "download_and_calibrate_parallel",
"line_start": 37,
"line_end": 51,
"permalink": "https://github.com/michaelaye/... | {
"spdx": "ISC",
"name": "ISC License",
"file": "LICENSE",
"blob_sha": "3ee7579207abe3d34171e64956e3a605e7c7b7c0",
"resolved_at_commit": "019256424466060babead7edab86736c881b0831",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | michaelaye/pyciss | download_and_calibrate_parallel | 37 | false |
417 | src/00417.py | pyc/00417.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _set_supported_content_type>
MAKE_FUNCTION 0
STORE_NAME _set_supported_content_type
RETURN_CONST None
END
CODE _set_supported_content_type(self, content_types_supported)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + isinstance
LOAD_FAST content_types_supported
LOAD... | def _set_supported_content_type(self, content_types_supported):
"""pass"""
if not isinstance(content_types_supported, list):
raise TypeError("Settings 'READTIME_CONTENT_SUPPORT' must bea list of content types.")
self.content_type_supported = content_types_supported | {
"repo": "JenkinsDev/pelican-readtime",
"repo_url": "https://github.com/JenkinsDev/pelican-readtime",
"file_path": "readtime.py",
"commit_sha": "9440eb062950cb34111170e057f1e73c82bdce9a",
"func_name": "ReadTimeParser._set_supported_content_type",
"line_start": 20,
"line_end": 27,
"permalink": "https://... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "aa3194a26748eddd81ff77d895f74de62473a7a8",
"resolved_at_commit": "9440eb062950cb34111170e057f1e73c82bdce9a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | JenkinsDev/pelican-readtime | ReadTimeParser._set_supported_content_type | 24 | false |
418 | src/00418.py | pyc/00418.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _set_lang_settings>
MAKE_FUNCTION 0
STORE_NAME _set_lang_settings
RETURN_CONST None
END
CODE _set_lang_settings(self, lang_settings)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + isinstance
LOAD_FAST lang_settings
LOAD_GLOBAL int
CALL 2
STORE_FAST is_int
LOAD... | def _set_lang_settings(self, lang_settings):
"""pass"""
is_int = isinstance(lang_settings, int)
is_dict = isinstance(lang_settings, dict)
if not is_int and (not is_dict):
raise TypeError("Settings 'READTIME_WPM' must be either an int,or a dict with settings per language.")
if is_int:
... | {
"repo": "JenkinsDev/pelican-readtime",
"repo_url": "https://github.com/JenkinsDev/pelican-readtime",
"file_path": "readtime.py",
"commit_sha": "9440eb062950cb34111170e057f1e73c82bdce9a",
"func_name": "ReadTimeParser._set_lang_settings",
"line_start": 29,
"line_end": 69,
"permalink": "https://github.co... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "aa3194a26748eddd81ff77d895f74de62473a7a8",
"resolved_at_commit": "9440eb062950cb34111170e057f1e73c82bdce9a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | JenkinsDev/pelican-readtime | ReadTimeParser._set_lang_settings | 135 | false |
419 | src/00419.py | pyc/00419.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code initialize_settings>
MAKE_FUNCTION 0
STORE_NAME initialize_settings
RETURN_CONST None
END
CODE initialize_settings(self, sender)
DOC 'pass'
RESUME 0
NOP
L1:
LOAD_CONST True
LOAD_FAST self
STORE_ATTR initialized
LOAD_FAST sender
LOAD_ATTR settings
LOA... | def initialize_settings(self, sender):
"""pass"""
try:
self.initialized = True
settings_content_types = sender.settings.get('READTIME_CONTENT_SUPPORT', self.content_type_supported)
self._set_supported_content_type(settings_content_types)
lang_settings = sender.settings.get('READT... | {
"repo": "JenkinsDev/pelican-readtime",
"repo_url": "https://github.com/JenkinsDev/pelican-readtime",
"file_path": "readtime.py",
"commit_sha": "9440eb062950cb34111170e057f1e73c82bdce9a",
"func_name": "ReadTimeParser.initialize_settings",
"line_start": 71,
"line_end": 86,
"permalink": "https://github.c... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "aa3194a26748eddd81ff77d895f74de62473a7a8",
"resolved_at_commit": "9440eb062950cb34111170e057f1e73c82bdce9a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | JenkinsDev/pelican-readtime | ReadTimeParser.initialize_settings | 73 | false |
420 | src/00420.py | pyc/00420.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code read_time>
MAKE_FUNCTION 0
STORE_NAME read_time
RETURN_CONST None
END
CODE read_time(self, content)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_class_name
LOAD_FAST content
CALL 1
LOAD_FAST self
LOAD_ATTR content_type_supported
CONTAINS_OP 0
POP_JUMP_... | def read_time(self, content):
"""pass"""
if get_class_name(content) in self.content_type_supported:
if hasattr(content, 'readtime'):
return None
default_lang_conf = self.lang_settings['default']
lang_conf = self.lang_settings.get(content.lang, default_lang_conf)
avg_r... | {
"repo": "JenkinsDev/pelican-readtime",
"repo_url": "https://github.com/JenkinsDev/pelican-readtime",
"file_path": "readtime.py",
"commit_sha": "9440eb062950cb34111170e057f1e73c82bdce9a",
"func_name": "ReadTimeParser.read_time",
"line_start": 88,
"line_end": 129,
"permalink": "https://github.com/Jenkin... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "aa3194a26748eddd81ff77d895f74de62473a7a8",
"resolved_at_commit": "9440eb062950cb34111170e057f1e73c82bdce9a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | JenkinsDev/pelican-readtime | ReadTimeParser.read_time | 107 | false |
421 | src/00421.py | pyc/00421.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code pluralize>
MAKE_FUNCTION 0
STORE_NAME pluralize
RETURN_CONST None
END
CODE pluralize(self, measure, singular, plural)
DOC 'pass'
RESUME 0
LOAD_FAST measure
LOAD_CONST 1
COMPARE_OP ==
POP_JUMP_IF_FALSE L1
LOAD_CONST '{} {}'
LOAD_ATTR NULL|self + format
... | def pluralize(self, measure, singular, plural):
"""pass"""
if measure == 1:
return '{} {}'.format(measure, singular)
else:
return '{} {}'.format(measure, plural) | {
"repo": "JenkinsDev/pelican-readtime",
"repo_url": "https://github.com/JenkinsDev/pelican-readtime",
"file_path": "readtime.py",
"commit_sha": "9440eb062950cb34111170e057f1e73c82bdce9a",
"func_name": "ReadTimeParser.pluralize",
"line_start": 131,
"line_end": 146,
"permalink": "https://github.com/Jenki... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "aa3194a26748eddd81ff77d895f74de62473a7a8",
"resolved_at_commit": "9440eb062950cb34111170e057f1e73c82bdce9a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | JenkinsDev/pelican-readtime | ReadTimeParser.pluralize | 27 | false |
422 | src/00422.py | pyc/00422.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code list_datasources>
MAKE_FUNCTION 0
STORE_NAME list_datasources
RETURN_CONST None
END
CODE list_datasources(self, source_id)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_CONST 'DATASOURCE'
LOAD_CONST 'GET'
LOAD_C... | def list_datasources(self, source_id):
"""pass"""
target_url = self.client.get_url('DATASOURCE', 'GET', 'multi', {'source_id': source_id})
return base.Query(self.client.get_manager(Datasource), target_url) | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/sources.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "SourceManager.list_datasources",
"line_start": 65,
"line_end": 70,
"permalink": "https://githu... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | SourceManager.list_datasources | 31 | false |
423 | src/00423.py | pyc/00423.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_datasource>
MAKE_FUNCTION 0
STORE_NAME get_datasource
RETURN_CONST None
END
CODE get_datasource(self, source_id, datasource_id)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR client
LOAD_ATTR NULL|self + get_url
LOAD_CONST 'DATASOURCE'
LOAD_CONST 'GET'... | def get_datasource(self, source_id, datasource_id):
"""pass"""
target_url = self.client.get_url('DATASOURCE', 'GET', 'single', {'source_id': source_id, 'datasource_id': datasource_id})
return self.client.get_manager(Datasource)._get(target_url) | {
"repo": "koordinates/python-client",
"repo_url": "https://github.com/koordinates/python-client",
"file_path": "koordinates/sources.py",
"commit_sha": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"func_name": "SourceManager.get_datasource",
"line_start": 72,
"line_end": 79,
"permalink": "https://github.... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "e89b1969bda047b875204298902885dcc291644b",
"resolved_at_commit": "f3dc7cd164f5a9499b2454cd1d4516e9d4b3c252",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | koordinates/python-client | SourceManager.get_datasource | 31 | false |
424 | src/00424.py | pyc/00424.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code open_store_variable>
MAKE_FUNCTION 0
STORE_NAME open_store_variable
RETURN_CONST None
END
CODE open_store_variable(self, name, var)
DOC 'pass'
RESUME 0
LOAD_GLOBAL indexing
LOAD_ATTR NULL|self + LazilyOuterIndexedArray
LOAD_GLOBAL NULL + CDMArrayWrapper
LO... | def open_store_variable(self, name, var):
"""pass"""
data = indexing.LazilyOuterIndexedArray(CDMArrayWrapper(name, self))
return Variable(var.dimensions, data, {a: getattr(var, a) for a in var.ncattrs()}) | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/cdmr/xarray_support.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "CDMRemoteStore.open_store_variable",
"line_start": 52,
"line_end": 55,
"permalink": "https://github.com/Unida... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | CDMRemoteStore.open_store_variable | 55 | false |
425 | src/00425.py | pyc/00425.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_attrs>
MAKE_FUNCTION 0
STORE_NAME get_attrs
RETURN_CONST None
END
CODE get_attrs(self)
DOC 'pass'
MAKE_CELL self
RESUME 0
LOAD_GLOBAL NULL + FrozenOrderedDict
LOAD_CLOSURE self
BUILD_TUPLE 1
LOAD_CONST <code get_attrs.<locals>.<genexpr>>
MAKE_FUNCT... | def get_attrs(self):
"""pass"""
return FrozenOrderedDict(((a, getattr(self.ds, a)) for a in self.ds.ncattrs())) | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/cdmr/xarray_support.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "CDMRemoteStore.get_attrs",
"line_start": 62,
"line_end": 64,
"permalink": "https://github.com/Unidata/siphon/... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | CDMRemoteStore.get_attrs | 53 | false |
426 | src/00426.py | pyc/00426.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_dimensions>
MAKE_FUNCTION 0
STORE_NAME get_dimensions
RETURN_CONST None
END
CODE get_dimensions(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + FrozenOrderedDict
LOAD_CONST <code get_dimensions.<locals>.<genexpr>>
MAKE_FUNCTION 0
LOAD_FAST self
LOAD_ATT... | def get_dimensions(self):
"""pass"""
return FrozenOrderedDict(((k, len(v)) for k, v in self.ds.dimensions.items())) | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/cdmr/xarray_support.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "CDMRemoteStore.get_dimensions",
"line_start": 66,
"line_end": 68,
"permalink": "https://github.com/Unidata/si... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | CDMRemoteStore.get_dimensions | 50 | false |
427 | src/00427.py | pyc/00427.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _find_base_tds_url>
MAKE_FUNCTION 0
STORE_NAME _find_base_tds_url
RETURN_CONST None
END
CODE _find_base_tds_url(catalog_url)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + urlparse
LOAD_FAST catalog_url
CALL 1
STORE_FAST url_components
LOAD_FAST url_components
... | def _find_base_tds_url(catalog_url):
"""pass"""
url_components = urlparse(catalog_url)
if url_components.path:
return catalog_url.split(url_components.path)[0]
else:
return catalog_url | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/catalog.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "_find_base_tds_url",
"line_start": 790,
"line_end": 799,
"permalink": "https://github.com/Unidata/siphon/blob/53fb0d84fbc... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | _find_base_tds_url | 28 | false |
428 | src/00428.py | pyc/00428.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code filter_time_nearest>
MAKE_FUNCTION defaults
STORE_NAME filter_time_nearest
RETURN_CONST None
END
CODE filter_time_nearest(self, time, regex)
DOC 'pass'
MAKE_CELL time
RESUME 0
LOAD_GLOBAL NULL + min
LOAD_FAST self
LOAD_ATTR NULL|self +... | def filter_time_nearest(self, time, regex=None):
"""pass"""
return min(self._get_datasets_with_times(regex), key=lambda i: abs((i[0] - time).total_seconds()))[-1] | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/catalog.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "DatasetCollection.filter_time_nearest",
"line_start": 74,
"line_end": 100,
"permalink": "https://github.com/Unidata/sipho... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | DatasetCollection.filter_time_nearest | 40 | false |
429 | src/00429.py | pyc/00429.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code filter_time_range>
MAKE_FUNCTION defaults
STORE_NAME filter_time_range
RETURN_CONST None
END
CODE filter_time_range(self, start, end, regex)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + _get_datasets_with_times
LOAD_FAST rege... | def filter_time_range(self, start, end, regex=None):
"""pass"""
return [item[-1] for item in self._get_datasets_with_times(regex) if start <= item[0] <= end] | {
"repo": "Unidata/siphon",
"repo_url": "https://github.com/Unidata/siphon",
"file_path": "siphon/catalog.py",
"commit_sha": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"func_name": "DatasetCollection.filter_time_range",
"line_start": 102,
"line_end": 129,
"permalink": "https://github.com/Unidata/siphon... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a6cba10978074255ecf8b4ff44fe2a4054670d05",
"resolved_at_commit": "53fb0d84fbce1c18c8e81c9e68bc81620ee0a6ac",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | Unidata/siphon | DatasetCollection.filter_time_range | 63 | false |
430 | src/00430.py | pyc/00430.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code check_token>
MAKE_FUNCTION 0
STORE_NAME check_token
RETURN_CONST None
END
CODE check_token(func)
DOC 'pass'
MAKE_CELL func
RESUME 0
LOAD_GLOBAL NULL + wraps
LOAD_DEREF func
CALL 1
LOAD_CLOSURE func
BUILD_TUPLE 1
LOAD_CONST <code check_token.<locals>.... | def check_token(func):
"""pass"""
@wraps(func)
def wrapper(*args, **kwargs):
response = func(*args, **kwargs)
if response.status_code == 401:
raise InvalidToken('Access token invalid or no longer valid')
else:
return response
return wrapper | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "check_token",
"line_start": 22,
"line_end": 31,
"permalink": "https://github.com/mozillazg/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | check_token | 46 | false |
431 | src/00431.py | pyc/00431.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code upload>
MAKE_FUNCTION defaults
STORE_NAME upload
RETURN_CONST None
END
CODE upload(self, remote_path, file_content, ondup, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST remote_path
LOAD_FAST ondup
LOAD_CONST ('path', 'ondup')
BUILD_CONST_KEY... | def upload(self, remote_path, file_content, ondup=None, **kwargs):
"""pass"""
params = {'path': remote_path, 'ondup': ondup}
files = {'file': ('file', file_content, '')}
url = 'https://c.pcs.baidu.com/rest/2.0/pcs/file'
return self._request('file', 'upload', url=url, extra_params=params, files=files... | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "PCS.upload",
"line_start": 103,
"line_end": 135,
"permalink": "https://github.com/mozillazg... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | PCS.upload | 38 | false |
432 | src/00432.py | pyc/00432.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code upload_tmpfile>
MAKE_FUNCTION 0
STORE_NAME upload_tmpfile
RETURN_CONST None
END
CODE upload_tmpfile(self, file_content, **kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 'type'
LOAD_CONST 'tmpfile'
BUILD_MAP 1
STORE_FAST params
LOAD_CONST 'file'
LOAD_CONST 'fil... | def upload_tmpfile(self, file_content, **kwargs):
"""pass"""
params = {'type': 'tmpfile'}
files = {'file': ('file', file_content, '')}
url = 'https://c.pcs.baidu.com/rest/2.0/pcs/file'
return self._request('file', 'upload', url=url, extra_params=params, files=files, **kwargs) | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "PCS.upload_tmpfile",
"line_start": 137,
"line_end": 163,
"permalink": "https://github.com/m... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | PCS.upload_tmpfile | 36 | false |
433 | src/00433.py | pyc/00433.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code upload_superfile>
MAKE_FUNCTION defaults
STORE_NAME upload_superfile
RETURN_CONST None
END
CODE upload_superfile(self, remote_path, block_list, ondup, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST remote_path
LOAD_FAST ondup
LOAD_CONST ('path'... | def upload_superfile(self, remote_path, block_list, ondup=None, **kwargs):
"""pass"""
params = {'path': remote_path, 'ondup': ondup}
data = {'param': json.dumps({'block_list': block_list})}
return self._request('file', 'createsuperfile', extra_params=params, data=data, **kwargs) | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "PCS.upload_superfile",
"line_start": 165,
"line_end": 198,
"permalink": "https://github.com... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | PCS.upload_superfile | 37 | false |
434 | src/00434.py | pyc/00434.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code mkdir>
MAKE_FUNCTION 0
STORE_NAME mkdir
RETURN_CONST None
END
CODE mkdir(self, remote_path, **kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 'path'
LOAD_FAST remote_path
BUILD_MAP 1
STORE_FAST data
PUSH_NULL
LOAD_FAST self
LOAD_ATTR _request
LOAD_CONST ('f... | def mkdir(self, remote_path, **kwargs):
"""pass"""
data = {'path': remote_path}
return self._request('file', 'mkdir', data=data, **kwargs) | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "PCS.mkdir",
"line_start": 232,
"line_end": 249,
"permalink": "https://github.com/mozillazg/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | PCS.mkdir | 25 | false |
435 | src/00435.py | pyc/00435.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code meta>
MAKE_FUNCTION 0
STORE_NAME meta
RETURN_CONST None
END
CODE meta(self, remote_path, **kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 'path'
LOAD_FAST remote_path
BUILD_MAP 1
STORE_FAST params
PUSH_NULL
LOAD_FAST self
LOAD_ATTR _request
LOAD_CONST ('fi... | def meta(self, remote_path, **kwargs):
"""pass"""
params = {'path': remote_path}
return self._request('file', 'meta', extra_params=params, **kwargs) | {
"repo": "mozillazg/baidu-pcs-python-sdk",
"repo_url": "https://github.com/mozillazg/baidu-pcs-python-sdk",
"file_path": "baidupcs/api.py",
"commit_sha": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"func_name": "PCS.meta",
"line_start": 251,
"line_end": 268,
"permalink": "https://github.com/mozillazg/b... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "f6129e2ec56f5658664380155206f64f6e1a4999",
"resolved_at_commit": "12fe3f13b2ecda8f8bdcc5334c876e934776a5cc",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | mozillazg/baidu-pcs-python-sdk | PCS.meta | 25 | false |
436 | src/00436.py | pyc/00436.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code login>
MAKE_FUNCTION 0
STORE_NAME login
RETURN_CONST None
END
CODE login(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL os
LOAD_ATTR path
LOAD_ATTR NULL|self + exists
LOAD_FAST self
LOAD_ATTR _cookieFileName
CALL 1
POP_JUMP_IF_FALSE L5
LOAD_GLOBAL NULL + op... | def login(self):
"""pass"""
if os.path.exists(self._cookieFileName):
with open(self._cookieFileName, 'r') as cookieFile:
self._vid = cookieFile.read().strip()
try:
self._get_installations()
except ResponseError:
self._vid = None
os.remove(s... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session.login",
"line_start": 73,
"line_end": 95,
"permalink": "https://github.com/persands... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session.login | 151 | false |
437 | src/00437.py | pyc/00437.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _get_installations>
MAKE_FUNCTION 0
STORE_NAME _get_installations
RETURN_CONST None
END
CODE _get_installations(self)
DOC 'pass'
RESUME 0
LOAD_CONST None
STORE_FAST response
LOAD_GLOBAL urls
LOAD_ATTR BASE_URLS
GET_ITER
L1:
FOR_ITER L7
STORE_FAST bas... | def _get_installations(self):
"""pass"""
response = None
for base_url in urls.BASE_URLS:
urls.BASE_URL = base_url
try:
response = requests.get(urls.get_installations(self._username), headers={'Cookie': 'vid={}'.format(self._vid), 'Accept': 'application/json,text/javascript, */*; ... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session._get_installations",
"line_start": 127,
"line_end": 150,
"permalink": "https://gith... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session._get_installations | 112 | false |
438 | src/00438.py | pyc/00438.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_overview>
MAKE_FUNCTION 0
STORE_NAME get_overview
RETURN_CONST None
END
CODE get_overview(self)
DOC 'pass'
RESUME 0
LOAD_CONST None
STORE_FAST response
NOP
L1:
LOAD_GLOBAL requests
LOAD_ATTR NULL|self + get
LOAD_GLOBAL urls
LOAD_ATTR NULL|self + ... | def get_overview(self):
"""pass"""
response = None
try:
response = requests.get(urls.overview(self._giid), headers={'Accept': 'application/json, text/javascript, */*; q=0.01', 'Accept-Encoding': 'gzip, deflate', 'Content-Type': 'application/json', 'Cookie': 'vid={}'.format(self._vid)})
except re... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session.get_overview",
"line_start": 160,
"line_end": 174,
"permalink": "https://github.com... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session.get_overview | 73 | false |
439 | src/00439.py | pyc/00439.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code set_smartplug_state>
MAKE_FUNCTION 0
STORE_NAME set_smartplug_state
RETURN_CONST None
END
CODE set_smartplug_state(self, device_label, state)
DOC 'pass'
RESUME 0
LOAD_CONST None
STORE_FAST response
NOP
L1:
LOAD_GLOBAL requests
LOAD_ATTR NULL|self + post
... | def set_smartplug_state(self, device_label, state):
"""pass"""
response = None
try:
response = requests.post(urls.smartplug(self._giid), headers={'Content-Type': 'application/json', 'Cookie': 'vid={}'.format(self._vid)}, data=json.dumps([{'deviceLabel': device_label, 'state': state}]))
except re... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session.set_smartplug_state",
"line_start": 176,
"line_end": 195,
"permalink": "https://git... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session.set_smartplug_state | 74 | false |
440 | src/00440.py | pyc/00440.pyc | CODE <module>()
RESUME 0
LOAD_CONST ((), 15, 0)
LOAD_CONST <code get_history>
MAKE_FUNCTION defaults
STORE_NAME get_history
RETURN_CONST None
END
CODE get_history(self, filters, pagesize, offset)
DOC 'pass'
RESUME 0
LOAD_CONST None
STORE_FAST response
NOP
L1:
LOAD_GLOBAL requests
LOAD_ATTR NUL... | def get_history(self, filters=(), pagesize=15, offset=0):
"""pass"""
response = None
try:
response = requests.get(urls.history(self._giid), headers={'Accept': 'application/json, text/javascript, */*; q=0.01', 'Cookie': 'vid={}'.format(self._vid)}, params={'offset': int(offset), 'pagesize': int(pages... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session.get_history",
"line_start": 250,
"line_end": 274,
"permalink": "https://github.com/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session.get_history | 81 | false |
441 | src/00441.py | pyc/00441.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_climate>
MAKE_FUNCTION 0
STORE_NAME get_climate
RETURN_CONST None
END
CODE get_climate(self, device_label)
DOC 'pass'
RESUME 0
LOAD_CONST None
STORE_FAST response
NOP
L1:
LOAD_GLOBAL requests
LOAD_ATTR NULL|self + get
LOAD_GLOBAL urls
LOAD_ATTR N... | def get_climate(self, device_label):
"""pass"""
response = None
try:
response = requests.get(urls.climate(self._giid), headers={'Accept': 'application/json, text/javascript, */*; q=0.01', 'Cookie': 'vid={}'.format(self._vid)}, params={'deviceLabel': device_label})
except requests.exceptions.Requ... | {
"repo": "persandstrom/python-verisure",
"repo_url": "https://github.com/persandstrom/python-verisure",
"file_path": "verisure/session.py",
"commit_sha": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"func_name": "Session.get_climate",
"line_start": 276,
"line_end": 293,
"permalink": "https://github.com/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "42e15619d6e1be46784af0e1f2babd97a682fd3a",
"resolved_at_commit": "babd25e7f8fb2b24f12e4109dfa8a04041e8dcb8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | persandstrom/python-verisure | Session.get_climate | 74 | false |
442 | src/00442.py | pyc/00442.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code type_id>
MAKE_FUNCTION 0
STORE_NAME type_id
RETURN_CONST None
END
CODE type_id(self)
DOC 'pass'
RESUME 0
NOP
L1:
LOAD_GLOBAL ContentType
LOAD_ATTR objects
LOAD_ATTR NULL|self + get_for_model
LOAD_FAST self
LOAD_ATTR model
LOAD_CONST False
KW_NAMES ... | def type_id(self):
"""pass"""
try:
return ContentType.objects.get_for_model(self.model, for_concrete_model=False).id
except DatabaseError as e:
raise DatabaseError('Unable to fetch ContentType object, is a plugin being registered before the initial syncdb? (original error: {0})'.format(str(e... | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.type_id",
"line_start": 291,
"line_end": 2... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.type_id | 54 | false |
443 | src/00443.py | pyc/00443.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_output_cache_key>
MAKE_FUNCTION 0
STORE_NAME get_output_cache_key
RETURN_CONST None
END
CODE get_output_cache_key(self, placeholder_name, instance)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + get_output_cache_base_key
LOAD_FAST placeholder_n... | def get_output_cache_key(self, placeholder_name, instance):
"""pass"""
cachekey = self.get_output_cache_base_key(placeholder_name, instance)
if self.cache_output_per_site:
cachekey = '{0}-s{1}'.format(cachekey, settings.SITE_ID)
if self.cache_output_per_language:
user_language = get_lang... | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.get_output_cache_key",
"line_start": 339,
... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.get_output_cache_key | 50 | false |
444 | src/00444.py | pyc/00444.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_output_cache_keys>
MAKE_FUNCTION 0
STORE_NAME get_output_cache_keys
RETURN_CONST None
END
CODE get_output_cache_keys(self, placeholder_name, instance)
DOC 'pass'
MAKE_CELL placeholder
MAKE_CELL user_language
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self ... | def get_output_cache_keys(self, placeholder_name, instance):
"""pass"""
base_key = self.get_output_cache_base_key(placeholder_name, instance)
cachekeys = [base_key]
if self.cache_output_per_site:
site_ids = list(Site.objects.values_list('pk', flat=True))
if settings.SITE_ID not in site_i... | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.get_output_cache_keys",
"line_start": 361,
... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.get_output_cache_keys | 191 | false |
445 | src/00445.py | pyc/00445.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_cached_output>
MAKE_FUNCTION 0
STORE_NAME get_cached_output
RETURN_CONST None
END
CODE get_cached_output(self, placeholder_name, instance)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + get_output_cache_key
LOAD_FAST placeholder_name
LOAD_FAS... | def get_cached_output(self, placeholder_name, instance):
"""pass"""
cachekey = self.get_output_cache_key(placeholder_name, instance)
return cache.get(cachekey) | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.get_cached_output",
"line_start": 402,
"li... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.get_cached_output | 21 | false |
446 | src/00446.py | pyc/00446.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code set_cached_output>
MAKE_FUNCTION 0
STORE_NAME set_cached_output
RETURN_CONST None
END
CODE set_cached_output(self, placeholder_name, instance, output)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + get_output_cache_key
LOAD_FAST placeholder_name
... | def set_cached_output(self, placeholder_name, instance, output):
"""pass"""
cachekey = self.get_output_cache_key(placeholder_name, instance)
if self.cache_timeout is not DEFAULT_TIMEOUT:
cache.set(cachekey, output, self.cache_timeout)
else:
cache.set(cachekey, output) | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.set_cached_output",
"line_start": 414,
"li... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.set_cached_output | 38 | false |
447 | src/00447.py | pyc/00447.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code render>
MAKE_FUNCTION 0
STORE_NAME render
RETURN_CONST None
END
CODE render(self, request, instance, **kwargs)
DOC 'pass'
RESUME 0
PUSH_NULL
LOAD_FAST self
LOAD_ATTR get_render_template
LOAD_FAST request
LOAD_FAST instance
BUILD_TUPLE 2
BUILD_MAP 0
... | def render(self, request, instance, **kwargs):
"""pass"""
render_template = self.get_render_template(request, instance, **kwargs)
if not render_template:
return str(_(u"{No rendering defined for class '%s'}" % self.__class__.__name__))
context = self.get_context(request, instance, **kwargs)
... | {
"repo": "django-fluent/django-fluent-contents",
"repo_url": "https://github.com/django-fluent/django-fluent-contents",
"file_path": "fluent_contents/extensions/pluginbase.py",
"commit_sha": "896f14add58471b98d7aa295b2c9e6abedec9003",
"func_name": "ContentPlugin.render",
"line_start": 436,
"line_end": 46... | {
"spdx": "Apache-2.0",
"name": "Apache License 2.0",
"file": "LICENSE",
"blob_sha": "261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64",
"resolved_at_commit": "896f14add58471b98d7aa295b2c9e6abedec9003",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | django-fluent/django-fluent-contents | ContentPlugin.render | 52 | false |
448 | src/00448.py | pyc/00448.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code inline_requests>
MAKE_FUNCTION 0
STORE_NAME inline_requests
RETURN_CONST None
END
CODE inline_requests(method_or_func)
DOC 'pass'
MAKE_CELL method_or_func
RESUME 0
LOAD_GLOBAL NULL + get_args
LOAD_DEREF method_or_func
CALL 1
STORE_FAST args
LOAD_FAST a... | def inline_requests(method_or_func):
"""pass"""
args = get_args(method_or_func)
if not args:
raise TypeError('Function must accept at least one argument.')
if args[0] == 'self':
def wrapper(self, response, **kwargs):
callback = create_bound_method(method_or_func, self)
... | {
"repo": "rmax/scrapy-inline-requests",
"repo_url": "https://github.com/rmax/scrapy-inline-requests",
"file_path": "src/inline_requests/__init__.py",
"commit_sha": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"func_name": "inline_requests",
"line_start": 19,
"line_end": 74,
"permalink": "https://github.... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "c4d833ae92dda71af9e389503e9b491ce29de529",
"resolved_at_commit": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | rmax/scrapy-inline-requests | inline_requests | 95 | false |
449 | src/00449.py | pyc/00449.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_args>
MAKE_FUNCTION 0
STORE_NAME get_args
RETURN_CONST None
END
CODE get_args(method_or_func)
DOC 'pass'
RESUME 0
NOP
L1:
LOAD_GLOBAL NULL + list
LOAD_GLOBAL inspect
LOAD_ATTR NULL|self + signature
LOAD_FAST method_or_func
CALL 1
LOAD_ATTR parame... | def get_args(method_or_func):
"""pass"""
try:
args = list(inspect.signature(method_or_func).parameters.keys())
except AttributeError:
args = inspect.getargspec(method_or_func).args
return args | {
"repo": "rmax/scrapy-inline-requests",
"repo_url": "https://github.com/rmax/scrapy-inline-requests",
"file_path": "src/inline_requests/utils.py",
"commit_sha": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"func_name": "get_args",
"line_start": 4,
"line_end": 12,
"permalink": "https://github.com/rmax/sc... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "c4d833ae92dda71af9e389503e9b491ce29de529",
"resolved_at_commit": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | rmax/scrapy-inline-requests | get_args | 50 | false |
450 | src/00450.py | pyc/00450.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code _unwindGenerator>
MAKE_FUNCTION defaults
STORE_NAME _unwindGenerator
RETURN_CONST None
END
CODE _unwindGenerator(self, generator, _prev)
DOC 'pass'
RETURN_GENERATOR
POP_TOP
L1:
RESUME 0
NOP
L2:
LOAD_FAST _prev
POP_JUMP_IF_FALSE L3
... | def _unwindGenerator(self, generator, _prev=None):
"""pass"""
while True:
if _prev:
ret, _prev = (_prev, None)
else:
try:
ret = next(generator)
except StopIteration:
break
if isinstance(ret, Request):
if ret.... | {
"repo": "rmax/scrapy-inline-requests",
"repo_url": "https://github.com/rmax/scrapy-inline-requests",
"file_path": "src/inline_requests/generator.py",
"commit_sha": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"func_name": "RequestGenerator._unwindGenerator",
"line_start": 44,
"line_end": 71,
"permalink... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "c4d833ae92dda71af9e389503e9b491ce29de529",
"resolved_at_commit": "2cbbb66e6e97260b7e126aa9d8ecde1393a554c9",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | rmax/scrapy-inline-requests | RequestGenerator._unwindGenerator | 100 | false |
451 | src/00451.py | pyc/00451.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code jwt_required>
MAKE_FUNCTION 0
STORE_NAME jwt_required
RETURN_CONST None
END
CODE jwt_required(fn)
DOC 'pass'
MAKE_CELL fn
RESUME 0
LOAD_GLOBAL NULL + wraps
LOAD_DEREF fn
CALL 1
LOAD_CLOSURE fn
BUILD_TUPLE 1
LOAD_CONST <code jwt_required.<locals>.wrap... | def jwt_required(fn):
"""pass"""
@wraps(fn)
def wrapper(*args, **kwargs):
jwt_data = _decode_jwt_from_headers()
ctx_stack.top.jwt = jwt_data
return fn(*args, **kwargs)
return wrapper | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/view_decorators.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "jwt_required",
"line_start": 14,
"line_end": 26,
"permalink": "https://github.com... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | jwt_required | 41 | false |
452 | src/00452.py | pyc/00452.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code jwt_optional>
MAKE_FUNCTION 0
STORE_NAME jwt_optional
RETURN_CONST None
END
CODE jwt_optional(fn)
DOC 'pass'
MAKE_CELL fn
RESUME 0
LOAD_GLOBAL NULL + wraps
LOAD_DEREF fn
CALL 1
LOAD_CLOSURE fn
BUILD_TUPLE 1
LOAD_CONST <code jwt_optional.<locals>.wrap... | def jwt_optional(fn):
"""pass"""
@wraps(fn)
def wrapper(*args, **kwargs):
try:
jwt_data = _decode_jwt_from_headers()
ctx_stack.top.jwt = jwt_data
except (NoAuthorizationError, InvalidHeaderError):
pass
return fn(*args, **kwargs)
return wrapper | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/view_decorators.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "jwt_optional",
"line_start": 29,
"line_end": 48,
"permalink": "https://github.com... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | jwt_optional | 64 | false |
453 | src/00453.py | pyc/00453.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code decode_jwt>
MAKE_FUNCTION 0
STORE_NAME decode_jwt
RETURN_CONST None
END
CODE decode_jwt(encoded_token)
DOC 'pass'
RESUME 0
LOAD_GLOBAL config
LOAD_ATTR decode_key
STORE_FAST secret
LOAD_GLOBAL config
LOAD_ATTR algorithm
STORE_FAST algorithm
LOAD_GLOB... | def decode_jwt(encoded_token):
"""pass"""
secret = config.decode_key
algorithm = config.algorithm
audience = config.audience
return jwt.decode(encoded_token, secret, algorithms=[algorithm], audience=audience) | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/utils.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "decode_jwt",
"line_start": 36,
"line_end": 44,
"permalink": "https://github.com/vimalloc/fl... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | decode_jwt | 29 | false |
454 | src/00454.py | pyc/00454.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code init_app>
MAKE_FUNCTION 0
STORE_NAME init_app
RETURN_CONST None
END
CODE init_app(self, app)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + hasattr
LOAD_FAST app
LOAD_CONST 'extensions'
CALL 2
POP_JUMP_IF_TRUE L1
BUILD_MAP 0
LOAD_FAST app
STORE_ATTR extens... | def init_app(self, app):
"""pass"""
if not hasattr(app, 'extensions'):
app.extensions = {}
app.extensions['flask-jwt-simple'] = self
self._set_default_configuration_options(app)
self._set_error_handler_callbacks(app)
app.config['PROPAGATE_EXCEPTIONS'] = True | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/jwt_manager.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "JWTManager.init_app",
"line_start": 40,
"line_end": 57,
"permalink": "https://github.... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | JWTManager.init_app | 40 | false |
455 | src/00455.py | pyc/00455.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _set_error_handler_callbacks>
MAKE_FUNCTION 0
STORE_NAME _set_error_handler_callbacks
RETURN_CONST None
END
CODE _set_error_handler_callbacks(self, app)
DOC 'pass'
MAKE_CELL self
RESUME 0
LOAD_FAST app
LOAD_ATTR NULL|self + errorhandler
LOAD_GLOBAL NoAutho... | def _set_error_handler_callbacks(self, app):
"""pass"""
@app.errorhandler(NoAuthorizationError)
def handle_no_auth_error(e):
return self._unauthorized_callback(str(e))
@app.errorhandler(InvalidHeaderError)
def handle_invalid_header_error(e):
return self._invalid_token_callback(str(... | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/jwt_manager.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "JWTManager._set_error_handler_callbacks",
"line_start": 59,
"line_end": 77,
"permalin... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | JWTManager._set_error_handler_callbacks | 95 | false |
456 | src/00456.py | pyc/00456.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _set_default_configuration_options>
MAKE_FUNCTION 0
STORE_NAME _set_default_configuration_options
RETURN_CONST None
END
CODE _set_default_configuration_options(app)
DOC 'pass'
RESUME 0
LOAD_FAST app
LOAD_ATTR config
LOAD_ATTR NULL|self + setdefault
LOAD_CO... | def _set_default_configuration_options(app):
"""pass"""
app.config.setdefault('JWT_HEADER_NAME', 'Authorization')
app.config.setdefault('JWT_HEADER_TYPE', 'Bearer')
app.config.setdefault('JWT_EXPIRES', datetime.timedelta(hours=1))
app.config.setdefault('JWT_ALGORITHM', 'HS256')
app.config.setdef... | {
"repo": "vimalloc/flask-jwt-simple",
"repo_url": "https://github.com/vimalloc/flask-jwt-simple",
"file_path": "flask_jwt_simple/jwt_manager.py",
"commit_sha": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"func_name": "JWTManager._set_default_configuration_options",
"line_start": 80,
"line_end": 109,
"p... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "36e516ef4f50bb157b9920aa74350751e923ab80",
"resolved_at_commit": "ed930340cfcff5a6ddc49248d4682e87204dd3be",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | vimalloc/flask-jwt-simple | JWTManager._set_default_configuration_options | 78 | false |
457 | src/00457.py | pyc/00457.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code category>
MAKE_FUNCTION 0
STORE_NAME category
RETURN_CONST None
END
CODE category(**kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 'series'
LOAD_FAST kwargs
CONTAINS_OP 0
POP_JUMP_IF_FALSE L1
LOAD_FAST kwargs
LOAD_ATTR NULL|self + pop
LOAD_CONST 'series'
C... | def category(**kwargs):
"""pass"""
if 'series' in kwargs:
kwargs.pop('series')
path = 'series'
else:
path = None
return Fred().category(path, **kwargs) | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/api.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "category",
"line_start": 18,
"line_end": 25,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586027dd75cbc... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | category | 37 | false |
458 | src/00458.py | pyc/00458.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code releases>
MAKE_FUNCTION defaults
STORE_NAME releases
RETURN_CONST None
END
CODE releases(release_id, **kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 'id'
LOAD_FAST kwargs
CONTAINS_OP 1
POP_JUMP_IF_FALSE L1
LOAD_FAST release_id
POP_JUMP_IF... | def releases(release_id=None, **kwargs):
"""pass"""
if not 'id' in kwargs and release_id is not None:
kwargs['release_id'] = release_id
return Fred().release(**kwargs)
return Fred().releases(**kwargs) | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/api.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "releases",
"line_start": 62,
"line_end": 67,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586027dd75cbc... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | releases | 42 | false |
459 | src/00459.py | pyc/00459.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code series>
MAKE_FUNCTION defaults
STORE_NAME series
RETURN_CONST None
END
CODE series(identifier, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST identifier
POP_JUMP_IF_FALSE L1
LOAD_FAST identifier
LOAD_FAST kwargs
LOAD_CONST 'series_id'
STO... | def series(identifier=None, **kwargs):
"""pass"""
if identifier:
kwargs['series_id'] = identifier
if 'release' in kwargs:
kwargs.pop('release')
path = 'release'
elif 'releases' in kwargs:
kwargs.pop('releases')
path = 'release'
else:
path = None
re... | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/api.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "series",
"line_start": 79,
"line_end": 91,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586027dd75cbc2f... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | series | 58 | false |
460 | src/00460.py | pyc/00460.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code source>
MAKE_FUNCTION defaults
STORE_NAME source
RETURN_CONST None
END
CODE source(source_id, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST source_id
POP_JUMP_IF_NONE L1
LOAD_FAST source_id
LOAD_FAST kwargs
LOAD_CONST 'source_id'
STORE_S... | def source(source_id=None, **kwargs):
"""pass"""
if source_id is not None:
kwargs['source_id'] = source_id
elif 'id' in kwargs:
source_id = kwargs.pop('id')
kwargs['source_id'] = source_id
if 'releases' in kwargs:
kwargs.pop('releases')
path = 'releases'
else:... | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/api.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "source",
"line_start": 124,
"line_end": 136,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586027dd75cbc... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | source | 60 | false |
461 | src/00461.py | pyc/00461.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None,)
LOAD_CONST <code sources>
MAKE_FUNCTION defaults
STORE_NAME sources
RETURN_CONST None
END
CODE sources(source_id, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST source_id
POP_JUMP_IF_TRUE L1
LOAD_CONST 'id'
LOAD_FAST kwargs
CONTAINS_OP 0
POP_JUMP_IF_FALSE... | def sources(source_id=None, **kwargs):
"""pass"""
if source_id or 'id' in kwargs:
return source(source_id, **kwargs)
return Fred().sources(**kwargs) | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/api.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "sources",
"line_start": 139,
"line_end": 143,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586027dd75cb... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | sources | 37 | false |
462 | src/00462.py | pyc/00462.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _create_path>
MAKE_FUNCTION 0
STORE_NAME _create_path
RETURN_CONST None
END
CODE _create_path(self, *args)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + filter
LOAD_CONST None
LOAD_FAST args
CALL 2
STORE_FAST args
LOAD_FAST self
LOAD_ATTR endpoint
LOAD_CO... | def _create_path(self, *args):
"""pass"""
args = filter(None, args)
path = self.endpoint + '/'.join(args)
return path | {
"repo": "zachwill/fred",
"repo_url": "https://github.com/zachwill/fred",
"file_path": "fred/core.py",
"commit_sha": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"func_name": "Fred._create_path",
"line_start": 32,
"line_end": 36,
"permalink": "https://github.com/zachwill/fred/blob/8fb8975e8b4fd8a550f586... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.md",
"blob_sha": "6833bd26725115927a70ccd946aad3f64589df42",
"resolved_at_commit": "8fb8975e8b4fd8a550f586027dd75cbc2fe225f0",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | zachwill/fred | Fred._create_path | 25 | false |
463 | src/00463.py | pyc/00463.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code item_extra_kwargs>
MAKE_FUNCTION 0
STORE_NAME item_extra_kwargs
RETURN_CONST None
END
CODE item_extra_kwargs(self, item)
DOC 'pass'
RESUME 0
LOAD_GLOBAL use_feed_image
POP_JUMP_IF_FALSE L2
LOAD_FAST item
LOAD_ATTR feed_image
STORE_FAST feed_image
LOAD_... | def item_extra_kwargs(self, item):
"""pass"""
if use_feed_image:
feed_image = item.feed_image
if feed_image:
image_complete_url = urljoin(self.get_site_url(), feed_image.file.url)
else:
image_complete_url = ''
content_field = getattr(item, self.item_content_fi... | {
"repo": "chrisdev/django-wagtail-feeds",
"repo_url": "https://github.com/chrisdev/django-wagtail-feeds",
"file_path": "wagtail_feeds/feeds.py",
"commit_sha": "df377afa7fc44316d1149183201461de2d8a99ca",
"func_name": "ExtendedFeed.item_extra_kwargs",
"line_start": 231,
"line_end": 270,
"permalink": "htt... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "3901f161276d4cbcbcf7304c060b157101bf8257",
"resolved_at_commit": "df377afa7fc44316d1149183201461de2d8a99ca",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | chrisdev/django-wagtail-feeds | ExtendedFeed.item_extra_kwargs | 134 | false |
464 | src/00464.py | pyc/00464.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code treenav_undefined_url>
MAKE_FUNCTION 0
STORE_NAME treenav_undefined_url
RETURN_CONST None
END
CODE treenav_undefined_url(request, item_slug)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + get_object_or_404
LOAD_GLOBAL treenav
LOAD_ATTR MenuItem
LOAD_FAST item_slug... | def treenav_undefined_url(request, item_slug):
"""pass"""
item = get_object_or_404(treenav.MenuItem, slug=item_slug)
raise Http404 | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/views.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "treenav_undefined_url",
"line_start": 7,
"line_end": 14,
"permalink": "https://github.com/caktus/django-tree... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | treenav_undefined_url | 19 | false |
465 | src/00465.py | pyc/00465.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code treenav_save_other_object_handler>
MAKE_FUNCTION 0
STORE_NAME treenav_save_other_object_handler
RETURN_CONST None
END
CODE treenav_save_other_object_handler(sender, instance, created, **kwargs)
DOC 'pass'
RESUME 0
LOAD_CONST 0
LOAD_CONST ('ContentType',)
IMP... | def treenav_save_other_object_handler(sender, instance, created, **kwargs):
"""pass"""
from django.contrib.contenttypes.models import ContentType
from .models import MenuItem
cache_key = 'django-treenav-menumodels'
if sender == MenuItem:
cache.delete(cache_key)
menu_models = cache.get(ca... | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/signals.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "treenav_save_other_object_handler",
"line_start": 5,
"line_end": 29,
"permalink": "https://github.com/cakt... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | treenav_save_other_object_handler | 119 | false |
466 | src/00466.py | pyc/00466.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code refresh_hrefs>
MAKE_FUNCTION 0
STORE_NAME refresh_hrefs
RETURN_CONST None
END
CODE refresh_hrefs(self, request)
DOC 'pass'
RESUME 0
LOAD_GLOBAL treenav
LOAD_ATTR MenuItem
LOAD_ATTR objects
LOAD_ATTR NULL|self + all
CALL 0
GET_ITER
L1:
FOR_ITER L2
S... | def refresh_hrefs(self, request):
"""pass"""
for item in treenav.MenuItem.objects.all():
item.save()
self.message_user(request, _('Menu item HREFs refreshed successfully.'))
info = (self.model._meta.app_label, self.model._meta.model_name)
changelist_url = reverse('admin:%s_%s_changelist' % i... | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/admin.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "MenuItemAdmin.refresh_hrefs",
"line_start": 82,
"line_end": 91,
"permalink": "https://github.com/caktus/djan... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | MenuItemAdmin.refresh_hrefs | 58 | false |
467 | src/00467.py | pyc/00467.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code clean_cache>
MAKE_FUNCTION 0
STORE_NAME clean_cache
RETURN_CONST None
END
CODE clean_cache(self, request)
DOC 'pass'
RESUME 0
LOAD_GLOBAL treenav
LOAD_ATTR NULL|self + delete_cache
CALL 0
POP_TOP
LOAD_FAST self
LOAD_ATTR NULL|self + message_user
LOAD... | def clean_cache(self, request):
"""pass"""
treenav.delete_cache()
self.message_user(request, _('Cache menuitem cache cleaned successfully.'))
info = (self.model._meta.app_label, self.model._meta.model_name)
changelist_url = reverse('admin:%s_%s_changelist' % info, current_app=self.admin_site.name)
... | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/admin.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "MenuItemAdmin.clean_cache",
"line_start": 93,
"line_end": 101,
"permalink": "https://github.com/caktus/djang... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | MenuItemAdmin.clean_cache | 46 | false |
468 | src/00468.py | pyc/00468.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code rebuild_tree>
MAKE_FUNCTION 0
STORE_NAME rebuild_tree
RETURN_CONST None
END
CODE rebuild_tree(self, request)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR model
LOAD_ATTR objects
LOAD_ATTR NULL|self + rebuild
CALL 0
POP_TOP
LOAD_FAST self
LOAD_ATTR ... | def rebuild_tree(self, request):
"""pass"""
self.model.objects.rebuild()
self.message_user(request, _('Menu Tree Rebuilt.'))
return self.clean_cache(request) | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/admin.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "MenuItemAdmin.rebuild_tree",
"line_start": 103,
"line_end": 109,
"permalink": "https://github.com/caktus/dja... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | MenuItemAdmin.rebuild_tree | 29 | false |
469 | src/00469.py | pyc/00469.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code save_related>
MAKE_FUNCTION 0
STORE_NAME save_related
RETURN_CONST None
END
CODE save_related(self, request, form, formsets, change)
DOC 'pass'
RESUME 0
LOAD_GLOBAL super
LOAD_GLOBAL MenuItemAdmin
LOAD_FAST self
LOAD_SUPER_ATTR NULL|self + save_related
L... | def save_related(self, request, form, formsets, change):
"""pass"""
super(MenuItemAdmin, self).save_related(request, form, formsets, change)
self.model.objects.rebuild() | {
"repo": "caktus/django-treenav",
"repo_url": "https://github.com/caktus/django-treenav",
"file_path": "treenav/admin.py",
"commit_sha": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"func_name": "MenuItemAdmin.save_related",
"line_start": 111,
"line_end": 116,
"permalink": "https://github.com/caktus/dja... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE.txt",
"blob_sha": "316c5d1055a328dc8e15c1ace121d6d8c2a9f89a",
"resolved_at_commit": "8f81619a8598790d1c2dc7bf77ba9d8e9e9564e6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | caktus/django-treenav | MenuItemAdmin.save_related | 27 | false |
470 | src/00470.py | pyc/00470.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'labels'
LOAD_NAME np
LOAD_ATTR ndarray
LOAD_CONST 'centroids'
LOAD_NAME np
LOAD_ATTR ndarray
LOAD_CONST 'return'
LOA... | def _calculate_dispersion(X: Union[pd.DataFrame, np.ndarray], labels: np.ndarray, centroids: np.ndarray) -> float:
"""pass"""
disp = np.sum(np.sum([np.abs(inst - centroids[label]) ** 2 for inst, label in zip(X, labels)]))
return disp | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._calculate_dispersion",
"line_start": 91,
"line_end": 96,
"permalink": "https://... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._calculate_dispersion | 79 | true |
471 | src/00471.py | pyc/00471.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'n_refs'
LOAD_NAME int
LOAD_CONST 'n_clusters'
LOAD_NAME int
LOAD_CONST 'return'
LOAD_NAME Tuple
LOAD_NAME float
LOAD... | def _calculate_gap(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, n_clusters: int) -> Tuple[float, int]:
"""pass"""
ref_dispersions = np.zeros(n_refs)
for i in range(n_refs):
random_data = np.random.random_sample(size=X.shape)
centroids, labels = kmeans2(data=random_data, k=n_cluster... | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._calculate_gap",
"line_start": 98,
"line_end": 127,
"permalink": "https://github... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._calculate_gap | 112 | true |
472 | src/00472.py | pyc/00472.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'n_refs'
LOAD_NAME int
LOAD_CONST 'cluster_array'
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 6
LOAD_CONST <code _proces... | def _process_with_rust(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
"""pass"""
from gap_statistic.rust import gapstat
for label, gap_value in gapstat.optimal_k(X, list(cluster_array)):
yield (gap_value, label) | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._process_with_rust",
"line_start": 129,
"line_end": 135,
"permalink": "https://g... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._process_with_rust | 61 | true |
473 | src/00473.py | pyc/00473.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'n_refs'
LOAD_NAME int
LOAD_CONST 'cluster_array'
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 6
LOAD_CONST <code _proces... | def _process_with_joblib(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
"""pass"""
if Parallel is None:
raise EnvironmentError('joblib is not installed; cannot use joblib as the parallel backend!')
with Parallel(n_jobs=self.n_jobs) as parallel:
for gap_val... | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._process_with_joblib",
"line_start": 137,
"line_end": 147,
"permalink": "https:/... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._process_with_joblib | 137 | true |
474 | src/00474.py | pyc/00474.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'n_refs'
LOAD_NAME int
LOAD_CONST 'cluster_array'
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 6
LOAD_CONST <code _proces... | def _process_with_multiprocessing(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
"""pass"""
with ProcessPoolExecutor(max_workers=self.n_jobs) as executor:
jobs = [executor.submit(self._calculate_gap, X, n_refs, n_clusters) for n_clusters in cluster_array]
for ... | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._process_with_multiprocessing",
"line_start": 149,
"line_end": 161,
"permalink":... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._process_with_multiprocessing | 125 | true |
475 | src/00475.py | pyc/00475.pyc | CODE <module>()
DOC 'X'
RESUME 0
LOAD_CONST 'X'
LOAD_NAME Union
LOAD_NAME pd
LOAD_ATTR DataFrame
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 2
BINARY_SUBSCR
LOAD_CONST 'n_refs'
LOAD_NAME int
LOAD_CONST 'cluster_array'
LOAD_NAME np
LOAD_ATTR ndarray
BUILD_TUPLE 6
LOAD_CONST <code _proces... | def _process_non_parallel(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
"""pass"""
for gap_value, n_clusters in [self._calculate_gap(X, n_refs, n_clusters) for n_clusters in cluster_array]:
yield (gap_value, n_clusters) | {
"repo": "milesgranger/gap_statistic",
"repo_url": "https://github.com/milesgranger/gap_statistic",
"file_path": "gap_statistic/optimalK.py",
"commit_sha": "146f868febfac37823114e87819df5e8bfc16ac8",
"func_name": "OptimalK._process_non_parallel",
"line_start": 163,
"line_end": 169,
"permalink": "https:... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "a3e2c0f1dd9a00ace7e9eec10a37f939079f0190",
"resolved_at_commit": "146f868febfac37823114e87819df5e8bfc16ac8",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | milesgranger/gap_statistic | OptimalK._process_non_parallel | 79 | true |
476 | src/00476.py | pyc/00476.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_last>
MAKE_FUNCTION 0
STORE_NAME get_last
RETURN_CONST None
END
CODE get_last(self)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + table
CALL 0
LOAD_ATTR NULL|self + where
LOAD_CONST 'batch'
LOAD_FAST self
LOAD_ATTR NULL|self + get_last... | def get_last(self):
"""pass"""
query = self.table().where('batch', self.get_last_batch_number())
return query.order_by('migration', 'desc').get() | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/migrations/database_migration_repository.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "DatabaseMigrationRepository.get_last",
"line_start": 25,
"line_end": 33,
"perm... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | DatabaseMigrationRepository.get_last | 28 | false |
477 | src/00477.py | pyc/00477.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code compile_insert>
MAKE_FUNCTION 0
STORE_NAME compile_insert
RETURN_CONST None
END
CODE compile_insert(self, query, values)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + wrap_table
LOAD_FAST query
LOAD_ATTR from__
CALL 1
STORE_FAST table
LOAD... | def compile_insert(self, query, values):
"""pass"""
table = self.wrap_table(query.from__)
if not isinstance(values, list):
values = [values]
columns = self.columnize(values[0].keys())
parameters = self.parameterize(values[0].values())
value = ['(%s)' % parameters] * len(values)
param... | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/query/grammars/grammar.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "QueryGrammar.compile_insert",
"line_start": 312,
"line_end": 344,
"permalink": "https://github.c... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | QueryGrammar.compile_insert | 68 | false |
478 | src/00478.py | pyc/00478.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code get_alter_table_sql>
MAKE_FUNCTION 0
STORE_NAME get_alter_table_sql
RETURN_CONST None
END
CODE get_alter_table_sql(self, diff)
DOC 'pass'
RESUME 0
BUILD_LIST 0
STORE_FAST sql
LOAD_FAST diff
LOAD_ATTR changed_columns
LOAD_ATTR NULL|self + values
CALL 0
... | def get_alter_table_sql(self, diff):
"""pass"""
sql = []
for column_diff in diff.changed_columns.values():
if self.is_unchanged_binary_column(column_diff):
continue
old_column_name = column_diff.old_column_name
column = column_diff.column
if any([column_diff.has_c... | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/dbal/platforms/postgres_platform.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "PostgresPlatform.get_alter_table_sql",
"line_start": 117,
"line_end": 180,
"permalink"... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | PostgresPlatform.get_alter_table_sql | 319 | false |
479 | src/00479.py | pyc/00479.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _date_based_where>
MAKE_FUNCTION 0
STORE_NAME _date_based_where
RETURN_CONST None
END
CODE _date_based_where(self, type, query, where)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + str
LOAD_FAST where
LOAD_CONST 'value'
BINARY_SUBSCR
CALL 1
LOAD_ATTR NULL|sel... | def _date_based_where(self, type, query, where):
"""pass"""
value = str(where['value']).zfill(2)
value = self.parameter(value)
return "strftime('%s', %s) %s %s" % (type, self.wrap(where['column']), where['operator'], value) | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/query/grammars/sqlite_grammar.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "SQLiteQueryGrammar._date_based_where",
"line_start": 114,
"line_end": 135,
"permalink": "... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | SQLiteQueryGrammar._date_based_where | 45 | false |
480 | src/00480.py | pyc/00480.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code compile_select>
MAKE_FUNCTION 0
STORE_NAME compile_select
RETURN_CONST None
END
CODE compile_select(self, query)
DOC 'pass'
RESUME 0
LOAD_GLOBAL super
LOAD_GLOBAL MySqlQueryGrammar
LOAD_FAST self
LOAD_SUPER_ATTR NULL|self + compile_select
LOAD_FAST query... | def compile_select(self, query):
"""pass"""
sql = super(MySqlQueryGrammar, self).compile_select(query)
if query.unions:
sql = '(%s) %s' % (sql, self._compile_unions(query))
return sql | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/query/grammars/mysql_grammar.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "MySqlQueryGrammar.compile_select",
"line_start": 23,
"line_end": 38,
"permalink": "https:/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | MySqlQueryGrammar.compile_select | 34 | false |
481 | src/00481.py | pyc/00481.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _compile_lock>
MAKE_FUNCTION 0
STORE_NAME _compile_lock
RETURN_CONST None
END
CODE _compile_lock(self, query, value)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + isinstance
LOAD_FAST value
LOAD_GLOBAL basestring
CALL 2
POP_JUMP_IF_FALSE L1
LOAD_FAST value
... | def _compile_lock(self, query, value):
"""pass"""
if isinstance(value, basestring):
return value
if value is True:
return 'FOR UPDATE'
elif value is False:
return 'LOCK IN SHARE MODE' | {
"repo": "sdispater/eloquent",
"repo_url": "https://github.com/sdispater/eloquent",
"file_path": "eloquent/query/grammars/mysql_grammar.py",
"commit_sha": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"func_name": "MySqlQueryGrammar._compile_lock",
"line_start": 57,
"line_end": 76,
"permalink": "https://... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE",
"blob_sha": "701df228d97e9bf3f2b10c5634107daff2f7bd3d",
"resolved_at_commit": "0638b688d5fd0c1a46b7471dd465eeb4c2f84666",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | sdispater/eloquent | MySqlQueryGrammar._compile_lock | 31 | false |
482 | src/00482.py | pyc/00482.pyc | CODE <module>()
DOC 'Modality'
RESUME 0
LOAD_CONST ('Modality', '$\\log_2 K$')
LOAD_CONST <code plot_best_worst_fits>
MAKE_FUNCTION defaults
STORE_NAME plot_best_worst_fits
RETURN_CONST None
END
CODE plot_best_worst_fits(assignments_df, data, modality_col, score)
DOC 'pass'
RESUME 0
LOAD_CONST 2
S... | def plot_best_worst_fits(assignments_df, data, modality_col='Modality', score='$\\log_2 K$'):
"""pass"""
ncols = 2
nrows = len(assignments_df.groupby(modality_col).groups.keys())
fig, axes = plt.subplots(nrows=nrows, ncols=ncols, figsize=(nrows * 4, ncols * 6))
axes_iter = axes.flat
fits = ('Hig... | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/simulate.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "plot_best_worst_fits",
"line_start": 158,
"line_end": 194,
"permalink": "https://github.com/YeoLab/anchor/blob/1f9c9d6d302... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | plot_best_worst_fits | 156 | false |
483 | src/00483.py | pyc/00483.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None, None, None, 0.2, 'width', None, None)
LOAD_CONST <code violinplot>
MAKE_FUNCTION defaults
STORE_NAME violinplot
RETURN_CONST None
END
CODE violinplot(x, y, data, bw, scale, inner, ax, **kwargs)
DOC 'pass'
RESUME 0
LOAD_FAST ax
POP_JUMP_IF_NOT_NONE L1
LOAD... | def violinplot(x=None, y=None, data=None, bw=0.2, scale='width', inner=None, ax=None, **kwargs):
"""pass"""
if ax is None:
ax = plt.gca()
sns.violinplot(x, y, data=data, bw=bw, scale=scale, inner=inner, ax=ax, **kwargs)
ax.set(ylim=(0, 1), yticks=(0, 0.5, 1))
return ax | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/visualize.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "violinplot",
"line_start": 33,
"line_end": 48,
"permalink": "https://github.com/YeoLab/anchor/blob/1f9c9d6d30235b1e77b945... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | violinplot | 43 | false |
484 | src/00484.py | pyc/00484.pyc | CODE <module>()
RESUME 0
LOAD_CONST (None, None, True)
LOAD_CONST <code bar>
MAKE_FUNCTION defaults
STORE_NAME bar
RETURN_CONST None
END
CODE bar(self, counts, phenotype_to_color, ax, percentages)
DOC 'pass'
RESUME 0
LOAD_FAST percentages
POP_JUMP_IF_FALSE L1
LOAD_CONST 100
LOAD_FAST counts
LO... | def bar(self, counts, phenotype_to_color=None, ax=None, percentages=True):
"""pass"""
if percentages:
counts = 100 * (counts.T / counts.T.sum()).T
if ax is None:
ax = plt.gca()
full_width = 0.8
width = full_width / counts.shape[0]
for i, (group, series) in enumerate(counts.iterro... | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/visualize.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "ModalitiesViz.bar",
"line_start": 110,
"line_end": 149,
"permalink": "https://github.com/YeoLab/anchor/blob/1f9c9d6d30235... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | ModalitiesViz.bar | 188 | false |
485 | src/00485.py | pyc/00485.pyc | CODE <module>()
DOC ''
RESUME 0
LOAD_CONST ('',)
LOAD_CONST <code event_estimation>
MAKE_FUNCTION defaults
STORE_NAME event_estimation
RETURN_CONST None
END
CODE event_estimation(self, event, logliks, logsumexps, renamed)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + _ModelLoglikPlotter
CALL 0
STORE_FA... | def event_estimation(self, event, logliks, logsumexps, renamed=''):
"""pass"""
plotter = _ModelLoglikPlotter()
plotter.plot(event, logliks, logsumexps, self.modality_to_color, renamed=renamed)
return plotter | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/visualize.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "ModalitiesViz.event_estimation",
"line_start": 151,
"line_end": 168,
"permalink": "https://github.com/YeoLab/anchor/blob/... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | ModalitiesViz.event_estimation | 28 | false |
486 | src/00486.py | pyc/00486.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code predict>
MAKE_FUNCTION 0
STORE_NAME predict
RETURN_CONST None
END
CODE predict(self, fitted)
DOC 'pass'
RESUME 0
LOAD_FAST fitted
LOAD_ATTR shape
LOAD_CONST 0
BINARY_SUBSCR
LOAD_GLOBAL NULL + len
LOAD_FAST self
LOAD_ATTR modalities
CALL 1
COMPARE... | def predict(self, fitted):
"""pass"""
if fitted.shape[0] != len(self.modalities):
raise ValueError("This data doesn't look like it had the distance between it and the five modalities calculated")
return fitted.idxmin() | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/binning.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "BinnedModalities.predict",
"line_start": 37,
"line_end": 50,
"permalink": "https://github.com/YeoLab/anchor/blob/1f9c9d6d30... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | BinnedModalities.predict | 29 | false |
487 | src/00487.py | pyc/00487.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code logliks>
MAKE_FUNCTION 0
STORE_NAME logliks
RETURN_CONST None
END
CODE logliks(self, x)
DOC 'pass'
RESUME 0
LOAD_FAST x
LOAD_ATTR NULL|self + copy
CALL 0
STORE_FAST x
LOAD_GLOBAL VERY_SMALL_NUMBER
LOAD_FAST x
LOAD_FAST x
LOAD_CONST 0
COMPARE_OP =... | def logliks(self, x):
"""pass"""
x = x.copy()
x[x == 0] = VERY_SMALL_NUMBER
x[x == 1] = 1 - VERY_SMALL_NUMBER
return np.array([np.log(prob) + rv.logpdf(x[np.isfinite(x)]).sum() for prob, rv in zip(self.prob_parameters, self.rvs)]) | {
"repo": "YeoLab/anchor",
"repo_url": "https://github.com/YeoLab/anchor",
"file_path": "anchor/model.py",
"commit_sha": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"func_name": "ModalityModel.logliks",
"line_start": 71,
"line_end": 97,
"permalink": "https://github.com/YeoLab/anchor/blob/1f9c9d6d30235b1... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "15d9f3b92db59f3c266e7be850fc8618fdeda8d3",
"resolved_at_commit": "1f9c9d6d30235b1e77b945e6ef01db5a0e55d53a",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | YeoLab/anchor | ModalityModel.logliks | 82 | false |
488 | src/00488.py | pyc/00488.pyc | CODE <module>()
DOC 'default'
RESUME 0
LOAD_CONST ('default', 1, None)
LOAD_CONST False
LOAD_CONST None
LOAD_CONST ('nowait', 'using')
BUILD_CONST_KEY_MAP 2
LOAD_CONST <code get_next_value>
MAKE_FUNCTION defaults, kwdefaults
STORE_NAME get_next_value
RETURN_CONST None
END
CODE get_next_value(seque... | def get_next_value(sequence_name='default', initial_value=1, reset_value=None, *, nowait=False, using=None):
"""pass"""
from .models import Sequence
if reset_value is not None:
assert initial_value < reset_value
if using is None:
using = router.db_for_write(Sequence)
connection = con... | {
"repo": "aaugustin/django-sequences",
"repo_url": "https://github.com/aaugustin/django-sequences",
"file_path": "sequences/__init__.py",
"commit_sha": "0228ae003540ccb63be4a456fb8f63a2f4038de6",
"func_name": "get_next_value",
"line_start": 13,
"line_end": 59,
"permalink": "https://github.com/aaugustin... | {
"spdx": "BSD-3-Clause",
"name": "BSD 3-Clause \"New\" or \"Revised\" License",
"file": "LICENSE",
"blob_sha": "ad0a5aa23297743432d449a1f49380af55c06a4e",
"resolved_at_commit": "0228ae003540ccb63be4a456fb8f63a2f4038de6",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | aaugustin/django-sequences | get_next_value | 180 | false |
489 | src/00489.py | pyc/00489.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code check>
MAKE_FUNCTION 0
STORE_NAME check
RETURN_CONST None
END
CODE check(self, final_line_count)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR _lines_seen
LOAD_CONST 'version'
BINARY_SUBSCR
POP_JUMP_IF_FALSE L1
LOAD_FAST self
LOAD_ATTR NULL|self + _pr... | def check(self, final_line_count):
"""pass"""
if self._lines_seen['version']:
self._process_version_lines()
self._process_plan_lines(final_line_count) | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules.check",
"line_start": 15,
"line_end": 19,
"permalink": "https://github.com/python-tap/tappy/blob/79a749313c61ea94ee4... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules.check | 26 | false |
490 | src/00490.py | pyc/00490.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _process_version_lines>
MAKE_FUNCTION 0
STORE_NAME _process_version_lines
RETURN_CONST None
END
CODE _process_version_lines(self)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + len
LOAD_FAST self
LOAD_ATTR _lines_seen
LOAD_CONST 'version'
BINARY_SUBSCR
CALL 1
... | def _process_version_lines(self):
"""pass"""
if len(self._lines_seen['version']) > 1:
self._add_error(_('Multiple version lines appeared.'))
elif self._lines_seen['version'][0] != 1:
self._add_error(_('The version must be on the first line.')) | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules._process_version_lines",
"line_start": 21,
"line_end": 26,
"permalink": "https://github.com/python-tap/tappy/blob/79... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules._process_version_lines | 47 | false |
491 | src/00491.py | pyc/00491.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _process_plan_lines>
MAKE_FUNCTION 0
STORE_NAME _process_plan_lines
RETURN_CONST None
END
CODE _process_plan_lines(self, final_line_count)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR _lines_seen
LOAD_CONST 'plan'
BINARY_SUBSCR
POP_JUMP_IF_TRUE L1
LOAD... | def _process_plan_lines(self, final_line_count):
"""pass"""
if not self._lines_seen['plan']:
self._add_error(_('Missing a plan.'))
return
if len(self._lines_seen['plan']) > 1:
self._add_error(_('Only one plan line is permitted per file.'))
return
plan, at_line = self._lin... | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules._process_plan_lines",
"line_start": 28,
"line_end": 51,
"permalink": "https://github.com/python-tap/tappy/blob/79a74... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules._process_plan_lines | 93 | false |
492 | src/00492.py | pyc/00492.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code _plan_on_valid_line>
MAKE_FUNCTION 0
STORE_NAME _plan_on_valid_line
RETURN_CONST None
END
CODE _plan_on_valid_line(self, at_line, final_line_count)
DOC 'pass'
RESUME 0
LOAD_FAST at_line
LOAD_CONST 1
COMPARE_OP ==
POP_JUMP_IF_TRUE L1
LOAD_FAST at_line
L... | def _plan_on_valid_line(self, at_line, final_line_count):
"""pass"""
if at_line == 1 or at_line == final_line_count:
return True
after_version = self._lines_seen['version'] and self._lines_seen['version'][0] == 1 and (at_line == 2)
if after_version:
return True
return False | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules._plan_on_valid_line",
"line_start": 53,
"line_end": 68,
"permalink": "https://github.com/python-tap/tappy/blob/79a74... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules._plan_on_valid_line | 49 | false |
493 | src/00493.py | pyc/00493.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code handle_bail>
MAKE_FUNCTION 0
STORE_NAME handle_bail
RETURN_CONST None
END
CODE handle_bail(self, bail)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR NULL|self + _add_error
LOAD_GLOBAL NULL + _
LOAD_CONST 'Bailed: {reason}'
CALL 1
LOAD_ATTR NULL|self + f... | def handle_bail(self, bail):
"""pass"""
self._add_error(_('Bailed: {reason}').format(reason=bail.reason)) | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules.handle_bail",
"line_start": 70,
"line_end": 72,
"permalink": "https://github.com/python-tap/tappy/blob/79a749313c61e... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules.handle_bail | 23 | false |
494 | src/00494.py | pyc/00494.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code handle_skipping_plan>
MAKE_FUNCTION 0
STORE_NAME handle_skipping_plan
RETURN_CONST None
END
CODE handle_skipping_plan(self, skip_plan)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + Result
LOAD_CONST True
LOAD_CONST None
LOAD_FAST skip_plan
LOAD_ATTR directive
... | def handle_skipping_plan(self, skip_plan):
"""pass"""
skip_line = Result(True, None, skip_plan.directive.text, Directive('SKIP'))
self._suite.addTest(Adapter(self._filename, skip_line)) | {
"repo": "python-tap/tappy",
"repo_url": "https://github.com/python-tap/tappy",
"file_path": "tap/rules.py",
"commit_sha": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"func_name": "Rules.handle_skipping_plan",
"line_start": 78,
"line_end": 81,
"permalink": "https://github.com/python-tap/tappy/blob/79a7... | {
"spdx": "BSD-2-Clause",
"name": "BSD 2-Clause \"Simplified\" License",
"file": "LICENSE",
"blob_sha": "852b81e477557dc43881c45e1282b2e02aebfa18",
"resolved_at_commit": "79a749313c61ea94ee49d67ba6a1534974bc03aa",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | python-tap/tappy | Rules.handle_skipping_plan | 32 | false |
495 | src/00495.py | pyc/00495.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code mptt_before_insert>
MAKE_FUNCTION 0
STORE_NAME mptt_before_insert
RETURN_CONST None
END
CODE mptt_before_insert(mapper, connection, instance)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + _get_tree_table
LOAD_FAST mapper
CALL 1
STORE_FAST table
LOAD_FAST instan... | def mptt_before_insert(mapper, connection, instance):
"""pass"""
table = _get_tree_table(mapper)
db_pk = instance.get_pk_column()
table_pk = getattr(table.c, db_pk.name)
if instance.parent_id is None:
instance.left = 1
instance.right = 2
instance.level = instance.get_default_... | {
"repo": "uralbash/sqlalchemy_mptt",
"repo_url": "https://github.com/uralbash/sqlalchemy_mptt",
"file_path": "sqlalchemy_mptt/events.py",
"commit_sha": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"func_name": "mptt_before_insert",
"line_start": 83,
"line_end": 150,
"permalink": "https://github.com/ural... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "a73581adf7eee2704fcd14cc30764b2a012c49c0",
"resolved_at_commit": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | uralbash/sqlalchemy_mptt | mptt_before_insert | 170 | false |
496 | src/00496.py | pyc/00496.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code mptt_before_update>
MAKE_FUNCTION 0
STORE_NAME mptt_before_update
RETURN_CONST None
END
CODE mptt_before_update(mapper, connection, instance)
DOC 'pass'
RESUME 0
LOAD_GLOBAL NULL + getattr
LOAD_FAST instance
LOAD_FAST instance
LOAD_ATTR NULL|self + get_pk_... | def mptt_before_update(mapper, connection, instance):
"""pass"""
node_id = getattr(instance, instance.get_pk_name())
table = _get_tree_table(mapper)
db_pk = instance.get_pk_column()
default_level = instance.get_default_level()
table_pk = getattr(table.c, db_pk.name)
mptt_move_inside = None
... | {
"repo": "uralbash/sqlalchemy_mptt",
"repo_url": "https://github.com/uralbash/sqlalchemy_mptt",
"file_path": "sqlalchemy_mptt/events.py",
"commit_sha": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"func_name": "mptt_before_update",
"line_start": 221,
"line_end": 479,
"permalink": "https://github.com/ura... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "a73581adf7eee2704fcd14cc30764b2a012c49c0",
"resolved_at_commit": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | uralbash/sqlalchemy_mptt | mptt_before_update | 536 | false |
497 | src/00497.py | pyc/00497.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code after_flush_postexec>
MAKE_FUNCTION 0
STORE_NAME after_flush_postexec
RETURN_CONST None
END
CODE after_flush_postexec(self, session, context)
DOC 'pass'
RESUME 0
LOAD_FAST self
LOAD_ATTR instances
LOAD_FAST session
BINARY_SUBSCR
STORE_FAST instances
L1:
... | def after_flush_postexec(self, session, context):
"""pass"""
instances = self.instances[session]
while instances:
instance = instances.pop()
if instance not in session:
continue
parent = self.get_parent_value(instance)
while parent != NO_VALUE and parent is not No... | {
"repo": "uralbash/sqlalchemy_mptt",
"repo_url": "https://github.com/uralbash/sqlalchemy_mptt",
"file_path": "sqlalchemy_mptt/events.py",
"commit_sha": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"func_name": "TreesManager.after_flush_postexec",
"line_start": 586,
"line_end": 604,
"permalink": "https:/... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "a73581adf7eee2704fcd14cc30764b2a012c49c0",
"resolved_at_commit": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | uralbash/sqlalchemy_mptt | TreesManager.after_flush_postexec | 88 | false |
498 | src/00498.py | pyc/00498.pyc | CODE <module>()
RESUME 0
LOAD_CONST (False,)
LOAD_CONST <code is_ancestor_of>
MAKE_FUNCTION defaults
STORE_NAME is_ancestor_of
RETURN_CONST None
END
CODE is_ancestor_of(self, other, inclusive)
DOC 'pass'
RESUME 0
LOAD_FAST inclusive
POP_JUMP_IF_FALSE L1
LOAD_FAST self
LOAD_ATTR tree_id
LOAD_FA... | def is_ancestor_of(self, other, inclusive=False):
"""pass"""
if inclusive:
return (self.tree_id == other.tree_id) & (self.left <= other.left) & (other.right <= self.right)
return (self.tree_id == other.tree_id) & (self.left < other.left) & (other.right < self.right) | {
"repo": "uralbash/sqlalchemy_mptt",
"repo_url": "https://github.com/uralbash/sqlalchemy_mptt",
"file_path": "sqlalchemy_mptt/mixins.py",
"commit_sha": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"func_name": "BaseNestedSets.is_ancestor_of",
"line_start": 124,
"line_end": 139,
"permalink": "https://git... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "a73581adf7eee2704fcd14cc30764b2a012c49c0",
"resolved_at_commit": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | uralbash/sqlalchemy_mptt | BaseNestedSets.is_ancestor_of | 50 | false |
499 | src/00499.py | pyc/00499.pyc | CODE <module>()
RESUME 0
LOAD_CONST <code move_inside>
MAKE_FUNCTION 0
STORE_NAME move_inside
RETURN_CONST None
END
CODE move_inside(self, parent_id)
DOC 'pass'
RESUME 0
LOAD_GLOBAL Session
LOAD_ATTR NULL|self + object_session
LOAD_FAST self
CALL 1
STORE_FAST session
LOAD_FAST parent_id
LOAD... | def move_inside(self, parent_id):
"""pass"""
session = Session.object_session(self)
self.parent_id = parent_id
self.mptt_move_inside = parent_id
session.add(self) | {
"repo": "uralbash/sqlalchemy_mptt",
"repo_url": "https://github.com/uralbash/sqlalchemy_mptt",
"file_path": "sqlalchemy_mptt/mixins.py",
"commit_sha": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"func_name": "BaseNestedSets.move_inside",
"line_start": 153,
"line_end": 164,
"permalink": "https://github... | {
"spdx": "MIT",
"name": "MIT License",
"file": "LICENSE.txt",
"blob_sha": "a73581adf7eee2704fcd14cc30764b2a012c49c0",
"resolved_at_commit": "2971c9fa49bbeaa3e2fb96229d933ceae450b319",
"resolved_via": "GitHub GET /repos/{repo}/license?ref={sha}"
} | uralbash/sqlalchemy_mptt | BaseNestedSets.move_inside | 27 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.