code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _check_directory_arguments(self): """ Validates arguments for loading from directories, including static image and time series directories. """ if not os.path.isdir(self.datapath): raise (NotADirectoryError('Directory does not exist: %s' % self.datapath)) if self....
def function[_check_directory_arguments, parameter[self]]: constant[ Validates arguments for loading from directories, including static image and time series directories. ] if <ast.UnaryOp object at 0x7da20e962bc0> begin[:] <ast.Raise object at 0x7da20e960430> if name[sel...
keyword[def] identifier[_check_directory_arguments] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[isdir] ( identifier[self] . identifier[datapath] ): keyword[raise] ( identifier[NotADirectoryError] ( literal[string] % id...
def _check_directory_arguments(self): """ Validates arguments for loading from directories, including static image and time series directories. """ if not os.path.isdir(self.datapath): raise NotADirectoryError('Directory does not exist: %s' % self.datapath) # depends on [control=['if'],...
def new_board(self, name): """Make a board for a character name, and switch to it.""" char = self.engine.character[name] board = Board(character=char) self.mainscreen.boards[name] = board self.character = char
def function[new_board, parameter[self, name]]: constant[Make a board for a character name, and switch to it.] variable[char] assign[=] call[name[self].engine.character][name[name]] variable[board] assign[=] call[name[Board], parameter[]] call[name[self].mainscreen.boards][name[name]] as...
keyword[def] identifier[new_board] ( identifier[self] , identifier[name] ): literal[string] identifier[char] = identifier[self] . identifier[engine] . identifier[character] [ identifier[name] ] identifier[board] = identifier[Board] ( identifier[character] = identifier[char] ) iden...
def new_board(self, name): """Make a board for a character name, and switch to it.""" char = self.engine.character[name] board = Board(character=char) self.mainscreen.boards[name] = board self.character = char
def pci_lookup_name4( access: (IN, ctypes.POINTER(pci_access)), buf: (IN, ctypes.c_char_p), size: (IN, ctypes.c_int), flags: (IN, ctypes.c_int), arg1: (IN, ctypes.c_int), arg2: (IN, ctypes.c_int), arg3: (IN, ctypes.c_int), arg4: (IN, ctypes.c_int), ) -> ctypes.c_char_p: """ Conve...
def function[pci_lookup_name4, parameter[access, buf, size, flags, arg1, arg2, arg3, arg4]]: constant[ Conversion of PCI ID's to names (according to the pci.ids file). char *pci_lookup_name( struct pci_access *a, char *buf, int size, int flags, ... ) PCI_ABI; This is a variant of pci_l...
keyword[def] identifier[pci_lookup_name4] ( identifier[access] :( identifier[IN] , identifier[ctypes] . identifier[POINTER] ( identifier[pci_access] )), identifier[buf] :( identifier[IN] , identifier[ctypes] . identifier[c_char_p] ), identifier[size] :( identifier[IN] , identifier[ctypes] . identifier[c_int] ), i...
def pci_lookup_name4(access: (IN, ctypes.POINTER(pci_access)), buf: (IN, ctypes.c_char_p), size: (IN, ctypes.c_int), flags: (IN, ctypes.c_int), arg1: (IN, ctypes.c_int), arg2: (IN, ctypes.c_int), arg3: (IN, ctypes.c_int), arg4: (IN, ctypes.c_int)) -> ctypes.c_char_p: """ Conversion of PCI ID's to names (accordi...
def _log(file_list, list_name, in_path): """Logs result at debug level""" file_names = '\n'.join(file_list) LOG.debug("\nDiscovered %(size)d %(name)s file(s) in %(path)s:\n" "%(files)s\n", {'size': len(file_list), 'name': list_name, 'path': in_path, 'files': file_n...
def function[_log, parameter[file_list, list_name, in_path]]: constant[Logs result at debug level] variable[file_names] assign[=] call[constant[ ].join, parameter[name[file_list]]] call[name[LOG].debug, parameter[constant[ Discovered %(size)d %(name)s file(s) in %(path)s: %(files)s ], dictionary...
keyword[def] identifier[_log] ( identifier[file_list] , identifier[list_name] , identifier[in_path] ): literal[string] identifier[file_names] = literal[string] . identifier[join] ( identifier[file_list] ) identifier[LOG] . identifier[debug] ( literal[string] literal[string] , { literal[strin...
def _log(file_list, list_name, in_path): """Logs result at debug level""" file_names = '\n'.join(file_list) LOG.debug('\nDiscovered %(size)d %(name)s file(s) in %(path)s:\n%(files)s\n', {'size': len(file_list), 'name': list_name, 'path': in_path, 'files': file_names})
def community_topic_delete(self, id, **kwargs): "https://developer.zendesk.com/rest_api/docs/help_center/topics#delete-topic" api_path = "/api/v2/community/topics/{id}.json" api_path = api_path.format(id=id) return self.call(api_path, method="DELETE", **kwargs)
def function[community_topic_delete, parameter[self, id]]: constant[https://developer.zendesk.com/rest_api/docs/help_center/topics#delete-topic] variable[api_path] assign[=] constant[/api/v2/community/topics/{id}.json] variable[api_path] assign[=] call[name[api_path].format, parameter[]] ret...
keyword[def] identifier[community_topic_delete] ( identifier[self] , identifier[id] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_path] = identifier[api_path] . identifier[format] ( identifier[id] = identifier[id] ) keyword[return...
def community_topic_delete(self, id, **kwargs): """https://developer.zendesk.com/rest_api/docs/help_center/topics#delete-topic""" api_path = '/api/v2/community/topics/{id}.json' api_path = api_path.format(id=id) return self.call(api_path, method='DELETE', **kwargs)
def schedule_jobs(user): """Dispatch jobs to remotecis. The remoteci can use this method to request a new job. Before a job is dispatched, the server will flag as 'killed' all the running jobs that were associated with the remoteci. This is because they will never be finished. """ values ...
def function[schedule_jobs, parameter[user]]: constant[Dispatch jobs to remotecis. The remoteci can use this method to request a new job. Before a job is dispatched, the server will flag as 'killed' all the running jobs that were associated with the remoteci. This is because they will never be...
keyword[def] identifier[schedule_jobs] ( identifier[user] ): literal[string] identifier[values] = identifier[schemas] . identifier[job_schedule] . identifier[post] ( identifier[flask] . identifier[request] . identifier[json] ) identifier[values] . identifier[update] ({ literal[string] : identif...
def schedule_jobs(user): """Dispatch jobs to remotecis. The remoteci can use this method to request a new job. Before a job is dispatched, the server will flag as 'killed' all the running jobs that were associated with the remoteci. This is because they will never be finished. """ values =...
def main(extension, strict_extensions, default_extension, x): """Top level zipline entry point. """ # install a logbook handler before performing any other operations logbook.StderrHandler().push_application() create_args(x, zipline.extension_args) load_extensions( default_extension, ...
def function[main, parameter[extension, strict_extensions, default_extension, x]]: constant[Top level zipline entry point. ] call[call[name[logbook].StderrHandler, parameter[]].push_application, parameter[]] call[name[create_args], parameter[name[x], name[zipline].extension_args]] ca...
keyword[def] identifier[main] ( identifier[extension] , identifier[strict_extensions] , identifier[default_extension] , identifier[x] ): literal[string] identifier[logbook] . identifier[StderrHandler] (). identifier[push_application] () identifier[create_args] ( identifier[x] , identifier[ziplin...
def main(extension, strict_extensions, default_extension, x): """Top level zipline entry point. """ # install a logbook handler before performing any other operations logbook.StderrHandler().push_application() create_args(x, zipline.extension_args) load_extensions(default_extension, extension, s...
def break_mst(mst, i): """ Break mst into multiple MSTs by removing one node i. Parameters ---------- mst : symmetrical square matrix i : index of the mst where to break Returns ------- list of dictionarys ('mst' and 'strokes' are the keys) """ for j in range(len(mst['mst']...
def function[break_mst, parameter[mst, i]]: constant[ Break mst into multiple MSTs by removing one node i. Parameters ---------- mst : symmetrical square matrix i : index of the mst where to break Returns ------- list of dictionarys ('mst' and 'strokes' are the keys) ] ...
keyword[def] identifier[break_mst] ( identifier[mst] , identifier[i] ): literal[string] keyword[for] identifier[j] keyword[in] identifier[range] ( identifier[len] ( identifier[mst] [ literal[string] ])): identifier[mst] [ literal[string] ][ identifier[i] ][ identifier[j] ]= literal[int] ...
def break_mst(mst, i): """ Break mst into multiple MSTs by removing one node i. Parameters ---------- mst : symmetrical square matrix i : index of the mst where to break Returns ------- list of dictionarys ('mst' and 'strokes' are the keys) """ for j in range(len(mst['mst']...
def project_destroy(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /project-xxxx/destroy API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Projects#API-method%3A-%2Fproject-xxxx%2Fdestroy """ return DXHTTPRequest('/%s/destroy' % object_id,...
def function[project_destroy, parameter[object_id, input_params, always_retry]]: constant[ Invokes the /project-xxxx/destroy API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Projects#API-method%3A-%2Fproject-xxxx%2Fdestroy ] return[call[name[DXHTTPRequest], par...
keyword[def] identifier[project_destroy] ( identifier[object_id] , identifier[input_params] ={}, identifier[always_retry] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[DXHTTPRequest] ( literal[string] % identifier[object_id] , identifier[input_params] , identifier[al...
def project_destroy(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /project-xxxx/destroy API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Projects#API-method%3A-%2Fproject-xxxx%2Fdestroy """ return DXHTTPRequest('/%s/destroy' % object_id,...
def disconnect(self, cback, subscribers=None, instance=None): """Remove a previously added function or method from the set of the signal's handlers. :param cback: the callback (or *handler*) to be added to the set :returns: ``None`` or the value returned by the corresponding wrapper ...
def function[disconnect, parameter[self, cback, subscribers, instance]]: constant[Remove a previously added function or method from the set of the signal's handlers. :param cback: the callback (or *handler*) to be added to the set :returns: ``None`` or the value returned by the correspo...
keyword[def] identifier[disconnect] ( identifier[self] , identifier[cback] , identifier[subscribers] = keyword[None] , identifier[instance] = keyword[None] ): literal[string] keyword[if] identifier[subscribers] keyword[is] keyword[None] : identifier[subscribers] = identifier[self] ....
def disconnect(self, cback, subscribers=None, instance=None): """Remove a previously added function or method from the set of the signal's handlers. :param cback: the callback (or *handler*) to be added to the set :returns: ``None`` or the value returned by the corresponding wrapper ...
def run(self): """Executed by Sphinx. :returns: Single DisqusNode instance with config values passed as arguments. :rtype: list """ disqus_shortname = self.get_shortname() disqus_identifier = self.get_identifier() return [DisqusNode(disqus_shortname, disqus_ident...
def function[run, parameter[self]]: constant[Executed by Sphinx. :returns: Single DisqusNode instance with config values passed as arguments. :rtype: list ] variable[disqus_shortname] assign[=] call[name[self].get_shortname, parameter[]] variable[disqus_identifier] assig...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[disqus_shortname] = identifier[self] . identifier[get_shortname] () identifier[disqus_identifier] = identifier[self] . identifier[get_identifier] () keyword[return] [ identifier[DisqusNode] ( identifier[...
def run(self): """Executed by Sphinx. :returns: Single DisqusNode instance with config values passed as arguments. :rtype: list """ disqus_shortname = self.get_shortname() disqus_identifier = self.get_identifier() return [DisqusNode(disqus_shortname, disqus_identifier)]
def _mode(self, s): """Check file mode format and parse into an int. :return: mode as integer """ # Note: Output from git-fast-export slightly different to spec if s in [b'644', b'100644', b'0100644']: return 0o100644 elif s in [b'755', b'100755', b'0100755']...
def function[_mode, parameter[self, s]]: constant[Check file mode format and parse into an int. :return: mode as integer ] if compare[name[s] in list[[<ast.Constant object at 0x7da1b0ac82b0>, <ast.Constant object at 0x7da1b0a04c70>, <ast.Constant object at 0x7da1b0a04d90>]]] begin[:] ...
keyword[def] identifier[_mode] ( identifier[self] , identifier[s] ): literal[string] keyword[if] identifier[s] keyword[in] [ literal[string] , literal[string] , literal[string] ]: keyword[return] literal[int] keyword[elif] identifier[s] keyword[in] [ literal[str...
def _mode(self, s): """Check file mode format and parse into an int. :return: mode as integer """ # Note: Output from git-fast-export slightly different to spec if s in [b'644', b'100644', b'0100644']: return 33188 # depends on [control=['if'], data=[]] elif s in [b'755', b'100...
def as_qubit_order(val: 'qubit_order_or_list.QubitOrderOrList' ) -> 'QubitOrder': """Converts a value into a basis. Args: val: An iterable or a basis. Returns: The basis implied by the value. """ if isinstance(val, collections.Iter...
def function[as_qubit_order, parameter[val]]: constant[Converts a value into a basis. Args: val: An iterable or a basis. Returns: The basis implied by the value. ] if call[name[isinstance], parameter[name[val], name[collections].Iterable]] begin[:] ...
keyword[def] identifier[as_qubit_order] ( identifier[val] : literal[string] )-> literal[string] : literal[string] keyword[if] identifier[isinstance] ( identifier[val] , identifier[collections] . identifier[Iterable] ): keyword[return] identifier[QubitOrder] . identifier[explicit] ( ...
def as_qubit_order(val: 'qubit_order_or_list.QubitOrderOrList') -> 'QubitOrder': """Converts a value into a basis. Args: val: An iterable or a basis. Returns: The basis implied by the value. """ if isinstance(val, collections.Iterable): return QubitOrder...
def generate_response(chaldict,uri,username,passwd,method='GET',cnonce=None): """ Generate an authorization response dictionary. chaldict should contain the digest challenge in dict form. Use fetch_challenge to create a chaldict from a HTTPResponse object like this: fetch_challenge(res.getheaders()). returns...
def function[generate_response, parameter[chaldict, uri, username, passwd, method, cnonce]]: constant[ Generate an authorization response dictionary. chaldict should contain the digest challenge in dict form. Use fetch_challenge to create a chaldict from a HTTPResponse object like this: fetch_challenge(re...
keyword[def] identifier[generate_response] ( identifier[chaldict] , identifier[uri] , identifier[username] , identifier[passwd] , identifier[method] = literal[string] , identifier[cnonce] = keyword[None] ): literal[string] identifier[authdict] ={} identifier[qop] = identifier[dict_fetch] ( identifier[chaldi...
def generate_response(chaldict, uri, username, passwd, method='GET', cnonce=None): """ Generate an authorization response dictionary. chaldict should contain the digest challenge in dict form. Use fetch_challenge to create a chaldict from a HTTPResponse object like this: fetch_challenge(res.getheaders()). ...
def _ask_for_credentials(): """ Asks the user for their email and password. """ _print_msg('Please enter your SolveBio credentials') domain = raw_input('Domain (e.g. <domain>.solvebio.com): ') # Check to see if this domain supports password authentication try: account = client.reques...
def function[_ask_for_credentials, parameter[]]: constant[ Asks the user for their email and password. ] call[name[_print_msg], parameter[constant[Please enter your SolveBio credentials]]] variable[domain] assign[=] call[name[raw_input], parameter[constant[Domain (e.g. <domain>.solvebio....
keyword[def] identifier[_ask_for_credentials] (): literal[string] identifier[_print_msg] ( literal[string] ) identifier[domain] = identifier[raw_input] ( literal[string] ) keyword[try] : identifier[account] = identifier[client] . identifier[request] ( literal[string] , literal[strin...
def _ask_for_credentials(): """ Asks the user for their email and password. """ _print_msg('Please enter your SolveBio credentials') domain = raw_input('Domain (e.g. <domain>.solvebio.com): ') # Check to see if this domain supports password authentication try: account = client.reques...
def run_cmd(call, cmd, *, echo=True, **kwargs): """Run a command and echo it first""" if echo: print('$> ' + ' '.join(map(pipes.quote, cmd))) return call(cmd, **kwargs)
def function[run_cmd, parameter[call, cmd]]: constant[Run a command and echo it first] if name[echo] begin[:] call[name[print], parameter[binary_operation[constant[$> ] + call[constant[ ].join, parameter[call[name[map], parameter[name[pipes].quote, name[cmd]]]]]]]] return[call[name[c...
keyword[def] identifier[run_cmd] ( identifier[call] , identifier[cmd] ,*, identifier[echo] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[echo] : identifier[print] ( literal[string] + literal[string] . identifier[join] ( identifier[map] ( identifier[pipes] . iden...
def run_cmd(call, cmd, *, echo=True, **kwargs): """Run a command and echo it first""" if echo: print('$> ' + ' '.join(map(pipes.quote, cmd))) # depends on [control=['if'], data=[]] return call(cmd, **kwargs)
def parse(self, argv=None, keyring_namespace=None, strict=False): """Find settings from all sources. :keyword strict: fail if unknown args are passed in. :returns: dict of parsed option name and values :raises: SystemExit if invalid arguments supplied along with stdout messa...
def function[parse, parameter[self, argv, keyring_namespace, strict]]: constant[Find settings from all sources. :keyword strict: fail if unknown args are passed in. :returns: dict of parsed option name and values :raises: SystemExit if invalid arguments supplied along with stdout ...
keyword[def] identifier[parse] ( identifier[self] , identifier[argv] = keyword[None] , identifier[keyring_namespace] = keyword[None] , identifier[strict] = keyword[False] ): literal[string] keyword[if] identifier[argv] keyword[is] keyword[None] : identifier[argv] = identifier[self] ...
def parse(self, argv=None, keyring_namespace=None, strict=False): """Find settings from all sources. :keyword strict: fail if unknown args are passed in. :returns: dict of parsed option name and values :raises: SystemExit if invalid arguments supplied along with stdout message (...
def get_epoch_price_divisor( block_height, namespace_id, units ): """ what's the name price divisor for this epoch? Not all epochs have one---if this epoch does NOT have BLOCKSTACK_INT_DIVISION set, use get_epoch_price_multiplier() instead. """ try: assert units in [TOKEN_TYPE_STACKS, 'B...
def function[get_epoch_price_divisor, parameter[block_height, namespace_id, units]]: constant[ what's the name price divisor for this epoch? Not all epochs have one---if this epoch does NOT have BLOCKSTACK_INT_DIVISION set, use get_epoch_price_multiplier() instead. ] <ast.Try object at 0x7da...
keyword[def] identifier[get_epoch_price_divisor] ( identifier[block_height] , identifier[namespace_id] , identifier[units] ): literal[string] keyword[try] : keyword[assert] identifier[units] keyword[in] [ identifier[TOKEN_TYPE_STACKS] , literal[string] ], literal[string] . identifier[format] ( i...
def get_epoch_price_divisor(block_height, namespace_id, units): """ what's the name price divisor for this epoch? Not all epochs have one---if this epoch does NOT have BLOCKSTACK_INT_DIVISION set, use get_epoch_price_multiplier() instead. """ try: assert units in [TOKEN_TYPE_STACKS, 'BTC...
def _get_input_steps(self): """ Search and return all steps that have no parents. These are the steps that are get the input data. """ input_steps = [] for step in self.steps_sorted: parent_steps = self._parent_steps(step) if len(parent_steps) == 0: ...
def function[_get_input_steps, parameter[self]]: constant[ Search and return all steps that have no parents. These are the steps that are get the input data. ] variable[input_steps] assign[=] list[[]] for taget[name[step]] in starred[name[self].steps_sorted] begin[:] ...
keyword[def] identifier[_get_input_steps] ( identifier[self] ): literal[string] identifier[input_steps] =[] keyword[for] identifier[step] keyword[in] identifier[self] . identifier[steps_sorted] : identifier[parent_steps] = identifier[self] . identifier[_parent_steps] ( ide...
def _get_input_steps(self): """ Search and return all steps that have no parents. These are the steps that are get the input data. """ input_steps = [] for step in self.steps_sorted: parent_steps = self._parent_steps(step) if len(parent_steps) == 0: input_steps.ap...
def _extractEgaNegFromSent( sentTokens, clausesDict, foundChains ): ''' Meetod, mis tuvastab antud lausest 'ega'-predikaadiga seotud eituse(d): ega + sobiv verb. *) Juhtudel kui 'ega'-le j2rgneb juba tuvastatud, positiivse polaarsusega verbiahel (nt ahel mille alguses on käskivas kõneviisis v...
def function[_extractEgaNegFromSent, parameter[sentTokens, clausesDict, foundChains]]: constant[ Meetod, mis tuvastab antud lausest 'ega'-predikaadiga seotud eituse(d): ega + sobiv verb. *) Juhtudel kui 'ega'-le j2rgneb juba tuvastatud, positiivse polaarsusega verbiahel (nt ahel mille alguse...
keyword[def] identifier[_extractEgaNegFromSent] ( identifier[sentTokens] , identifier[clausesDict] , identifier[foundChains] ): literal[string] identifier[sonaEga] = identifier[WordTemplate] ({ identifier[ROOT] : literal[string] , identifier[POSTAG] : literal[string] }) identifier[verbEiJarel] = id...
def _extractEgaNegFromSent(sentTokens, clausesDict, foundChains): """ Meetod, mis tuvastab antud lausest 'ega'-predikaadiga seotud eituse(d): ega + sobiv verb. *) Juhtudel kui 'ega'-le j2rgneb juba tuvastatud, positiivse polaarsusega verbiahel (nt ahel mille alguses on käskivas kõneviisis verb),...
def json(self): """ returns a dict that represents a NetJSON NetworkGraph object """ nodes = [] links = [] for link in self.link_set.all(): if self.is_layer2: source = link.interface_a.mac destination = link.interface_b.mac else: ...
def function[json, parameter[self]]: constant[ returns a dict that represents a NetJSON NetworkGraph object ] variable[nodes] assign[=] list[[]] variable[links] assign[=] list[[]] for taget[name[link]] in starred[call[name[self].link_set.all, parameter[]]] begin[:] if nam...
keyword[def] identifier[json] ( identifier[self] ): literal[string] identifier[nodes] =[] identifier[links] =[] keyword[for] identifier[link] keyword[in] identifier[self] . identifier[link_set] . identifier[all] (): keyword[if] identifier[self] . identifier[is_la...
def json(self): """ returns a dict that represents a NetJSON NetworkGraph object """ nodes = [] links = [] for link in self.link_set.all(): if self.is_layer2: source = link.interface_a.mac destination = link.interface_b.mac # depends on [control=['if'], data=[]] ...
def flexifunction_read_req_send(self, target_system, target_component, read_req_type, data_index, force_mavlink1=False): ''' Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Component ID (uin...
def function[flexifunction_read_req_send, parameter[self, target_system, target_component, read_req_type, data_index, force_mavlink1]]: constant[ Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Comp...
keyword[def] identifier[flexifunction_read_req_send] ( identifier[self] , identifier[target_system] , identifier[target_component] , identifier[read_req_type] , identifier[data_index] , identifier[force_mavlink1] = keyword[False] ): literal[string] keyword[return] identifier[self] ...
def flexifunction_read_req_send(self, target_system, target_component, read_req_type, data_index, force_mavlink1=False): """ Reqest reading of flexifunction data target_system : System ID (uint8_t) target_component : Component ID (uint8_t) ...
def _make_gelf_dict(self, record): """Create a dictionary representing a Graylog GELF log from a python :class:`logging.LogRecord` :param record: :class:`logging.LogRecord` to create a Graylog GELF log from. :type record: logging.LogRecord :return: dictionary repres...
def function[_make_gelf_dict, parameter[self, record]]: constant[Create a dictionary representing a Graylog GELF log from a python :class:`logging.LogRecord` :param record: :class:`logging.LogRecord` to create a Graylog GELF log from. :type record: logging.LogRecord ...
keyword[def] identifier[_make_gelf_dict] ( identifier[self] , identifier[record] ): literal[string] identifier[gelf_dict] ={ literal[string] : literal[string] , literal[string] : identifier[BaseGELFHandler] . identifier[_resolve_host] ( identifier[self] . identifier[fqdn]...
def _make_gelf_dict(self, record): """Create a dictionary representing a Graylog GELF log from a python :class:`logging.LogRecord` :param record: :class:`logging.LogRecord` to create a Graylog GELF log from. :type record: logging.LogRecord :return: dictionary representi...
def get_url(cls, data): """Return the URL for a get request based on data type. Args: data: Accepts multiple types. Int: Generate URL to object with data ID. None: Get basic object GET URL (list). String/Unicode: Search for <data> with default...
def function[get_url, parameter[cls, data]]: constant[Return the URL for a get request based on data type. Args: data: Accepts multiple types. Int: Generate URL to object with data ID. None: Get basic object GET URL (list). String/Unicode: Sea...
keyword[def] identifier[get_url] ( identifier[cls] , identifier[data] ): literal[string] keyword[try] : identifier[data] = identifier[int] ( identifier[data] ) keyword[except] ( identifier[ValueError] , identifier[TypeError] ): keyword[pass] keyword[if] ...
def get_url(cls, data): """Return the URL for a get request based on data type. Args: data: Accepts multiple types. Int: Generate URL to object with data ID. None: Get basic object GET URL (list). String/Unicode: Search for <data> with default_sea...
def delete_resource(self, resource): """ Deletes the resource from the pool and destroys the associated resource. Not usually needed by users of the pool, but called internally when BadResource is raised. :param resource: the resource to remove :type resource: Resource ...
def function[delete_resource, parameter[self, resource]]: constant[ Deletes the resource from the pool and destroys the associated resource. Not usually needed by users of the pool, but called internally when BadResource is raised. :param resource: the resource to remove ...
keyword[def] identifier[delete_resource] ( identifier[self] , identifier[resource] ): literal[string] keyword[with] identifier[self] . identifier[lock] : identifier[self] . identifier[resources] . identifier[remove] ( identifier[resource] ) identifier[self] . identifier[destr...
def delete_resource(self, resource): """ Deletes the resource from the pool and destroys the associated resource. Not usually needed by users of the pool, but called internally when BadResource is raised. :param resource: the resource to remove :type resource: Resource ...
def ncVarUnit(ncVar): """ Returns the unit of the ncVar by looking in the attributes. It searches in the attributes for one of the following keys: 'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty string is returned. """ attributes = ncVarAttribute...
def function[ncVarUnit, parameter[ncVar]]: constant[ Returns the unit of the ncVar by looking in the attributes. It searches in the attributes for one of the following keys: 'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty string is returned. ] ...
keyword[def] identifier[ncVarUnit] ( identifier[ncVar] ): literal[string] identifier[attributes] = identifier[ncVarAttributes] ( identifier[ncVar] ) keyword[if] keyword[not] identifier[attributes] : keyword[return] literal[string] keyword[for] identifier[key] keyword[in] ( literal...
def ncVarUnit(ncVar): """ Returns the unit of the ncVar by looking in the attributes. It searches in the attributes for one of the following keys: 'unit', 'units', 'Unit', 'Units', 'UNIT', 'UNITS'. If these are not found, the empty string is returned. """ attributes = ncVarAttribute...
def decorate(self, name_or_func): """Decorate a function/method to check its timings. To use the function's name: @sw.decorate def func(): pass To name it explicitly: @sw.decorate("name") def random_func_name(): pass Args: name_or_func: the name or the fu...
def function[decorate, parameter[self, name_or_func]]: constant[Decorate a function/method to check its timings. To use the function's name: @sw.decorate def func(): pass To name it explicitly: @sw.decorate("name") def random_func_name(): pass Args: n...
keyword[def] identifier[decorate] ( identifier[self] , identifier[name_or_func] ): literal[string] keyword[if] identifier[os] . identifier[environ] . identifier[get] ( literal[string] ): keyword[return] identifier[name_or_func] keyword[if] identifier[callable] ( identifier[name_or_func] ) keywor...
def decorate(self, name_or_func): """Decorate a function/method to check its timings. To use the function's name: @sw.decorate def func(): pass To name it explicitly: @sw.decorate("name") def random_func_name(): pass Args: name_or_func: the name or the fu...
def add_query(self, name, filter, **kwargs): """Add a new query to device query service. .. code-block:: python f = api.add_query( name = "Query name", filter = { "device_id": {"$eq": "01234"}, custom_attributes = { ...
def function[add_query, parameter[self, name, filter]]: constant[Add a new query to device query service. .. code-block:: python f = api.add_query( name = "Query name", filter = { "device_id": {"$eq": "01234"}, custom_...
keyword[def] identifier[add_query] ( identifier[self] , identifier[name] , identifier[filter] ,** identifier[kwargs] ): literal[string] identifier[filter_obj] = identifier[filters] . identifier[legacy_filter_formatter] ( identifier[dict] ( identifier[filter] = identifier[filter] )...
def add_query(self, name, filter, **kwargs): """Add a new query to device query service. .. code-block:: python f = api.add_query( name = "Query name", filter = { "device_id": {"$eq": "01234"}, custom_attributes = { ...
def write_string(self, obj, use_reference=True): """ Writes a Java string with the TC_STRING type marker :param obj: The string to print :param use_reference: If True, allow writing a reference """ if use_reference and isinstance(obj, JavaString): try: ...
def function[write_string, parameter[self, obj, use_reference]]: constant[ Writes a Java string with the TC_STRING type marker :param obj: The string to print :param use_reference: If True, allow writing a reference ] if <ast.BoolOp object at 0x7da20c76fa60> begin[:] ...
keyword[def] identifier[write_string] ( identifier[self] , identifier[obj] , identifier[use_reference] = keyword[True] ): literal[string] keyword[if] identifier[use_reference] keyword[and] identifier[isinstance] ( identifier[obj] , identifier[JavaString] ): keyword[try] : ...
def write_string(self, obj, use_reference=True): """ Writes a Java string with the TC_STRING type marker :param obj: The string to print :param use_reference: If True, allow writing a reference """ if use_reference and isinstance(obj, JavaString): try: idx = ...
def get_arp_output_arp_entry_age(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_arp = ET.Element("get_arp") config = get_arp output = ET.SubElement(get_arp, "output") arp_entry = ET.SubElement(output, "arp-entry") ip_address_...
def function[get_arp_output_arp_entry_age, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_arp] assign[=] call[name[ET].Element, parameter[constant[get_arp]]] variable[config] assign[=] n...
keyword[def] identifier[get_arp_output_arp_entry_age] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_arp] = identifier[ET] . identifier[Element] ( literal[string] ) identifie...
def get_arp_output_arp_entry_age(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_arp = ET.Element('get_arp') config = get_arp output = ET.SubElement(get_arp, 'output') arp_entry = ET.SubElement(output, 'arp-entry') ip_address_key = ET.SubElement(arp_entr...
def addToService(self, service, namespace=None, seperator='.'): """ Add this Handler's exported methods to an RPC Service instance. """ if namespace is None: namespace = [] if isinstance(namespace, basestring): namespace = [namespace] for n, m in ...
def function[addToService, parameter[self, service, namespace, seperator]]: constant[ Add this Handler's exported methods to an RPC Service instance. ] if compare[name[namespace] is constant[None]] begin[:] variable[namespace] assign[=] list[[]] if call[name[isins...
keyword[def] identifier[addToService] ( identifier[self] , identifier[service] , identifier[namespace] = keyword[None] , identifier[seperator] = literal[string] ): literal[string] keyword[if] identifier[namespace] keyword[is] keyword[None] : identifier[namespace] =[] keywor...
def addToService(self, service, namespace=None, seperator='.'): """ Add this Handler's exported methods to an RPC Service instance. """ if namespace is None: namespace = [] # depends on [control=['if'], data=['namespace']] if isinstance(namespace, basestring): namespace = [n...
def convert_convolution(node, **kwargs): """Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. """ name, input_nodes, attrs = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, "kernel")) stride_dims = list(parse_helper(attrs, "stride",...
def function[convert_convolution, parameter[node]]: constant[Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. ] <ast.Tuple object at 0x7da1b1ef0b80> assign[=] call[name[get_inputs], parameter[name[node], name[kwargs]]] variable[kernel_dims]...
keyword[def] identifier[convert_convolution] ( identifier[node] ,** identifier[kwargs] ): literal[string] identifier[name] , identifier[input_nodes] , identifier[attrs] = identifier[get_inputs] ( identifier[node] , identifier[kwargs] ) identifier[kernel_dims] = identifier[list] ( identifier[parse_hel...
def convert_convolution(node, **kwargs): """Map MXNet's convolution operator attributes to onnx's Conv operator and return the created node. """ (name, input_nodes, attrs) = get_inputs(node, kwargs) kernel_dims = list(parse_helper(attrs, 'kernel')) stride_dims = list(parse_helper(attrs, 'stride'...
def import_type(dest, src, name, api=None, filter_symbol=None): """Import Type `name` and its dependencies from Registry `src` to Registry `dest`. :param Registry dest: Destination Registry :param Registry src: Source Registry :param str name: Name of type to import :param str api: Prefer to im...
def function[import_type, parameter[dest, src, name, api, filter_symbol]]: constant[Import Type `name` and its dependencies from Registry `src` to Registry `dest`. :param Registry dest: Destination Registry :param Registry src: Source Registry :param str name: Name of type to import :param ...
keyword[def] identifier[import_type] ( identifier[dest] , identifier[src] , identifier[name] , identifier[api] = keyword[None] , identifier[filter_symbol] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[filter_symbol] : identifier[filter_symbol] = identifier[_default_filte...
def import_type(dest, src, name, api=None, filter_symbol=None): """Import Type `name` and its dependencies from Registry `src` to Registry `dest`. :param Registry dest: Destination Registry :param Registry src: Source Registry :param str name: Name of type to import :param str api: Prefer to im...
def add_marccountry_tag(dom): """ Add ``<mods:placeTerm>`` tag with proper content. """ marccountry = dom.find("mods:placeTerm", {"authority": "marccountry"}) # don't add again if already defined if marccountry: return marccountry_tag = dhtmlparser.HTMLElement( "mods:place"...
def function[add_marccountry_tag, parameter[dom]]: constant[ Add ``<mods:placeTerm>`` tag with proper content. ] variable[marccountry] assign[=] call[name[dom].find, parameter[constant[mods:placeTerm], dictionary[[<ast.Constant object at 0x7da1b094a500>], [<ast.Constant object at 0x7da1b094a3e0>...
keyword[def] identifier[add_marccountry_tag] ( identifier[dom] ): literal[string] identifier[marccountry] = identifier[dom] . identifier[find] ( literal[string] ,{ literal[string] : literal[string] }) keyword[if] identifier[marccountry] : keyword[return] identifier[marccountry_t...
def add_marccountry_tag(dom): """ Add ``<mods:placeTerm>`` tag with proper content. """ marccountry = dom.find('mods:placeTerm', {'authority': 'marccountry'}) # don't add again if already defined if marccountry: return # depends on [control=['if'], data=[]] marccountry_tag = dhtmlpa...
def results(project, apikey, run, watch, server, output): """ Check to see if results are available for a particular mapping and if so download. Authentication is carried out using the --apikey option which must be provided. Depending on the server operating mode this may return a mask, a linka...
def function[results, parameter[project, apikey, run, watch, server, output]]: constant[ Check to see if results are available for a particular mapping and if so download. Authentication is carried out using the --apikey option which must be provided. Depending on the server operating mode this...
keyword[def] identifier[results] ( identifier[project] , identifier[apikey] , identifier[run] , identifier[watch] , identifier[server] , identifier[output] ): literal[string] identifier[status] = identifier[run_get_status] ( identifier[server] , identifier[project] , identifier[run] , identifier[apikey] )...
def results(project, apikey, run, watch, server, output): """ Check to see if results are available for a particular mapping and if so download. Authentication is carried out using the --apikey option which must be provided. Depending on the server operating mode this may return a mask, a linka...
def samples(self, anystring, limit=None, offset=None, sortby=None): '''Return an object representing the samples identified by the input domain, IP, or URL''' uri = self._uris['samples'].format(anystring) params = {'limit': limit, 'offset': offset, 'sortby': sortby} return self.get_par...
def function[samples, parameter[self, anystring, limit, offset, sortby]]: constant[Return an object representing the samples identified by the input domain, IP, or URL] variable[uri] assign[=] call[call[name[self]._uris][constant[samples]].format, parameter[name[anystring]]] variable[params] ass...
keyword[def] identifier[samples] ( identifier[self] , identifier[anystring] , identifier[limit] = keyword[None] , identifier[offset] = keyword[None] , identifier[sortby] = keyword[None] ): literal[string] identifier[uri] = identifier[self] . identifier[_uris] [ literal[string] ]. identifier[format...
def samples(self, anystring, limit=None, offset=None, sortby=None): """Return an object representing the samples identified by the input domain, IP, or URL""" uri = self._uris['samples'].format(anystring) params = {'limit': limit, 'offset': offset, 'sortby': sortby} return self.get_parse(uri, params)
def validate_schema(instance, schema, test_required=True, data_location=None, skip_missing_data=False): """Check if DictField values are consistent with our data types. Perform basic JSON schema validation and our custom validations: * check that required fields are given (if `test_r...
def function[validate_schema, parameter[instance, schema, test_required, data_location, skip_missing_data]]: constant[Check if DictField values are consistent with our data types. Perform basic JSON schema validation and our custom validations: * check that required fields are given (if `test_requir...
keyword[def] identifier[validate_schema] ( identifier[instance] , identifier[schema] , identifier[test_required] = keyword[True] , identifier[data_location] = keyword[None] , identifier[skip_missing_data] = keyword[False] ): literal[string] keyword[from] . identifier[storage] keyword[import] identifier[...
def validate_schema(instance, schema, test_required=True, data_location=None, skip_missing_data=False): """Check if DictField values are consistent with our data types. Perform basic JSON schema validation and our custom validations: * check that required fields are given (if `test_required` is set ...
def compare_jsone_task_definition(parent_link, rebuilt_definitions): """Compare the json-e rebuilt task definition vs the runtime definition. Args: parent_link (LinkOfTrust): the parent link to test. rebuilt_definitions (dict): the rebuilt task definitions. Raises: CoTError: on fai...
def function[compare_jsone_task_definition, parameter[parent_link, rebuilt_definitions]]: constant[Compare the json-e rebuilt task definition vs the runtime definition. Args: parent_link (LinkOfTrust): the parent link to test. rebuilt_definitions (dict): the rebuilt task definitions. R...
keyword[def] identifier[compare_jsone_task_definition] ( identifier[parent_link] , identifier[rebuilt_definitions] ): literal[string] identifier[diffs] =[] keyword[for] identifier[compare_definition] keyword[in] identifier[rebuilt_definitions] [ literal[string] ]: keyword[if] literal...
def compare_jsone_task_definition(parent_link, rebuilt_definitions): """Compare the json-e rebuilt task definition vs the runtime definition. Args: parent_link (LinkOfTrust): the parent link to test. rebuilt_definitions (dict): the rebuilt task definitions. Raises: CoTError: on fai...
def tx2genedict(gtf, keep_version=False): """ produce a tx2gene dictionary from a GTF file """ d = {} with open_gzipsafe(gtf) as in_handle: for line in in_handle: if "gene_id" not in line or "transcript_id" not in line: continue geneid = line.split("ge...
def function[tx2genedict, parameter[gtf, keep_version]]: constant[ produce a tx2gene dictionary from a GTF file ] variable[d] assign[=] dictionary[[], []] with call[name[open_gzipsafe], parameter[name[gtf]]] begin[:] for taget[name[line]] in starred[name[in_handle]] begin...
keyword[def] identifier[tx2genedict] ( identifier[gtf] , identifier[keep_version] = keyword[False] ): literal[string] identifier[d] ={} keyword[with] identifier[open_gzipsafe] ( identifier[gtf] ) keyword[as] identifier[in_handle] : keyword[for] identifier[line] keyword[in] identifier[in_...
def tx2genedict(gtf, keep_version=False): """ produce a tx2gene dictionary from a GTF file """ d = {} with open_gzipsafe(gtf) as in_handle: for line in in_handle: if 'gene_id' not in line or 'transcript_id' not in line: continue # depends on [control=['if'], data...
def display_status(): """Display an OK or FAILED message for the context block.""" def print_status(msg, color): """Print the status message. Args: msg: The message to display (e.g. OK or FAILED). color: The ANSI color code to use in displaying the message. """ ...
def function[display_status, parameter[]]: constant[Display an OK or FAILED message for the context block.] def function[print_status, parameter[msg, color]]: constant[Print the status message. Args: msg: The message to display (e.g. OK or FAILED). color:...
keyword[def] identifier[display_status] (): literal[string] keyword[def] identifier[print_status] ( identifier[msg] , identifier[color] ): literal[string] identifier[print] ( literal[string] keyword[if] identifier[sys] . identifier[stdout] . identifier[isatty] () keyword[else] litera...
def display_status(): """Display an OK or FAILED message for the context block.""" def print_status(msg, color): """Print the status message. Args: msg: The message to display (e.g. OK or FAILED). color: The ANSI color code to use in displaying the message. """ ...
def _get_observation(self): """ Returns an OrderedDict containing observations [(name_string, np.array), ...]. Important keys: robot-state: contains robot-centric information. object-state: requires @self.use_object_obs to be True. contains object-centric...
def function[_get_observation, parameter[self]]: constant[ Returns an OrderedDict containing observations [(name_string, np.array), ...]. Important keys: robot-state: contains robot-centric information. object-state: requires @self.use_object_obs to be True. ...
keyword[def] identifier[_get_observation] ( identifier[self] ): literal[string] identifier[di] = identifier[super] (). identifier[_get_observation] () keyword[if] identifier[self] . identifier[use_camera_obs] : identifier[camera_obs] = identifier[self] . identifier[sim] . ide...
def _get_observation(self): """ Returns an OrderedDict containing observations [(name_string, np.array), ...]. Important keys: robot-state: contains robot-centric information. object-state: requires @self.use_object_obs to be True. contains object-centric inf...
def conv_stack(name, x, mid_channels, output_channels, dilations=None, activation="relu", dropout=0.0): """3-layer convolutional stack. Args: name: variable scope. x: 5-D Tensor. mid_channels: Number of output channels of the first layer. output_channels: Number of output channels. ...
def function[conv_stack, parameter[name, x, mid_channels, output_channels, dilations, activation, dropout]]: constant[3-layer convolutional stack. Args: name: variable scope. x: 5-D Tensor. mid_channels: Number of output channels of the first layer. output_channels: Number of output channels....
keyword[def] identifier[conv_stack] ( identifier[name] , identifier[x] , identifier[mid_channels] , identifier[output_channels] , identifier[dilations] = keyword[None] , identifier[activation] = literal[string] , identifier[dropout] = literal[int] ): literal[string] keyword[with] identifier[tf] . identifier[...
def conv_stack(name, x, mid_channels, output_channels, dilations=None, activation='relu', dropout=0.0): """3-layer convolutional stack. Args: name: variable scope. x: 5-D Tensor. mid_channels: Number of output channels of the first layer. output_channels: Number of output channels. dilations:...
def set_ttl(self, key, ttl): """ Sets time to live for @key to @ttl seconds -> #bool True if the timeout was set """ return self._client.expire(self.get_key(key), ttl)
def function[set_ttl, parameter[self, key, ttl]]: constant[ Sets time to live for @key to @ttl seconds -> #bool True if the timeout was set ] return[call[name[self]._client.expire, parameter[call[name[self].get_key, parameter[name[key]]], name[ttl]]]]
keyword[def] identifier[set_ttl] ( identifier[self] , identifier[key] , identifier[ttl] ): literal[string] keyword[return] identifier[self] . identifier[_client] . identifier[expire] ( identifier[self] . identifier[get_key] ( identifier[key] ), identifier[ttl] )
def set_ttl(self, key, ttl): """ Sets time to live for @key to @ttl seconds -> #bool True if the timeout was set """ return self._client.expire(self.get_key(key), ttl)
def create(cls, cli, management_address, local_username=None, local_password=None, remote_username=None, remote_password=None, connection_type=None): """ Configures a remote system for remote replication. :param cls: this class. :param cli: t...
def function[create, parameter[cls, cli, management_address, local_username, local_password, remote_username, remote_password, connection_type]]: constant[ Configures a remote system for remote replication. :param cls: this class. :param cli: the rest client. :param management_a...
keyword[def] identifier[create] ( identifier[cls] , identifier[cli] , identifier[management_address] , identifier[local_username] = keyword[None] , identifier[local_password] = keyword[None] , identifier[remote_username] = keyword[None] , identifier[remote_password] = keyword[None] , identifier[connection_type] = ...
def create(cls, cli, management_address, local_username=None, local_password=None, remote_username=None, remote_password=None, connection_type=None): """ Configures a remote system for remote replication. :param cls: this class. :param cli: the rest client. :param management_address...
def transform_qubits(self: TSelf_Operation, func: Callable[[Qid], Qid]) -> TSelf_Operation: """Returns the same operation, but with different qubits. Args: func: The function to use to turn each current qubit into a desired new qubit. Return...
def function[transform_qubits, parameter[self, func]]: constant[Returns the same operation, but with different qubits. Args: func: The function to use to turn each current qubit into a desired new qubit. Returns: The receiving operation but with qubits t...
keyword[def] identifier[transform_qubits] ( identifier[self] : identifier[TSelf_Operation] , identifier[func] : identifier[Callable] [[ identifier[Qid] ], identifier[Qid] ])-> identifier[TSelf_Operation] : literal[string] keyword[return] identifier[self] . identifier[with_qubits] (*( identifier[f...
def transform_qubits(self: TSelf_Operation, func: Callable[[Qid], Qid]) -> TSelf_Operation: """Returns the same operation, but with different qubits. Args: func: The function to use to turn each current qubit into a desired new qubit. Returns: The receiving ...
def _objective_decorator(func): """Decorate an objective function Converts an objective function using the typical sklearn metrics signature so that it is usable with ``xgboost.training.train`` Parameters ---------- func: callable Expects a callable with signature ``func(y_true, y_pred...
def function[_objective_decorator, parameter[func]]: constant[Decorate an objective function Converts an objective function using the typical sklearn metrics signature so that it is usable with ``xgboost.training.train`` Parameters ---------- func: callable Expects a callable with ...
keyword[def] identifier[_objective_decorator] ( identifier[func] ): literal[string] keyword[def] identifier[inner] ( identifier[preds] , identifier[dmatrix] ): literal[string] identifier[labels] = identifier[dmatrix] . identifier[get_label] () keyword[return] identifier[func] ...
def _objective_decorator(func): """Decorate an objective function Converts an objective function using the typical sklearn metrics signature so that it is usable with ``xgboost.training.train`` Parameters ---------- func: callable Expects a callable with signature ``func(y_true, y_pred...
def retrieve_all_quiz_reports(self, quiz_id, course_id, includes_all_versions=None): """ Retrieve all quiz reports. Returns a list of all available reports. """ path = {} data = {} params = {} # REQUIRED - PATH - course_id """ID""" ...
def function[retrieve_all_quiz_reports, parameter[self, quiz_id, course_id, includes_all_versions]]: constant[ Retrieve all quiz reports. Returns a list of all available reports. ] variable[path] assign[=] dictionary[[], []] variable[data] assign[=] dictionary[[], []] ...
keyword[def] identifier[retrieve_all_quiz_reports] ( identifier[self] , identifier[quiz_id] , identifier[course_id] , identifier[includes_all_versions] = keyword[None] ): literal[string] identifier[path] ={} identifier[data] ={} identifier[params] ={} lit...
def retrieve_all_quiz_reports(self, quiz_id, course_id, includes_all_versions=None): """ Retrieve all quiz reports. Returns a list of all available reports. """ path = {} data = {} params = {} # REQUIRED - PATH - course_id 'ID' path['course_id'] = course_id # REQUIRED ...
def download_mail_attachments(self, name, local_output_directory, mail_folder='INBOX', check_regex=False, latest_only=False, ...
def function[download_mail_attachments, parameter[self, name, local_output_directory, mail_folder, check_regex, latest_only, not_found_mode]]: constant[ Downloads mail's attachments in the mail folder by its name to the local directory. :param name: The name of the attachment that will be downl...
keyword[def] identifier[download_mail_attachments] ( identifier[self] , identifier[name] , identifier[local_output_directory] , identifier[mail_folder] = literal[string] , identifier[check_regex] = keyword[False] , identifier[latest_only] = keyword[False] , identifier[not_found_mode] = literal[string] ): ...
def download_mail_attachments(self, name, local_output_directory, mail_folder='INBOX', check_regex=False, latest_only=False, not_found_mode='raise'): """ Downloads mail's attachments in the mail folder by its name to the local directory. :param name: The name of the attachment that will be download...
def plot_fit(self, **kwargs): """ Plots the fit of the model against the data """ import matplotlib.pyplot as plt import seaborn as sns figsize = kwargs.get('figsize',(10,7)) plt.figure(figsize=figsize) date_index = self.index[self.ar:self.data.shape[0]...
def function[plot_fit, parameter[self]]: constant[ Plots the fit of the model against the data ] import module[matplotlib.pyplot] as alias[plt] import module[seaborn] as alias[sns] variable[figsize] assign[=] call[name[kwargs].get, parameter[constant[figsize], tuple[[<ast.Consta...
keyword[def] identifier[plot_fit] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[import] identifier[matplotlib] . identifier[pyplot] keyword[as] identifier[plt] keyword[import] identifier[seaborn] keyword[as] identifier[sns] identifier[figsize] = id...
def plot_fit(self, **kwargs): """ Plots the fit of the model against the data """ import matplotlib.pyplot as plt import seaborn as sns figsize = kwargs.get('figsize', (10, 7)) plt.figure(figsize=figsize) date_index = self.index[self.ar:self.data.shape[0]] (mu, Y) = self._mo...
def match(self, tag): """Match.""" return CSSMatch(self.selectors, tag, self.namespaces, self.flags).match(tag)
def function[match, parameter[self, tag]]: constant[Match.] return[call[call[name[CSSMatch], parameter[name[self].selectors, name[tag], name[self].namespaces, name[self].flags]].match, parameter[name[tag]]]]
keyword[def] identifier[match] ( identifier[self] , identifier[tag] ): literal[string] keyword[return] identifier[CSSMatch] ( identifier[self] . identifier[selectors] , identifier[tag] , identifier[self] . identifier[namespaces] , identifier[self] . identifier[flags] ). identifier[match] ( identi...
def match(self, tag): """Match.""" return CSSMatch(self.selectors, tag, self.namespaces, self.flags).match(tag)
def GetValues(self, table_names, column_names, condition): """Retrieves values from a table. Args: table_names (list[str]): table names. column_names (list[str]): column names. condition (str): query condition such as "log_source == 'Application Error'". Yields: sqlite3.r...
def function[GetValues, parameter[self, table_names, column_names, condition]]: constant[Retrieves values from a table. Args: table_names (list[str]): table names. column_names (list[str]): column names. condition (str): query condition such as "log_source == 'Application Error'...
keyword[def] identifier[GetValues] ( identifier[self] , identifier[table_names] , identifier[column_names] , identifier[condition] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_connection] : keyword[raise] identifier[RuntimeError] ( literal[string] ) keyword[if]...
def GetValues(self, table_names, column_names, condition): """Retrieves values from a table. Args: table_names (list[str]): table names. column_names (list[str]): column names. condition (str): query condition such as "log_source == 'Application Error'". Yields: sqlite3.r...
def getHelp(arg=None): """ This function provides interactive manuals and tutorials. """ if arg==None: print('--------------------------------------------------------------') print('Hello, this is an interactive help system of HITRANonline API.') print('--------------------------...
def function[getHelp, parameter[arg]]: constant[ This function provides interactive manuals and tutorials. ] if compare[name[arg] equal[==] constant[None]] begin[:] call[name[print], parameter[constant[--------------------------------------------------------------]]] ...
keyword[def] identifier[getHelp] ( identifier[arg] = keyword[None] ): literal[string] keyword[if] identifier[arg] == keyword[None] : identifier[print] ( literal[string] ) identifier[print] ( literal[string] ) identifier[print] ( literal[string] ) identifier[print] ( lit...
def getHelp(arg=None): """ This function provides interactive manuals and tutorials. """ if arg == None: print('--------------------------------------------------------------') print('Hello, this is an interactive help system of HITRANonline API.') print('------------------------...
def read_configs_(self): """Read config files and set config values accordingly. Returns: (dict, list, list): respectively content of files, list of missing/empty files and list of files for which a parsing error arised. """ if not self.config_files_:...
def function[read_configs_, parameter[self]]: constant[Read config files and set config values accordingly. Returns: (dict, list, list): respectively content of files, list of missing/empty files and list of files for which a parsing error arised. ] i...
keyword[def] identifier[read_configs_] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[config_files_] : keyword[return] {},[],[] identifier[content] ={ identifier[section] :{} keyword[for] identifier[section] keyword[in] identi...
def read_configs_(self): """Read config files and set config values accordingly. Returns: (dict, list, list): respectively content of files, list of missing/empty files and list of files for which a parsing error arised. """ if not self.config_files_: ...
def f_migrate(self, new_name=None, in_store=False, new_storage_service=None, **kwargs): """Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to T...
def function[f_migrate, parameter[self, new_name, in_store, new_storage_service]]: constant[Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to True if the trajec...
keyword[def] identifier[f_migrate] ( identifier[self] , identifier[new_name] = keyword[None] , identifier[in_store] = keyword[False] , identifier[new_storage_service] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[new_name] keyword[is] keyword[not] keyword[Non...
def f_migrate(self, new_name=None, in_store=False, new_storage_service=None, **kwargs): """Can be called to rename and relocate the trajectory. :param new_name: New name of the trajectory, None if you do not want to change the name. :param in_store: Set this to True if the trajectory ...
def phase_to_color_wheel(complex_number): """Map a phase of a complexnumber to a color in (r,g,b). complex_number is phase is first mapped to angle in the range [0, 2pi] and then to a color wheel with blue at zero phase. """ angles = np.angle(complex_number) angle_round = int(((angles + 2 * np....
def function[phase_to_color_wheel, parameter[complex_number]]: constant[Map a phase of a complexnumber to a color in (r,g,b). complex_number is phase is first mapped to angle in the range [0, 2pi] and then to a color wheel with blue at zero phase. ] variable[angles] assign[=] call[name[np]....
keyword[def] identifier[phase_to_color_wheel] ( identifier[complex_number] ): literal[string] identifier[angles] = identifier[np] . identifier[angle] ( identifier[complex_number] ) identifier[angle_round] = identifier[int] ((( identifier[angles] + literal[int] * identifier[np] . identifier[pi] )%( lit...
def phase_to_color_wheel(complex_number): """Map a phase of a complexnumber to a color in (r,g,b). complex_number is phase is first mapped to angle in the range [0, 2pi] and then to a color wheel with blue at zero phase. """ angles = np.angle(complex_number) angle_round = int((angles + 2 * np.p...
def pick_synchronous_standby(self, cluster): """Finds the best candidate to be the synchronous standby. Current synchronous standby is always preferred, unless it has disconnected or does not want to be a synchronous standby any longer. :returns tuple of candidate name or None, and boo...
def function[pick_synchronous_standby, parameter[self, cluster]]: constant[Finds the best candidate to be the synchronous standby. Current synchronous standby is always preferred, unless it has disconnected or does not want to be a synchronous standby any longer. :returns tuple of cand...
keyword[def] identifier[pick_synchronous_standby] ( identifier[self] , identifier[cluster] ): literal[string] identifier[current] = identifier[cluster] . identifier[sync] . identifier[sync_standby] identifier[current] = identifier[current] . identifier[lower] () keyword[if] identifier[cu...
def pick_synchronous_standby(self, cluster): """Finds the best candidate to be the synchronous standby. Current synchronous standby is always preferred, unless it has disconnected or does not want to be a synchronous standby any longer. :returns tuple of candidate name or None, and bool sh...
def _SetupBotoConfig(self): """Set the boto config so GSUtil works with provisioned service accounts.""" project_id = self._GetNumericProjectId() try: boto_config.BotoConfig(project_id, debug=self.debug) except (IOError, OSError) as e: self.logger.warning(str(e))
def function[_SetupBotoConfig, parameter[self]]: constant[Set the boto config so GSUtil works with provisioned service accounts.] variable[project_id] assign[=] call[name[self]._GetNumericProjectId, parameter[]] <ast.Try object at 0x7da2044c0520>
keyword[def] identifier[_SetupBotoConfig] ( identifier[self] ): literal[string] identifier[project_id] = identifier[self] . identifier[_GetNumericProjectId] () keyword[try] : identifier[boto_config] . identifier[BotoConfig] ( identifier[project_id] , identifier[debug] = identifier[self] . ident...
def _SetupBotoConfig(self): """Set the boto config so GSUtil works with provisioned service accounts.""" project_id = self._GetNumericProjectId() try: boto_config.BotoConfig(project_id, debug=self.debug) # depends on [control=['try'], data=[]] except (IOError, OSError) as e: self.logger...
def present( name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, cloud_init=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, de...
def function[present, parameter[name, image_id, key_name, vpc_id, vpc_name, security_groups, user_data, cloud_init, instance_type, kernel_id, ramdisk_id, block_device_mappings, delete_on_termination, instance_monitoring, spot_price, instance_profile_name, ebs_optimized, associate_public_ip_address, region, key, keyid, ...
keyword[def] identifier[present] ( identifier[name] , identifier[image_id] , identifier[key_name] = keyword[None] , identifier[vpc_id] = keyword[None] , identifier[vpc_name] = keyword[None] , identifier[security_groups] = keyword[None] , identifier[user_data] = keyword[None] , identifier[cloud_init] = keyword...
def present(name, image_id, key_name=None, vpc_id=None, vpc_name=None, security_groups=None, user_data=None, cloud_init=None, instance_type='m1.small', kernel_id=None, ramdisk_id=None, block_device_mappings=None, delete_on_termination=None, instance_monitoring=False, spot_price=None, instance_profile_name=None, ebs_opt...
def get_response_signer(self): """Returns the response signer for this version of the signature. """ if not hasattr(self, "response_signer"): self.response_signer = V2ResponseSigner(self.digest, orig=self) return self.response_signer
def function[get_response_signer, parameter[self]]: constant[Returns the response signer for this version of the signature. ] if <ast.UnaryOp object at 0x7da1b14d8a90> begin[:] name[self].response_signer assign[=] call[name[V2ResponseSigner], parameter[name[self].digest]] ret...
keyword[def] identifier[get_response_signer] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): identifier[self] . identifier[response_signer] = identifier[V2ResponseSigner] ( identifier[self] . identifier[digest...
def get_response_signer(self): """Returns the response signer for this version of the signature. """ if not hasattr(self, 'response_signer'): self.response_signer = V2ResponseSigner(self.digest, orig=self) # depends on [control=['if'], data=[]] return self.response_signer
def _trim_batch(batch, length): """Trim the mini-batch `batch` to the size `length`. `batch` can be: - a NumPy array, in which case it's first axis will be trimmed to size `length` - a tuple, in which case `_trim_batch` applied recursively to each element and the resulting tuple returned ...
def function[_trim_batch, parameter[batch, length]]: constant[Trim the mini-batch `batch` to the size `length`. `batch` can be: - a NumPy array, in which case it's first axis will be trimmed to size `length` - a tuple, in which case `_trim_batch` applied recursively to each element and ...
keyword[def] identifier[_trim_batch] ( identifier[batch] , identifier[length] ): literal[string] keyword[if] identifier[isinstance] ( identifier[batch] , identifier[tuple] ): keyword[return] identifier[tuple] ([ identifier[_trim_batch] ( identifier[b] , identifier[length] ) keyword[for] identif...
def _trim_batch(batch, length): """Trim the mini-batch `batch` to the size `length`. `batch` can be: - a NumPy array, in which case it's first axis will be trimmed to size `length` - a tuple, in which case `_trim_batch` applied recursively to each element and the resulting tuple returned ...
def _find_particle_image(self, query, match, all_particles): """Find particle with the same index as match in a neighboring tile. """ _, idxs = self.particle_kdtree.query(query.pos, k=10) neighbors = all_particles[idxs] for particle in neighbors: if particle.index == match....
def function[_find_particle_image, parameter[self, query, match, all_particles]]: constant[Find particle with the same index as match in a neighboring tile. ] <ast.Tuple object at 0x7da1b20c49d0> assign[=] call[name[self].particle_kdtree.query, parameter[name[query].pos]] variable[neighbors] ass...
keyword[def] identifier[_find_particle_image] ( identifier[self] , identifier[query] , identifier[match] , identifier[all_particles] ): literal[string] identifier[_] , identifier[idxs] = identifier[self] . identifier[particle_kdtree] . identifier[query] ( identifier[query] . identifier[pos] , ident...
def _find_particle_image(self, query, match, all_particles): """Find particle with the same index as match in a neighboring tile. """ (_, idxs) = self.particle_kdtree.query(query.pos, k=10) neighbors = all_particles[idxs] for particle in neighbors: if particle.index == match.index: r...
def load_data(filename): """Loads data from a file. Parameters ---------- filename : :obj:`str` The file to load the collection from. Returns ------- :obj:`numpy.ndarray` of float The data read from the file. Raises -----...
def function[load_data, parameter[filename]]: constant[Loads data from a file. Parameters ---------- filename : :obj:`str` The file to load the collection from. Returns ------- :obj:`numpy.ndarray` of float The data read from the file. ...
keyword[def] identifier[load_data] ( identifier[filename] ): literal[string] identifier[file_root] , identifier[file_ext] = identifier[os] . identifier[path] . identifier[splitext] ( identifier[filename] ) identifier[data] = keyword[None] keyword[if] identifier[file_ext] == lite...
def load_data(filename): """Loads data from a file. Parameters ---------- filename : :obj:`str` The file to load the collection from. Returns ------- :obj:`numpy.ndarray` of float The data read from the file. Raises ------ ...
def get_list( self, search='', start=0, limit=0, order_by='', order_by_dir='ASC', published_only=False, minimal=False ): """ Get a list of items :param search: str :param start: int :param limit: int :pa...
def function[get_list, parameter[self, search, start, limit, order_by, order_by_dir, published_only, minimal]]: constant[ Get a list of items :param search: str :param start: int :param limit: int :param order_by: str :param order_by_dir: str :param publi...
keyword[def] identifier[get_list] ( identifier[self] , identifier[search] = literal[string] , identifier[start] = literal[int] , identifier[limit] = literal[int] , identifier[order_by] = literal[string] , identifier[order_by_dir] = literal[string] , identifier[published_only] = keyword[False] , identifier[min...
def get_list(self, search='', start=0, limit=0, order_by='', order_by_dir='ASC', published_only=False, minimal=False): """ Get a list of items :param search: str :param start: int :param limit: int :param order_by: str :param order_by_dir: str :param publishe...
def get_ot_study_info_from_treebase_nexml(src=None, nexml_content=None, encoding=u'utf8', nexson_syntax_version=DEFAULT_NEXSON_VERSION, merge_blocks=Tru...
def function[get_ot_study_info_from_treebase_nexml, parameter[src, nexml_content, encoding, nexson_syntax_version, merge_blocks, sort_arbitrary]]: constant[Normalize treebase-specific metadata into the locations where open tree of life software that expects it. See get_ot_study_info_from_nexml for the ...
keyword[def] identifier[get_ot_study_info_from_treebase_nexml] ( identifier[src] = keyword[None] , identifier[nexml_content] = keyword[None] , identifier[encoding] = literal[string] , identifier[nexson_syntax_version] = identifier[DEFAULT_NEXSON_VERSION] , identifier[merge_blocks] = keyword[True] , identifier[so...
def get_ot_study_info_from_treebase_nexml(src=None, nexml_content=None, encoding=u'utf8', nexson_syntax_version=DEFAULT_NEXSON_VERSION, merge_blocks=True, sort_arbitrary=False): """Normalize treebase-specific metadata into the locations where open tree of life software that expects it. See get_ot_study_inf...
def tange_pth(v, temp, v0, gamma0, a, b, theta0, n, z, t_ref=300., three_r=3. * constants.R): """ calculate thermal pressure for the Tange equation :param v: unit-cell volume in A^3 :param temp: temperature in K :param v0: unit-cell volume in A^3 at 1 bar :param gamma0: Gruneisen ...
def function[tange_pth, parameter[v, temp, v0, gamma0, a, b, theta0, n, z, t_ref, three_r]]: constant[ calculate thermal pressure for the Tange equation :param v: unit-cell volume in A^3 :param temp: temperature in K :param v0: unit-cell volume in A^3 at 1 bar :param gamma0: Gruneisen param...
keyword[def] identifier[tange_pth] ( identifier[v] , identifier[temp] , identifier[v0] , identifier[gamma0] , identifier[a] , identifier[b] , identifier[theta0] , identifier[n] , identifier[z] , identifier[t_ref] = literal[int] , identifier[three_r] = literal[int] * identifier[constants] . identifier[R] ): lite...
def tange_pth(v, temp, v0, gamma0, a, b, theta0, n, z, t_ref=300.0, three_r=3.0 * constants.R): """ calculate thermal pressure for the Tange equation :param v: unit-cell volume in A^3 :param temp: temperature in K :param v0: unit-cell volume in A^3 at 1 bar :param gamma0: Gruneisen parameter at...
def setCurrentSchemaPath(self, path): """ Sets the current item based on the inputed column. :param path | <str> """ if not path: return False parts = path.split('.') name = parts[0] next = parts[1:] ...
def function[setCurrentSchemaPath, parameter[self, path]]: constant[ Sets the current item based on the inputed column. :param path | <str> ] if <ast.UnaryOp object at 0x7da18f58e5f0> begin[:] return[constant[False]] variable[parts] assign[=] call[na...
keyword[def] identifier[setCurrentSchemaPath] ( identifier[self] , identifier[path] ): literal[string] keyword[if] keyword[not] identifier[path] : keyword[return] keyword[False] identifier[parts] = identifier[path] . identifier[split] ( literal[string] ) id...
def setCurrentSchemaPath(self, path): """ Sets the current item based on the inputed column. :param path | <str> """ if not path: return False # depends on [control=['if'], data=[]] parts = path.split('.') name = parts[0] next = parts[1:] if name ==...
def messages_from_response(response): """Returns a list of the messages from the django MessageMiddleware package contained within the given response. This is to be used during unit testing when trying to see if a message was set properly in a view. :param response: HttpResponse object, likely obtaine...
def function[messages_from_response, parameter[response]]: constant[Returns a list of the messages from the django MessageMiddleware package contained within the given response. This is to be used during unit testing when trying to see if a message was set properly in a view. :param response: Http...
keyword[def] identifier[messages_from_response] ( identifier[response] ): literal[string] identifier[messages] =[] keyword[if] identifier[hasattr] ( identifier[response] , literal[string] ) keyword[and] identifier[response] . identifier[context] keyword[and] literal[string] keyword[in] identifie...
def messages_from_response(response): """Returns a list of the messages from the django MessageMiddleware package contained within the given response. This is to be used during unit testing when trying to see if a message was set properly in a view. :param response: HttpResponse object, likely obtaine...
def get_data(self, safe_copy=False): """Get the data in the image. If save_copy is True, will perform a deep copy of the data and return it. Parameters ---------- smoothed: (optional) bool If True and self._smooth_fwhm > 0 will smooth the data before masking. ...
def function[get_data, parameter[self, safe_copy]]: constant[Get the data in the image. If save_copy is True, will perform a deep copy of the data and return it. Parameters ---------- smoothed: (optional) bool If True and self._smooth_fwhm > 0 will smooth the data b...
keyword[def] identifier[get_data] ( identifier[self] , identifier[safe_copy] = keyword[False] ): literal[string] keyword[if] identifier[safe_copy] : identifier[data] = identifier[get_data] ( identifier[self] . identifier[img] ) keyword[else] : identifier[data] = ...
def get_data(self, safe_copy=False): """Get the data in the image. If save_copy is True, will perform a deep copy of the data and return it. Parameters ---------- smoothed: (optional) bool If True and self._smooth_fwhm > 0 will smooth the data before masking. m...
def BC_Rigidity(self): """ Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid """ ######################################### # FLEXURAL RIGIDITY BOUNDARY CONDITIONS # ######################################### # W...
def function[BC_Rigidity, parameter[self]]: constant[ Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid ] if compare[name[self].BC_W equal[==] constant[Periodic]] begin[:] name[self].BC_Rigidity_W as...
keyword[def] identifier[BC_Rigidity] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[BC_W] == literal[string] : identifier[self] . identifier[BC_Rigidity_W] = literal[string] keyword[elif] ( identifier[self] . identifier[BC_W] == identifier...
def BC_Rigidity(self): """ Utility function to help implement boundary conditions by specifying them for and applying them to the elastic thickness grid """ ######################################### # FLEXURAL RIGIDITY BOUNDARY CONDITIONS # ######################################### # We...
def _generate_move( cls, char, width=None, fill_char=None, bounce=False, reverse=True, back_char=None): """ Yields strings that simulate movement of a character from left to right. For use with `BarSet.from_char`. Arguments: char : Charac...
def function[_generate_move, parameter[cls, char, width, fill_char, bounce, reverse, back_char]]: constant[ Yields strings that simulate movement of a character from left to right. For use with `BarSet.from_char`. Arguments: char : Character to move across the p...
keyword[def] identifier[_generate_move] ( identifier[cls] , identifier[char] , identifier[width] = keyword[None] , identifier[fill_char] = keyword[None] , identifier[bounce] = keyword[False] , identifier[reverse] = keyword[True] , identifier[back_char] = keyword[None] ): literal[string] identifie...
def _generate_move(cls, char, width=None, fill_char=None, bounce=False, reverse=True, back_char=None): """ Yields strings that simulate movement of a character from left to right. For use with `BarSet.from_char`. Arguments: char : Character to move across the progre...
def specialspaceless(parser, token): """ Removes whitespace between HTML tags, and introduces a whitespace after buttons an inputs, necessary for Bootstrap to place them correctly in the layout. """ nodelist = parser.parse(('endspecialspaceless',)) parser.delete_first_token() return Spe...
def function[specialspaceless, parameter[parser, token]]: constant[ Removes whitespace between HTML tags, and introduces a whitespace after buttons an inputs, necessary for Bootstrap to place them correctly in the layout. ] variable[nodelist] assign[=] call[name[parser].parse, parameter[...
keyword[def] identifier[specialspaceless] ( identifier[parser] , identifier[token] ): literal[string] identifier[nodelist] = identifier[parser] . identifier[parse] (( literal[string] ,)) identifier[parser] . identifier[delete_first_token] () keyword[return] identifier[SpecialSpacelessNode] ( id...
def specialspaceless(parser, token): """ Removes whitespace between HTML tags, and introduces a whitespace after buttons an inputs, necessary for Bootstrap to place them correctly in the layout. """ nodelist = parser.parse(('endspecialspaceless',)) parser.delete_first_token() return Spec...
def check_mass_balance(self): """Compute mass and charge balance for the reaction returns a dict of {element: amount} for unbalanced elements. "charge" is treated as an element in this dict This should be empty for balanced reactions. """ reaction_element_dict = defaultd...
def function[check_mass_balance, parameter[self]]: constant[Compute mass and charge balance for the reaction returns a dict of {element: amount} for unbalanced elements. "charge" is treated as an element in this dict This should be empty for balanced reactions. ] variabl...
keyword[def] identifier[check_mass_balance] ( identifier[self] ): literal[string] identifier[reaction_element_dict] = identifier[defaultdict] ( identifier[int] ) keyword[for] identifier[metabolite] , identifier[coefficient] keyword[in] identifier[iteritems] ( identifier[self] . identifi...
def check_mass_balance(self): """Compute mass and charge balance for the reaction returns a dict of {element: amount} for unbalanced elements. "charge" is treated as an element in this dict This should be empty for balanced reactions. """ reaction_element_dict = defaultdict(int)...
def create_load_balancer(self, name, zones, listeners, subnets=None, security_groups=None): """ Create a new load balancer for your account. By default the load balancer will be created in EC2. To create a load balancer inside a VPC, parameter zones must be set to None and subnet...
def function[create_load_balancer, parameter[self, name, zones, listeners, subnets, security_groups]]: constant[ Create a new load balancer for your account. By default the load balancer will be created in EC2. To create a load balancer inside a VPC, parameter zones must be set to None a...
keyword[def] identifier[create_load_balancer] ( identifier[self] , identifier[name] , identifier[zones] , identifier[listeners] , identifier[subnets] = keyword[None] , identifier[security_groups] = keyword[None] ): literal[string] identifier[params] ={ literal[string] : identifier[name] } ...
def create_load_balancer(self, name, zones, listeners, subnets=None, security_groups=None): """ Create a new load balancer for your account. By default the load balancer will be created in EC2. To create a load balancer inside a VPC, parameter zones must be set to None and subnets must not b...
def parse_degrees(cls, degrees, arcminutes, arcseconds, direction=None): """ Parse degrees minutes seconds including direction (N, S, E, W) """ degrees = float(degrees) negative = degrees < 0 arcminutes = float(arcminutes) arcseconds = float(arcseconds) i...
def function[parse_degrees, parameter[cls, degrees, arcminutes, arcseconds, direction]]: constant[ Parse degrees minutes seconds including direction (N, S, E, W) ] variable[degrees] assign[=] call[name[float], parameter[name[degrees]]] variable[negative] assign[=] compare[name[de...
keyword[def] identifier[parse_degrees] ( identifier[cls] , identifier[degrees] , identifier[arcminutes] , identifier[arcseconds] , identifier[direction] = keyword[None] ): literal[string] identifier[degrees] = identifier[float] ( identifier[degrees] ) identifier[negative] = identifier[degr...
def parse_degrees(cls, degrees, arcminutes, arcseconds, direction=None): """ Parse degrees minutes seconds including direction (N, S, E, W) """ degrees = float(degrees) negative = degrees < 0 arcminutes = float(arcminutes) arcseconds = float(arcseconds) if arcminutes or arcsecond...
def resize(self, package): """ :: POST /:login/machines/:id?action=resize Initiate resizing of the remote machine to a new package. """ if isinstance(package, dict): package = package['name'] action = {'action': 'resize', ...
def function[resize, parameter[self, package]]: constant[ :: POST /:login/machines/:id?action=resize Initiate resizing of the remote machine to a new package. ] if call[name[isinstance], parameter[name[package], name[dict]]] begin[:] ...
keyword[def] identifier[resize] ( identifier[self] , identifier[package] ): literal[string] keyword[if] identifier[isinstance] ( identifier[package] , identifier[dict] ): identifier[package] = identifier[package] [ literal[string] ] identifier[action] ={ literal[string] : lit...
def resize(self, package): """ :: POST /:login/machines/:id?action=resize Initiate resizing of the remote machine to a new package. """ if isinstance(package, dict): package = package['name'] # depends on [control=['if'], data=[]] action = {'act...
def configure_sessionmaker(graph): """ Create the SQLAlchemy session class. """ engine_routing_strategy = getattr(graph, graph.config.sessionmaker.engine_routing_strategy) if engine_routing_strategy.supports_multiple_binds: ScopedFactory.infect(graph, "postgres") class RoutingSession(...
def function[configure_sessionmaker, parameter[graph]]: constant[ Create the SQLAlchemy session class. ] variable[engine_routing_strategy] assign[=] call[name[getattr], parameter[name[graph], name[graph].config.sessionmaker.engine_routing_strategy]] if name[engine_routing_strategy].supp...
keyword[def] identifier[configure_sessionmaker] ( identifier[graph] ): literal[string] identifier[engine_routing_strategy] = identifier[getattr] ( identifier[graph] , identifier[graph] . identifier[config] . identifier[sessionmaker] . identifier[engine_routing_strategy] ) keyword[if] identifier[engi...
def configure_sessionmaker(graph): """ Create the SQLAlchemy session class. """ engine_routing_strategy = getattr(graph, graph.config.sessionmaker.engine_routing_strategy) if engine_routing_strategy.supports_multiple_binds: ScopedFactory.infect(graph, 'postgres') # depends on [control=['if...
def resize_image_with_crop_or_pad(img, target_height, target_width): """ Crops and/or pads an image to a target width and height. Resizes an image to a target width and height by either cropping the image or padding it with zeros. NO CENTER CROP. NO CENTER PAD. (Just fill bottom right or crop bottom r...
def function[resize_image_with_crop_or_pad, parameter[img, target_height, target_width]]: constant[ Crops and/or pads an image to a target width and height. Resizes an image to a target width and height by either cropping the image or padding it with zeros. NO CENTER CROP. NO CENTER PAD. (Just fil...
keyword[def] identifier[resize_image_with_crop_or_pad] ( identifier[img] , identifier[target_height] , identifier[target_width] ): literal[string] identifier[h] , identifier[w] = identifier[target_height] , identifier[target_width] identifier[max_h] , identifier[max_w] , identifier[c] = identifier[im...
def resize_image_with_crop_or_pad(img, target_height, target_width): """ Crops and/or pads an image to a target width and height. Resizes an image to a target width and height by either cropping the image or padding it with zeros. NO CENTER CROP. NO CENTER PAD. (Just fill bottom right or crop bottom r...
def on_disconnect(self, broker): """ Called by :class:`Broker` to force disconnect the stream. The base implementation simply closes :attr:`receive_side` and :attr:`transmit_side` and unregisters the stream from the broker. """ LOG.debug('%r.on_disconnect()', self) ...
def function[on_disconnect, parameter[self, broker]]: constant[ Called by :class:`Broker` to force disconnect the stream. The base implementation simply closes :attr:`receive_side` and :attr:`transmit_side` and unregisters the stream from the broker. ] call[name[LOG].debu...
keyword[def] identifier[on_disconnect] ( identifier[self] , identifier[broker] ): literal[string] identifier[LOG] . identifier[debug] ( literal[string] , identifier[self] ) keyword[if] identifier[self] . identifier[receive_side] : identifier[broker] . identifier[stop_receive]...
def on_disconnect(self, broker): """ Called by :class:`Broker` to force disconnect the stream. The base implementation simply closes :attr:`receive_side` and :attr:`transmit_side` and unregisters the stream from the broker. """ LOG.debug('%r.on_disconnect()', self) if self.re...
def generate(env): """Add Builders and construction variables for ifl to an Environment.""" fscan = FortranScan("FORTRANPATH") SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.SourceFileScanner.add_scanner('.i90', fscan) if 'FORTRANFILESUFFIXES' not in env: env['FORTRANFILES...
def function[generate, parameter[env]]: constant[Add Builders and construction variables for ifl to an Environment.] variable[fscan] assign[=] call[name[FortranScan], parameter[constant[FORTRANPATH]]] call[name[SCons].Tool.SourceFileScanner.add_scanner, parameter[constant[.i], name[fscan]]] ...
keyword[def] identifier[generate] ( identifier[env] ): literal[string] identifier[fscan] = identifier[FortranScan] ( literal[string] ) identifier[SCons] . identifier[Tool] . identifier[SourceFileScanner] . identifier[add_scanner] ( literal[string] , identifier[fscan] ) identifier[SCons] . identif...
def generate(env): """Add Builders and construction variables for ifl to an Environment.""" fscan = FortranScan('FORTRANPATH') SCons.Tool.SourceFileScanner.add_scanner('.i', fscan) SCons.Tool.SourceFileScanner.add_scanner('.i90', fscan) if 'FORTRANFILESUFFIXES' not in env: env['FORTRANFILESU...
def listen(self, message_consumer): """Blocking call to listen for messages on the rfile. Args: message_consumer (fn): function that is passed each message as it is read off the socket. """ while not self._rfile.closed: request_str = self._read_message() ...
def function[listen, parameter[self, message_consumer]]: constant[Blocking call to listen for messages on the rfile. Args: message_consumer (fn): function that is passed each message as it is read off the socket. ] while <ast.UnaryOp object at 0x7da1b2828af0> begin[:] ...
keyword[def] identifier[listen] ( identifier[self] , identifier[message_consumer] ): literal[string] keyword[while] keyword[not] identifier[self] . identifier[_rfile] . identifier[closed] : identifier[request_str] = identifier[self] . identifier[_read_message] () keywor...
def listen(self, message_consumer): """Blocking call to listen for messages on the rfile. Args: message_consumer (fn): function that is passed each message as it is read off the socket. """ while not self._rfile.closed: request_str = self._read_message() if request_s...
def _get_output(algorithm, iport=0, iconnection=0, oport=0, active_scalar=None, active_scalar_field='point'): """A helper to get the algorithm's output and copy input's vtki meta info""" ido = algorithm.GetInputDataObject(iport, iconnection) data = wrap(algorithm.GetOutputDataObject(oport)) ...
def function[_get_output, parameter[algorithm, iport, iconnection, oport, active_scalar, active_scalar_field]]: constant[A helper to get the algorithm's output and copy input's vtki meta info] variable[ido] assign[=] call[name[algorithm].GetInputDataObject, parameter[name[iport], name[iconnection]]] ...
keyword[def] identifier[_get_output] ( identifier[algorithm] , identifier[iport] = literal[int] , identifier[iconnection] = literal[int] , identifier[oport] = literal[int] , identifier[active_scalar] = keyword[None] , identifier[active_scalar_field] = literal[string] ): literal[string] identifier[ido] = i...
def _get_output(algorithm, iport=0, iconnection=0, oport=0, active_scalar=None, active_scalar_field='point'): """A helper to get the algorithm's output and copy input's vtki meta info""" ido = algorithm.GetInputDataObject(iport, iconnection) data = wrap(algorithm.GetOutputDataObject(oport)) data.copy_me...
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict """ return ...
def function[serialize, parameter[self]]: constant[This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict ...
keyword[def] identifier[serialize] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[operand] , literal[string] :[ identifier[serialize] ( identifier[elem] ) keyword[for] identifier[elem] keyword[in] identifier[self] . identifier[sons] ], ...
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict """ return {'operan...
def sky2pix_vec(self, pos, r, pa): """ Convert a vector from sky to pixel coords. The vector has a magnitude, angle, and an origin on the sky. Parameters ---------- pos : (float, float) The (ra, dec) of the origin of the vector (degrees). r : float ...
def function[sky2pix_vec, parameter[self, pos, r, pa]]: constant[ Convert a vector from sky to pixel coords. The vector has a magnitude, angle, and an origin on the sky. Parameters ---------- pos : (float, float) The (ra, dec) of the origin of the vector (deg...
keyword[def] identifier[sky2pix_vec] ( identifier[self] , identifier[pos] , identifier[r] , identifier[pa] ): literal[string] identifier[ra] , identifier[dec] = identifier[pos] identifier[x] , identifier[y] = identifier[self] . identifier[sky2pix] ( identifier[pos] ) identifier[a...
def sky2pix_vec(self, pos, r, pa): """ Convert a vector from sky to pixel coords. The vector has a magnitude, angle, and an origin on the sky. Parameters ---------- pos : (float, float) The (ra, dec) of the origin of the vector (degrees). r : float ...
def insert(self, value, key): """ Insert a value into a tree rooted at the given node, and return whether this was an insertion or update. Balances the tree during insertion. An update is performed instead of an insertion if a value in the tree compares equal to the new...
def function[insert, parameter[self, value, key]]: constant[ Insert a value into a tree rooted at the given node, and return whether this was an insertion or update. Balances the tree during insertion. An update is performed instead of an insertion if a value in the tree ...
keyword[def] identifier[insert] ( identifier[self] , identifier[value] , identifier[key] ): literal[string] keyword[if] identifier[self] keyword[is] identifier[NULL] : keyword[return] identifier[Node] ( identifier[value] , identifier[NULL] , identifier[NULL] , ke...
def insert(self, value, key): """ Insert a value into a tree rooted at the given node, and return whether this was an insertion or update. Balances the tree during insertion. An update is performed instead of an insertion if a value in the tree compares equal to the new val...
def engage(self, height): """ Move the magnet to a specific height, in mm from home position """ if height > MAX_ENGAGE_HEIGHT or height < 0: raise ValueError('Invalid engage height. Should be 0 to {}'.format( MAX_ENGAGE_HEIGHT)) self._driver.move(heig...
def function[engage, parameter[self, height]]: constant[ Move the magnet to a specific height, in mm from home position ] if <ast.BoolOp object at 0x7da1b086e950> begin[:] <ast.Raise object at 0x7da1b086d5d0> call[name[self]._driver.move, parameter[name[height]]] ...
keyword[def] identifier[engage] ( identifier[self] , identifier[height] ): literal[string] keyword[if] identifier[height] > identifier[MAX_ENGAGE_HEIGHT] keyword[or] identifier[height] < literal[int] : keyword[raise] identifier[ValueError] ( literal[string] . identifier[format] ( ...
def engage(self, height): """ Move the magnet to a specific height, in mm from home position """ if height > MAX_ENGAGE_HEIGHT or height < 0: raise ValueError('Invalid engage height. Should be 0 to {}'.format(MAX_ENGAGE_HEIGHT)) # depends on [control=['if'], data=[]] self._driver.mo...
def setInverted(self, state): """ Sets whether or not to invert the check state for collapsing. :param state | <bool> """ collapsed = self.isCollapsed() self._inverted = state if self.isCollapsible(): self.setCollapsed(collapsed)
def function[setInverted, parameter[self, state]]: constant[ Sets whether or not to invert the check state for collapsing. :param state | <bool> ] variable[collapsed] assign[=] call[name[self].isCollapsed, parameter[]] name[self]._inverted assign[=] name[sta...
keyword[def] identifier[setInverted] ( identifier[self] , identifier[state] ): literal[string] identifier[collapsed] = identifier[self] . identifier[isCollapsed] () identifier[self] . identifier[_inverted] = identifier[state] keyword[if] identifier[self] . identifier[isColla...
def setInverted(self, state): """ Sets whether or not to invert the check state for collapsing. :param state | <bool> """ collapsed = self.isCollapsed() self._inverted = state if self.isCollapsible(): self.setCollapsed(collapsed) # depends on [control=['if'...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url return _d...
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da18c4cf4f0> begin[:] call[name[_dict]][constant[status]] assign[=] name[self].status if <ast.Bool...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[status] keyword[is] keyword[not] keyword[None] : identifier[_dic...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'status') and self.status is not None: _dict['status'] = self.status # depends on [control=['if'], data=[]] if hasattr(self, 'url') and self.url is not None: _dict['url'] = self.url ...
def add_contact(self, phone_number: str, first_name: str, last_name: str=None, on_success: callable=None): """ Add contact by phone number and name (last_name is optional). :param phone: Valid phone number for contact. :param first_name: First name to use. :param last_name: Last ...
def function[add_contact, parameter[self, phone_number, first_name, last_name, on_success]]: constant[ Add contact by phone number and name (last_name is optional). :param phone: Valid phone number for contact. :param first_name: First name to use. :param last_name: Last name to ...
keyword[def] identifier[add_contact] ( identifier[self] , identifier[phone_number] : identifier[str] , identifier[first_name] : identifier[str] , identifier[last_name] : identifier[str] = keyword[None] , identifier[on_success] : identifier[callable] = keyword[None] ): literal[string] keyword[pass]
def add_contact(self, phone_number: str, first_name: str, last_name: str=None, on_success: callable=None): """ Add contact by phone number and name (last_name is optional). :param phone: Valid phone number for contact. :param first_name: First name to use. :param last_name: Last name...
def Validate(self): """Check the source is well constructed.""" self._ValidateReturnedTypes() self._ValidatePaths() self._ValidateType() self._ValidateRequiredAttributes() self._ValidateCommandArgs()
def function[Validate, parameter[self]]: constant[Check the source is well constructed.] call[name[self]._ValidateReturnedTypes, parameter[]] call[name[self]._ValidatePaths, parameter[]] call[name[self]._ValidateType, parameter[]] call[name[self]._ValidateRequiredAttributes, para...
keyword[def] identifier[Validate] ( identifier[self] ): literal[string] identifier[self] . identifier[_ValidateReturnedTypes] () identifier[self] . identifier[_ValidatePaths] () identifier[self] . identifier[_ValidateType] () identifier[self] . identifier[_ValidateRequiredAttributes] () ...
def Validate(self): """Check the source is well constructed.""" self._ValidateReturnedTypes() self._ValidatePaths() self._ValidateType() self._ValidateRequiredAttributes() self._ValidateCommandArgs()
def tokenize (self, value): """Take a string and break it into tokens. Return the tokens as a list of strings. """ # This code uses a state machine: class STATE: NORMAL = 0 GROUP_PUNCTUATION = 1 PROCESS_HTML_TAG = 2 PROCESS_HTML_E...
def function[tokenize, parameter[self, value]]: constant[Take a string and break it into tokens. Return the tokens as a list of strings. ] class class[STATE, parameter[]] begin[:] variable[NORMAL] assign[=] constant[0] variable[GROUP_PUNCTUATION] assign[=...
keyword[def] identifier[tokenize] ( identifier[self] , identifier[value] ): literal[string] keyword[class] identifier[STATE] : identifier[NORMAL] = literal[int] identifier[GROUP_PUNCTUATION] = literal[int] identifier[PROCESS_HTML_TAG] = literal[in...
def tokenize(self, value): """Take a string and break it into tokens. Return the tokens as a list of strings. """ # This code uses a state machine: class STATE: NORMAL = 0 GROUP_PUNCTUATION = 1 PROCESS_HTML_TAG = 2 PROCESS_HTML_ENTITY = 3 GROUP_LINEB...
def nics_skip(name, nics, ipv6): ''' Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` ''' return nics_skipped(name, nics=nics, ipv6=ipv6)
def function[nics_skip, parameter[name, nics, ipv6]]: constant[ Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` ] return[call[name[nics_skipped], parameter[name[name]]]]
keyword[def] identifier[nics_skip] ( identifier[name] , identifier[nics] , identifier[ipv6] ): literal[string] keyword[return] identifier[nics_skipped] ( identifier[name] , identifier[nics] = identifier[nics] , identifier[ipv6] = identifier[ipv6] )
def nics_skip(name, nics, ipv6): """ Alias for :mod:`csf.nics_skipped <salt.states.csf.nics_skipped>` """ return nics_skipped(name, nics=nics, ipv6=ipv6)
def deep_compare(obj1, obj2): """ >>> deep_compare({'1': None}, {}) False >>> deep_compare({'1': {}}, {'1': None}) False >>> deep_compare({'1': [1]}, {'1': [2]}) False >>> deep_compare({'1': 2}, {'1': '2'}) True >>> deep_compare({'1': {'2': [3, 4]}}, {'1': {'2': [3, 4]}}) Tru...
def function[deep_compare, parameter[obj1, obj2]]: constant[ >>> deep_compare({'1': None}, {}) False >>> deep_compare({'1': {}}, {'1': None}) False >>> deep_compare({'1': [1]}, {'1': [2]}) False >>> deep_compare({'1': 2}, {'1': '2'}) True >>> deep_compare({'1': {'2': [3, 4]}}...
keyword[def] identifier[deep_compare] ( identifier[obj1] , identifier[obj2] ): literal[string] keyword[if] identifier[set] ( identifier[list] ( identifier[obj1] . identifier[keys] ()))!= identifier[set] ( identifier[list] ( identifier[obj2] . identifier[keys] ())): keyword[return] keyword[False...
def deep_compare(obj1, obj2): """ >>> deep_compare({'1': None}, {}) False >>> deep_compare({'1': {}}, {'1': None}) False >>> deep_compare({'1': [1]}, {'1': [2]}) False >>> deep_compare({'1': 2}, {'1': '2'}) True >>> deep_compare({'1': {'2': [3, 4]}}, {'1': {'2': [3, 4]}}) Tru...
def units(self): """Units.""" if "units" in self.attrs.keys(): # This try-except here for compatibility with v1.0.0 of WT5 format try: self.attrs["units"] = self.attrs["units"].decode() except AttributeError: pass # already a string, n...
def function[units, parameter[self]]: constant[Units.] if compare[constant[units] in call[name[self].attrs.keys, parameter[]]] begin[:] <ast.Try object at 0x7da1b0b9f670> return[call[name[self].attrs][constant[units]]] return[constant[None]]
keyword[def] identifier[units] ( identifier[self] ): literal[string] keyword[if] literal[string] keyword[in] identifier[self] . identifier[attrs] . identifier[keys] (): keyword[try] : identifier[self] . identifier[attrs] [ literal[string] ]= identifier[self...
def units(self): """Units.""" if 'units' in self.attrs.keys(): # This try-except here for compatibility with v1.0.0 of WT5 format try: self.attrs['units'] = self.attrs['units'].decode() # depends on [control=['try'], data=[]] except AttributeError: pass # alread...
def logpdf(self, mu): """ Log PDF for Skew t prior Parameters ---------- mu : float Latent variable for which the prior is being formed over Returns ---------- - log(p(mu)) """ if self.transform is not None: mu = s...
def function[logpdf, parameter[self, mu]]: constant[ Log PDF for Skew t prior Parameters ---------- mu : float Latent variable for which the prior is being formed over Returns ---------- - log(p(mu)) ] if compare[name[self].tr...
keyword[def] identifier[logpdf] ( identifier[self] , identifier[mu] ): literal[string] keyword[if] identifier[self] . identifier[transform] keyword[is] keyword[not] keyword[None] : identifier[mu] = identifier[self] . identifier[transform] ( identifier[mu] ) keyword[return]...
def logpdf(self, mu): """ Log PDF for Skew t prior Parameters ---------- mu : float Latent variable for which the prior is being formed over Returns ---------- - log(p(mu)) """ if self.transform is not None: mu = self.transfor...
def compute_metric(self, components): """Compute precision from `components`""" numerator = components[PRECISION_RELEVANT_RETRIEVED] denominator = components[PRECISION_RETRIEVED] if denominator == 0.: if numerator == 0: return 1. else: ...
def function[compute_metric, parameter[self, components]]: constant[Compute precision from `components`] variable[numerator] assign[=] call[name[components]][name[PRECISION_RELEVANT_RETRIEVED]] variable[denominator] assign[=] call[name[components]][name[PRECISION_RETRIEVED]] if compare[n...
keyword[def] identifier[compute_metric] ( identifier[self] , identifier[components] ): literal[string] identifier[numerator] = identifier[components] [ identifier[PRECISION_RELEVANT_RETRIEVED] ] identifier[denominator] = identifier[components] [ identifier[PRECISION_RETRIEVED] ] k...
def compute_metric(self, components): """Compute precision from `components`""" numerator = components[PRECISION_RELEVANT_RETRIEVED] denominator = components[PRECISION_RETRIEVED] if denominator == 0.0: if numerator == 0: return 1.0 # depends on [control=['if'], data=[]] else...
def predict_subsequences( self, sequence_dict, peptide_lengths=None): """ Given a dictionary mapping sequence names to amino acid strings, and an optional list of peptide lengths, returns a BindingPredictionCollection. """ if isinstance...
def function[predict_subsequences, parameter[self, sequence_dict, peptide_lengths]]: constant[ Given a dictionary mapping sequence names to amino acid strings, and an optional list of peptide lengths, returns a BindingPredictionCollection. ] if call[name[isinstance], para...
keyword[def] identifier[predict_subsequences] ( identifier[self] , identifier[sequence_dict] , identifier[peptide_lengths] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[sequence_dict] , identifier[string_types] ): identifier[sequence_dict] ={ li...
def predict_subsequences(self, sequence_dict, peptide_lengths=None): """ Given a dictionary mapping sequence names to amino acid strings, and an optional list of peptide lengths, returns a BindingPredictionCollection. """ if isinstance(sequence_dict, string_types): sequen...
def path_for_import(name): """ Returns the directory path for the given package or module. """ return os.path.dirname(os.path.abspath(import_module(name).__file__))
def function[path_for_import, parameter[name]]: constant[ Returns the directory path for the given package or module. ] return[call[name[os].path.dirname, parameter[call[name[os].path.abspath, parameter[call[name[import_module], parameter[name[name]]].__file__]]]]]
keyword[def] identifier[path_for_import] ( identifier[name] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[dirname] ( identifier[os] . identifier[path] . identifier[abspath] ( identifier[import_module] ( identifier[name] ). identifier[__file__] ))
def path_for_import(name): """ Returns the directory path for the given package or module. """ return os.path.dirname(os.path.abspath(import_module(name).__file__))
def _draw_frame(self, framedata): """Reads, processes and draws the frames. If needed for color maps, conversions to gray scale are performed. In case the images are no color images and no custom color maps are defined, the colormap `gray` is applied. This function is called by...
def function[_draw_frame, parameter[self, framedata]]: constant[Reads, processes and draws the frames. If needed for color maps, conversions to gray scale are performed. In case the images are no color images and no custom color maps are defined, the colormap `gray` is applied. ...
keyword[def] identifier[_draw_frame] ( identifier[self] , identifier[framedata] ): literal[string] identifier[original] = identifier[self] . identifier[read_frame] () keyword[if] identifier[original] keyword[is] keyword[None] : identifier[self] . identifier[update_info] ( i...
def _draw_frame(self, framedata): """Reads, processes and draws the frames. If needed for color maps, conversions to gray scale are performed. In case the images are no color images and no custom color maps are defined, the colormap `gray` is applied. This function is called by Tim...
def sync(self, force=False, safe=True, revision=0, changelist=0): """Syncs the file at the current revision :param force: Force the file to sync :type force: bool :param safe: Don't sync files that were changed outside perforce :type safe: bool :param revision: Sync to a...
def function[sync, parameter[self, force, safe, revision, changelist]]: constant[Syncs the file at the current revision :param force: Force the file to sync :type force: bool :param safe: Don't sync files that were changed outside perforce :type safe: bool :param revisio...
keyword[def] identifier[sync] ( identifier[self] , identifier[force] = keyword[False] , identifier[safe] = keyword[True] , identifier[revision] = literal[int] , identifier[changelist] = literal[int] ): literal[string] identifier[cmd] =[ literal[string] ] keyword[if] identifier[force] : ...
def sync(self, force=False, safe=True, revision=0, changelist=0): """Syncs the file at the current revision :param force: Force the file to sync :type force: bool :param safe: Don't sync files that were changed outside perforce :type safe: bool :param revision: Sync to a spe...
def pack_paths(paths, sheet_size=None): """ Pack a list of Path2D objects into a rectangle. Parameters ------------ paths: (n,) Path2D Geometry to be packed Returns ------------ packed : trimesh.path.Path2D Object containing input geometry inserted : (m,) int Inde...
def function[pack_paths, parameter[paths, sheet_size]]: constant[ Pack a list of Path2D objects into a rectangle. Parameters ------------ paths: (n,) Path2D Geometry to be packed Returns ------------ packed : trimesh.path.Path2D Object containing input geometry inse...
keyword[def] identifier[pack_paths] ( identifier[paths] , identifier[sheet_size] = keyword[None] ): literal[string] keyword[from] . identifier[util] keyword[import] identifier[concatenate] keyword[if] identifier[sheet_size] keyword[is] keyword[not] keyword[None] : identifier[sheet_siz...
def pack_paths(paths, sheet_size=None): """ Pack a list of Path2D objects into a rectangle. Parameters ------------ paths: (n,) Path2D Geometry to be packed Returns ------------ packed : trimesh.path.Path2D Object containing input geometry inserted : (m,) int Inde...