src stringlengths 75 47.4k | cfg stringlengths 32 2.5k | ast stringlengths 78 54.9k |
|---|---|---|
def findArgs(args, prefixes):
"""
Extracts the list of arguments that start with any of the specified prefix values
"""
return list([
arg for arg in args
if len([p for p in prefixes if arg.lower().startswith(p.lower())]) > 0
]) | [2][SEP1][Return][SEP2][][SEP3][5] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_RETURN_CALL_NAME_LOAD_LISTCOMP_NAME_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_COMPARE_CALL_NAME_LOAD_LISTCOMP_NAME_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_CALL_ATTRIBUTE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_GT_CONSTANT |
def buildDescriptor(self, dir=os.getcwd(), configuration='Development', args=[], suppressOutput=False):
"""
Builds the editor modules for the Unreal project or plugin in the specified directory, using the specified build configuration
"""
# Verify that an Unreal project or plugin exists in the specified dire... | [5][SEP1][If][Return][If][None][None][SEP2][1,2][][3,4][][][SEP3][4][2][1][1][5] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_LIST_LOAD_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_IFEXP_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_CONSTANT_CONSTANT_IF_COMPARE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CAL... |
def _getThirdPartyLibs(self, platformIdentifier, configuration):
"""
Runs UnrealBuildTool in JSON export mode and extracts the list of third-party libraries
"""
# If we have previously cached the library list for the current engine version, use the cached data
cachedList = CachedDataManager.getCachedDataKe... | [3][SEP1][If][Return][If][None][Try][None][Try][None][None][Return][SEP2][1,2][][3,4][4][5][6][7,8][9][9][][SEP3][1][0][5][1][1][1][4][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_IF_COMPARE_NAME_LOAD_NOTEQ_CONSTANT_RETURN_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_CONSTANT_... |
def set_command_attributes(self, name, attributes):
""" Sets the xml attributes of a specified command. """
if self.command_exists(name):
command = self.commands.get(name)
command['attributes'] = attributes | [3][SEP1][If][None][SEP2][1][][SEP3][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_IF_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_CONSTANT_STORE_NAME_LOAD |
def start_scan(self, scan_id, targets, parallel=1):
""" Handle N parallel scans if 'parallel' is greater than 1. """
os.setsid()
multiscan_proc = []
logger.info("%s: Scan started.", scan_id)
target_list = targets
if target_list is None or not target_list:
rai... | [4][SEP1][If][None][For][While][While][None][If][If][If][Return][None][None][None][None][SEP2][1,2][][3,4][5,6][7,8][3][9,10][11,12][13][][2][12][4][][SEP3][2][1][7][1][1][4][1][1][1][0][5][2][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_LIST_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD_ASSIGN_NAME_STORE_NAME_LOAD_IF_BOOLOP_OR_COMPARE_NAME_LOAD_IS_CONSTANT_UNARYOP_NOT_NAME_LOAD_RAISE_CALL_NAME_LOAD_CONSTANT_CONSTANT_FOR... |
def create_scan(self, scan_id, targets, options, vts):
""" Creates a new scan.
@target: Target to scan.
@options: Miscellaneous scan options.
@return: New scan's ID.
"""
if self.scan_exists(scan_id):
logger.info("Scan %s exists. Resuming scan.", scan_id)
... | [5][SEP1][If][None][Return][SEP2][1,2][2][][SEP3][1][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_EXPR_CONSTANT_IF_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD_RETURN_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD |
def target_to_list(target):
""" Attempt to return a list of single hosts from a target string. """
# Is it an IPv4 address ?
new_list = target_to_ipv4(target)
# Is it an IPv6 address ?
if not new_list:
new_list = target_to_ipv6(target)
# Is it an IPv4 CIDR ?
if not new_list:
... | [1][SEP1][If][None][If][None][If][None][If][None][If][None][If][None][If][None][If][None][Return][SEP2][1,2][2][3,4][4][5,6][6][7,8][8][9,10][10][11,12][12][13,14][14][15,16][16][][SEP3][1][1][0][1][0][1][0][1][0][1][0][1][0][1][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_IF_UNARYOP_NOT_NAME_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_IF_UNARYOP_NOT_NAME_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_IF_UNARYOP_NOT_NAME_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_IF_UNARYOP_NOT_NAME_LOAD_A... |
def create_scan(self, scan_id='', targets='', options=None, vts=''):
""" Creates a new scan with provided scan information. """
if self.data_manager is None:
self.data_manager = multiprocessing.Manager()
# Check if it is possible to resume task. To avoid to resume, the
# sc... | [5][SEP1][If][None][If][Return][If][None][If][None][Return][SEP2][1,2][2][3,4][][5,6][6][7,8][8][][SEP3][0][1][2][1][0][1][6][2][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_CONSTANT_CONSTANT_EXPR_CONSTANT_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_IS_CONSTANT_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_IF_BOOLOP_AND_NAME_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_COMPARE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOA... |
def write_gene_recs(self, db, gene_id):
"""
NOTE: The goal of this function is to have a canonical ordering when
outputting a gene and all of its records to a file. The order is
intended to be:
gene
# mRNAs sorted by length, with longest mRNA first
mRNA_1
... | [3][SEP1][None][For][None][None][For][None][For][If][None][SEP2][1][2,3][1][4][5,6][4][7][8,6][6][SEP3][3][1][3][2][0][2][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_SUBSCRIPT_NAME_LOAD_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_DICT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_KEYWORD_CONSTANT_FOR_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD... |
def sequence(self, fasta, use_strand=True):
"""
Retrieves the sequence of this feature as a string.
Uses the pyfaidx package.
Parameters
----------
fasta : str
If str, then it's a FASTA-format filename; otherwise assume it's
a pyfaidx.Fasta obje... | [3][SEP1][If][None][If][None][Return][SEP2][1,2][2][3,4][4][][SEP3][1][1][0][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_CONSTANT_EXPR_CONSTANT_IF_CALL_NAME_LOAD_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_KEYWORD_CONSTANT_ASSIGN_NAME_STORE_SUBSCRIPT_SUBSCRIPT_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_SLICE_BINOP_ATTRIBUTE_NAME_LOAD_LOAD_SUB_CONSTANT_ATTRIBUTE_NAME_... |
def _replace(self, feature, cursor):
"""
Insert a feature into the database.
"""
try:
cursor.execute(
constants._UPDATE,
list(feature.astuple()) + [feature.id])
except sqlite3.ProgrammingError:
cursor.execute(
... | [3][SEP1][Try][None][None][SEP2][1,2][][][SEP3][0][3][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_TRY_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_CALL_NAME_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ADD_LIST_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_EXCEPTHANDLER_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_CALL_N... |
def _proxy_kwargs(browser_name, proxy, browser_kwargs={}): # pylint: disable=dangerous-default-value
"""
Determines the kwargs needed to set up a proxy based on the
browser type.
Returns: a dictionary of arguments needed to pass when
instantiating the WebDriver instance.
"""
proxy_dic... | [3][SEP1][If][None][If][Return][None][None][SEP2][1,2][3][4,5][][5][3][SEP3][0][1][0][0][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_DICT_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_IF_BOOLOP_AND_COMPARE_NAME_LOAD_EQ_CONSTANT_COMPARE_CONSTANT_NOTIN_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_LOAD_NAME_LOAD_ASSIGN_SUBSCRIPT_NAM... |
def _parse_options(self, options):
"""Copy needed options to self"""
attributes = ('host', 'wapi_version', 'username', 'password',
'ssl_verify', 'http_request_timeout', 'max_retries',
'http_pool_connections', 'http_pool_maxsize',
'silent_... | [2][SEP1][None][For][If][For][None][If][If][None][None][If][None][None][None][SEP2][1][2,3][4,5][6,7][1][8,9][10,3][][1][11,12][][1][][SEP3][0][0][1][0][1][1][1][1][2][0][1][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_TUPLE_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_LOAD_FOR_NAME_STORE_NAME_LOAD_IF_BOOLOP_AND_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_COMPARE_NAME_LOAD_IN_NAME_LOAD_EXPR_CALL_NAME_LOA... |
def _sincedb_update_position(self, lines=0, force_update=False):
"""Retrieves the starting position from the sincedb sql db for a given file
Returns a boolean representing whether or not it updated the record
"""
if not self._sincedb_path:
return False
self._line_cou... | [3][SEP1][If][Return][If][If][Return][Return][If][Return][SEP2][1,2][][3,4][5,6][][][7,4][][SEP3][0][0][2][0][8][0][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_CONSTANT_CONSTANT_EXPR_CONSTANT_IF_UNARYOP_NOT_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CONSTANT_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_BINOP_ATTRIBUTE_NAME_LOAD_LOAD_ADD_NAME_LOAD_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME... |
def read(file_path):
""" Read a gmt file at the path specified by file_path.
Args:
file_path (string): path to gmt file
Returns:
gmt (GMT object): list of dicts, where each dict corresponds to one
line of the GMT file
"""
# Read in file
actual_file_path = os.path.e... | [1][SEP1][None][None][None][For][None][Return][None][None][SEP2][1][2][3][4,5][6][][7][3][SEP3][2][1][0][7][3][1][5][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_WITH_WITHITEM_CALL_NAME_LOAD_NAME_LOAD_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_LIST_LOAD_FOR_TUPLE_NAME_STORE_NAME_STORE_STORE_CALL_NAME_LOAD_NAME_LOAD_AS... |
def write_version_and_dims(version, dims, f):
"""Write first two lines of gct file.
Args:
version (string): 1.3 by default
dims (list of strings): length = 4
f (file handle): handle of output file
Returns:
nothing
"""
f.write(("#" + version + "\n"))
f.write((dims... | [3][SEP1][None][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_BINOP_CONSTANT_ADD_NAME_LOAD_ADD_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_BINOP_BINOP_BINOP_BINOP_BINOP_BINOP_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_ADD_CONSTANT_ADD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_ADD_CONSTANT_ADD_SUB... |
def read(in_path):
""" Read a grp file at the path specified by in_path.
Args:
in_path (string): path to GRP file
Returns:
grp (list)
"""
assert os.path.exists(in_path), "The following GRP file can't be found. in_path: {}".format(in_path)
with open(in_path, "r") as f:
... | [1][SEP1][None][None][None][Return][SEP2][1][2][3][][SEP3][2][1][3][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSERT_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_WITH_WITHITEM_CALL_NAME_LOAD_NAME_LOAD_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_LISTCOMP_CALL_ATTRIBUTE_NAME_LOAD_LOAD_COMPREHE... |
def timesince(when):
"""Returns string representing "time since" or "time until".
Examples:
3 days ago, 5 hours ago, 3 minutes from now, 5 hours from now, now.
"""
if not when:
return ''
now = datetime.datetime.utcnow()
if now > when:
diff = now - when
suffix = ... | [1][SEP1][If][Return][If][None][None][None][For][If][Return][Return][SEP2][1,2][][3,4][5][5][6][7,8][9,6][][][SEP3][0][0][1][0][0][0][0][0][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_IF_UNARYOP_NOT_NAME_LOAD_RETURN_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_IF_COMPARE_NAME_LOAD_GT_NAME_LOAD_ASSIGN_NAME_STORE_BINOP_NAME_LOAD_SUB_NAME_LOAD_ASSIGN_NAME_STORE_CONSTANT_ASSIGN_NAME_STORE_BINOP_NAME_LOAD_SUB_NAME_LOAD_ASSIGN_NAME_... |
def _get_artifact_context(run, file_type):
"""Gets the artifact details for the given run and file_type."""
sha1sum = None
image_file = False
log_file = False
config_file = False
if request.path == '/image':
image_file = True
if file_type == 'before':
sha1sum = run.r... | [2][SEP1][If][If][If][None][If][If][If][Return][None][If][None][If][If][None][None][None][If][None][If][None][None][None][None][SEP2][1,2][3,4][5,6][7][8,9][10,11][12,7][][7][13,14][7][15,16][17,18][7][7][7][19,20][7][21,22][7][7][7][7][SEP3][0][0][0][0][0][0][0][0][0][0][0][0][0][0][1][0][0][0][0][0][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_EQ_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_IF_COMPARE_NAME_LOAD_EQ_CONSTANT_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_IF_COMPARE... |
def verify_binary(flag_name, process_args=None):
"""Exits the program if the binary from the given flag doesn't run.
Args:
flag_name: Name of the flag that should be the path to the binary.
process_args: Args to pass to the binary to do nothing but verify
that it's working correctly... | [2][SEP1][If][None][If][None][None][Try][None][None][SEP2][1,2][2][3,4][4][5][6,7][][][SEP3][0][0][1][2][1][0][1][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_CONSTANT_EXPR_CONSTANT_IF_COMPARE_NAME_LOAD_IS_CONSTANT_ASSIGN_NAME_STORE_LIST_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_IF_UNARYOP_NOT_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_CONSTANT_MOD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_WITH_WITHITEM... |
def list(self, detail=False):
"""
A generator that yields information about each file in the upload area
:param detail: return detailed file information (slower)
:return: a list of dicts containing at least 'name', or more of detail was requested
"""
creds_provider = Cred... | [2][SEP1][None][For][If][None][None][For][None][SEP2][1][2][3,4][5][5][6,1][5][SEP3][3][1][0][1][0][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_KEYWORD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_KEYWORD_NAME_LOAD_ASSIGN_NAME_STORE_BINOP_ATTRIBUTE_NAME_LOAD_LOAD_ADD_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_FOR_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_... |
def select_area(self, area_uuid):
"""
Update the "current area" to be the area with this UUID.
:param str area_uuid: The RFC4122-compliant UUID of the Upload Area.
"""
self._config.upload.current_area = area_uuid
self.save() | [2][SEP1][None][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_ATTRIBUTE_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_STORE_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD |
def safe_read_file(file_path: Path) -> str:
"""Read a text file. Several text encodings are tried until
the file content is correctly decoded.
:raise GuesslangError: when the file encoding is not supported
:param file_path: path to the input file
:return: text file content
"""
for encoding ... | [1][SEP1][None][For][Try][None][Return][None][SEP2][1][2,3][4,5][][][1][SEP3][0][0][0][2][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_NAME_LOAD_EXPR_CONSTANT_FOR_NAME_STORE_NAME_LOAD_TRY_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_NAME_LOAD_EXCEPTHANDLER_NAME_LOAD_PASS_RAISE_CALL_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_NAME_LOAD |
def make_relative(cls, course_locator, block_type, block_id):
"""
Return a new instance which has the given block_id in the given course
:param course_locator: may be a BlockUsageLocator in the same snapshot
"""
if hasattr(course_locator, 'course_key'):
course_locator... | [4][SEP1][If][None][Return][SEP2][1,2][2][][SEP3][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_EXPR_CONSTANT_IF_CALL_NAME_LOAD_NAME_LOAD_CONSTANT_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_NAME_LOAD_KEYWORD_NAME_LOAD |
def _clean(cls, value, invalid):
"""Deprecated. See BlockUsageLocator._clean"""
cls._deprecation_warning()
return BlockUsageLocator._clean(value, invalid) | [3][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_NAME_LOAD |
def is_mutating(status):
"""Determines if the statement is mutating based on the status."""
if not status:
return False
mutating = set(['insert', 'update', 'delete', 'alter', 'create', 'drop',
'replace', 'truncate', 'load'])
return status.split(None, 1)[0].lower() in mutatin... | [1][SEP1][If][Return][Return][SEP2][1,2][][][SEP3][0][0][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_IF_UNARYOP_NOT_NAME_LOAD_RETURN_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_LIST_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_LOAD_RETURN_COMPARE_CALL_ATTRIBUTE_SUBSCRIPT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_CONSTANT_LOAD_LOAD_I... |
def _get_vi_mode(cli):
"""Get the current vi mode for display."""
return {
InputMode.INSERT: 'I',
InputMode.NAVIGATION: 'N',
InputMode.REPLACE: 'R',
InputMode.INSERT_MULTIPLE: 'M'
}[cli.vi_state.input_mode] | [1][SEP1][Return][SEP2][][SEP3][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_RETURN_SUBSCRIPT_DICT_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_CONSTANT_CONSTANT_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_LOAD |
def _find_relevant_nodes(query_nodes, relevance_network, relevance_node_lim):
"""Return a list of nodes that are relevant for the query.
Parameters
----------
query_nodes : list[str]
A list of node names to query for.
relevance_network : str
The UUID of the NDEx network to query rel... | [3][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_LISTCOMP_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_COMPREHENSION_NAME_STORE_SUBSCRIPT_NAME_LOAD_SLICE_NAME_LOAD_LOAD_RETURN_NAME_LOAD |
def extract_statements(self):
"""Extracts INDRA statements from the RDF graph via SPARQL queries.
"""
# Look for events that have an AGENT and an AFFECTED, and get the
# start and ending text indices for each.
query = prefixes + """
SELECT
?agent_start
... | [1][SEP1][None][For][None][None][For][None][SEP2][1][2,3][1][4][5][4][SEP3][1][0][1][2][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_BINOP_NAME_LOAD_ADD_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_FOR_NAME_STORE_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_ASSIGN_NAME_STORE... |
def ungrounded_texts(stmts):
"""Return a list of all ungrounded entities ordered by number of mentions
Parameters
----------
stmts : list of :py:class:`indra.statements.Statement`
Returns
-------
ungroundc : list of tuple
list of tuples of the form (text: str, count: int) sorted in ... | [1][SEP1][Return][SEP2][][SEP3][6] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LISTCOMP_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_COMPREHENSION_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BOOLOP_AND_COMPARE_NAME_LOAD_ISNOT_CONSTANT_COMPARE_CALL_NAME_LOAD_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_... |
def _is_physical_entity(pe):
"""Return True if the element is a physical entity"""
val = isinstance(pe, _bp('PhysicalEntity')) or \
isinstance(pe, _bpimpl('PhysicalEntity'))
return val | [1][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_BOOLOP_OR_CALL_NAME_LOAD_NAME_LOAD_CALL_NAME_LOAD_CONSTANT_CALL_NAME_LOAD_NAME_LOAD_CALL_NAME_LOAD_CONSTANT_RETURN_NAME_LOAD |
def _get_db_refs(term):
"""Extract database references for a TERM."""
db_refs = {}
# Here we extract the text name of the Agent
# There are two relevant tags to consider here.
# The <text> tag typically contains a larger phrase surrounding the
# term but it contains the term in a raw, non-canoni... | [1][SEP1][If][If][If][If][If][None][None][None][Return][For][For][None][If][If][For][If][None][None][None][If][None][For][For][None][None][If][For][If][None][For][None][If][None][If][Try][If][For][None][None][None][If][None][None][If][If][None][If][If][None][If][If][If][If][None][None][None][If][None][None][Return][SEP... | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_IF_COMPARE_NAME_LOAD_ISNOT_CONSTANT_ASSIGN_SUBSCRIPT_NAME_LOAD_CONSTANT_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_IF_NAME_LOAD_ASSIGN_NAME_STORE_CA... |
def _assemble_transphosphorylation(self, stmt):
"""Example: complex(p(HGNC:EGFR)) =>
p(HGNC:EGFR, pmod(Ph, Tyr, 1173))"""
# Check our assumptions about the bound condition of the enzyme
assert len(stmt.enz.bound_conditions) == 1
assert stmt.enz.b... | [2][SEP1][None][None][None][SEP2][1][2][][SEP3][1][0][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSERT_COMPARE_CALL_NAME_LOAD_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_EQ_CONSTANT_ASSERT_ATTRIBUTE_SUBSCRIPT_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_ATTRIBUTE_SUBSCRIPT_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT... |
def submit_curation():
"""Submit curations for a given corpus.
The submitted curations are handled to update the probability model but
there is no return value here. The update_belief function can be called
separately to calculate update belief scores.
Parameters
----------
corpus_id : str... | [0][SEP1][If][None][Try][None][Return][Return][SEP2][1,2][2][3,4][5][][][SEP3][0][2][2][1][2][1] | MODULE_FUNCTIONDEF_ARGUMENTS_EXPR_CONSTANT_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_IS_CONSTANT_EXPR_CALL_NAME_LOAD_CALL_NAME_LOAD_CONSTANT_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_DICT_TRY_EXPR_CALL_ATTRIBUTE_NAM... |
def extract_statements(self):
"""Extract the statements from the json."""
for p_info in self._json:
para = RlimspParagraph(p_info, self.doc_id_type)
self.statements.extend(para.get_statements())
return | [1][SEP1][None][For][None][Return][SEP2][1][2,3][1][][SEP3][0][0][3][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_RETURN |
def process_nxml(nxml_filename, pmid=None, extra_annotations=None,
cleanup=True, add_grounding=True):
"""Process an NXML file using the ISI reader
First converts NXML to plain text and preprocesses it, then runs the ISI
reader, and processes the output to extract INDRA Statements.
Par... | [5][SEP1][If][None][If][None][If][None][None][Return][SEP2][1,2][2][3,4][4][5,6][7][7][][SEP3][0][0][4][1][0][1][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_CONSTANT_CONSTANT_EXPR_CONSTANT_IF_COMPARE_NAME_LOAD_IS_CONSTANT_ASSIGN_NAME_STORE_DICT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_DICT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LO... |
def _get_node_key(self, node_dict_item):
"""Return a tuple of sorted sources and targets given a node dict."""
s = tuple(sorted(node_dict_item['sources']))
t = tuple(sorted(node_dict_item['targets']))
return (s, t) | [2][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_CALL_NAME_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_CALL_NAME_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_RETURN_TUPLE_NAME_LOAD_NAME_LOAD_LOAD |
def process_pybel_graph(graph):
"""Return a PybelProcessor by processing a PyBEL graph.
Parameters
----------
graph : pybel.struct.BELGraph
A PyBEL graph to process
Returns
-------
bp : PybelProcessor
A PybelProcessor object which contains INDRA Statements in
bp.sta... | [1][SEP1][If][None][Return][SEP2][1,2][2][][SEP3][2][4][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_IF_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CALL_NAME_LOAD_GENERATOREXP_CALL_NAME_LOAD_NAME_LOAD_COMPREHENSION_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_ATTRI... |
def isa_or_partof(self, ns1, id1, ns2, id2):
"""Return True if two entities are in an "isa" or "partof" relationship
Parameters
----------
ns1 : str
Namespace code for an entity.
id1 : str
URI for an entity.
ns2 : str
Namespace code fo... | [5][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LAMBDA_ARGUMENTS_ARG_ARG_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD |
def separate_reach_logs(log_str):
"""Get the list of reach logs from the overall logs."""
log_lines = log_str.splitlines()
reach_logs = []
reach_lines = []
adding_reach_lines = False
for l in log_lines[:]:
if not adding_reach_lines and 'Beginning reach' in l:
adding_reach_lin... | [1][SEP1][None][For][If][If][None][If][None][Return][None][If][None][SEP2][1][2,3][4,5][6,7][1][8,9][7][][1][10,1][1][SEP3][1][0][0][0][0][0][2][1][2][0][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_LIST_LOAD_ASSIGN_NAME_STORE_LIST_LOAD_ASSIGN_NAME_STORE_CONSTANT_FOR_NAME_STORE_SUBSCRIPT_NAME_LOAD_SLICE_LOAD_IF_BOOLOP_AND_UNARYOP_NOT_NAME_LOAD_COMPARE_CONSTANT_IN_NAME_LOAD_ASSIGN_NAME_STORE_CONSTANT_IF_... |
def _link_to_action_mentions(self, actionmention_filename):
"""Add action mentions"""
parser = GenewaysActionMentionParser(actionmention_filename)
self.action_mentions = parser.action_mentions
for action_mention in self.action_mentions:
hiid = action_mention.hiid
... | [2][SEP1][None][For][If][None][None][SEP2][1][2][3,4][][1][SEP3][1][0][0][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_ATTRIBUTE_NAME_LOAD_LOAD_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_IF_COMPARE_NAME_LOAD_NOTIN_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CONSTANT_ASSIGN... |
def get_uncond_agent(agent):
"""Construct the unconditional state of an Agent.
The unconditional Agent is a copy of the original agent but
without any bound conditions and modification conditions.
Mutation conditions, however, are preserved since they are static.
"""
agent_uncond = ist.Agent(_n... | [1][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_NAME_LOAD |
def get_statements(self):
"""Convert network edges into Statements.
Returns
-------
list of Statements
Converted INDRA Statements.
"""
edges = _get_dict_from_list('edges', self.cx)
for edge in edges:
edge_type = edge.get('i')
i... | [1][SEP1][None][For][If][Return][If][If][None][If][None][None][None][SEP2][1][2,3][4,1][][5,1][6,7][1][8,9][10][10][1][SEP3][1][8][1][0][5][2][1][1][1][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_CONSTANT_ATTRIBUTE_NAME_LOAD_LOAD_FOR_NAME_STORE_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_IF_UNARYOP_NOT_NAME_LOAD_CONTINUE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_IF_NAME_LOAD_ASSIGN_NAME_STORE_S... |
def process_from_web():
"""Return a TrrustProcessor based on the online interaction table.
Returns
-------
TrrustProcessor
A TrrustProcessor object that has a list of INDRA Statements in its
statements attribute.
"""
logger.info('Downloading table from %s' % trrust_human_url)
... | [0][SEP1][Return][SEP2][][SEP3][7] | MODULE_FUNCTIONDEF_ARGUMENTS_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_CONSTANT_MOD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE... |
def _sanitize(text):
"""Return sanitized Eidos text field for human readability."""
d = {'-LRB-': '(', '-RRB-': ')'}
return re.sub('|'.join(d.keys()), lambda m: d[m.group(0)], text) | [1][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LAMBDA_ARGUMENTS_ARG_SUBSCRIPT_NAME_LOAD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_LOAD_NAME_LOAD |
def get_activating_mods(self):
"""Extract INDRA ActiveForm Statements with a single mod from BEL.
The SPARQL pattern used for extraction from BEL looks for a
ModifiedProteinAbundance as subject and an Activiy of a
ProteinAbundance as object.
Examples:
proteinAbunda... | [1][SEP1][None][For][If][None][None][None][SEP2][1][2][3,4][5][5][1][SEP3][1][4][8][0][0][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_BINOP_NAME_LOAD_ADD_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_FOR_NAME_STORE_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOA... |
def process_nxml_file(file_name, citation=None, offline=False,
output_fname=default_output_fname):
"""Return a ReachProcessor by processing the given NXML file.
NXML is the format used by PubmedCentral for papers in the open
access subset.
Parameters
----------
file_name ... | [4][SEP1][None][Return][SEP2][1][][SEP3][1][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_NAME_LOAD_EXPR_CONSTANT_WITH_WITHITEM_CALL_NAME_LOAD_NAME_LOAD_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_RETURN_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_CONSTANT_NAME_LOAD |
def process_json(json_dict):
"""Return an EidosProcessor by processing a Eidos JSON-LD dict.
Parameters
----------
json_dict : dict
The JSON-LD dict to be processed.
Returns
-------
ep : EidosProcessor
A EidosProcessor containing the extracted INDRA Statements
in it... | [1][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_NAME_LOAD |
def _remove_bound_conditions(agent, keep_criterion):
"""Removes bound conditions of agent such that keep_criterion is False.
Parameters
----------
agent: Agent
The agent whose bound conditions we evaluate
keep_criterion: function
Evaluates removal_criterion(a) for each agent a in a ... | [2][SEP1][None][For][If][None][None][SEP2][1][2,3][4,1][][1][SEP3][0][2][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LIST_LOAD_FOR_NAME_STORE_CALL_NAME_LOAD_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_IF_CALL_NAME_LOAD_ATTRIBUTE_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_LOAD_ASS... |
def export_kappa_cm(model, fname=None):
"""Return a networkx graph representing the model's Kappa contact map.
Parameters
----------
model : pysb.core.Model
A PySB model to be exported into a Kappa CM.
fname : Optional[str]
A file name, typically with .png or .pdf extension in which... | [2][SEP1][If][None][Return][SEP2][1,2][2][][SEP3][3][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_CONSTANT_EXPR_CONSTANT_IMPORTFROM_ALIAS_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_IF_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_KEYWORD_CONSTANT_RETURN_NAME_LOAD |
def assemble_pysb():
"""Assemble INDRA Statements and return PySB model string."""
if request.method == 'OPTIONS':
return {}
response = request.body.read().decode('utf-8')
body = json.loads(response)
stmts_json = body.get('statements')
export_format = body.get('export_format')
stmts ... | [0][SEP1][If][Return][Try][For][None][None][If][None][If][Return][None][Try][Return][None][None][SEP2][1,2][][3,4][5,6][6][3][7,8][9][10,11][][12][13,14][][9][9][SEP3][0][0][9][0][1][1][0][1][0][0][4][0][3][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_EXPR_CONSTANT_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_EQ_CONSTANT_RETURN_DICT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_LOAD_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_ASSIGN_NAM... |
def make_model(self, add_indra_json=True):
"""Assemble the CX network from the collected INDRA Statements.
This method assembles a CX network from the set of INDRA Statements.
The assembled network is set as the assembler's cx argument.
Parameters
----------
add_indra_j... | [2][SEP1][None][For][If][Return][None][If][None][If][None][If][None][If][None][If][None][If][None][SEP2][1][2,3][4,5][][5][6,7][1][8,9][1][10,11][1][12,13][1][14,15][1][16,1][1][SEP3][0][13][1][3][1][1][1][2][1][1][1][1][1][1][1][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_CONSTANT_EXPR_CONSTANT_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_NAME_LOAD_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_IF_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_IF_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_IF_BOOLOP_O... |
def _get_edge_sign(im, edge):
"""Get the polarity of the influence by examining the edge sign."""
edge_data = im[edge[0]][edge[1]]
# Handle possible multiple edges between nodes
signs = list(set([v['sign'] for v in edge_data.values()
if v.get('sign')]))
if len(signs... | [2][SEP1][If][None][None][If][None][If][Return][None][SEP2][1,2][3][3][4,5][][6,7][][][SEP3][5][2][0][0][1][1][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_SUBSCRIPT_SUBSCRIPT_NAME_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_CALL_NAME_LOAD_LISTCOMP_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_COMPREHENSION_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LO... |
def id_lookup(paper_id, idtype=None):
"""This function takes a Pubmed ID, Pubmed Central ID, or DOI
and use the Pubmed ID mapping
service and looks up all other IDs from one
of these. The IDs are returned in a dictionary."""
if idtype is not None and idtype not in ('pmid', 'pmcid', 'doi'):
r... | [2][SEP1][If][None][If][None][If][None][If][If][None][None][Try][None][Return][If][Return][If][Return][Return][SEP2][1,2][][3,4][4][5,6][7][8,7][9,10][7][10][11,12][13][][14,15][][16,17][][][SEP3][0][1][2][0][2][0][2][0][0][0][0][1][1][0][0][1][0][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_CONSTANT_EXPR_CONSTANT_IF_BOOLOP_AND_COMPARE_NAME_LOAD_ISNOT_CONSTANT_COMPARE_NAME_LOAD_NOTIN_TUPLE_CONSTANT_CONSTANT_CONSTANT_LOAD_RAISE_CALL_NAME_LOAD_BINOP_CONSTANT_MOD_NAME_LOAD_IF_CALL_ATTRIBUTE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_IF_CALL_ATTR... |
def _make_sentence(txt):
"""Make a sentence from a piece of text."""
#Make sure first letter is capitalized
txt = txt.strip(' ')
txt = txt[0].upper() + txt[1:] + '.'
return txt | [1][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_ASSIGN_NAME_STORE_BINOP_BINOP_CALL_ATTRIBUTE_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_LOAD_ADD_SUBSCRIPT_NAME_LOAD_SLICE_CONSTANT_LOAD_ADD_CONSTANT_RETURN_NAME_LOAD |
def join_json_files(prefix):
"""Join different REACH output JSON files into a single JSON object.
The output of REACH is broken into three files that need to be joined
before processing. Specifically, there will be three files of the form:
`<prefix>.uaz.<subcategory>.json`.
Parameters
--------... | [1][SEP1][Try][None][Return][None][None][None][None][None][Return][SEP2][1,2][3][][4][5][6][7][8][][SEP3][4][1][2][1][1][1][1][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_TRY_WITH_WITHITEM_CALL_NAME_LOAD_BINOP_NAME_LOAD_ADD_CONSTANT_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_WITH_WITHITEM_CALL_NAME_LOAD_BINOP_NAME_LOAD_ADD_CONSTANT_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LO... |
def _make_concept(self, entity):
"""Return Concept from a Hume entity."""
# Use the canonical name as the name of the Concept by default
name = self._sanitize(entity['canonicalName'])
# But if there is a trigger head text, we prefer that since
# it almost always results in a clea... | [2][SEP1][Return][SEP2][][SEP3][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_KEYWORD_NAME_LOAD_ASSIGN_NAME_STORE_DICTCOMP_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_SUBSCRIP... |
def preprocess_plain_text_file(self, filename, pmid, extra_annotations):
"""Preprocess a plain text file for use with ISI reder.
Preprocessing results in a new text file with one sentence
per line.
Parameters
----------
filename : str
The name of the plain t... | [4][SEP1][None][None][SEP2][1][][SEP3][1][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_EXPR_CONSTANT_WITH_WITHITEM_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_CONSTANT_KEYWORD_CONSTANT_NAME_STORE_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD |
def comment_update(self, comment_id, body):
"""Function to update a comment (Requires login).
Parameters:
comment_id (int):
body (str):
"""
params = {'comment[body]': body}
return self._get('comments/{0}.json'.format(comment_id), params, 'PUT',
... | [3][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_NAME_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_NAME_LOAD_CONSTANT_KEYWORD_CONSTANT |
def note_list(self, body_matches=None, post_id=None, post_tags_match=None,
creator_name=None, creator_id=None, is_active=None):
"""Return list of notes.
Parameters:
body_matches (str): The note's body matches the given terms.
post_id (int): A specific post.
... | [7][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD |
def wiki_create(self, title, body, other_names=None):
"""Action to lets you create a wiki page (Requires login) (UNTESTED).
Parameters:
title (str): Page title.
body (str): Page content.
other_names (str): Other names.
"""
params = {
'wiki... | [4][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_CONSTANT_NAME_LOAD_NAME_LOAD_NAME_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD_KEYWORD_CONSTANT_KEYWORD_CONSTANT |
def artist_create(self, name, urls=None, alias=None, group=None):
"""Function to create an artist (Requires login) (UNTESTED).
Parameters:
name (str): The artist's name.
urls (str): A list of URLs associated with the artist, whitespace
delimited.
... | [5][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD_KEYWORD_CONSTANT |
def user_can_edit_news(user):
"""
Check if the user has permission to edit any of the registered NewsItem
types.
"""
newsitem_models = [model.get_newsitem_model()
for model in NEWSINDEX_MODEL_CLASSES]
if user.is_active and user.is_superuser:
# admin can edit news ... | [1][SEP1][If][Return][For][For][Return][If][Return][SEP2][1,2][][3,4][5,2][][6,3][][SEP3][1][1][0][1][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LISTCOMP_CALL_ATTRIBUTE_NAME_LOAD_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_IF_BOOLOP_AND_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CALL_NAME_LOAD_NAME_LOAD_FOR_NAME_STORE_NAME_LOAD_FOR_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_LIST_CONSTANT_CONSTA... |
def datetime_match(data, dts):
"""
matching of datetimes in time columns for data filtering
"""
dts = dts if islistable(dts) else [dts]
if any([not isinstance(i, datetime.datetime) for i in dts]):
error_msg = (
"`time` can only be filtered by datetimes"
)
raise Ty... | [2][SEP1][If][None][Return][SEP2][1,2][][][SEP3][3][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_IFEXP_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_LIST_NAME_LOAD_LOAD_IF_CALL_NAME_LOAD_LISTCOMP_UNARYOP_NOT_CALL_NAME_LOAD_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_ASSIGN_NAME_STORE_CONSTANT_RAISE_CALL_NAME_LOAD_NAME_LOAD_RETURN_C... |
def update(self, rc):
"""Add additional run control parameters
Parameters
----------
rc : string, file, dictionary, optional
a path to a YAML file, a file handle for a YAML file, or a
dictionary describing run control configuration
"""
rc = self._... | [2][SEP1][None][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD |
def mutate(self):
"""
Upgrades this Instance to the latest generation type
"""
self._client.post('{}/mutate'.format(Instance.api_endpoint), model=self)
return True | [1][SEP1][Return][SEP2][][SEP3][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_NAME_LOAD_RETURN_CONSTANT |
def events_mark_seen(self, event):
"""
Marks event as the last event we have seen. If event is an int, it is treated
as an event_id, otherwise it should be an event object whose id will be used.
"""
last_seen = event if isinstance(event, int) else event.id
self.client.po... | [2][SEP1][None][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_IFEXP_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD |
def iter_chain(cur):
"""Iterate over all of the chains in the database.
Args:
cur (:class:`sqlite3.Cursor`):
An sqlite3 cursor. This function is meant to be run within a :obj:`with` statement.
Yields:
list: The chain.
"""
select = "SELECT nodes FROM chain"
for node... | [1][SEP1][None][For][None][SEP2][1][2][1][SEP3][0][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_FOR_TUPLE_NAME_STORE_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_EXPR_YIELD_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD |
def _contains_line(self, line):
"""Test if a chain of qubits is completely contained in ``self``. In
particular, test if all qubits are present and the couplers
connecting those qubits are also connected.
NOTE: this function assumes that ``line`` is a list or tuple of
qubits wh... | [2][SEP1][Return][SEP2][][SEP3][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_RETURN_BOOLOP_AND_CALL_NAME_LOAD_GENERATOREXP_COMPARE_NAME_LOAD_IN_NAME_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_CALL_NAME_LOAD_GENERATOREXP_COMPARE_NAME_LOAD_IN_SUBSCRIPT_NAME_LOAD_NAME_LOAD_LOAD_COMPREHENSION_TUPLE_NAME_STORE_NAME_STORE_STORE_CALL_NAME_LOAD_NAME_LOAD_... |
def __related_categories(self, category_id):
""" Get all related categories to a given one """
related = []
for cat in self.categories_tree:
if category_id in self.categories_tree[cat]:
related.append(self.categories[cat])
return related | [2][SEP1][None][For][If][Return][None][SEP2][1][2,3][4,1][][1][SEP3][0][0][0][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LIST_LOAD_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_IF_COMPARE_NAME_LOAD_IN_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_LOAD_RETURN_NAME_LOAD |
def get_identities(self, item):
""" Return the identities from an item """
data = item['data']
if 'assigned_to' in data:
user = self.get_sh_identity(data, 'assigned_to')
yield user
author = self.get_sh_identity(data, 'author')
yield author | [2][SEP1][If][None][None][SEP2][1,2][2][][SEP3][0][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_IF_COMPARE_CONSTANT_IN_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_CONSTANT_EXPR_YIELD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_CONSTANT_EXPR_YIELD_NAME_LOAD |
def delete_items(self, retention_time, time_field="metadata__updated_on"):
"""Delete documents updated before a given date
:param retention_time: maximum number of minutes wrt the current date to retain the data
:param time_field: time field to delete the data
"""
if retention_t... | [3][SEP1][If][Return][If][Return][Try][None][Return][SEP2][1,2][][3,4][][5,6][][][SEP3][0][1][0][1][3][4][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_CONSTANT_EXPR_CONSTANT_IF_COMPARE_NAME_LOAD_IS_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_RETURN_IF_COMPARE_NAME_LOAD_LTE_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_RETURN_ASSIGN_NAME_STORE_CALL_NAME_LOAD_KEYWORD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAM... |
def get_params_parser_create_dash():
"""Parse command line arguments"""
parser = argparse.ArgumentParser(usage="usage: e2k.py [options]",
description="Create a Kibana dashboard from a template")
ElasticOcean.add_params(parser)
parser.add_argument("-d", "--dashboar... | [0][SEP1][Return][SEP2][][SEP3][6] | MODULE_FUNCTIONDEF_ARGUMENTS_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_CONSTANT_KEYWORD_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_KEYWORD_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_KEYWORD_CONSTANT_EXPR_CALL_... |
def get_domain(self, identity):
""" Get the domain from a SH identity """
domain = None
if identity['email']:
try:
domain = identity['email'].split("@")[1]
except IndexError:
# logger.warning("Bad email format: %s" % (identity['email']))
... | [2][SEP1][If][Try][Return][None][None][SEP2][1,2][3,4][][2][2][SEP3][0][0][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_IF_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_TRY_ASSIGN_NAME_STORE_SUBSCRIPT_CALL_ATTRIBUTE_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_LOAD_CONSTANT_CONSTANT_LOAD_EXCEPTHANDLER_NAME_LOAD_PASS_RETURN_NAME_LOAD |
def _fix_review_dates(self, item):
"""Convert dates so ES detect them"""
for date_field in ['timestamp', 'createdOn', 'lastUpdated']:
if date_field in item.keys():
date_ts = item[date_field]
item[date_field] = unixtime_to_datetime(date_ts).isoformat()
... | [2][SEP1][None][For][If][If][None][For][If][If][For][For][None][None][SEP2][1][2,3][4,1][5,6][1][7,6][8][9,5][10][11,5][8][9][SEP3][0][0][1][1][2][0][1][2][0][0][2][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_FOR_NAME_STORE_LIST_CONSTANT_CONSTANT_CONSTANT_LOAD_IF_COMPARE_NAME_LOAD_IN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_SUBSCRIPT_NAME_LOAD_NAME_LOAD_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_NAME_LOAD_STORE_CALL_ATTRIBUTE_CALL_NAME_LOAD_NAME_LOAD_LOAD_IF_COMPARE_CONSTANT_IN... |
def update_items(self, ocean_backend, enrich_backend):
"""Retrieve the commits not present in the original repository and delete
the corresponding documents from the raw and enriched indexes"""
fltr = {
'name': 'origin',
'value': [self.perceval_backend.origin]
}
... | [3][SEP1][Try][None][Return][None][For][If][If][None][None][None][SEP2][1,2][3][][4][5,6][7,4][8,9][4][9][][SEP3][2][2][1][4][2][2][0][2][2][8] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_CONSTANT_LIST_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_ATTRIBUT... |
def _serialize_fields(point):
"""Field values can be floats, integers, strings, or Booleans."""
output = []
for k, v in point['fields'].items():
k = escape(k, key_escape)
if isinstance(v, bool):
output.append(f'{k}={v}')
elif isinstance(v, int):
output.append(... | [1][SEP1][None][For][If][Return][None][If][None][If][None][If][None][SEP2][1][2,3][4,5][][1][6,7][1][8,9][1][10,1][1][SEP3][0][1][2][1][1][1][1][1][2][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_LIST_LOAD_FOR_TUPLE_NAME_STORE_NAME_STORE_STORE_CALL_ATTRIBUTE_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_IF_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_JOINEDSTR_FORMATTEDVALUE_NA... |
def user_login(self, email=None, password=None):
"""Login with email, password and get back a session cookie
:type email: str
:param email: The email used for authentication
:type password: str
:param password: The password used for authentication
"""
email = s... | [3][SEP1][If][None][SEP2][1][][SEP3][5][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_IFEXP_COMPARE_NAME_LOAD_IS_CONSTANT_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_CONSTANT_NAME_LOAD_ASSIGN_NAME_STORE_IFEXP_COMPARE_NAME_LOAD_IS_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_DICT_CONSTANT_CON... |
def resolve_post(self, post):
"""Mark post as resolved
:type post: dict|str|int
:param post: Either the post dict returned by another API method, or
the `cid` field of that post.
:returns: True if it is successful. False otherwise
"""
try:
cid = ... | [2][SEP1][Try][None][None][Return][SEP2][1,2][3][3][][SEP3][0][0][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_TRY_ASSIGN_NAME_STORE_SUBSCRIPT_NAME_LOAD_CONSTANT_LOAD_EXCEPTHANDLER_NAME_LOAD_ASSIGN_NAME_STORE_NAME_LOAD_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_NAME_LOAD_CONSTANT_RETURN_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD |
def metric_names(self, id, name=None, page=None):
"""
Return a list of known metrics and their value names for the given resource.
:type id: int
:param id: Server ID
:type name: str
:param name: Filter metrics by name
:type page: int
:param page: Pagina... | [4][SEP1][Return][SEP2][][SEP3][5] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_LIST_IFEXP_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_CONSTANT_IFEXP_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_CONSTANT_LOAD_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_KEYWORD_CALL_ATTRIBUTE_CONSTANT_LOAD_ATTRIBUTE_NAM... |
def list(
self, application_id, filter_hostname=None, filter_ids=None,
page=None):
"""
This API endpoint returns a paginated list of instances associated with the
given application.
Application instances can be filtered by hostname, or the list of
applica... | [5][SEP1][Return][SEP2][][SEP3][8] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_LIST_IFEXP_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_CONSTANT_IFEXP_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_LISTCOMP_CALL_NAME_LOAD_NAME_LOAD_COMPREHENSION_NAME_STORE_NAME_LOAD_... |
def makeNodeTuple(citation, idVal, nodeInfo, fullInfo, nodeType, count, coreCitesDict, coreValues, detailedValues, addCR):
"""Makes a tuple of idVal and a dict of the selected attributes"""
d = {}
if nodeInfo:
if nodeType == 'full':
if coreValues:
if citation in coreCites... | [10][SEP1][If][If][If][If][If][None][If][If][None][If][If][None][Return][If][If][None][None][None][None][None][For][None][For][If][If][If][None][None][None][None][None][If][None][None][SEP2][1,2][3,4][5,6][7,8][9,10][6][11,12][13,14][2][15,16][17,18][12][][19,20][21,2][2][2][2][2][22][23,24][2][25,26][27,28][29,2][30,3... | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_ARG_ARG_ARG_ARG_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_IF_NAME_LOAD_IF_COMPARE_NAME_LOAD_EQ_CONSTANT_IF_NAME_LOAD_IF_COMPARE_NAME_LOAD_IN_NAME_LOAD_ASSIGN_NAME_STORE_SUBSCRIPT_NAME_LOAD_NAME_LOAD_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_CONSTANT_STORE_ATTRIBUTE_NAME_LOAD_LOAD_I... |
def removeID(self, idVal):
"""Checks if the collected items contains the give _idVal_ and removes it if it is found, will raise a `KeyError` if item is not found
# Parameters
_idVal_ : `str`
> The removed id string
"""
for i in self:
if i.id == idVal:
... | [2][SEP1][None][For][If][None][Return][SEP2][1][2,3][4,1][][][SEP3][0][0][0][2][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_FOR_NAME_STORE_NAME_LOAD_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_EQ_NAME_LOAD_EXPR_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_RETURN_RAISE_CALL_NAME_LOAD_CALL_ATTRIBUTE_CONSTANT_LOAD_NAME_LOAD_NAME_LOAD |
def j9urlGenerator(nameDict = False):
"""How to get all the urls for the WOS Journal Title Abbreviations. Each is varies by only a few characters. These are the currently in use urls they may change.
They are of the form:
> "https://images.webofknowledge.com/images/help/WOS/{VAL}_abrvjt.html"
> Where ... | [1][SEP1][If][None][None][For][For][None][Return][None][SEP2][1,2][3][4][5,6][7,6][3][][4][SEP3][1][0][0][0][0][0][0][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_ASSIGN_NAME_STORE_CONSTANT_IF_NAME_LOAD_ASSIGN_NAME_STORE_DICT_CONSTANT_BINOP_BINOP_NAME_LOAD_ADD_CONSTANT_ADD_NAME_LOAD_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_NAME_LOAD_STORE_BINOP_BINOP_NAME_LOAD_ADD_NAME_LO... |
def _filter_pending_updates(self):
"""
Return all the updates that need to be applied, from a list of all the
updates that were called while the hold was active. This method is
meant to be overridden by subclasses that want to customize how held
updates are applied.
... | [1][SEP1][None][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_IMPORTFROM_ALIAS_EXPR_YIELDFROM_CALL_NAME_LOAD_CALL_NAME_LOAD_CALL_NAME_LOAD_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD |
def cli_main(pid, include_greenlet, debugger, verbose):
'''Print stack of python process.
$ pystack <pid>
'''
try:
print_stack(pid, include_greenlet, debugger, verbose)
except DebuggerNotFound as e:
click.echo('DebuggerNotFound: %s' % e.args[0], err=True)
click.get_current_c... | [4][SEP1][Try][None][None][SEP2][1,2][][][SEP3][0][1][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_EXPR_CONSTANT_TRY_EXPR_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD_EXCEPTHANDLER_NAME_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_BINOP_CONSTANT_MOD_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_LOAD_KEYWORD_CONSTANT_EXPR_CALL_ATTRIBUTE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LOA... |
def validate_email(addr):
"""Validate an email address.
This function raises ``ValueError`` if the email address is not valid.
>>> validate_email('foo@bar.com')
'foo@bar.com'
>>> validate_email('foo@bar com')
Traceback (most recent call last):
...
ValueError: Invalid domain: bar co... | [1][SEP1][If][None][Try][None][None][Return][SEP2][1,2][][3,4][5][][][SEP3][0][1][1][2][1][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_IF_COMPARE_CONSTANT_NOTIN_NAME_LOAD_RAISE_CALL_NAME_LOAD_BINOP_CONSTANT_MOD_NAME_LOAD_ASSIGN_TUPLE_NAME_STORE_NAME_STORE_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_TRY_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CALL_NAME_LOAD_NAME_LOAD_EXCEPTHANDLER_ATTRIBU... |
def bundle(self):
"""A list of any parent CAs, including this CA.
The list is ordered so the Root CA will be the first.
"""
ca = self
bundle = [ca]
while ca.parent is not None:
bundle.append(ca.parent)
ca = ca.parent
return bundle | [1][SEP1][None][While][None][Return][SEP2][1][2,3][1][][SEP3][0][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_NAME_LOAD_ASSIGN_NAME_STORE_LIST_NAME_LOAD_LOAD_WHILE_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_ISNOT_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_NAME_LOAD |
def include_theme_files(self, fragment):
"""
Gets theme configuration and renders theme css into fragment
"""
theme = self.get_theme()
if not theme or 'package' not in theme:
return
theme_package, theme_files = theme.get('package', None), theme.get('locations... | [2][SEP1][If][Return][None][For][None][SEP2][1,2][][3][4][3][SEP3][1][0][3][0][2] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_IF_BOOLOP_OR_UNARYOP_NOT_NAME_LOAD_COMPARE_CONSTANT_NOTIN_NAME_LOAD_RETURN_ASSIGN_TUPLE_NAME_STORE_NAME_STORE_STORE_TUPLE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_LIST_LOAD_LO... |
def is_requirement(line):
"""
Return True if the requirement line is a package requirement;
that is, it is not blank, a comment, a URL, or an included file.
"""
return not (
line == '' or
line.startswith('-r') or
line.startswith('#') or
line.startswith('-e') or
... | [1][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_RETURN_UNARYOP_NOT_BOOLOP_OR_COMPARE_NAME_LOAD_EQ_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT |
def _find_content(self, cont_name):
"""Search for a content_name in the content data, if not found the parent is searched."""
try:
a = self.content_data[cont_name]
return a
except KeyError:
if self.parent:
return self.parent._find_content(cont_... | [2][SEP1][Try][Return][If][Return][Return][SEP2][1,2][][3,4][][][SEP3][0][0][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_TRY_ASSIGN_NAME_STORE_SUBSCRIPT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_LOAD_RETURN_NAME_LOAD_EXCEPTHANDLER_NAME_LOAD_IF_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_RETURN_CONSTANT |
def read_config(name):
"""
配置读取
"""
name = name.lower()
conf_list = _read_config_list()
for conf in conf_list:
if conf.startswith(name):
return conf.split('=')[1].split('#')[0].strip()
return None | [1][SEP1][None][For][If][Return][Return][SEP2][1][2,3][4,1][][][SEP3][2][0][1][0][3] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_NAME_LOAD_FOR_NAME_STORE_NAME_LOAD_IF_CALL_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_RETURN_CALL_ATTRIBUTE_SUBSCRIPT_CALL_ATTRIBUTE_SUBSCRIPT_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_CONSTANT_LOAD_LOAD_CONSTANT_... |
def _dict_of_results(self):
"""
Get the dictionary representation of results
:return: dict (str -> dict (str -> str))
"""
result_json = {}
result_list = []
for r in self.results:
result_list.append({
'name': r.check_name,
... | [1][SEP1][None][For][None][Return][SEP2][1][2,3][1][][SEP3][0][0][1][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_ASSIGN_NAME_STORE_LIST_LOAD_FOR_NAME_STORE_ATTRIBUTE_NAME_LOAD_LOAD_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_DICT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_ATTR... |
def ostree_path(self):
""" ostree repository -- content """
if self._ostree_path is None:
self._ostree_path = os.path.join(self.tmpdir, "ostree-repo")
subprocess.check_call(["ostree", "init", "--mode", "bare-user-only",
"--repo", self._ostree_pa... | [1][SEP1][If][None][Return][SEP2][1,2][2][][SEP3][0][2][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_IF_COMPARE_ATTRIBUTE_NAME_LOAD_LOAD_IS_CONSTANT_ASSIGN_ATTRIBUTE_NAME_LOAD_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_LIST_CONSTANT_CONSTANT_CONSTANT_CONSTANT_CONSTANT_ATTRIBUTE_NAME_LOAD_LOAD_LOA... |
def quick_add(self, text, note=None, reminder=None):
"""Add a task using the 'Quick Add Task' syntax.
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label starts with a `@`
and an assignee starts with a `+`.
:type text: ... | [4][SEP1][Return][SEP2][][SEP3][4] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_KEYWORD_NAME_LOAD_KEYWORD_NAME_LOAD_EXPR_CALL_NAME_LOAD_NAME_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_RETURN_CALL_NAME_LOAD_NAME_LOAD_NAME_LOAD |
def delete_collaborator(self, email):
"""Remove a collaborating user from the shared project.
:param email: The collaborator's email address.
:type email: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user... | [2][SEP1][None][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_DICT_CONSTANT_CONSTANT_ATTRIBUTE_NAME_LOAD_LOAD_NAME_LOAD_EXPR_CALL_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD |
def rfind(self, sub, start=None, end=None):
"""Return the highest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Begin... | [4][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_ARG_CONSTANT_CONSTANT_EXPR_CONSTANT_RETURN_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_NAME_LOAD_NAME_LOAD_NAME_LOAD |
def white(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('white', string... | [3][SEP1][Return][SEP2][][SEP3][1] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_ARG_ARG_CONSTANT_EXPR_CONSTANT_RETURN_CALL_ATTRIBUTE_NAME_LOAD_LOAD_CONSTANT_NAME_LOAD_KEYWORD_NAME_LOAD |
def linked_parameters(self):
"""
Get a dictionary with all parameters in this model in a linked status. A parameter is in a linked status
if it is linked to another parameter (i.e. it is forced to have the same value of the other parameter), or
if it is linked with another parameter or a... | [1][SEP1][None][For][If][Return][None][SEP2][1][2,3][4,1][][1][SEP3][2][1][1][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_EXPR_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_FOR_TUPLE_NAME_STORE_NAME_STORE_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_IF_CALL_ATTRIBUTE_NAME_LOAD_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_NAME_LOAD_STORE_NAME_LOAD_RETURN_NAME_LOAD |
def parameters(self):
"""
Returns a dictionary of all parameters for this source.
We use the parameter path as the key because it's
guaranteed to be unique, unlike the parameter name.
:return:
"""
all_parameters = collections.OrderedDict()
for component... | [1][SEP1][None][For][For][Return][None][SEP2][1][2,3][4,1][][2][SEP3][1][1][1][0][0] | MODULE_FUNCTIONDEF_ARGUMENTS_ARG_EXPR_CONSTANT_ASSIGN_NAME_STORE_CALL_ATTRIBUTE_NAME_LOAD_LOAD_FOR_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_FOR_NAME_STORE_CALL_ATTRIBUTE_ATTRIBUTE_ATTRIBUTE_NAME_LOAD_LOAD_LOAD_LOAD_ASSIGN_SUBSCRIPT_NAME_LOAD_ATTRIBUTE_NAME_LOAD_LOAD_STORE_NAME_LOAD_RETURN_NAME_LOAD |
End of preview. Expand in Data Studio
SRC-AST-CFG
This dataset was created from CodeSearchNet, it contains triplets of (function, AST, CFG).
It was made for training deep learning models to associate code representations.
The code used to build it can be found here.
Size
#train = 278620 samples
#test = 15169 samples
#validation = 15566 samples
Contact
e-mail: mrochkoulets@gmail.com
- Downloads last month
- 14