code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def camera_position(self): """ Returns camera position of active render window """ return [self.camera.GetPosition(), self.camera.GetFocalPoint(), self.camera.GetViewUp()]
def function[camera_position, parameter[self]]: constant[ Returns camera position of active render window ] return[list[[<ast.Call object at 0x7da20c992770>, <ast.Call object at 0x7da20c993250>, <ast.Call object at 0x7da20c993100>]]]
keyword[def] identifier[camera_position] ( identifier[self] ): literal[string] keyword[return] [ identifier[self] . identifier[camera] . identifier[GetPosition] (), identifier[self] . identifier[camera] . identifier[GetFocalPoint] (), identifier[self] . identifier[camera] . identi...
def camera_position(self): """ Returns camera position of active render window """ return [self.camera.GetPosition(), self.camera.GetFocalPoint(), self.camera.GetViewUp()]
def handle_relative_import(self, node): """ from A means node.level == 0 from . import B means node.level == 1 from .A means node.level == 1 """ no_file = os.path.abspath(os.path.join(self.filenames[-1], os.pardir)) skip_init = False if node.l...
def function[handle_relative_import, parameter[self, node]]: constant[ from A means node.level == 0 from . import B means node.level == 1 from .A means node.level == 1 ] variable[no_file] assign[=] call[name[os].path.abspath, parameter[call[name[os].path.join,...
keyword[def] identifier[handle_relative_import] ( identifier[self] , identifier[node] ): literal[string] identifier[no_file] = identifier[os] . identifier[path] . identifier[abspath] ( identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[filenames] [- literal[int] ],...
def handle_relative_import(self, node): """ from A means node.level == 0 from . import B means node.level == 1 from .A means node.level == 1 """ no_file = os.path.abspath(os.path.join(self.filenames[-1], os.pardir)) skip_init = False if node.level == 1: ...
def get_fieldname(self, field, arnum): """Generate a new fieldname with a '-<arnum>' suffix """ name = field.getName() # ensure we have only *one* suffix base_name = name.split("-")[0] suffix = "-{}".format(arnum) return "{}{}".format(base_name, suffix)
def function[get_fieldname, parameter[self, field, arnum]]: constant[Generate a new fieldname with a '-<arnum>' suffix ] variable[name] assign[=] call[name[field].getName, parameter[]] variable[base_name] assign[=] call[call[name[name].split, parameter[constant[-]]]][constant[0]] ...
keyword[def] identifier[get_fieldname] ( identifier[self] , identifier[field] , identifier[arnum] ): literal[string] identifier[name] = identifier[field] . identifier[getName] () identifier[base_name] = identifier[name] . identifier[split] ( literal[string] )[ literal[int] ] ...
def get_fieldname(self, field, arnum): """Generate a new fieldname with a '-<arnum>' suffix """ name = field.getName() # ensure we have only *one* suffix base_name = name.split('-')[0] suffix = '-{}'.format(arnum) return '{}{}'.format(base_name, suffix)
def find_cross_contamination(databases, pair, tmpdir='tmp', log='log.txt', threads=1): """ Usese mash to find out whether or not a sample has more than one genus present, indicating cross-contamination. :param databases: A databases folder, which must contain refseq.msh, a mash sketch that has one represent...
def function[find_cross_contamination, parameter[databases, pair, tmpdir, log, threads]]: constant[ Usese mash to find out whether or not a sample has more than one genus present, indicating cross-contamination. :param databases: A databases folder, which must contain refseq.msh, a mash sketch that has ...
keyword[def] identifier[find_cross_contamination] ( identifier[databases] , identifier[pair] , identifier[tmpdir] = literal[string] , identifier[log] = literal[string] , identifier[threads] = literal[int] ): literal[string] identifier[genera_present] = identifier[list] () identifier[out] , identifier[...
def find_cross_contamination(databases, pair, tmpdir='tmp', log='log.txt', threads=1): """ Usese mash to find out whether or not a sample has more than one genus present, indicating cross-contamination. :param databases: A databases folder, which must contain refseq.msh, a mash sketch that has one represent...
def __skeleton_difference(graph, image, boundary_term, spacing): """ A skeleton for the calculation of intensity difference based boundary terms. Iterates over the images dimensions and generates for each an array of absolute neighbouring voxel :math:`(p, q)` intensity differences :math:`|I_p, I_q|...
def function[__skeleton_difference, parameter[graph, image, boundary_term, spacing]]: constant[ A skeleton for the calculation of intensity difference based boundary terms. Iterates over the images dimensions and generates for each an array of absolute neighbouring voxel :math:`(p, q)` intensit...
keyword[def] identifier[__skeleton_difference] ( identifier[graph] , identifier[image] , identifier[boundary_term] , identifier[spacing] ): literal[string] keyword[def] identifier[intensity_difference] ( identifier[neighbour_one] , identifier[neighbour_two] ): literal[string] keyword[re...
def __skeleton_difference(graph, image, boundary_term, spacing): """ A skeleton for the calculation of intensity difference based boundary terms. Iterates over the images dimensions and generates for each an array of absolute neighbouring voxel :math:`(p, q)` intensity differences :math:`|I_p, I_q|...
def delete_dataset(self, owner, id, **kwargs): """ Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by default. To make an ...
def function[delete_dataset, parameter[self, owner, id]]: constant[ Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by def...
keyword[def] identifier[delete_dataset] ( identifier[self] , identifier[owner] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[retur...
def delete_dataset(self, owner, id, **kwargs): """ Delete a dataset Permanently deletes a dataset and all data associated with it. This operation cannot be undone, although a new dataset may be created with the same id. This method makes a synchronous HTTP request by default. To make an ...
def dist(self, x1, x2): """Return the weighted distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `NumpyTensor` Tensors whose mutual distance is calculated. Returns ------- dist : float The distance between the tensors. ...
def function[dist, parameter[self, x1, x2]]: constant[Return the weighted distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `NumpyTensor` Tensors whose mutual distance is calculated. Returns ------- dist : float The dista...
keyword[def] identifier[dist] ( identifier[self] , identifier[x1] , identifier[x2] ): literal[string] keyword[if] identifier[self] . identifier[exponent] == literal[int] : keyword[return] identifier[float] ( identifier[np] . identifier[sqrt] ( identifier[self] . identifier[const] )* ...
def dist(self, x1, x2): """Return the weighted distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `NumpyTensor` Tensors whose mutual distance is calculated. Returns ------- dist : float The distance between the tensors. ...
def acquire(self, **kwargs): """ Copy the file and return its path Returns ------- str or None The path of the file or None if it does not exist or if verification failed. """ path = path_string(self.path) if os.path.exists(path): ...
def function[acquire, parameter[self]]: constant[ Copy the file and return its path Returns ------- str or None The path of the file or None if it does not exist or if verification failed. ] variable[path] assign[=] call[name[path_string],...
keyword[def] identifier[acquire] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[path] = identifier[path_string] ( identifier[self] . identifier[path] ) keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[path] ): keyword[if...
def acquire(self, **kwargs): """ Copy the file and return its path Returns ------- str or None The path of the file or None if it does not exist or if verification failed. """ path = path_string(self.path) if os.path.exists(path): if c...
def _pys2shape(self, line): """Updates shape in code_array""" self.code_array.shape = self._get_key(*self._split_tidy(line))
def function[_pys2shape, parameter[self, line]]: constant[Updates shape in code_array] name[self].code_array.shape assign[=] call[name[self]._get_key, parameter[<ast.Starred object at 0x7da1b16a7dc0>]]
keyword[def] identifier[_pys2shape] ( identifier[self] , identifier[line] ): literal[string] identifier[self] . identifier[code_array] . identifier[shape] = identifier[self] . identifier[_get_key] (* identifier[self] . identifier[_split_tidy] ( identifier[line] ))
def _pys2shape(self, line): """Updates shape in code_array""" self.code_array.shape = self._get_key(*self._split_tidy(line))
def ValidateRequiredFieldsAreNotEmpty(gtfs_object, required_field_names, problems=None): """ Validates whether all required fields of an object have a value: - if value empty adds MissingValue errors (if problems accumulator is provided) """ no_missing_value = Tru...
def function[ValidateRequiredFieldsAreNotEmpty, parameter[gtfs_object, required_field_names, problems]]: constant[ Validates whether all required fields of an object have a value: - if value empty adds MissingValue errors (if problems accumulator is provided) ] variable[no_missing_value] a...
keyword[def] identifier[ValidateRequiredFieldsAreNotEmpty] ( identifier[gtfs_object] , identifier[required_field_names] , identifier[problems] = keyword[None] ): literal[string] identifier[no_missing_value] = keyword[True] keyword[for] identifier[name] keyword[in] identifier[required_field_names] : ...
def ValidateRequiredFieldsAreNotEmpty(gtfs_object, required_field_names, problems=None): """ Validates whether all required fields of an object have a value: - if value empty adds MissingValue errors (if problems accumulator is provided) """ no_missing_value = True for name in required_field_n...
def first_key(res): """ Returns the first result for the given command. If more then 1 result is returned then a `RedisClusterException` is raised. """ if not isinstance(res, dict): raise ValueError('Value should be of dict type') if len(res.keys()) != 1: raise RedisClusterExce...
def function[first_key, parameter[res]]: constant[ Returns the first result for the given command. If more then 1 result is returned then a `RedisClusterException` is raised. ] if <ast.UnaryOp object at 0x7da1b0841240> begin[:] <ast.Raise object at 0x7da1b077b520> if compare...
keyword[def] identifier[first_key] ( identifier[res] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[res] , identifier[dict] ): keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[len] ( identifier[res] . identifier[keys] ())!=...
def first_key(res): """ Returns the first result for the given command. If more then 1 result is returned then a `RedisClusterException` is raised. """ if not isinstance(res, dict): raise ValueError('Value should be of dict type') # depends on [control=['if'], data=[]] if len(res.keys(...
def get_user(session, user_id): """Get user.""" try: user_id = int(user_id) except ValueError: user_id = find_user(session, user_id) resp = _make_request(session, USER_URL, user_id) if not resp: raise VooblyError('user id not found') return resp[0]
def function[get_user, parameter[session, user_id]]: constant[Get user.] <ast.Try object at 0x7da1b18b8580> variable[resp] assign[=] call[name[_make_request], parameter[name[session], name[USER_URL], name[user_id]]] if <ast.UnaryOp object at 0x7da1b18b8970> begin[:] <ast.Raise object...
keyword[def] identifier[get_user] ( identifier[session] , identifier[user_id] ): literal[string] keyword[try] : identifier[user_id] = identifier[int] ( identifier[user_id] ) keyword[except] identifier[ValueError] : identifier[user_id] = identifier[find_user] ( identifier[session] , ...
def get_user(session, user_id): """Get user.""" try: user_id = int(user_id) # depends on [control=['try'], data=[]] except ValueError: user_id = find_user(session, user_id) # depends on [control=['except'], data=[]] resp = _make_request(session, USER_URL, user_id) if not resp: ...
def is_dir_inside(dir, check_dirs): """ Check to see if dir is a subdirectory of (or matches) check_dir directories. Return True if the dir is a subdirectory of or matches any of the check directories. :param dir: String path of directory that may or may not be a subdirectory of or match th...
def function[is_dir_inside, parameter[dir, check_dirs]]: constant[ Check to see if dir is a subdirectory of (or matches) check_dir directories. Return True if the dir is a subdirectory of or matches any of the check directories. :param dir: String path of directory that may or may not be a ...
keyword[def] identifier[is_dir_inside] ( identifier[dir] , identifier[check_dirs] ): literal[string] keyword[for] identifier[check_dir] keyword[in] identifier[check_dirs] : keyword[if] identifier[os] . identifier[path] . identifier[commonprefix] ([ identifier[dir] , identifier[check_dir] ])== ...
def is_dir_inside(dir, check_dirs): """ Check to see if dir is a subdirectory of (or matches) check_dir directories. Return True if the dir is a subdirectory of or matches any of the check directories. :param dir: String path of directory that may or may not be a subdirectory of or match th...
def _validate_privileges(object_type, privs, privileges): ''' Validate the supplied privileges ''' if object_type != 'group': _perms = [_PRIVILEGES_MAP[perm] for perm in _PRIVILEGE_TYPE_MAP[object_type]] _perms.append('ALL') if object_type not in _PRIVILEGES_OBJE...
def function[_validate_privileges, parameter[object_type, privs, privileges]]: constant[ Validate the supplied privileges ] if compare[name[object_type] not_equal[!=] constant[group]] begin[:] variable[_perms] assign[=] <ast.ListComp object at 0x7da18dc079a0> call...
keyword[def] identifier[_validate_privileges] ( identifier[object_type] , identifier[privs] , identifier[privileges] ): literal[string] keyword[if] identifier[object_type] != literal[string] : identifier[_perms] =[ identifier[_PRIVILEGES_MAP] [ identifier[perm] ] keyword[for] identifier...
def _validate_privileges(object_type, privs, privileges): """ Validate the supplied privileges """ if object_type != 'group': _perms = [_PRIVILEGES_MAP[perm] for perm in _PRIVILEGE_TYPE_MAP[object_type]] _perms.append('ALL') if object_type not in _PRIVILEGES_OBJECTS: ...
def freqs_to_heights( matrix ): """ Calculate logo height using the method of: Schneider TD, Stephens RM. "Sequence logos: a new way to display consensus sequences." Nucleic Acids Res. 1990 Oct 25;18(20):6097-100. """ # Columns are sequence positions, rows are symbol counts/frequencies ...
def function[freqs_to_heights, parameter[matrix]]: constant[ Calculate logo height using the method of: Schneider TD, Stephens RM. "Sequence logos: a new way to display consensus sequences." Nucleic Acids Res. 1990 Oct 25;18(20):6097-100. ] variable[f] assign[=] call[name[matrix].v...
keyword[def] identifier[freqs_to_heights] ( identifier[matrix] ): literal[string] identifier[f] = identifier[matrix] . identifier[values] . identifier[transpose] () identifier[n] , identifier[m] = identifier[f] . identifier[shape] identifier[f] = identifier[f] / identifier[sum] ( ident...
def freqs_to_heights(matrix): """ Calculate logo height using the method of: Schneider TD, Stephens RM. "Sequence logos: a new way to display consensus sequences." Nucleic Acids Res. 1990 Oct 25;18(20):6097-100. """ # Columns are sequence positions, rows are symbol counts/frequencies f...
def diet(filename, configuration): ''' Squeeze files if there is a pipeline defined for them or leave them be otherwise. :param filename: filename of the file to process :param configuration: configuration dict describing commands and pipelines :type configuration: dict :return: has file ch...
def function[diet, parameter[filename, configuration]]: constant[ Squeeze files if there is a pipeline defined for them or leave them be otherwise. :param filename: filename of the file to process :param configuration: configuration dict describing commands and pipelines :type configuration...
keyword[def] identifier[diet] ( identifier[filename] , identifier[configuration] ): literal[string] identifier[changed] = keyword[False] keyword[if] keyword[not] identifier[isfile] ( identifier[filename] ): keyword[raise] identifier[NotFileDietException] ( literal[string] ) identi...
def diet(filename, configuration): """ Squeeze files if there is a pipeline defined for them or leave them be otherwise. :param filename: filename of the file to process :param configuration: configuration dict describing commands and pipelines :type configuration: dict :return: has file ch...
def delete_one_letter(self, letter=RIGHT): """Delete one letter the right or the the left of the cursor.""" assert letter in (self.RIGHT, self.LEFT) if letter == self.LEFT: papy = self.cursor self.text = self.text[:self.cursor - 1] + self.text[self.cursor:] ...
def function[delete_one_letter, parameter[self, letter]]: constant[Delete one letter the right or the the left of the cursor.] assert[compare[name[letter] in tuple[[<ast.Attribute object at 0x7da20c990970>, <ast.Attribute object at 0x7da20c992590>]]]] if compare[name[letter] equal[==] name[self].LEF...
keyword[def] identifier[delete_one_letter] ( identifier[self] , identifier[letter] = identifier[RIGHT] ): literal[string] keyword[assert] identifier[letter] keyword[in] ( identifier[self] . identifier[RIGHT] , identifier[self] . identifier[LEFT] ) keyword[if] identifier[letter] == ide...
def delete_one_letter(self, letter=RIGHT): """Delete one letter the right or the the left of the cursor.""" assert letter in (self.RIGHT, self.LEFT) if letter == self.LEFT: papy = self.cursor self.text = self.text[:self.cursor - 1] + self.text[self.cursor:] self.cursor = papy - 1 # ...
def _parseKeyName(self, name): """ Returns dict with fullpath, to, from. """ if name.endswith(Store.theInfoExtension): return {'type': 'info'} match = self.keyPattern.match(name) if not match: return None match = match.groupdict() match.update(ty...
def function[_parseKeyName, parameter[self, name]]: constant[ Returns dict with fullpath, to, from. ] if call[name[name].endswith, parameter[name[Store].theInfoExtension]] begin[:] return[dictionary[[<ast.Constant object at 0x7da2041d9ae0>], [<ast.Constant object at 0x7da2041d8b20>]]] va...
keyword[def] identifier[_parseKeyName] ( identifier[self] , identifier[name] ): literal[string] keyword[if] identifier[name] . identifier[endswith] ( identifier[Store] . identifier[theInfoExtension] ): keyword[return] { literal[string] : literal[string] } identifier[match] =...
def _parseKeyName(self, name): """ Returns dict with fullpath, to, from. """ if name.endswith(Store.theInfoExtension): return {'type': 'info'} # depends on [control=['if'], data=[]] match = self.keyPattern.match(name) if not match: return None # depends on [control=['if'], data=[]] ...
def unbuffered_write(self, buf): """Performs an unbuffered write, the default unless socket.send does not send everything, in which case an unbuffered write is done and the write method is set to be a buffered write until the buffer is empty once again. buf -- bytes to send ...
def function[unbuffered_write, parameter[self, buf]]: constant[Performs an unbuffered write, the default unless socket.send does not send everything, in which case an unbuffered write is done and the write method is set to be a buffered write until the buffer is empty once again. ...
keyword[def] identifier[unbuffered_write] ( identifier[self] , identifier[buf] ): literal[string] keyword[if] identifier[self] . identifier[closed] : keyword[raise] identifier[ConnectionClosed] () identifier[result] = literal[int] keyword[try] : ident...
def unbuffered_write(self, buf): """Performs an unbuffered write, the default unless socket.send does not send everything, in which case an unbuffered write is done and the write method is set to be a buffered write until the buffer is empty once again. buf -- bytes to send ...
def client_connection_made(self, transport): """ Called by twisted protocol when a connection attempt has succeeded. """ with self.lock: self.is_closed = False self.transport = transport self._send_options_message()
def function[client_connection_made, parameter[self, transport]]: constant[ Called by twisted protocol when a connection attempt has succeeded. ] with name[self].lock begin[:] name[self].is_closed assign[=] constant[False] name[self].transport assign[=] na...
keyword[def] identifier[client_connection_made] ( identifier[self] , identifier[transport] ): literal[string] keyword[with] identifier[self] . identifier[lock] : identifier[self] . identifier[is_closed] = keyword[False] identifier[self] . identifier[transport] = identifier[t...
def client_connection_made(self, transport): """ Called by twisted protocol when a connection attempt has succeeded. """ with self.lock: self.is_closed = False # depends on [control=['with'], data=[]] self.transport = transport self._send_options_message()
def monitor_session_span_command_direction(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") monitor = ET.SubElement(config, "monitor", xmlns="urn:brocade.com:mgmt:brocade-span") session = ET.SubElement(monitor, "session") session_number_key = ET.S...
def function[monitor_session_span_command_direction, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[monitor] assign[=] call[name[ET].SubElement, parameter[name[config], constant[monitor]]] v...
keyword[def] identifier[monitor_session_span_command_direction] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[monitor] = identifier[ET] . identifier[SubElement] ( identifier[config] , li...
def monitor_session_span_command_direction(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') monitor = ET.SubElement(config, 'monitor', xmlns='urn:brocade.com:mgmt:brocade-span') session = ET.SubElement(monitor, 'session') session_number_key = ET.SubElement(session, '...
def pre_build(self, traj, brian_list, network_dict): """Pre-builds the connections. Pre-build is only performed if none of the relevant parameters is explored and the relevant neuron groups exist. :param traj: Trajectory container :param brian_list: List o...
def function[pre_build, parameter[self, traj, brian_list, network_dict]]: constant[Pre-builds the connections. Pre-build is only performed if none of the relevant parameters is explored and the relevant neuron groups exist. :param traj: Trajectory container :param bria...
keyword[def] identifier[pre_build] ( identifier[self] , identifier[traj] , identifier[brian_list] , identifier[network_dict] ): literal[string] identifier[self] . identifier[_pre_build] = keyword[not] identifier[_explored_parameters_in_group] ( identifier[traj] , identifier[traj] . identifier[para...
def pre_build(self, traj, brian_list, network_dict): """Pre-builds the connections. Pre-build is only performed if none of the relevant parameters is explored and the relevant neuron groups exist. :param traj: Trajectory container :param brian_list: List of ob...
def _read_data(self): """ Reads data from the connection and adds it to _push_packet, until the connection is closed or the task in cancelled. """ while True: try: data = yield from self._socket.recv() except asyncio.CancelledError: ...
def function[_read_data, parameter[self]]: constant[ Reads data from the connection and adds it to _push_packet, until the connection is closed or the task in cancelled. ] while constant[True] begin[:] <ast.Try object at 0x7da207f03d60> call[name[self]._pu...
keyword[def] identifier[_read_data] ( identifier[self] ): literal[string] keyword[while] keyword[True] : keyword[try] : identifier[data] = keyword[yield] keyword[from] identifier[self] . identifier[_socket] . identifier[recv] () keyword[except] identif...
def _read_data(self): """ Reads data from the connection and adds it to _push_packet, until the connection is closed or the task in cancelled. """ while True: try: data = (yield from self._socket.recv()) # depends on [control=['try'], data=[]] except asyncio....
def get_summaries_log_dir(decode_hp, output_dir, dataset_split): """Get nested summaries_log_dir based on decode_hp.""" child_dir = decode_hp.summaries_log_dir level_dir = "".join([str(level) for level in decode_hp.level_interp]) if decode_hp.channel_interp == "all": rank_dir = "all" else: rank_dir = ...
def function[get_summaries_log_dir, parameter[decode_hp, output_dir, dataset_split]]: constant[Get nested summaries_log_dir based on decode_hp.] variable[child_dir] assign[=] name[decode_hp].summaries_log_dir variable[level_dir] assign[=] call[constant[].join, parameter[<ast.ListComp object at 0...
keyword[def] identifier[get_summaries_log_dir] ( identifier[decode_hp] , identifier[output_dir] , identifier[dataset_split] ): literal[string] identifier[child_dir] = identifier[decode_hp] . identifier[summaries_log_dir] identifier[level_dir] = literal[string] . identifier[join] ([ identifier[str] ( identi...
def get_summaries_log_dir(decode_hp, output_dir, dataset_split): """Get nested summaries_log_dir based on decode_hp.""" child_dir = decode_hp.summaries_log_dir level_dir = ''.join([str(level) for level in decode_hp.level_interp]) if decode_hp.channel_interp == 'all': rank_dir = 'all' # depends ...
def replace(s, replace): """Replace multiple values in a string""" for r in replace: s = s.replace(*r) return s
def function[replace, parameter[s, replace]]: constant[Replace multiple values in a string] for taget[name[r]] in starred[name[replace]] begin[:] variable[s] assign[=] call[name[s].replace, parameter[<ast.Starred object at 0x7da1b2344250>]] return[name[s]]
keyword[def] identifier[replace] ( identifier[s] , identifier[replace] ): literal[string] keyword[for] identifier[r] keyword[in] identifier[replace] : identifier[s] = identifier[s] . identifier[replace] (* identifier[r] ) keyword[return] identifier[s]
def replace(s, replace): """Replace multiple values in a string""" for r in replace: s = s.replace(*r) # depends on [control=['for'], data=['r']] return s
def n_atom(self, node): """atom ::= ('(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+) """ length = len(node) if length == 1: ...
def function[n_atom, parameter[self, node]]: constant[atom ::= ('(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+) ] variable[length] assign...
keyword[def] identifier[n_atom] ( identifier[self] , identifier[node] ): literal[string] identifier[length] = identifier[len] ( identifier[node] ) keyword[if] identifier[length] == literal[int] : identifier[self] . identifier[preorder] ( identifier[node] [ literal[int] ]) ...
def n_atom(self, node): """atom ::= ('(' [yield_expr|testlist_gexp] ')' | '[' [listmaker] ']' | '{' [dictmaker] '}' | '`' testlist1 '`' | NAME | NUMBER | STRING+) """ length = len(node) if length == 1: self.preo...
def create_record(cls, dump): """Create a new record from dump.""" # Reserve record identifier, create record and recid pid in one # operation. timestamp, data = dump.latest record = Record.create(data) record.model.created = dump.created.replace(tzinfo=None) reco...
def function[create_record, parameter[cls, dump]]: constant[Create a new record from dump.] <ast.Tuple object at 0x7da1b012ca00> assign[=] name[dump].latest variable[record] assign[=] call[name[Record].create, parameter[name[data]]] name[record].model.created assign[=] call[name[dump].cr...
keyword[def] identifier[create_record] ( identifier[cls] , identifier[dump] ): literal[string] identifier[timestamp] , identifier[data] = identifier[dump] . identifier[latest] identifier[record] = identifier[Record] . identifier[create] ( identifier[data] ) iden...
def create_record(cls, dump): """Create a new record from dump.""" # Reserve record identifier, create record and recid pid in one # operation. (timestamp, data) = dump.latest record = Record.create(data) record.model.created = dump.created.replace(tzinfo=None) record.model.updated = timesta...
def on_close(self, filename): """Move this file to destination folder.""" shutil.move(filename, self.destination_folder) path, fn = os.path.split(filename) return os.path.join(self.destination_folder, fn)
def function[on_close, parameter[self, filename]]: constant[Move this file to destination folder.] call[name[shutil].move, parameter[name[filename], name[self].destination_folder]] <ast.Tuple object at 0x7da18f813ca0> assign[=] call[name[os].path.split, parameter[name[filename]]] return[call...
keyword[def] identifier[on_close] ( identifier[self] , identifier[filename] ): literal[string] identifier[shutil] . identifier[move] ( identifier[filename] , identifier[self] . identifier[destination_folder] ) identifier[path] , identifier[fn] = identifier[os] . identifier[path] . identifi...
def on_close(self, filename): """Move this file to destination folder.""" shutil.move(filename, self.destination_folder) (path, fn) = os.path.split(filename) return os.path.join(self.destination_folder, fn)
def calculate_heading_longpath(locator1, locator2): """calculates the heading from the first to the second locator (long path) Args: locator1 (string): Locator, either 4 or 6 characters locator2 (string): Locator, either 4 or 6 characters Returns: float: Long pa...
def function[calculate_heading_longpath, parameter[locator1, locator2]]: constant[calculates the heading from the first to the second locator (long path) Args: locator1 (string): Locator, either 4 or 6 characters locator2 (string): Locator, either 4 or 6 characters Retu...
keyword[def] identifier[calculate_heading_longpath] ( identifier[locator1] , identifier[locator2] ): literal[string] identifier[heading] = identifier[calculate_heading] ( identifier[locator1] , identifier[locator2] ) identifier[lp] =( identifier[heading] + literal[int] )% literal[int] keyword...
def calculate_heading_longpath(locator1, locator2): """calculates the heading from the first to the second locator (long path) Args: locator1 (string): Locator, either 4 or 6 characters locator2 (string): Locator, either 4 or 6 characters Returns: float: Long pa...
def get_arguments(self): """ Extracts the specific arguments of this CLI """ # ApiCli.get_arguments(self) if self.args.file_name is not None: self.file_name = self.args.file_name
def function[get_arguments, parameter[self]]: constant[ Extracts the specific arguments of this CLI ] if compare[name[self].args.file_name is_not constant[None]] begin[:] name[self].file_name assign[=] name[self].args.file_name
keyword[def] identifier[get_arguments] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[args] . identifier[file_name] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[file_name] = identifier[self] . identifier[args] . id...
def get_arguments(self): """ Extracts the specific arguments of this CLI """ # ApiCli.get_arguments(self) if self.args.file_name is not None: self.file_name = self.args.file_name # depends on [control=['if'], data=[]]
def split_on_condition(seq, condition): """Split a sequence into two iterables without looping twice""" l1, l2 = tee((condition(item), item) for item in seq) return (i for p, i in l1 if p), (i for p, i in l2 if not p)
def function[split_on_condition, parameter[seq, condition]]: constant[Split a sequence into two iterables without looping twice] <ast.Tuple object at 0x7da1b253a410> assign[=] call[name[tee], parameter[<ast.GeneratorExp object at 0x7da1b253b9d0>]] return[tuple[[<ast.GeneratorExp object at 0x7da18f00...
keyword[def] identifier[split_on_condition] ( identifier[seq] , identifier[condition] ): literal[string] identifier[l1] , identifier[l2] = identifier[tee] (( identifier[condition] ( identifier[item] ), identifier[item] ) keyword[for] identifier[item] keyword[in] identifier[seq] ) keyword[return] ( ...
def split_on_condition(seq, condition): """Split a sequence into two iterables without looping twice""" (l1, l2) = tee(((condition(item), item) for item in seq)) return ((i for (p, i) in l1 if p), (i for (p, i) in l2 if not p))
def delete(self, cluster): """Deletes the cluster from persistent state. :param cluster: cluster to delete from persistent state :type cluster: :py:class:`elasticluster.cluster.Cluster` """ path = self._get_cluster_storage_path(cluster.name) if os.path.exists(path): ...
def function[delete, parameter[self, cluster]]: constant[Deletes the cluster from persistent state. :param cluster: cluster to delete from persistent state :type cluster: :py:class:`elasticluster.cluster.Cluster` ] variable[path] assign[=] call[name[self]._get_cluster_storage_pa...
keyword[def] identifier[delete] ( identifier[self] , identifier[cluster] ): literal[string] identifier[path] = identifier[self] . identifier[_get_cluster_storage_path] ( identifier[cluster] . identifier[name] ) keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifie...
def delete(self, cluster): """Deletes the cluster from persistent state. :param cluster: cluster to delete from persistent state :type cluster: :py:class:`elasticluster.cluster.Cluster` """ path = self._get_cluster_storage_path(cluster.name) if os.path.exists(path): os.unlin...
def uuid5(namespace, name): """Generate a UUID from the SHA-1 hash of a namespace UUID and a name.""" from hashlib import sha1 hash = sha1(namespace.bytes + name).digest() return UUID(bytes=hash[:16], version=5)
def function[uuid5, parameter[namespace, name]]: constant[Generate a UUID from the SHA-1 hash of a namespace UUID and a name.] from relative_module[hashlib] import module[sha1] variable[hash] assign[=] call[call[name[sha1], parameter[binary_operation[name[namespace].bytes + name[name]]]].digest, par...
keyword[def] identifier[uuid5] ( identifier[namespace] , identifier[name] ): literal[string] keyword[from] identifier[hashlib] keyword[import] identifier[sha1] identifier[hash] = identifier[sha1] ( identifier[namespace] . identifier[bytes] + identifier[name] ). identifier[digest] () keywo...
def uuid5(namespace, name): """Generate a UUID from the SHA-1 hash of a namespace UUID and a name.""" from hashlib import sha1 hash = sha1(namespace.bytes + name).digest() return UUID(bytes=hash[:16], version=5)
def plash_map(*args): from subprocess import check_output 'thin wrapper around plash map' out = check_output(['plash', 'map'] + list(args)) if out == '': return None return out.decode().strip('\n')
def function[plash_map, parameter[]]: from relative_module[subprocess] import module[check_output] constant[thin wrapper around plash map] variable[out] assign[=] call[name[check_output], parameter[binary_operation[list[[<ast.Constant object at 0x7da18f09cc70>, <ast.Constant object at 0x7da18f09f8e0...
keyword[def] identifier[plash_map] (* identifier[args] ): keyword[from] identifier[subprocess] keyword[import] identifier[check_output] literal[string] identifier[out] = identifier[check_output] ([ literal[string] , literal[string] ]+ identifier[list] ( identifier[args] )) keyword[if] identi...
def plash_map(*args): from subprocess import check_output 'thin wrapper around plash map' out = check_output(['plash', 'map'] + list(args)) if out == '': return None # depends on [control=['if'], data=[]] return out.decode().strip('\n')
def _get_field_types(self): 'Retrieve the field types. Useful for debugging.' mapping = self.conn.indices.get_mapping( index=self.index, doc_type=self.type) return mapping[self.index]['mappings'][self.type]['properties']
def function[_get_field_types, parameter[self]]: constant[Retrieve the field types. Useful for debugging.] variable[mapping] assign[=] call[name[self].conn.indices.get_mapping, parameter[]] return[call[call[call[call[name[mapping]][name[self].index]][constant[mappings]]][name[self].type]][constant[p...
keyword[def] identifier[_get_field_types] ( identifier[self] ): literal[string] identifier[mapping] = identifier[self] . identifier[conn] . identifier[indices] . identifier[get_mapping] ( identifier[index] = identifier[self] . identifier[index] , identifier[doc_type] = identifier[self] . i...
def _get_field_types(self): """Retrieve the field types. Useful for debugging.""" mapping = self.conn.indices.get_mapping(index=self.index, doc_type=self.type) return mapping[self.index]['mappings'][self.type]['properties']
def __getSequenceVariants(self, x1, polyStart, polyStop, listSequence) : """polyStop, is the polymorphisme at wixh number where the calcul of combinaisons stops""" if polyStart < len(self.polymorphisms) and polyStart < polyStop: sequence = copy.copy(listSequence) ret = [] pk = self.polymorphisms[polyS...
def function[__getSequenceVariants, parameter[self, x1, polyStart, polyStop, listSequence]]: constant[polyStop, is the polymorphisme at wixh number where the calcul of combinaisons stops] if <ast.BoolOp object at 0x7da18fe93e50> begin[:] variable[sequence] assign[=] call[name[copy].copy,...
keyword[def] identifier[__getSequenceVariants] ( identifier[self] , identifier[x1] , identifier[polyStart] , identifier[polyStop] , identifier[listSequence] ): literal[string] keyword[if] identifier[polyStart] < identifier[len] ( identifier[self] . identifier[polymorphisms] ) keyword[and] identifier[polyStar...
def __getSequenceVariants(self, x1, polyStart, polyStop, listSequence): """polyStop, is the polymorphisme at wixh number where the calcul of combinaisons stops""" if polyStart < len(self.polymorphisms) and polyStart < polyStop: sequence = copy.copy(listSequence) ret = [] pk = self.polymo...
def add_or_update(data, item, value): """ Add or update value in configuration file format used by proftpd. Args: data (str): Configuration file as string. item (str): What option will be added/updated. value (str): Value of option. Returns: str: updated configuration ...
def function[add_or_update, parameter[data, item, value]]: constant[ Add or update value in configuration file format used by proftpd. Args: data (str): Configuration file as string. item (str): What option will be added/updated. value (str): Value of option. Returns: ...
keyword[def] identifier[add_or_update] ( identifier[data] , identifier[item] , identifier[value] ): literal[string] identifier[data] = identifier[data] . identifier[splitlines] () identifier[data] = identifier[map] ( keyword[lambda] identifier[x] : identifier[bytearray] ( identifier[x...
def add_or_update(data, item, value): """ Add or update value in configuration file format used by proftpd. Args: data (str): Configuration file as string. item (str): What option will be added/updated. value (str): Value of option. Returns: str: updated configuration ...
def bounding_ellipsoids(points, pointvol=0., vol_dec=0.5, vol_check=2.): """ Calculate a set of ellipsoids that bound the collection of points. Parameters ---------- points : `~numpy.ndarray` with shape (npoints, ndim) A set of coordinates. pointvol : float, optional Volume rep...
def function[bounding_ellipsoids, parameter[points, pointvol, vol_dec, vol_check]]: constant[ Calculate a set of ellipsoids that bound the collection of points. Parameters ---------- points : `~numpy.ndarray` with shape (npoints, ndim) A set of coordinates. pointvol : float, option...
keyword[def] identifier[bounding_ellipsoids] ( identifier[points] , identifier[pointvol] = literal[int] , identifier[vol_dec] = literal[int] , identifier[vol_check] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[HAVE_KMEANS] : keyword[raise] identifier[ValueError] ( lite...
def bounding_ellipsoids(points, pointvol=0.0, vol_dec=0.5, vol_check=2.0): """ Calculate a set of ellipsoids that bound the collection of points. Parameters ---------- points : `~numpy.ndarray` with shape (npoints, ndim) A set of coordinates. pointvol : float, optional Volume r...
def rebuild(self, **kwargs): '''Repopulate the node-tracking data structures. Shouldn't really ever be needed. ''' self.nodes = [] self.node_types = [] self.id_dict = {} self.type_dict = {} self.add_node(self.root)
def function[rebuild, parameter[self]]: constant[Repopulate the node-tracking data structures. Shouldn't really ever be needed. ] name[self].nodes assign[=] list[[]] name[self].node_types assign[=] list[[]] name[self].id_dict assign[=] dictionary[[], []] name[sel...
keyword[def] identifier[rebuild] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[nodes] =[] identifier[self] . identifier[node_types] =[] identifier[self] . identifier[id_dict] ={} identifier[self] . identifier[type_dict] ={} ...
def rebuild(self, **kwargs): """Repopulate the node-tracking data structures. Shouldn't really ever be needed. """ self.nodes = [] self.node_types = [] self.id_dict = {} self.type_dict = {} self.add_node(self.root)
def write_line(self, values): """ Process a list of values according to the format specified to generate a line of output. """ if not self._write_line_init: self.init_write_line() if len(self._out_widths) > len(values): raise For2PyError(f"ERROR:...
def function[write_line, parameter[self, values]]: constant[ Process a list of values according to the format specified to generate a line of output. ] if <ast.UnaryOp object at 0x7da1b04fd4b0> begin[:] call[name[self].init_write_line, parameter[]] if comp...
keyword[def] identifier[write_line] ( identifier[self] , identifier[values] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_write_line_init] : identifier[self] . identifier[init_write_line] () keyword[if] identifier[len] ( identifier[self] . ide...
def write_line(self, values): """ Process a list of values according to the format specified to generate a line of output. """ if not self._write_line_init: self.init_write_line() # depends on [control=['if'], data=[]] if len(self._out_widths) > len(values): raise Fo...
def bm3_dPdV(v, v0, k0, k0p, precision=1.e-5): """ calculate dP/dV for numerical calculation of bulk modulus according to test this differs from analytical result by 1.e-5 :param v: volume :param v0: volume at reference conditions :param k0: bulk modulus at reference conditions :param k0p: ...
def function[bm3_dPdV, parameter[v, v0, k0, k0p, precision]]: constant[ calculate dP/dV for numerical calculation of bulk modulus according to test this differs from analytical result by 1.e-5 :param v: volume :param v0: volume at reference conditions :param k0: bulk modulus at reference co...
keyword[def] identifier[bm3_dPdV] ( identifier[v] , identifier[v0] , identifier[k0] , identifier[k0p] , identifier[precision] = literal[int] ): literal[string] keyword[def] identifier[f_scalar] ( identifier[v] , identifier[v0] , identifier[k0] , identifier[k0p] , identifier[precision] = identifier[precisi...
def bm3_dPdV(v, v0, k0, k0p, precision=1e-05): """ calculate dP/dV for numerical calculation of bulk modulus according to test this differs from analytical result by 1.e-5 :param v: volume :param v0: volume at reference conditions :param k0: bulk modulus at reference conditions :param k0p: ...
def _cut_to_heading( self, content: str, to_heading: str or None = None, options={} ) -> str: '''Cut part of Markdown string from the start to a certain heading, set internal heading level, and remove top heading. If not heading is defined...
def function[_cut_to_heading, parameter[self, content, to_heading, options]]: constant[Cut part of Markdown string from the start to a certain heading, set internal heading level, and remove top heading. If not heading is defined, the whole string is returned. Heading shift and top hea...
keyword[def] identifier[_cut_to_heading] ( identifier[self] , identifier[content] : identifier[str] , identifier[to_heading] : identifier[str] keyword[or] keyword[None] = keyword[None] , identifier[options] ={} )-> identifier[str] : literal[string] identifier[self] . identifier[logger] . ide...
def _cut_to_heading(self, content: str, to_heading: str or None=None, options={}) -> str: """Cut part of Markdown string from the start to a certain heading, set internal heading level, and remove top heading. If not heading is defined, the whole string is returned. Heading shift and top h...
def from_value(cls, value): """ Return the EChoice object associated with this value, if any. Parameters ---------- value In the type of the `value` field, as set when instantiating this EChoice. Returns ------- EChoice Raises ...
def function[from_value, parameter[cls, value]]: constant[ Return the EChoice object associated with this value, if any. Parameters ---------- value In the type of the `value` field, as set when instantiating this EChoice. Returns ------- ECh...
keyword[def] identifier[from_value] ( identifier[cls] , identifier[value] ): literal[string] identifier[warnings] . identifier[warn] ( literal[string] literal[string] . identifier[format] ( identifier[cls] . identifier[__name__] , identifier[cls] . identifier[from_value] . identifier[__na...
def from_value(cls, value): """ Return the EChoice object associated with this value, if any. Parameters ---------- value In the type of the `value` field, as set when instantiating this EChoice. Returns ------- EChoice Raises --...
def depth_bounds(self): """Depth at grid interfaces (m) :getter: Returns the bounds of axis ``'depth'`` if availible in the process's domains. :type: array :raises: :exc:`ValueError` if no ``'depth'`` axis can be found. """ ...
def function[depth_bounds, parameter[self]]: constant[Depth at grid interfaces (m) :getter: Returns the bounds of axis ``'depth'`` if availible in the process's domains. :type: array :raises: :exc:`ValueError` if no ``'depth'`` axis can be...
keyword[def] identifier[depth_bounds] ( identifier[self] ): literal[string] keyword[try] : keyword[for] identifier[domname] , identifier[dom] keyword[in] identifier[self] . identifier[domains] . identifier[items] (): keyword[try] : identifier[th...
def depth_bounds(self): """Depth at grid interfaces (m) :getter: Returns the bounds of axis ``'depth'`` if availible in the process's domains. :type: array :raises: :exc:`ValueError` if no ``'depth'`` axis can be found. """ try: ...
def _get_placeholders(sql_statement, parameters): """ Retrieve the list of placeholders and their type defined in an SQL statement. @param sql_statement: a parameterized statement. @param parameters: the list of parameters used in the SQL statement. @return: a dictio...
def function[_get_placeholders, parameter[sql_statement, parameters]]: constant[ Retrieve the list of placeholders and their type defined in an SQL statement. @param sql_statement: a parameterized statement. @param parameters: the list of parameters used in the SQL statement. ...
keyword[def] identifier[_get_placeholders] ( identifier[sql_statement] , identifier[parameters] ): literal[string] identifier[placeholders] ={} keyword[try] : keyword[for] identifier[match] keyword[in] identifier[REGEX_PATTERN_SQL_PLACEHOLDERS] . identifi...
def _get_placeholders(sql_statement, parameters): """ Retrieve the list of placeholders and their type defined in an SQL statement. @param sql_statement: a parameterized statement. @param parameters: the list of parameters used in the SQL statement. @return: a dictionary...
def device_query_list(self, **kwargs): # noqa: E501 """List device queries. # noqa: E501 List all device queries. The result will be paged into pages of 100. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asynch...
def function[device_query_list, parameter[self]]: constant[List device queries. # noqa: E501 List all device queries. The result will be paged into pages of 100. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asy...
keyword[def] identifier[device_query_list] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[self] . identifier[...
def device_query_list(self, **kwargs): # noqa: E501 'List device queries. # noqa: E501\n\n List all device queries. The result will be paged into pages of 100. # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass asynchro...
def _print_layers(targets, components, tasks): """ Print dependency information, grouping components based on their position in the dependency graph. Components with no dependnecies will be in layer 0, components that only depend on layer 0 will be in layer 1, and so on. If there's a circular depe...
def function[_print_layers, parameter[targets, components, tasks]]: constant[ Print dependency information, grouping components based on their position in the dependency graph. Components with no dependnecies will be in layer 0, components that only depend on layer 0 will be in layer 1, and so on. ...
keyword[def] identifier[_print_layers] ( identifier[targets] , identifier[components] , identifier[tasks] ): literal[string] identifier[layer] = literal[int] identifier[expected_count] = identifier[len] ( identifier[tasks] ) identifier[counts] ={} keyword[def] identifier[_add_layer] ( ide...
def _print_layers(targets, components, tasks): """ Print dependency information, grouping components based on their position in the dependency graph. Components with no dependnecies will be in layer 0, components that only depend on layer 0 will be in layer 1, and so on. If there's a circular depe...
def floats(self, n: int = 2) -> List[float]: """Generate a list of random float numbers. :param n: Raise 10 to the 'n' power. :return: The list of floating-point numbers. """ nums = [self.random.random() for _ in range(10 ** int(n))] return nums
def function[floats, parameter[self, n]]: constant[Generate a list of random float numbers. :param n: Raise 10 to the 'n' power. :return: The list of floating-point numbers. ] variable[nums] assign[=] <ast.ListComp object at 0x7da18f811ab0> return[name[nums]]
keyword[def] identifier[floats] ( identifier[self] , identifier[n] : identifier[int] = literal[int] )-> identifier[List] [ identifier[float] ]: literal[string] identifier[nums] =[ identifier[self] . identifier[random] . identifier[random] () keyword[for] identifier[_] keyword[in] identi...
def floats(self, n: int=2) -> List[float]: """Generate a list of random float numbers. :param n: Raise 10 to the 'n' power. :return: The list of floating-point numbers. """ nums = [self.random.random() for _ in range(10 ** int(n))] return nums
def score_cosine(self, term1, term2, **kwargs): """ Compute a weighting score based on the cosine distance between the kernel density estimates of two terms. Args: term1 (str) term2 (str) Returns: float """ t1_kde = self.kde(term1, **kw...
def function[score_cosine, parameter[self, term1, term2]]: constant[ Compute a weighting score based on the cosine distance between the kernel density estimates of two terms. Args: term1 (str) term2 (str) Returns: float ] variable[t1_kde]...
keyword[def] identifier[score_cosine] ( identifier[self] , identifier[term1] , identifier[term2] ,** identifier[kwargs] ): literal[string] identifier[t1_kde] = identifier[self] . identifier[kde] ( identifier[term1] ,** identifier[kwargs] ) identifier[t2_kde] = identifier[self] . identifi...
def score_cosine(self, term1, term2, **kwargs): """ Compute a weighting score based on the cosine distance between the kernel density estimates of two terms. Args: term1 (str) term2 (str) Returns: float """ t1_kde = self.kde(term1, **kwargs) ...
def get_state_change_with_balance_proof_by_balance_hash( storage: sqlite.SQLiteStorage, canonical_identifier: CanonicalIdentifier, balance_hash: BalanceHash, sender: Address, ) -> sqlite.StateChangeRecord: """ Returns the state change which contains the corresponding balance proo...
def function[get_state_change_with_balance_proof_by_balance_hash, parameter[storage, canonical_identifier, balance_hash, sender]]: constant[ Returns the state change which contains the corresponding balance proof. Use this function to find a balance proof for a call to settle, which only has the bl...
keyword[def] identifier[get_state_change_with_balance_proof_by_balance_hash] ( identifier[storage] : identifier[sqlite] . identifier[SQLiteStorage] , identifier[canonical_identifier] : identifier[CanonicalIdentifier] , identifier[balance_hash] : identifier[BalanceHash] , identifier[sender] : identifier[Address] ,...
def get_state_change_with_balance_proof_by_balance_hash(storage: sqlite.SQLiteStorage, canonical_identifier: CanonicalIdentifier, balance_hash: BalanceHash, sender: Address) -> sqlite.StateChangeRecord: """ Returns the state change which contains the corresponding balance proof. Use this function to find a...
def link2html(text): ''' Turns md links to html ''' match = r'\[([^\]]+)\]\(([^)]+)\)' replace = r'<a href="\2">\1</a>' return re.sub(match, replace, text)
def function[link2html, parameter[text]]: constant[ Turns md links to html ] variable[match] assign[=] constant[\[([^\]]+)\]\(([^)]+)\)] variable[replace] assign[=] constant[<a href="\2">\1</a>] return[call[name[re].sub, parameter[name[match], name[replace], name[text]]]]
keyword[def] identifier[link2html] ( identifier[text] ): literal[string] identifier[match] = literal[string] identifier[replace] = literal[string] keyword[return] identifier[re] . identifier[sub] ( identifier[match] , identifier[replace] , identifier[text] )
def link2html(text): """ Turns md links to html """ match = '\\[([^\\]]+)\\]\\(([^)]+)\\)' replace = '<a href="\\2">\\1</a>' return re.sub(match, replace, text)
def pattern_logic_aeidon(): """Return patterns to be used for searching subtitles via aeidon.""" if Config.options.pattern_files: return prep_patterns(Config.options.pattern_files) elif Config.options.regex: return Config.REGEX else: return Config.TERMS
def function[pattern_logic_aeidon, parameter[]]: constant[Return patterns to be used for searching subtitles via aeidon.] if name[Config].options.pattern_files begin[:] return[call[name[prep_patterns], parameter[name[Config].options.pattern_files]]]
keyword[def] identifier[pattern_logic_aeidon] (): literal[string] keyword[if] identifier[Config] . identifier[options] . identifier[pattern_files] : keyword[return] identifier[prep_patterns] ( identifier[Config] . identifier[options] . identifier[pattern_files] ) keyword[elif] identifier[...
def pattern_logic_aeidon(): """Return patterns to be used for searching subtitles via aeidon.""" if Config.options.pattern_files: return prep_patterns(Config.options.pattern_files) # depends on [control=['if'], data=[]] elif Config.options.regex: return Config.REGEX # depends on [control=[...
def Copy(self, field_number=None): """Returns descriptor copy, optionally changing field number.""" new_args = self._kwargs.copy() if field_number is not None: new_args["field_number"] = field_number return ProtoRDFValue( rdf_type=self.original_proto_type_name, default=getattr(sel...
def function[Copy, parameter[self, field_number]]: constant[Returns descriptor copy, optionally changing field number.] variable[new_args] assign[=] call[name[self]._kwargs.copy, parameter[]] if compare[name[field_number] is_not constant[None]] begin[:] call[name[new_args]][const...
keyword[def] identifier[Copy] ( identifier[self] , identifier[field_number] = keyword[None] ): literal[string] identifier[new_args] = identifier[self] . identifier[_kwargs] . identifier[copy] () keyword[if] identifier[field_number] keyword[is] keyword[not] keyword[None] : identifier[new_arg...
def Copy(self, field_number=None): """Returns descriptor copy, optionally changing field number.""" new_args = self._kwargs.copy() if field_number is not None: new_args['field_number'] = field_number # depends on [control=['if'], data=['field_number']] return ProtoRDFValue(rdf_type=self.origina...
def close(self): """Close open resources.""" super(RarExtFile, self).close() if self._fd: self._fd.close() self._fd = None
def function[close, parameter[self]]: constant[Close open resources.] call[call[name[super], parameter[name[RarExtFile], name[self]]].close, parameter[]] if name[self]._fd begin[:] call[name[self]._fd.close, parameter[]] name[self]._fd assign[=] constant[None]
keyword[def] identifier[close] ( identifier[self] ): literal[string] identifier[super] ( identifier[RarExtFile] , identifier[self] ). identifier[close] () keyword[if] identifier[self] . identifier[_fd] : identifier[self] . identifier[_fd] . identifier[close] () ...
def close(self): """Close open resources.""" super(RarExtFile, self).close() if self._fd: self._fd.close() self._fd = None # depends on [control=['if'], data=[]]
def block(self, cutoffs=None, values=None, n_bins=0, right=False, function=None): """ Block a log based on number of bins, or on cutoffs. Args: cutoffs (array) values (array): the values to map to. Def...
def function[block, parameter[self, cutoffs, values, n_bins, right, function]]: constant[ Block a log based on number of bins, or on cutoffs. Args: cutoffs (array) values (array): the values to map to. Defaults to [0, 1, 2,...] n_bins (int) right ...
keyword[def] identifier[block] ( identifier[self] , identifier[cutoffs] = keyword[None] , identifier[values] = keyword[None] , identifier[n_bins] = literal[int] , identifier[right] = keyword[False] , identifier[function] = keyword[None] ): literal[string] identifier[params] = identifi...
def block(self, cutoffs=None, values=None, n_bins=0, right=False, function=None): """ Block a log based on number of bins, or on cutoffs. Args: cutoffs (array) values (array): the values to map to. Defaults to [0, 1, 2,...] n_bins (int) right (bool) ...
def query(self, expression, vm='python'): """Evaluate expression and then use it to extract rows from the table. Parameters ---------- expression : string Expression to evaluate. vm : {'numexpr', 'python'} Virtual machine to use. Returns ...
def function[query, parameter[self, expression, vm]]: constant[Evaluate expression and then use it to extract rows from the table. Parameters ---------- expression : string Expression to evaluate. vm : {'numexpr', 'python'} Virtual machine to use. ...
keyword[def] identifier[query] ( identifier[self] , identifier[expression] , identifier[vm] = literal[string] ): literal[string] identifier[condition] = identifier[self] . identifier[eval] ( identifier[expression] , identifier[vm] = identifier[vm] ) keyword[return] identifier[self] . ide...
def query(self, expression, vm='python'): """Evaluate expression and then use it to extract rows from the table. Parameters ---------- expression : string Expression to evaluate. vm : {'numexpr', 'python'} Virtual machine to use. Returns ----...
def get_waveform_end_frequency(template=None, **kwargs): """Return the stop frequency of a template """ input_params = props(template,**kwargs) approximant = kwargs['approximant'] if approximant in _filter_ends: return _filter_ends[approximant](**input_params) else: return None
def function[get_waveform_end_frequency, parameter[template]]: constant[Return the stop frequency of a template ] variable[input_params] assign[=] call[name[props], parameter[name[template]]] variable[approximant] assign[=] call[name[kwargs]][constant[approximant]] if compare[name[ap...
keyword[def] identifier[get_waveform_end_frequency] ( identifier[template] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[input_params] = identifier[props] ( identifier[template] ,** identifier[kwargs] ) identifier[approximant] = identifier[kwargs] [ literal[string] ] keywo...
def get_waveform_end_frequency(template=None, **kwargs): """Return the stop frequency of a template """ input_params = props(template, **kwargs) approximant = kwargs['approximant'] if approximant in _filter_ends: return _filter_ends[approximant](**input_params) # depends on [control=['if'],...
def set_chat_description(chat_id, description, **kwargs): """ Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. :param chat_id: Unique identifier for ...
def function[set_chat_description, parameter[chat_id, description]]: constant[ Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. :param chat_id: U...
keyword[def] identifier[set_chat_description] ( identifier[chat_id] , identifier[description] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[len] ( identifier[description] )> literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[par...
def set_chat_description(chat_id, description, **kwargs): """ Use this method to change the description of a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate admin rights. Returns True on success. :param chat_id: Unique identifier for ...
def size(ctx, dataset, kwargs): "Show dataset size" kwargs = parse_kwargs(kwargs) (print)(data(dataset, **ctx.obj).get(**kwargs).complete_set.size)
def function[size, parameter[ctx, dataset, kwargs]]: constant[Show dataset size] variable[kwargs] assign[=] call[name[parse_kwargs], parameter[name[kwargs]]] call[name[print], parameter[call[call[name[data], parameter[name[dataset]]].get, parameter[]].complete_set.size]]
keyword[def] identifier[size] ( identifier[ctx] , identifier[dataset] , identifier[kwargs] ): literal[string] identifier[kwargs] = identifier[parse_kwargs] ( identifier[kwargs] ) ( identifier[print] )( identifier[data] ( identifier[dataset] ,** identifier[ctx] . identifier[obj] ). identifier[get] (** ...
def size(ctx, dataset, kwargs): """Show dataset size""" kwargs = parse_kwargs(kwargs) print(data(dataset, **ctx.obj).get(**kwargs).complete_set.size)
def get_pseudo_abi_for_input(s, timeout=None, proxies=None): """ Lookup sighash from 4bytes.directory, create a pseudo api and try to decode it with the parsed abi. May return multiple results as sighashes may collide. :param s: bytes input :return: pseudo abi for method ...
def function[get_pseudo_abi_for_input, parameter[s, timeout, proxies]]: constant[ Lookup sighash from 4bytes.directory, create a pseudo api and try to decode it with the parsed abi. May return multiple results as sighashes may collide. :param s: bytes input :return: pseudo abi fo...
keyword[def] identifier[get_pseudo_abi_for_input] ( identifier[s] , identifier[timeout] = keyword[None] , identifier[proxies] = keyword[None] ): literal[string] identifier[sighash] = identifier[Utils] . identifier[bytes_to_str] ( identifier[s] [: literal[int] ]) keyword[for] identifier[ps...
def get_pseudo_abi_for_input(s, timeout=None, proxies=None): """ Lookup sighash from 4bytes.directory, create a pseudo api and try to decode it with the parsed abi. May return multiple results as sighashes may collide. :param s: bytes input :return: pseudo abi for method """ ...
def Emulation_setScriptExecutionDisabled(self, value): """ Function path: Emulation.setScriptExecutionDisabled Domain: Emulation Method name: setScriptExecutionDisabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'value' (type: boolean) -> Whether scri...
def function[Emulation_setScriptExecutionDisabled, parameter[self, value]]: constant[ Function path: Emulation.setScriptExecutionDisabled Domain: Emulation Method name: setScriptExecutionDisabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'value...
keyword[def] identifier[Emulation_setScriptExecutionDisabled] ( identifier[self] , identifier[value] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[value] ,( identifier[bool] ,) ), literal[string] % identifier[type] ( identifier[value] ) identifier[subdom_funcs] = identifier[se...
def Emulation_setScriptExecutionDisabled(self, value): """ Function path: Emulation.setScriptExecutionDisabled Domain: Emulation Method name: setScriptExecutionDisabled WARNING: This function is marked 'Experimental'! Parameters: Required arguments: 'value' (type: boolean) -> Whether sc...
def gps2_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses): ''' RTK GPS data. Gives information on the relative baseline calculation ...
def function[gps2_rtk_encode, parameter[self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses]]: constant[ RTK GPS data. Gives information on the relative baseline calcul...
keyword[def] identifier[gps2_rtk_encode] ( identifier[self] , identifier[time_last_baseline_ms] , identifier[rtk_receiver_id] , identifier[wn] , identifier[tow] , identifier[rtk_health] , identifier[rtk_rate] , identifier[nsats] , identifier[baseline_coords_type] , identifier[baseline_a_mm] , identifier[baseline_b_mm...
def gps2_rtk_encode(self, time_last_baseline_ms, rtk_receiver_id, wn, tow, rtk_health, rtk_rate, nsats, baseline_coords_type, baseline_a_mm, baseline_b_mm, baseline_c_mm, accuracy, iar_num_hypotheses): """ RTK GPS data. Gives information on the relative baseline calculation the GPS i...
def imatch(pattern, name): # type: (Text, Text) -> bool """Test whether a name matches a wildcard pattern (case insensitive). Arguments: pattern (str): A wildcard pattern, e.g. ``"*.py"``. name (bool): A filename. Returns: bool: `True` if the filename matches the pattern. ...
def function[imatch, parameter[pattern, name]]: constant[Test whether a name matches a wildcard pattern (case insensitive). Arguments: pattern (str): A wildcard pattern, e.g. ``"*.py"``. name (bool): A filename. Returns: bool: `True` if the filename matches the pattern. ] ...
keyword[def] identifier[imatch] ( identifier[pattern] , identifier[name] ): literal[string] keyword[try] : identifier[re_pat] = identifier[_PATTERN_CACHE] [( identifier[pattern] , keyword[False] )] keyword[except] identifier[KeyError] : identifier[res] = literal[string] + identifie...
def imatch(pattern, name): # type: (Text, Text) -> bool 'Test whether a name matches a wildcard pattern (case insensitive).\n\n Arguments:\n pattern (str): A wildcard pattern, e.g. ``"*.py"``.\n name (bool): A filename.\n\n Returns:\n bool: `True` if the filename matches the pattern.\...
def setClients(self, *args, **kwargs): """Adds the clients for this group to a 'clients' field. The 'groupMembers' field of the group holds the encodedKeys of the member clients of the group. Since Mambu REST API accepts both ids or encodedKeys to retrieve entities, we use that here. ...
def function[setClients, parameter[self]]: constant[Adds the clients for this group to a 'clients' field. The 'groupMembers' field of the group holds the encodedKeys of the member clients of the group. Since Mambu REST API accepts both ids or encodedKeys to retrieve entities, we use tha...
keyword[def] identifier[setClients] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[requests] = literal[int] keyword[if] literal[string] keyword[in] identifier[kwargs] : identifier[fullDetails] = identifier[kwargs] [ literal[str...
def setClients(self, *args, **kwargs): """Adds the clients for this group to a 'clients' field. The 'groupMembers' field of the group holds the encodedKeys of the member clients of the group. Since Mambu REST API accepts both ids or encodedKeys to retrieve entities, we use that here. ...
def load(self, **kwargs): """Custom load method to address issue in 11.6.0 Final, where non existing objects would be True. """ if LooseVersion(self.tmos_ver) == LooseVersion('11.6.0'): return self._load_11_6(**kwargs) else: return super(Rule, self)._load...
def function[load, parameter[self]]: constant[Custom load method to address issue in 11.6.0 Final, where non existing objects would be True. ] if compare[call[name[LooseVersion], parameter[name[self].tmos_ver]] equal[==] call[name[LooseVersion], parameter[constant[11.6.0]]]] begin[:] ...
keyword[def] identifier[load] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[LooseVersion] ( identifier[self] . identifier[tmos_ver] )== identifier[LooseVersion] ( literal[string] ): keyword[return] identifier[self] . identifier[_load_11_6] (** id...
def load(self, **kwargs): """Custom load method to address issue in 11.6.0 Final, where non existing objects would be True. """ if LooseVersion(self.tmos_ver) == LooseVersion('11.6.0'): return self._load_11_6(**kwargs) # depends on [control=['if'], data=[]] else: return sup...
def timestring(self, pattern="%Y-%m-%d %H:%M:%S", timezone=None): """Returns a time string. :param pattern = "%Y-%m-%d %H:%M:%S" The format used. By default, an ISO-type format is used. The syntax here is identical to the one used by time.strftime() and time.strptime...
def function[timestring, parameter[self, pattern, timezone]]: constant[Returns a time string. :param pattern = "%Y-%m-%d %H:%M:%S" The format used. By default, an ISO-type format is used. The syntax here is identical to the one used by time.strftime() and time.strpti...
keyword[def] identifier[timestring] ( identifier[self] , identifier[pattern] = literal[string] , identifier[timezone] = keyword[None] ): literal[string] keyword[if] identifier[timezone] keyword[is] keyword[None] : identifier[timezone] = identifier[self] . identifier[timezone] ...
def timestring(self, pattern='%Y-%m-%d %H:%M:%S', timezone=None): """Returns a time string. :param pattern = "%Y-%m-%d %H:%M:%S" The format used. By default, an ISO-type format is used. The syntax here is identical to the one used by time.strftime() and time.strptime(). ...
def fetch_resource(url): """Fetch a resource and return the resulting lines in a list Send file_name to get more clean log messages Args: url(str) Returns: lines(list(str)) """ try: data = get_request(url) lines = data.split('\n') except Exception as...
def function[fetch_resource, parameter[url]]: constant[Fetch a resource and return the resulting lines in a list Send file_name to get more clean log messages Args: url(str) Returns: lines(list(str)) ] <ast.Try object at 0x7da18fe93be0> return[name[lines]]
keyword[def] identifier[fetch_resource] ( identifier[url] ): literal[string] keyword[try] : identifier[data] = identifier[get_request] ( identifier[url] ) identifier[lines] = identifier[data] . identifier[split] ( literal[string] ) keyword[except] identifier[Exception] keyword[as] ...
def fetch_resource(url): """Fetch a resource and return the resulting lines in a list Send file_name to get more clean log messages Args: url(str) Returns: lines(list(str)) """ try: data = get_request(url) lines = data.split('\n') # depends on [control=...
def read_core_state_eigen(self): """ Read the core state eigenenergies at each ionic step. Returns: A list of dict over the atom such as [{"AO":[core state eig]}]. The core state eigenenergie list for each AO is over all ionic step. Example: ...
def function[read_core_state_eigen, parameter[self]]: constant[ Read the core state eigenenergies at each ionic step. Returns: A list of dict over the atom such as [{"AO":[core state eig]}]. The core state eigenenergie list for each AO is over all ionic step....
keyword[def] identifier[read_core_state_eigen] ( identifier[self] ): literal[string] keyword[with] identifier[zopen] ( identifier[self] . identifier[filename] , literal[string] ) keyword[as] identifier[foutcar] : identifier[line] = identifier[foutcar] . identifier[readline] () ...
def read_core_state_eigen(self): """ Read the core state eigenenergies at each ionic step. Returns: A list of dict over the atom such as [{"AO":[core state eig]}]. The core state eigenenergie list for each AO is over all ionic step. Example: ...
def initialize_bfd(self, abfd): """Initialize underlying libOpcodes library using BFD.""" self._ptr = _opcodes.initialize_bfd(abfd._ptr) # Already done inside opcodes.c #self.architecture = abfd.architecture #self.machine = abfd.machine #self.endian = abfd....
def function[initialize_bfd, parameter[self, abfd]]: constant[Initialize underlying libOpcodes library using BFD.] name[self]._ptr assign[=] call[name[_opcodes].initialize_bfd, parameter[name[abfd]._ptr]] if compare[name[self].architecture equal[==] name[ARCH_I386]] begin[:] if c...
keyword[def] identifier[initialize_bfd] ( identifier[self] , identifier[abfd] ): literal[string] identifier[self] . identifier[_ptr] = identifier[_opcodes] . identifier[initialize_bfd] ( identifier[abfd] . identifier[_ptr] ) keyword[if] ident...
def initialize_bfd(self, abfd): """Initialize underlying libOpcodes library using BFD.""" self._ptr = _opcodes.initialize_bfd(abfd._ptr) # Already done inside opcodes.c #self.architecture = abfd.architecture #self.machine = abfd.machine #self.endian = abfd.endian # force intel syntax if ...
def get_block_raw(self, block): """ Args: block: block number (eg: 223212) block hash (eg: 0000000000000000210b10d620600dc1cc2380bb58eb2408f9767eb792ed31fa) word "last" - this will always return the latest block word "first" - this will always ...
def function[get_block_raw, parameter[self, block]]: constant[ Args: block: block number (eg: 223212) block hash (eg: 0000000000000000210b10d620600dc1cc2380bb58eb2408f9767eb792ed31fa) word "last" - this will always return the latest block word ...
keyword[def] identifier[get_block_raw] ( identifier[self] , identifier[block] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[self] . identifier[_url] , identifier[block] ) keyword[return] identifier[self] . identifier[make_request] ( identifier[url]...
def get_block_raw(self, block): """ Args: block: block number (eg: 223212) block hash (eg: 0000000000000000210b10d620600dc1cc2380bb58eb2408f9767eb792ed31fa) word "last" - this will always return the latest block word "first" - this will always retu...
def list_param_combinations(param_ranges): """ Create a list of all parameter combinations from a dictionary specifying desired parameter values as lists. Example: >>> param_ranges = {'a': [1], 'b': [2, 3]} >>> list_param_combinations(param_ranges) [{'a': 1, 'b': 2}, {'a': 1, '...
def function[list_param_combinations, parameter[param_ranges]]: constant[ Create a list of all parameter combinations from a dictionary specifying desired parameter values as lists. Example: >>> param_ranges = {'a': [1], 'b': [2, 3]} >>> list_param_combinations(param_ranges) ...
keyword[def] identifier[list_param_combinations] ( identifier[param_ranges] ): literal[string] keyword[for] identifier[key] keyword[in] identifier[param_ranges] : keyword[if] keyword[not] identifier[isinstance] ( identifier[param_ranges] [ identifier[key] ], identifier[list] ): ...
def list_param_combinations(param_ranges): """ Create a list of all parameter combinations from a dictionary specifying desired parameter values as lists. Example: >>> param_ranges = {'a': [1], 'b': [2, 3]} >>> list_param_combinations(param_ranges) [{'a': 1, 'b': 2}, {'a': 1, '...
def draw_path_collection(self, paths, path_coordinates, path_transforms, offsets, offset_coordinates, offset_order, styles, mplobj=None): """ Draw a collection of paths. The paths, offsets, and styles are all iterables, and the number of ...
def function[draw_path_collection, parameter[self, paths, path_coordinates, path_transforms, offsets, offset_coordinates, offset_order, styles, mplobj]]: constant[ Draw a collection of paths. The paths, offsets, and styles are all iterables, and the number of paths is max(len(paths), len(offsets...
keyword[def] identifier[draw_path_collection] ( identifier[self] , identifier[paths] , identifier[path_coordinates] , identifier[path_transforms] , identifier[offsets] , identifier[offset_coordinates] , identifier[offset_order] , identifier[styles] , identifier[mplobj] = keyword[None] ): literal[string] ...
def draw_path_collection(self, paths, path_coordinates, path_transforms, offsets, offset_coordinates, offset_order, styles, mplobj=None): """ Draw a collection of paths. The paths, offsets, and styles are all iterables, and the number of paths is max(len(paths), len(offsets)). By default, t...
def from_string(string_data, file_format="xyz"): """ Uses OpenBabel to read a molecule from a string in all supported formats. Args: string_data: String containing molecule data. file_format: String specifying any OpenBabel supported formats. Returns: ...
def function[from_string, parameter[string_data, file_format]]: constant[ Uses OpenBabel to read a molecule from a string in all supported formats. Args: string_data: String containing molecule data. file_format: String specifying any OpenBabel supported formats....
keyword[def] identifier[from_string] ( identifier[string_data] , identifier[file_format] = literal[string] ): literal[string] identifier[mols] = identifier[pb] . identifier[readstring] ( identifier[str] ( identifier[file_format] ), identifier[str] ( identifier[string_data] )) keyword[retur...
def from_string(string_data, file_format='xyz'): """ Uses OpenBabel to read a molecule from a string in all supported formats. Args: string_data: String containing molecule data. file_format: String specifying any OpenBabel supported formats. Returns: ...
def label_from_instance(self, obj): """ Creates labels which represent the tree level of each node when generating option labels. """ return '%s %s' % (self.level_indicator * getattr(obj, obj._mptt_meta.level_attr), obj)
def function[label_from_instance, parameter[self, obj]]: constant[ Creates labels which represent the tree level of each node when generating option labels. ] return[binary_operation[constant[%s %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.BinOp object at 0x7da2054a6bc0>, <ast....
keyword[def] identifier[label_from_instance] ( identifier[self] , identifier[obj] ): literal[string] keyword[return] literal[string] %( identifier[self] . identifier[level_indicator] * identifier[getattr] ( identifier[obj] , identifier[obj] . identifier[_mptt_meta] . identifier[level_attr] ), iden...
def label_from_instance(self, obj): """ Creates labels which represent the tree level of each node when generating option labels. """ return '%s %s' % (self.level_indicator * getattr(obj, obj._mptt_meta.level_attr), obj)
def parse(cls, buf, options=None): """ According to Philip, an abuf is like a TARDIS: it's bigger on the inside """ error = [] do_header = True do_question = True do_answer = True do_authority = True do_additional = True do_options = True ...
def function[parse, parameter[cls, buf, options]]: constant[ According to Philip, an abuf is like a TARDIS: it's bigger on the inside ] variable[error] assign[=] list[[]] variable[do_header] assign[=] constant[True] variable[do_question] assign[=] constant[True] v...
keyword[def] identifier[parse] ( identifier[cls] , identifier[buf] , identifier[options] = keyword[None] ): literal[string] identifier[error] =[] identifier[do_header] = keyword[True] identifier[do_question] = keyword[True] identifier[do_answer] = keyword[True] ...
def parse(cls, buf, options=None): """ According to Philip, an abuf is like a TARDIS: it's bigger on the inside """ error = [] do_header = True do_question = True do_answer = True do_authority = True do_additional = True do_options = True if options and isinstance(opt...
def sent2examples(self, sent): """ Convert ngrams into feature vectors.""" # TODO(rmyeid): use expanders. words = [w if w in self.embeddings else TaggerBase.UNK for w in sent] ngrams = TaggerBase.ngrams(words, self.context, self.transfer) fvs = [] for word, ngram in zip(sent, ngrams): fv ...
def function[sent2examples, parameter[self, sent]]: constant[ Convert ngrams into feature vectors.] variable[words] assign[=] <ast.ListComp object at 0x7da20c76ec80> variable[ngrams] assign[=] call[name[TaggerBase].ngrams, parameter[name[words], name[self].context, name[self].transfer]] ...
keyword[def] identifier[sent2examples] ( identifier[self] , identifier[sent] ): literal[string] identifier[words] =[ identifier[w] keyword[if] identifier[w] keyword[in] identifier[self] . identifier[embeddings] keyword[else] identifier[TaggerBase] . identifier[UNK] keyword[for] identifier[w] ...
def sent2examples(self, sent): """ Convert ngrams into feature vectors.""" # TODO(rmyeid): use expanders. words = [w if w in self.embeddings else TaggerBase.UNK for w in sent] ngrams = TaggerBase.ngrams(words, self.context, self.transfer) fvs = [] for (word, ngram) in zip(sent, ngrams): ...
def expose_request(func): """ A decorator that adds an expose_request flag to the underlying callable. @raise TypeError: C{func} must be callable. """ if not python.callable(func): raise TypeError("func must be callable") if isinstance(func, types.UnboundMethodType): setattr(fu...
def function[expose_request, parameter[func]]: constant[ A decorator that adds an expose_request flag to the underlying callable. @raise TypeError: C{func} must be callable. ] if <ast.UnaryOp object at 0x7da2054a7340> begin[:] <ast.Raise object at 0x7da2054a7d90> if call[nam...
keyword[def] identifier[expose_request] ( identifier[func] ): literal[string] keyword[if] keyword[not] identifier[python] . identifier[callable] ( identifier[func] ): keyword[raise] identifier[TypeError] ( literal[string] ) keyword[if] identifier[isinstance] ( identifier[func] , identifi...
def expose_request(func): """ A decorator that adds an expose_request flag to the underlying callable. @raise TypeError: C{func} must be callable. """ if not python.callable(func): raise TypeError('func must be callable') # depends on [control=['if'], data=[]] if isinstance(func, types...
def collect_samples(agents, sample_batch_size, num_envs_per_worker, train_batch_size): """Collects at least train_batch_size samples, never discarding any.""" num_timesteps_so_far = 0 trajectories = [] agent_dict = {} for agent in agents: fut_sample = agent.sample.remot...
def function[collect_samples, parameter[agents, sample_batch_size, num_envs_per_worker, train_batch_size]]: constant[Collects at least train_batch_size samples, never discarding any.] variable[num_timesteps_so_far] assign[=] constant[0] variable[trajectories] assign[=] list[[]] variable[...
keyword[def] identifier[collect_samples] ( identifier[agents] , identifier[sample_batch_size] , identifier[num_envs_per_worker] , identifier[train_batch_size] ): literal[string] identifier[num_timesteps_so_far] = literal[int] identifier[trajectories] =[] identifier[agent_dict] ={} keywor...
def collect_samples(agents, sample_batch_size, num_envs_per_worker, train_batch_size): """Collects at least train_batch_size samples, never discarding any.""" num_timesteps_so_far = 0 trajectories = [] agent_dict = {} for agent in agents: fut_sample = agent.sample.remote() agent_dict...
def get_access_token(self): """ Obtain the access token to access private resources at the API endpoint. """ if self.access_token is None: request_token = self._get_rt_from_session() oauth = OAuth1( self.consumer_key, client...
def function[get_access_token, parameter[self]]: constant[ Obtain the access token to access private resources at the API endpoint. ] if compare[name[self].access_token is constant[None]] begin[:] variable[request_token] assign[=] call[name[self]._get_rt_from_sess...
keyword[def] identifier[get_access_token] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[access_token] keyword[is] keyword[None] : identifier[request_token] = identifier[self] . identifier[_get_rt_from_session] () identifier[oauth] = ide...
def get_access_token(self): """ Obtain the access token to access private resources at the API endpoint. """ if self.access_token is None: request_token = self._get_rt_from_session() oauth = OAuth1(self.consumer_key, client_secret=self.consumer_secret, resource_owner_key=...
def parse_multiexpreq(self, tup_tree): # pylint: disable=unused-argument """ Not Implemented. Because this request is generally not implemented by platforms, It will probably never be implemented. """ raise CIMXMLParseError( _format("Internal Error: Parsing su...
def function[parse_multiexpreq, parameter[self, tup_tree]]: constant[ Not Implemented. Because this request is generally not implemented by platforms, It will probably never be implemented. ] <ast.Raise object at 0x7da1b0ddc370>
keyword[def] identifier[parse_multiexpreq] ( identifier[self] , identifier[tup_tree] ): literal[string] keyword[raise] identifier[CIMXMLParseError] ( identifier[_format] ( literal[string] literal[string] , identifier[name] ( identifier[tup_tree] )), identifier[conn_id]...
def parse_multiexpreq(self, tup_tree): # pylint: disable=unused-argument '\n Not Implemented. Because this request is generally not implemented\n by platforms, It will probably never be implemented.\n ' raise CIMXMLParseError(_format('Internal Error: Parsing support for element {0!A} is...
def needs_fixing(raw_params, kwargs_default=_kwargs_default_name): u""" Returns string with the name of the kwargs dict if the params after the first star need fixing Otherwise returns empty string """ found_kwargs = False needs_fix = False for t in raw_params[2:]: if t.type == toke...
def function[needs_fixing, parameter[raw_params, kwargs_default]]: constant[ Returns string with the name of the kwargs dict if the params after the first star need fixing Otherwise returns empty string ] variable[found_kwargs] assign[=] constant[False] variable[needs_fix] assign[=] ...
keyword[def] identifier[needs_fixing] ( identifier[raw_params] , identifier[kwargs_default] = identifier[_kwargs_default_name] ): literal[string] identifier[found_kwargs] = keyword[False] identifier[needs_fix] = keyword[False] keyword[for] identifier[t] keyword[in] identifier[raw_params] [ ...
def needs_fixing(raw_params, kwargs_default=_kwargs_default_name): u""" Returns string with the name of the kwargs dict if the params after the first star need fixing Otherwise returns empty string """ found_kwargs = False needs_fix = False for t in raw_params[2:]: if t.type == token...
def delete_lower(script, layer_num=None): """ Delete all layers below the specified one. Useful for MeshLab ver 2016.12, whcih will only output layer 0. """ if layer_num is None: layer_num = script.current_layer() if layer_num != 0: change(script, 0) for i in range(layer_num): ...
def function[delete_lower, parameter[script, layer_num]]: constant[ Delete all layers below the specified one. Useful for MeshLab ver 2016.12, whcih will only output layer 0. ] if compare[name[layer_num] is constant[None]] begin[:] variable[layer_num] assign[=] call[name[script]...
keyword[def] identifier[delete_lower] ( identifier[script] , identifier[layer_num] = keyword[None] ): literal[string] keyword[if] identifier[layer_num] keyword[is] keyword[None] : identifier[layer_num] = identifier[script] . identifier[current_layer] () keyword[if] identifier[layer_num] !...
def delete_lower(script, layer_num=None): """ Delete all layers below the specified one. Useful for MeshLab ver 2016.12, whcih will only output layer 0. """ if layer_num is None: layer_num = script.current_layer() # depends on [control=['if'], data=['layer_num']] if layer_num != 0: ...
def brew_query_parts(self): """ Make columns, group_bys, filters, havings """ columns, group_bys, filters, havings = [], [], set(), set() for ingredient in self.ingredients(): if ingredient.query_columns: columns.extend(ingredient.query_columns) if...
def function[brew_query_parts, parameter[self]]: constant[ Make columns, group_bys, filters, havings ] <ast.Tuple object at 0x7da18f09e110> assign[=] tuple[[<ast.List object at 0x7da18f09cb50>, <ast.List object at 0x7da18f09e740>, <ast.Call object at 0x7da18f09e440>, <ast.Call object at 0x7da18f...
keyword[def] identifier[brew_query_parts] ( identifier[self] ): literal[string] identifier[columns] , identifier[group_bys] , identifier[filters] , identifier[havings] =[],[], identifier[set] (), identifier[set] () keyword[for] identifier[ingredient] keyword[in] identifier[self] . ident...
def brew_query_parts(self): """ Make columns, group_bys, filters, havings """ (columns, group_bys, filters, havings) = ([], [], set(), set()) for ingredient in self.ingredients(): if ingredient.query_columns: columns.extend(ingredient.query_columns) # depends on [control=['if'],...
async def up(self): """Press key up.""" await self._send_commands( self._move('Down', 0, 20, 275), self._move('Move', 1, 20, 270), self._move('Move', 2, 20, 265), self._move('Move', 3, 20, 260), self._move('Move', 4, 20, 255), self....
<ast.AsyncFunctionDef object at 0x7da18fe90550>
keyword[async] keyword[def] identifier[up] ( identifier[self] ): literal[string] keyword[await] identifier[self] . identifier[_send_commands] ( identifier[self] . identifier[_move] ( literal[string] , literal[int] , literal[int] , literal[int] ), identifier[self] . identifier[_m...
async def up(self): """Press key up.""" await self._send_commands(self._move('Down', 0, 20, 275), self._move('Move', 1, 20, 270), self._move('Move', 2, 20, 265), self._move('Move', 3, 20, 260), self._move('Move', 4, 20, 255), self._move('Move', 5, 20, 250), self._move('Up', 6, 20, 250))
def init_parser(): """ Initialize the arguments parser. """ parser = argparse.ArgumentParser( description="Automated development environment initialization") parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) subparsers = parser.add_subparsers(title="...
def function[init_parser, parameter[]]: constant[ Initialize the arguments parser. ] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[--version]]] variable[subparsers] assign[=] call[name[parser].add_subparsers...
keyword[def] identifier[init_parser] (): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = literal[string] ) identifier[parser] . identifier[add_argument] ( literal[string] , identifier[action] = literal[string] , identifier[v...
def init_parser(): """ Initialize the arguments parser. """ parser = argparse.ArgumentParser(description='Automated development environment initialization') parser.add_argument('--version', action='version', version='%(prog)s ' + __version__) subparsers = parser.add_subparsers(title='commands') # Li...
def deseq2_size_factors(counts, meta, design): """ Get size factors for counts using DESeq2. Parameters ---------- counts : pandas.DataFrame Counts to pass to DESeq2. meta : pandas.DataFrame Pandas dataframe whose index matches the columns of counts. This is passed to D...
def function[deseq2_size_factors, parameter[counts, meta, design]]: constant[ Get size factors for counts using DESeq2. Parameters ---------- counts : pandas.DataFrame Counts to pass to DESeq2. meta : pandas.DataFrame Pandas dataframe whose index matches the columns of coun...
keyword[def] identifier[deseq2_size_factors] ( identifier[counts] , identifier[meta] , identifier[design] ): literal[string] keyword[import] identifier[rpy2] . identifier[robjects] keyword[as] identifier[r] keyword[from] identifier[rpy2] . identifier[robjects] keyword[import] identifier[pandas2...
def deseq2_size_factors(counts, meta, design): """ Get size factors for counts using DESeq2. Parameters ---------- counts : pandas.DataFrame Counts to pass to DESeq2. meta : pandas.DataFrame Pandas dataframe whose index matches the columns of counts. This is passed to D...
def get(self, key, namespace=None): """Retrieve value for key.""" full_key = generate_uppercase_key(key, namespace) full_key = full_key.lower() logger.debug('Searching %s for %s', self, full_key) # Build a map of lowercase -> actual key obj_keys = { item.low...
def function[get, parameter[self, key, namespace]]: constant[Retrieve value for key.] variable[full_key] assign[=] call[name[generate_uppercase_key], parameter[name[key], name[namespace]]] variable[full_key] assign[=] call[name[full_key].lower, parameter[]] call[name[logger].debug, param...
keyword[def] identifier[get] ( identifier[self] , identifier[key] , identifier[namespace] = keyword[None] ): literal[string] identifier[full_key] = identifier[generate_uppercase_key] ( identifier[key] , identifier[namespace] ) identifier[full_key] = identifier[full_key] . identifier[lower]...
def get(self, key, namespace=None): """Retrieve value for key.""" full_key = generate_uppercase_key(key, namespace) full_key = full_key.lower() logger.debug('Searching %s for %s', self, full_key) # Build a map of lowercase -> actual key obj_keys = {item.lower(): item for item in dir(self.obj) if...
def save(self, path=None, fatal=True, logger=None, sort_keys=True, indent=2): """ :param str|None path: Save this serializable to file with 'path' (default: self._path) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to use :param bo...
def function[save, parameter[self, path, fatal, logger, sort_keys, indent]]: constant[ :param str|None path: Save this serializable to file with 'path' (default: self._path) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to use :par...
keyword[def] identifier[save] ( identifier[self] , identifier[path] = keyword[None] , identifier[fatal] = keyword[True] , identifier[logger] = keyword[None] , identifier[sort_keys] = keyword[True] , identifier[indent] = literal[int] ): literal[string] identifier[path] = identifier[path] keyword[or...
def save(self, path=None, fatal=True, logger=None, sort_keys=True, indent=2): """ :param str|None path: Save this serializable to file with 'path' (default: self._path) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to use :param bool s...
def parse_formula(model_formula, parent_data, unscramble=False): """ Recursively parse a model formula by breaking it into additive atoms and tracking grouping symbol depth. Parameters ---------- model_formula: str Expression for the model formula, e.g. '(a + b)^^2 + dd1(c + (d ...
def function[parse_formula, parameter[model_formula, parent_data, unscramble]]: constant[ Recursively parse a model formula by breaking it into additive atoms and tracking grouping symbol depth. Parameters ---------- model_formula: str Expression for the model formula, e.g. ...
keyword[def] identifier[parse_formula] ( identifier[model_formula] , identifier[parent_data] , identifier[unscramble] = keyword[False] ): literal[string] identifier[variables] ={} identifier[data] ={} identifier[expr_delimiter] = literal[int] identifier[grouping_depth] = literal[int] ...
def parse_formula(model_formula, parent_data, unscramble=False): """ Recursively parse a model formula by breaking it into additive atoms and tracking grouping symbol depth. Parameters ---------- model_formula: str Expression for the model formula, e.g. '(a + b)^^2 + dd1(c + (d ...
def database(self, database_id, ddl_statements=(), pool=None): """Factory to create a database within this instance. :type database_id: str :param database_id: The ID of the instance. :type ddl_statements: list of string :param ddl_statements: (Optional) DDL statements, excludi...
def function[database, parameter[self, database_id, ddl_statements, pool]]: constant[Factory to create a database within this instance. :type database_id: str :param database_id: The ID of the instance. :type ddl_statements: list of string :param ddl_statements: (Optional) DDL ...
keyword[def] identifier[database] ( identifier[self] , identifier[database_id] , identifier[ddl_statements] =(), identifier[pool] = keyword[None] ): literal[string] keyword[return] identifier[Database] ( identifier[database_id] , identifier[self] , identifier[ddl_statements] = identifier[ddl_state...
def database(self, database_id, ddl_statements=(), pool=None): """Factory to create a database within this instance. :type database_id: str :param database_id: The ID of the instance. :type ddl_statements: list of string :param ddl_statements: (Optional) DDL statements, excluding t...
def get(self, client_id, code): """Get the Grant object with the given client ID and code :param client_id: ID of the client :param code: """ return self.query.filter_by(client_id=client_id, code=code).first()
def function[get, parameter[self, client_id, code]]: constant[Get the Grant object with the given client ID and code :param client_id: ID of the client :param code: ] return[call[call[name[self].query.filter_by, parameter[]].first, parameter[]]]
keyword[def] identifier[get] ( identifier[self] , identifier[client_id] , identifier[code] ): literal[string] keyword[return] identifier[self] . identifier[query] . identifier[filter_by] ( identifier[client_id] = identifier[client_id] , identifier[code] = identifier[code] ). identifier[first] ()
def get(self, client_id, code): """Get the Grant object with the given client ID and code :param client_id: ID of the client :param code: """ return self.query.filter_by(client_id=client_id, code=code).first()
def _check_digit(self): """ Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation. """ weights = (1 if x % 2 == 0 else 3 for x in range(12)) body = ''.join([self.ean, self.group, self.registrant, ...
def function[_check_digit, parameter[self]]: constant[ Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation. ] variable[weights] assign[=] <ast.GeneratorExp object at 0x7da204345510> variable[body] ass...
keyword[def] identifier[_check_digit] ( identifier[self] ): literal[string] identifier[weights] =( literal[int] keyword[if] identifier[x] % literal[int] == literal[int] keyword[else] literal[int] keyword[for] identifier[x] keyword[in] identifier[range] ( literal[int] )) identifier[...
def _check_digit(self): """ Calculate the check digit for ISBN-13. See https://en.wikipedia.org/wiki/International_Standard_Book_Number for calculation. """ weights = (1 if x % 2 == 0 else 3 for x in range(12)) body = ''.join([self.ean, self.group, self.registrant, self.publication])...
def add_kb(self, issuer, kb): """ Add a key bundle and bind it to an identifier :param issuer: Owner of the keys in the key bundle :param kb: A :py:class:`oidcmsg.key_bundle.KeyBundle` instance """ try: self.issuer_keys[issuer].append(kb) exce...
def function[add_kb, parameter[self, issuer, kb]]: constant[ Add a key bundle and bind it to an identifier :param issuer: Owner of the keys in the key bundle :param kb: A :py:class:`oidcmsg.key_bundle.KeyBundle` instance ] <ast.Try object at 0x7da1b0548340>
keyword[def] identifier[add_kb] ( identifier[self] , identifier[issuer] , identifier[kb] ): literal[string] keyword[try] : identifier[self] . identifier[issuer_keys] [ identifier[issuer] ]. identifier[append] ( identifier[kb] ) keyword[except] identifier[KeyError] : ...
def add_kb(self, issuer, kb): """ Add a key bundle and bind it to an identifier :param issuer: Owner of the keys in the key bundle :param kb: A :py:class:`oidcmsg.key_bundle.KeyBundle` instance """ try: self.issuer_keys[issuer].append(kb) # depends on [control=[...
def make_bigint_autoincrement_column(column_name: str, dialect: Dialect) -> Column: """ Returns an instance of :class:`Column` representing a :class:`BigInteger` ``AUTOINCREMENT`` column in the specified :class:`Dialect`. """ # noinspection PyUnresolvedReferences...
def function[make_bigint_autoincrement_column, parameter[column_name, dialect]]: constant[ Returns an instance of :class:`Column` representing a :class:`BigInteger` ``AUTOINCREMENT`` column in the specified :class:`Dialect`. ] if compare[name[dialect].name equal[==] name[SqlaDialectName].MSS...
keyword[def] identifier[make_bigint_autoincrement_column] ( identifier[column_name] : identifier[str] , identifier[dialect] : identifier[Dialect] )-> identifier[Column] : literal[string] keyword[if] identifier[dialect] . identifier[name] == identifier[SqlaDialectName] . identifier[MSSQL] : ...
def make_bigint_autoincrement_column(column_name: str, dialect: Dialect) -> Column: """ Returns an instance of :class:`Column` representing a :class:`BigInteger` ``AUTOINCREMENT`` column in the specified :class:`Dialect`. """ # noinspection PyUnresolvedReferences if dialect.name == SqlaDialectNa...
def print_featurelist(feature_list): """ Print the feature_list in a human-readable form. Parameters ---------- feature_list : list feature objects """ input_features = sum(map(lambda n: n.get_dimension(), feature_list)) print("## Features (%i)" % input_features) print("```"...
def function[print_featurelist, parameter[feature_list]]: constant[ Print the feature_list in a human-readable form. Parameters ---------- feature_list : list feature objects ] variable[input_features] assign[=] call[name[sum], parameter[call[name[map], parameter[<ast.Lambda...
keyword[def] identifier[print_featurelist] ( identifier[feature_list] ): literal[string] identifier[input_features] = identifier[sum] ( identifier[map] ( keyword[lambda] identifier[n] : identifier[n] . identifier[get_dimension] (), identifier[feature_list] )) identifier[print] ( literal[string] % ide...
def print_featurelist(feature_list): """ Print the feature_list in a human-readable form. Parameters ---------- feature_list : list feature objects """ input_features = sum(map(lambda n: n.get_dimension(), feature_list)) print('## Features (%i)' % input_features) print('```'...
def _send_request(self, method, url, *args, **kwargs): """ Send HTTP request. :param str method: The HTTP method to use. :param str url: The URL to make the request to. :return: Deferred firing with the HTTP response. """ action = LOG_JWS_REQUEST(url=url) ...
def function[_send_request, parameter[self, method, url]]: constant[ Send HTTP request. :param str method: The HTTP method to use. :param str url: The URL to make the request to. :return: Deferred firing with the HTTP response. ] variable[action] assign[=] call[...
keyword[def] identifier[_send_request] ( identifier[self] , identifier[method] , identifier[url] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[action] = identifier[LOG_JWS_REQUEST] ( identifier[url] = identifier[url] ) keyword[with] identifier[action] . identifi...
def _send_request(self, method, url, *args, **kwargs): """ Send HTTP request. :param str method: The HTTP method to use. :param str url: The URL to make the request to. :return: Deferred firing with the HTTP response. """ action = LOG_JWS_REQUEST(url=url) with actio...
def plot(q: np.ndarray, bodies: List[str], plot_colors: Dict[str, str], sim_name: str, fname: Optional[str] = None): """ Plot the planetary orbits. Plot size limited to box of 10 AU around the sun. q is a Nx3B array. t indexes time points. 3B columns are (x, y, z) for the bodies in order. ""...
def function[plot, parameter[q, bodies, plot_colors, sim_name, fname]]: constant[ Plot the planetary orbits. Plot size limited to box of 10 AU around the sun. q is a Nx3B array. t indexes time points. 3B columns are (x, y, z) for the bodies in order. ] <ast.Tuple object at 0x7da18fe90520>...
keyword[def] identifier[plot] ( identifier[q] : identifier[np] . identifier[ndarray] , identifier[bodies] : identifier[List] [ identifier[str] ], identifier[plot_colors] : identifier[Dict] [ identifier[str] , identifier[str] ], identifier[sim_name] : identifier[str] , identifier[fname] : identifier[Optional] [ ident...
def plot(q: np.ndarray, bodies: List[str], plot_colors: Dict[str, str], sim_name: str, fname: Optional[str]=None): """ Plot the planetary orbits. Plot size limited to box of 10 AU around the sun. q is a Nx3B array. t indexes time points. 3B columns are (x, y, z) for the bodies in order. """ # Get...
def gapsplit(args): """ %prog gapsplit gffile > split.gff Read in the gff (normally generated by GMAP) and print it out after splitting each feature into one parent and multiple child features based on alignment information encoded in CIGAR string. """ p = OptionParser(gapsplit.__doc__) ...
def function[gapsplit, parameter[args]]: constant[ %prog gapsplit gffile > split.gff Read in the gff (normally generated by GMAP) and print it out after splitting each feature into one parent and multiple child features based on alignment information encoded in CIGAR string. ] varia...
keyword[def] identifier[gapsplit] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[gapsplit] . identifier[__doc__] ) identifier[opts] , identifier[args] = identifier[p] . identifier[parse_args] ( identifier[args] ) keyword[if] identifier[len] ( identi...
def gapsplit(args): """ %prog gapsplit gffile > split.gff Read in the gff (normally generated by GMAP) and print it out after splitting each feature into one parent and multiple child features based on alignment information encoded in CIGAR string. """ p = OptionParser(gapsplit.__doc__) ...
def pass_none(func): """ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) """ @functools.wraps(func) def wrapper(param, *args, **kwargs): if param is not None: return func(param, *args, **kwargs) return wrapper
def function[pass_none, parameter[func]]: constant[ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) ] def function[wrapper, parameter[param]]: if compare[name[param] is_not constant[None]] b...
keyword[def] identifier[pass_none] ( identifier[func] ): literal[string] @ identifier[functools] . identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapper] ( identifier[param] ,* identifier[args] ,** identifier[kwargs] ): keyword[if] identifier[param] keyword[is] keyword[not] keyword[None...
def pass_none(func): """ Wrap func so it's not called if its first param is None >>> print_text = pass_none(print) >>> print_text('text') text >>> print_text(None) """ @functools.wraps(func) def wrapper(param, *args, **kwargs): if param is not None: return func(param, *args, **kw...
def _set_var_from_xml_text(self, xml, xmlpath, var): ''' Sets a object variable from the xml if it is there and passing it through a data conversion based on the variable datatype ''' xmle = xml.find(xmlpath) if xmle is not None: setattr(self, var, type_conver...
def function[_set_var_from_xml_text, parameter[self, xml, xmlpath, var]]: constant[ Sets a object variable from the xml if it is there and passing it through a data conversion based on the variable datatype ] variable[xmle] assign[=] call[name[xml].find, parameter[name[xmlpath]]]...
keyword[def] identifier[_set_var_from_xml_text] ( identifier[self] , identifier[xml] , identifier[xmlpath] , identifier[var] ): literal[string] identifier[xmle] = identifier[xml] . identifier[find] ( identifier[xmlpath] ) keyword[if] identifier[xmle] keyword[is] keyword[not] keyword[No...
def _set_var_from_xml_text(self, xml, xmlpath, var): """ Sets a object variable from the xml if it is there and passing it through a data conversion based on the variable datatype """ xmle = xml.find(xmlpath) if xmle is not None: setattr(self, var, type_converter[xmle.attrib....