code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def setpassword(self, password): """Sets the password to use when extracting. """ self._password = password if self._file_parser: if self._file_parser.has_header_encryption(): self._file_parser = None if not self._file_parser: self._parse()...
def function[setpassword, parameter[self, password]]: constant[Sets the password to use when extracting. ] name[self]._password assign[=] name[password] if name[self]._file_parser begin[:] if call[name[self]._file_parser.has_header_encryption, parameter[]] begin[:] ...
keyword[def] identifier[setpassword] ( identifier[self] , identifier[password] ): literal[string] identifier[self] . identifier[_password] = identifier[password] keyword[if] identifier[self] . identifier[_file_parser] : keyword[if] identifier[self] . identifier[_file_parser...
def setpassword(self, password): """Sets the password to use when extracting. """ self._password = password if self._file_parser: if self._file_parser.has_header_encryption(): self._file_parser = None # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]]...
def get_cache_path(self, archive_name, names=()): """Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not ...
def function[get_cache_path, parameter[self, archive_name, names]]: constant[Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclo...
keyword[def] identifier[get_cache_path] ( identifier[self] , identifier[archive_name] , identifier[names] =()): literal[string] identifier[extract_path] = identifier[self] . identifier[extraction_path] keyword[or] identifier[get_default_cache] () identifier[target_path] = identifier[os] ...
def get_cache_path(self, archive_name, names=()): """Return absolute location in cache for `archive_name` and `names` The parent directory of the resulting path will be created if it does not already exist. `archive_name` should be the base filename of the enclosing egg (which may not be t...
def setop(args): """ %prog setop "fileA & fileB" > newfile Perform set operations, except on files. The files (fileA and fileB) contain list of ids. The operator is one of the four: |: union (elements found in either file) &: intersection (elements found in both) -: difference (elements in...
def function[setop, parameter[args]]: constant[ %prog setop "fileA & fileB" > newfile Perform set operations, except on files. The files (fileA and fileB) contain list of ids. The operator is one of the four: |: union (elements found in either file) &: intersection (elements found in both)...
keyword[def] identifier[setop] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[utils] . identifier[natsort] keyword[import] identifier[natsorted] identifier[p] = identifier[OptionParser] ( identifier[setop] . identifier[__doc__] ) identifier[p] . identifier[...
def setop(args): """ %prog setop "fileA & fileB" > newfile Perform set operations, except on files. The files (fileA and fileB) contain list of ids. The operator is one of the four: |: union (elements found in either file) &: intersection (elements found in both) -: difference (elements in...
def close(self): """Close the plot and release its memory. """ from matplotlib.pyplot import close for ax in self.axes[::-1]: # avoid matplotlib/matplotlib#9970 ax.set_xscale('linear') ax.set_yscale('linear') # clear the axes ax...
def function[close, parameter[self]]: constant[Close the plot and release its memory. ] from relative_module[matplotlib.pyplot] import module[close] for taget[name[ax]] in starred[call[name[self].axes][<ast.Slice object at 0x7da1b0608370>]] begin[:] call[name[ax].set_xscale, ...
keyword[def] identifier[close] ( identifier[self] ): literal[string] keyword[from] identifier[matplotlib] . identifier[pyplot] keyword[import] identifier[close] keyword[for] identifier[ax] keyword[in] identifier[self] . identifier[axes] [::- literal[int] ]: ide...
def close(self): """Close the plot and release its memory. """ from matplotlib.pyplot import close for ax in self.axes[::-1]: # avoid matplotlib/matplotlib#9970 ax.set_xscale('linear') ax.set_yscale('linear') # clear the axes ax.cla() # depends on [control=['...
def _is_old_database(db_dir, args): """Check for old database versions, supported in snpEff 4.1. """ snpeff_version = effects.snpeff_version(args) if LooseVersion(snpeff_version) >= LooseVersion("4.1"): pred_file = os.path.join(db_dir, "snpEffectPredictor.bin") if not utils.file_exists(p...
def function[_is_old_database, parameter[db_dir, args]]: constant[Check for old database versions, supported in snpEff 4.1. ] variable[snpeff_version] assign[=] call[name[effects].snpeff_version, parameter[name[args]]] if compare[call[name[LooseVersion], parameter[name[snpeff_version]]] grea...
keyword[def] identifier[_is_old_database] ( identifier[db_dir] , identifier[args] ): literal[string] identifier[snpeff_version] = identifier[effects] . identifier[snpeff_version] ( identifier[args] ) keyword[if] identifier[LooseVersion] ( identifier[snpeff_version] )>= identifier[LooseVersion] ( lite...
def _is_old_database(db_dir, args): """Check for old database versions, supported in snpEff 4.1. """ snpeff_version = effects.snpeff_version(args) if LooseVersion(snpeff_version) >= LooseVersion('4.1'): pred_file = os.path.join(db_dir, 'snpEffectPredictor.bin') if not utils.file_exists(p...
def get_for_targets(self, targets): """Gets the classpath products for the given targets. Products are returned in order, respecting target excludes. :param targets: The targets to lookup classpath products for. :returns: The ordered (conf, path) tuples, with paths being either classfile directories o...
def function[get_for_targets, parameter[self, targets]]: constant[Gets the classpath products for the given targets. Products are returned in order, respecting target excludes. :param targets: The targets to lookup classpath products for. :returns: The ordered (conf, path) tuples, with paths being...
keyword[def] identifier[get_for_targets] ( identifier[self] , identifier[targets] ): literal[string] identifier[cp_entries] = identifier[self] . identifier[get_classpath_entries_for_targets] ( identifier[targets] ) keyword[return] [( identifier[conf] , identifier[cp_entry] . identifier[path] ) keyword...
def get_for_targets(self, targets): """Gets the classpath products for the given targets. Products are returned in order, respecting target excludes. :param targets: The targets to lookup classpath products for. :returns: The ordered (conf, path) tuples, with paths being either classfile directories o...
def load_file_or_hdu(filename): """ Load a file from disk and return an HDUList If filename is already an HDUList return that instead Parameters ---------- filename : str or HDUList File or HDU to be loaded Returns ------- hdulist : HDUList """ if isinstance(filenam...
def function[load_file_or_hdu, parameter[filename]]: constant[ Load a file from disk and return an HDUList If filename is already an HDUList return that instead Parameters ---------- filename : str or HDUList File or HDU to be loaded Returns ------- hdulist : HDUList ...
keyword[def] identifier[load_file_or_hdu] ( identifier[filename] ): literal[string] keyword[if] identifier[isinstance] ( identifier[filename] , identifier[fits] . identifier[HDUList] ): identifier[hdulist] = identifier[filename] keyword[else] : identifier[hdulist] = identifier[fits...
def load_file_or_hdu(filename): """ Load a file from disk and return an HDUList If filename is already an HDUList return that instead Parameters ---------- filename : str or HDUList File or HDU to be loaded Returns ------- hdulist : HDUList """ if isinstance(filenam...
def dag_paused(dag_id, paused): """(Un)pauses a dag""" DagModel = models.DagModel with create_session() as session: orm_dag = ( session.query(DagModel) .filter(DagModel.dag_id == dag_id).first() ) if paused == 'true': orm_dag.is_paused = Tr...
def function[dag_paused, parameter[dag_id, paused]]: constant[(Un)pauses a dag] variable[DagModel] assign[=] name[models].DagModel with call[name[create_session], parameter[]] begin[:] variable[orm_dag] assign[=] call[call[call[name[session].query, parameter[name[DagModel]]].filt...
keyword[def] identifier[dag_paused] ( identifier[dag_id] , identifier[paused] ): literal[string] identifier[DagModel] = identifier[models] . identifier[DagModel] keyword[with] identifier[create_session] () keyword[as] identifier[session] : identifier[orm_dag] =( identifier[sessio...
def dag_paused(dag_id, paused): """(Un)pauses a dag""" DagModel = models.DagModel with create_session() as session: orm_dag = session.query(DagModel).filter(DagModel.dag_id == dag_id).first() if paused == 'true': orm_dag.is_paused = True # depends on [control=['if'], data=[]] ...
def _setup_evp_encrypt_decrypt(cipher, data): """ Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", ...
def function[_setup_evp_encrypt_decrypt, parameter[cipher, data]]: constant[ Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", ...
keyword[def] identifier[_setup_evp_encrypt_decrypt] ( identifier[cipher] , identifier[data] ): literal[string] identifier[evp_cipher] ={ literal[string] : identifier[libcrypto] . identifier[EVP_aes_128_cbc] , literal[string] : identifier[libcrypto] . identifier[EVP_aes_192_cbc] , literal[st...
def _setup_evp_encrypt_decrypt(cipher, data): """ Creates an EVP_CIPHER pointer object and determines the buffer size necessary for the parameter specified. :param evp_cipher_ctx: An EVP_CIPHER_CTX pointer :param cipher: A unicode string of "aes128", "aes192", "aes256", "des", ...
def files_log_graph(self, stream): ''' Build up a graph (nodes and edges from a Bro dns.log) ''' for row in list(stream): # dataframes['files_log'][['md5','mime_type','missing_bytes','rx_hosts','source','tx_hosts']] # If the mime-type is interesting add the uri and ...
def function[files_log_graph, parameter[self, stream]]: constant[ Build up a graph (nodes and edges from a Bro dns.log) ] for taget[name[row]] in starred[call[name[list], parameter[name[stream]]]] begin[:] if compare[call[name[row]][constant[mime_type]] <ast.NotIn object at 0x7da2590d719...
keyword[def] identifier[files_log_graph] ( identifier[self] , identifier[stream] ): literal[string] keyword[for] identifier[row] keyword[in] identifier[list] ( identifier[stream] ): keyword[if] identifier[row] [ literal[string] ] keyword[not] keyword[in] ident...
def files_log_graph(self, stream): """ Build up a graph (nodes and edges from a Bro dns.log) """ for row in list(stream): # dataframes['files_log'][['md5','mime_type','missing_bytes','rx_hosts','source','tx_hosts']] # If the mime-type is interesting add the uri and the host->uri->host relationsh...
def match_abstract_str(cls): """ For a given abstract or match rule meta-class returns a nice string representation for the body. """ def r(s): if s.root: if s in visited or s.rule_name in ALL_TYPE_NAMES or \ (hasattr(s, '_tx_class') and s...
def function[match_abstract_str, parameter[cls]]: constant[ For a given abstract or match rule meta-class returns a nice string representation for the body. ] def function[r, parameter[s]]: if name[s].root begin[:] if <ast.BoolOp object at 0x7da20e961d...
keyword[def] identifier[match_abstract_str] ( identifier[cls] ): literal[string] keyword[def] identifier[r] ( identifier[s] ): keyword[if] identifier[s] . identifier[root] : keyword[if] identifier[s] keyword[in] identifier[visited] keyword[or] identifier[s] . identifier[rule_na...
def match_abstract_str(cls): """ For a given abstract or match rule meta-class returns a nice string representation for the body. """ def r(s): if s.root: if s in visited or s.rule_name in ALL_TYPE_NAMES or (hasattr(s, '_tx_class') and s._tx_class._tx_type is not RULE_MATCH): ...
def tidy_nlm_references(document): """Remove punctuation around references like brackets, commas, hyphens.""" def strip_preceding(text): stext = text.rstrip() if stext.endswith('[') or stext.endswith('('): #log.debug('%s -> %s' % (text, stext[:-1])) return stext[:-1] ...
def function[tidy_nlm_references, parameter[document]]: constant[Remove punctuation around references like brackets, commas, hyphens.] def function[strip_preceding, parameter[text]]: variable[stext] assign[=] call[name[text].rstrip, parameter[]] if <ast.BoolOp object at 0...
keyword[def] identifier[tidy_nlm_references] ( identifier[document] ): literal[string] keyword[def] identifier[strip_preceding] ( identifier[text] ): identifier[stext] = identifier[text] . identifier[rstrip] () keyword[if] identifier[stext] . identifier[endswith] ( literal[string] ) ke...
def tidy_nlm_references(document): """Remove punctuation around references like brackets, commas, hyphens.""" def strip_preceding(text): stext = text.rstrip() if stext.endswith('[') or stext.endswith('('): #log.debug('%s -> %s' % (text, stext[:-1])) return stext[:-1] # ...
def transfer(self, user): """Transfers app to given username's account.""" r = self._h._http_resource( method='PUT', resource=('apps', self.name), data={'app[transfer_owner]': user} ) return r.ok
def function[transfer, parameter[self, user]]: constant[Transfers app to given username's account.] variable[r] assign[=] call[name[self]._h._http_resource, parameter[]] return[name[r].ok]
keyword[def] identifier[transfer] ( identifier[self] , identifier[user] ): literal[string] identifier[r] = identifier[self] . identifier[_h] . identifier[_http_resource] ( identifier[method] = literal[string] , identifier[resource] =( literal[string] , identifier[self] . identifi...
def transfer(self, user): """Transfers app to given username's account.""" r = self._h._http_resource(method='PUT', resource=('apps', self.name), data={'app[transfer_owner]': user}) return r.ok
def connect_ses(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.ses.SESConnectio...
def function[connect_ses, parameter[aws_access_key_id, aws_secret_access_key]]: constant[ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.ses.S...
keyword[def] identifier[connect_ses] ( identifier[aws_access_key_id] = keyword[None] , identifier[aws_secret_access_key] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[from] identifier[boto] . identifier[ses] keyword[import] identifier[SESConnection] keyword[return] identifier[...
def connect_ses(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.ses.SESConnectio...
def play_tone(self, pin, tone_command, frequency, duration=None): """ This method will call the Tone library for the selected pin. It requires FirmataPlus to be loaded onto the arduino If the tone command is set to TONE_TONE, then the specified tone will be played. Else...
def function[play_tone, parameter[self, pin, tone_command, frequency, duration]]: constant[ This method will call the Tone library for the selected pin. It requires FirmataPlus to be loaded onto the arduino If the tone command is set to TONE_TONE, then the specified tone will be...
keyword[def] identifier[play_tone] ( identifier[self] , identifier[pin] , identifier[tone_command] , identifier[frequency] , identifier[duration] = keyword[None] ): literal[string] identifier[task] = identifier[asyncio] . identifier[ensure_future] ( identifier[self] . identifier[core] . identifier[...
def play_tone(self, pin, tone_command, frequency, duration=None): """ This method will call the Tone library for the selected pin. It requires FirmataPlus to be loaded onto the arduino If the tone command is set to TONE_TONE, then the specified tone will be played. Else, if...
def _new_name(method, old_name): """Return a method with a deprecation warning.""" # Looks suspiciously like a decorator, but isn't! @wraps(method) def _method(*args, **kwargs): warnings.warn( "method '{}' has been deprecated, please rename to '{}'".format( old_name,...
def function[_new_name, parameter[method, old_name]]: constant[Return a method with a deprecation warning.] def function[_method, parameter[]]: call[name[warnings].warn, parameter[call[constant[method '{}' has been deprecated, please rename to '{}'].format, parameter[name[old_name], name...
keyword[def] identifier[_new_name] ( identifier[method] , identifier[old_name] ): literal[string] @ identifier[wraps] ( identifier[method] ) keyword[def] identifier[_method] (* identifier[args] ,** identifier[kwargs] ): identifier[warnings] . identifier[warn] ( literal[string] ...
def _new_name(method, old_name): """Return a method with a deprecation warning.""" # Looks suspiciously like a decorator, but isn't! @wraps(method) def _method(*args, **kwargs): warnings.warn("method '{}' has been deprecated, please rename to '{}'".format(old_name, method.__name__), Deprecation...
def is_continuous(self): """Boolean denoting whether the data collection is continuous.""" if self._validated_a_period is True and \ len(self.values) == len(self.header.analysis_period.months_int): return True else: return False
def function[is_continuous, parameter[self]]: constant[Boolean denoting whether the data collection is continuous.] if <ast.BoolOp object at 0x7da1b12ba890> begin[:] return[constant[True]]
keyword[def] identifier[is_continuous] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_validated_a_period] keyword[is] keyword[True] keyword[and] identifier[len] ( identifier[self] . identifier[values] )== identifier[len] ( identifier[self] . identifier[header]...
def is_continuous(self): """Boolean denoting whether the data collection is continuous.""" if self._validated_a_period is True and len(self.values) == len(self.header.analysis_period.months_int): return True # depends on [control=['if'], data=[]] else: return False
def get_block_from_time(self, timestring, error_margin=10): """ Estimate block number from given time :param str timestring: String representing time :param int error_margin: Estimate block number within this interval (in seconds) """ known_block = self.get_current_bloc...
def function[get_block_from_time, parameter[self, timestring, error_margin]]: constant[ Estimate block number from given time :param str timestring: String representing time :param int error_margin: Estimate block number within this interval (in seconds) ] variable[know...
keyword[def] identifier[get_block_from_time] ( identifier[self] , identifier[timestring] , identifier[error_margin] = literal[int] ): literal[string] identifier[known_block] = identifier[self] . identifier[get_current_block] ()[ literal[string] ] identifier[known_block_timestamp] = identif...
def get_block_from_time(self, timestring, error_margin=10): """ Estimate block number from given time :param str timestring: String representing time :param int error_margin: Estimate block number within this interval (in seconds) """ known_block = self.get_current_block()['blo...
def expr_match(line, expr): ''' Checks whether or not the passed value matches the specified expression. Tries to match expr first as a glob using fnmatch.fnmatch(), and then tries to match expr as a regular expression. Originally designed to match minion IDs for whitelists/blacklists. Note tha...
def function[expr_match, parameter[line, expr]]: constant[ Checks whether or not the passed value matches the specified expression. Tries to match expr first as a glob using fnmatch.fnmatch(), and then tries to match expr as a regular expression. Originally designed to match minion IDs for white...
keyword[def] identifier[expr_match] ( identifier[line] , identifier[expr] ): literal[string] keyword[try] : keyword[if] identifier[fnmatch] . identifier[fnmatch] ( identifier[line] , identifier[expr] ): keyword[return] keyword[True] keyword[try] : keyword[if] ...
def expr_match(line, expr): """ Checks whether or not the passed value matches the specified expression. Tries to match expr first as a glob using fnmatch.fnmatch(), and then tries to match expr as a regular expression. Originally designed to match minion IDs for whitelists/blacklists. Note tha...
def secured_clipboard(item): """This clipboard only allows 1 paste """ expire_clock = time.time() def set_text(clipboard, selectiondata, info, data): # expire after 15 secs if 15.0 >= time.time() - expire_clock: selectiondata.set_text(item.get_secret()) clipboard...
def function[secured_clipboard, parameter[item]]: constant[This clipboard only allows 1 paste ] variable[expire_clock] assign[=] call[name[time].time, parameter[]] def function[set_text, parameter[clipboard, selectiondata, info, data]]: if compare[constant[15.0] greater_or_e...
keyword[def] identifier[secured_clipboard] ( identifier[item] ): literal[string] identifier[expire_clock] = identifier[time] . identifier[time] () keyword[def] identifier[set_text] ( identifier[clipboard] , identifier[selectiondata] , identifier[info] , identifier[data] ): keyword[if] ...
def secured_clipboard(item): """This clipboard only allows 1 paste """ expire_clock = time.time() def set_text(clipboard, selectiondata, info, data): # expire after 15 secs if 15.0 >= time.time() - expire_clock: selectiondata.set_text(item.get_secret()) clipboar...
def file_objects(self): """Returns the :class:`basc_py4chan.File` objects of all files attached to posts in the thread.""" if self.topic.has_file: yield self.topic.file for reply in self.replies: if reply.has_file: yield reply.file
def function[file_objects, parameter[self]]: constant[Returns the :class:`basc_py4chan.File` objects of all files attached to posts in the thread.] if name[self].topic.has_file begin[:] <ast.Yield object at 0x7da1b267a8c0> for taget[name[reply]] in starred[name[self].replies] beg...
keyword[def] identifier[file_objects] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[topic] . identifier[has_file] : keyword[yield] identifier[self] . identifier[topic] . identifier[file] keyword[for] identifier[reply] keyword[in] identif...
def file_objects(self): """Returns the :class:`basc_py4chan.File` objects of all files attached to posts in the thread.""" if self.topic.has_file: yield self.topic.file # depends on [control=['if'], data=[]] for reply in self.replies: if reply.has_file: yield reply.file # depen...
def local_minima(img, min_distance = 4): r""" Returns all local minima from an image. Parameters ---------- img : array_like The image. min_distance : integer The minimal distance between the minimas in voxels. If it is less, only the lower minima is returned. Retur...
def function[local_minima, parameter[img, min_distance]]: constant[ Returns all local minima from an image. Parameters ---------- img : array_like The image. min_distance : integer The minimal distance between the minimas in voxels. If it is less, only the lower minima i...
keyword[def] identifier[local_minima] ( identifier[img] , identifier[min_distance] = literal[int] ): literal[string] identifier[fits] = identifier[numpy] . identifier[asarray] ( identifier[img] ) identifier[minfits] = identifier[minimum_filter] ( identifier[fits] , identifier[size] = identifier[m...
def local_minima(img, min_distance=4): """ Returns all local minima from an image. Parameters ---------- img : array_like The image. min_distance : integer The minimal distance between the minimas in voxels. If it is less, only the lower minima is returned. Returns ...
def resource_name(self, resource): """ Return the name of the file within the reference package for a particular named resource. """ if not(resource in self.contents['files']): raise ValueError("No such resource %r in refpkg" % (resource,)) return self.content...
def function[resource_name, parameter[self, resource]]: constant[ Return the name of the file within the reference package for a particular named resource. ] if <ast.UnaryOp object at 0x7da1b1b9dd20> begin[:] <ast.Raise object at 0x7da1b1b9c520> return[call[call[name[...
keyword[def] identifier[resource_name] ( identifier[self] , identifier[resource] ): literal[string] keyword[if] keyword[not] ( identifier[resource] keyword[in] identifier[self] . identifier[contents] [ literal[string] ]): keyword[raise] identifier[ValueError] ( literal[string] %( i...
def resource_name(self, resource): """ Return the name of the file within the reference package for a particular named resource. """ if not resource in self.contents['files']: raise ValueError('No such resource %r in refpkg' % (resource,)) # depends on [control=['if'], data=[]] ...
def get_instance(self, payload): """ Build an instance of LocalInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalIn...
def function[get_instance, parameter[self, payload]]: constant[ Build an instance of LocalInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance :rtype: twilio.rest.api.v2010.account.incoming...
keyword[def] identifier[get_instance] ( identifier[self] , identifier[payload] ): literal[string] keyword[return] identifier[LocalInstance] ( identifier[self] . identifier[_version] , identifier[payload] , identifier[account_sid] = identifier[self] . identifier[_solution] [ literal[string] ],)
def get_instance(self, payload): """ Build an instance of LocalInstance :param dict payload: Payload response from the API :returns: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstance :rtype: twilio.rest.api.v2010.account.incoming_phone_number.local.LocalInstan...
def get_eligible_features(examples, num_mutants): """Returns a list of JSON objects for each feature in the examples. This list is used to drive partial dependence plots in the plugin. Args: examples: Examples to examine to determine the eligible features. num_mutants: The number of mutations to...
def function[get_eligible_features, parameter[examples, num_mutants]]: constant[Returns a list of JSON objects for each feature in the examples. This list is used to drive partial dependence plots in the plugin. Args: examples: Examples to examine to determine the eligible features. num_mu...
keyword[def] identifier[get_eligible_features] ( identifier[examples] , identifier[num_mutants] ): literal[string] identifier[features_dict] =( identifier[get_numeric_features_to_observed_range] ( identifier[examples] )) identifier[features_dict] . identifier[update] ( identifier[get_categorical_f...
def get_eligible_features(examples, num_mutants): """Returns a list of JSON objects for each feature in the examples. This list is used to drive partial dependence plots in the plugin. Args: examples: Examples to examine to determine the eligible features. num_mutants: The number of mutations ...
def pots(self, refresh=False): """ Returns a list of pots owned by the currently authorised user. Official docs: https://monzo.com/docs/#pots :param refresh: decides if the pots information should be refreshed. :type refresh: bool :returns: list of Monzo pot...
def function[pots, parameter[self, refresh]]: constant[ Returns a list of pots owned by the currently authorised user. Official docs: https://monzo.com/docs/#pots :param refresh: decides if the pots information should be refreshed. :type refresh: bool :retur...
keyword[def] identifier[pots] ( identifier[self] , identifier[refresh] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[refresh] keyword[and] identifier[self] . identifier[_cached_pots] : keyword[return] identifier[self] . identifier[_cached_pots] ...
def pots(self, refresh=False): """ Returns a list of pots owned by the currently authorised user. Official docs: https://monzo.com/docs/#pots :param refresh: decides if the pots information should be refreshed. :type refresh: bool :returns: list of Monzo pots ...
def mac_access_list_standard_hide_mac_acl_std_seq_action(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") mac = ET.SubElement(config, "mac", xmlns="urn:brocade.com:mgmt:brocade-mac-access-list") access_list = ET.SubElement(mac, "access-list") stan...
def function[mac_access_list_standard_hide_mac_acl_std_seq_action, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[mac] assign[=] call[name[ET].SubElement, parameter[name[config], constant[mac]]] ...
keyword[def] identifier[mac_access_list_standard_hide_mac_acl_std_seq_action] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[mac] = identifier[ET] . identifier[SubElement] ( identifier[co...
def mac_access_list_standard_hide_mac_acl_std_seq_action(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') mac = ET.SubElement(config, 'mac', xmlns='urn:brocade.com:mgmt:brocade-mac-access-list') access_list = ET.SubElement(mac, 'access-list') standard = ET.SubElement...
def _transform_local_field_to_expression(expression, node, context): """Transform a LocalField compiler expression into its SQLAlchemy expression representation. Args: expression: expression, LocalField compiler expression. node: SqlNode, the SqlNode the expression applies to. context: ...
def function[_transform_local_field_to_expression, parameter[expression, node, context]]: constant[Transform a LocalField compiler expression into its SQLAlchemy expression representation. Args: expression: expression, LocalField compiler expression. node: SqlNode, the SqlNode the expressio...
keyword[def] identifier[_transform_local_field_to_expression] ( identifier[expression] , identifier[node] , identifier[context] ): literal[string] identifier[column_name] = identifier[expression] . identifier[field_name] identifier[column] = identifier[sql_context_helpers] . identifier[get_column] ( ...
def _transform_local_field_to_expression(expression, node, context): """Transform a LocalField compiler expression into its SQLAlchemy expression representation. Args: expression: expression, LocalField compiler expression. node: SqlNode, the SqlNode the expression applies to. context: ...
def grantxml2json(self, grant_xml): """Convert OpenAIRE grant XML into JSON.""" tree = etree.fromstring(grant_xml) # XML harvested from OAI-PMH has a different format/structure if tree.prefix == 'oai': ptree = self.get_subtree( tree, '/oai:record/oai:metadata/...
def function[grantxml2json, parameter[self, grant_xml]]: constant[Convert OpenAIRE grant XML into JSON.] variable[tree] assign[=] call[name[etree].fromstring, parameter[name[grant_xml]]] if compare[name[tree].prefix equal[==] constant[oai]] begin[:] variable[ptree] assign[=] call...
keyword[def] identifier[grantxml2json] ( identifier[self] , identifier[grant_xml] ): literal[string] identifier[tree] = identifier[etree] . identifier[fromstring] ( identifier[grant_xml] ) keyword[if] identifier[tree] . identifier[prefix] == literal[string] : identif...
def grantxml2json(self, grant_xml): """Convert OpenAIRE grant XML into JSON.""" tree = etree.fromstring(grant_xml) # XML harvested from OAI-PMH has a different format/structure if tree.prefix == 'oai': ptree = self.get_subtree(tree, '/oai:record/oai:metadata/oaf:entity/oaf:project')[0] h...
def representer(dumper, data): """ http://stackoverflow.com/a/14001707/4075339 http://stackoverflow.com/a/21912744/4075339 """ tag = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG return dumper.represent_mapping(tag,list(data.todict().items()),flow_style=True)
def function[representer, parameter[dumper, data]]: constant[ http://stackoverflow.com/a/14001707/4075339 http://stackoverflow.com/a/21912744/4075339 ] variable[tag] assign[=] name[yaml].resolver.BaseResolver.DEFAULT_MAPPING_TAG return[call[name[dumper].represent_mapping, p...
keyword[def] identifier[representer] ( identifier[dumper] , identifier[data] ): literal[string] identifier[tag] = identifier[yaml] . identifier[resolver] . identifier[BaseResolver] . identifier[DEFAULT_MAPPING_TAG] keyword[return] identifier[dumper] . identifier[represent_mapping] ( iden...
def representer(dumper, data): """ http://stackoverflow.com/a/14001707/4075339 http://stackoverflow.com/a/21912744/4075339 """ tag = yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG return dumper.represent_mapping(tag, list(data.todict().items()), flow_style=True)
def inline_callbacks(original, debug=False): """ Decorate a function like ``inlineCallbacks`` would but in a more Eliot-friendly way. Use it just like ``inlineCallbacks`` but where you want Eliot action contexts to Do The Right Thing inside the decorated function. """ f = eliot_friendly_gen...
def function[inline_callbacks, parameter[original, debug]]: constant[ Decorate a function like ``inlineCallbacks`` would but in a more Eliot-friendly way. Use it just like ``inlineCallbacks`` but where you want Eliot action contexts to Do The Right Thing inside the decorated function. ] ...
keyword[def] identifier[inline_callbacks] ( identifier[original] , identifier[debug] = keyword[False] ): literal[string] identifier[f] = identifier[eliot_friendly_generator_function] ( identifier[original] ) keyword[if] identifier[debug] : identifier[f] . identifier[debug] = keyword[True] ...
def inline_callbacks(original, debug=False): """ Decorate a function like ``inlineCallbacks`` would but in a more Eliot-friendly way. Use it just like ``inlineCallbacks`` but where you want Eliot action contexts to Do The Right Thing inside the decorated function. """ f = eliot_friendly_gen...
def _fsic_queuing_calc(fsic1, fsic2): """ We set the lower counter between two same instance ids. If an instance_id exists in one fsic but not the other we want to give that counter a value of 0. :param fsic1: dictionary containing (instance_id, counter) pairs :param fsic2: dictionary containing (i...
def function[_fsic_queuing_calc, parameter[fsic1, fsic2]]: constant[ We set the lower counter between two same instance ids. If an instance_id exists in one fsic but not the other we want to give that counter a value of 0. :param fsic1: dictionary containing (instance_id, counter) pairs :param ...
keyword[def] identifier[_fsic_queuing_calc] ( identifier[fsic1] , identifier[fsic2] ): literal[string] keyword[return] { identifier[instance] : identifier[fsic2] . identifier[get] ( identifier[instance] , literal[int] ) keyword[for] identifier[instance] , identifier[counter] keyword[in] identifier[six] ...
def _fsic_queuing_calc(fsic1, fsic2): """ We set the lower counter between two same instance ids. If an instance_id exists in one fsic but not the other we want to give that counter a value of 0. :param fsic1: dictionary containing (instance_id, counter) pairs :param fsic2: dictionary containing (i...
def open(self, interface_name, namespaced=False, connection=None): """Open a new connection and get a client interface handle with the varlink methods installed. :param interface_name: an interface name, which the service this client object is connected to, provides. ...
def function[open, parameter[self, interface_name, namespaced, connection]]: constant[Open a new connection and get a client interface handle with the varlink methods installed. :param interface_name: an interface name, which the service this client object is connected to...
keyword[def] identifier[open] ( identifier[self] , identifier[interface_name] , identifier[namespaced] = keyword[False] , identifier[connection] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[connection] : identifier[connection] = identifier[self] . identifie...
def open(self, interface_name, namespaced=False, connection=None): """Open a new connection and get a client interface handle with the varlink methods installed. :param interface_name: an interface name, which the service this client object is connected to, provides. ...
def save(self): """ Creates this index in the collection if it hasn't been already created """ api = Client.instance().api index_details = { 'type': self.index_type_obj.type_name } extra_index_attributes = self.index_type_obj.get_extra_attribute...
def function[save, parameter[self]]: constant[ Creates this index in the collection if it hasn't been already created ] variable[api] assign[=] call[name[Client].instance, parameter[]].api variable[index_details] assign[=] dictionary[[<ast.Constant object at 0x7da18ede6a70>],...
keyword[def] identifier[save] ( identifier[self] ): literal[string] identifier[api] = identifier[Client] . identifier[instance] (). identifier[api] identifier[index_details] ={ literal[string] : identifier[self] . identifier[index_type_obj] . identifier[type_name] } ...
def save(self): """ Creates this index in the collection if it hasn't been already created """ api = Client.instance().api index_details = {'type': self.index_type_obj.type_name} extra_index_attributes = self.index_type_obj.get_extra_attributes() for extra_attribute_key in extra_...
def get_main_pattern(self, directory): """ Get the :func:`~glob.glob()` pattern to find the main configuration file. :param directory: The pathname of a base directory (a string). :returns: A filename pattern (a string). This method generates a pattern that matches a filename b...
def function[get_main_pattern, parameter[self, directory]]: constant[ Get the :func:`~glob.glob()` pattern to find the main configuration file. :param directory: The pathname of a base directory (a string). :returns: A filename pattern (a string). This method generates a patter...
keyword[def] identifier[get_main_pattern] ( identifier[self] , identifier[directory] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[join] ( identifier[directory] , identifier[format] ( literal[string] , identifier[extension] = identifier[self] ....
def get_main_pattern(self, directory): """ Get the :func:`~glob.glob()` pattern to find the main configuration file. :param directory: The pathname of a base directory (a string). :returns: A filename pattern (a string). This method generates a pattern that matches a filename based...
def get_results(cmd): """ def get_results(cmd: list) -> str: return lines Get the ping results using fping. :param cmd: List - the fping command and its options :return: String - raw string output containing csv fping results including the newline characters ...
def function[get_results, parameter[cmd]]: constant[ def get_results(cmd: list) -> str: return lines Get the ping results using fping. :param cmd: List - the fping command and its options :return: String - raw string output containing csv fping results includi...
keyword[def] identifier[get_results] ( identifier[cmd] ): literal[string] keyword[try] : keyword[return] identifier[subprocess] . identifier[check_output] ( identifier[cmd] ) keyword[except] identifier[subprocess] . identifier[CalledProcessError] keyword[as] identifier[e] ...
def get_results(cmd): """ def get_results(cmd: list) -> str: return lines Get the ping results using fping. :param cmd: List - the fping command and its options :return: String - raw string output containing csv fping results including the newline characters ...
def return_future(fn): """Decorator that turns a synchronous function into one returning a future. This should only be applied to non-blocking functions. Will do set_result() with the return value, or set_exc_info() if an exception is raised. """ @wraps(fn) def decorated(*args, **kwargs): ...
def function[return_future, parameter[fn]]: constant[Decorator that turns a synchronous function into one returning a future. This should only be applied to non-blocking functions. Will do set_result() with the return value, or set_exc_info() if an exception is raised. ] def function[decor...
keyword[def] identifier[return_future] ( identifier[fn] ): literal[string] @ identifier[wraps] ( identifier[fn] ) keyword[def] identifier[decorated] (* identifier[args] ,** identifier[kwargs] ): keyword[return] identifier[gen] . identifier[maybe_future] ( identifier[fn] (* identifier[args] ,...
def return_future(fn): """Decorator that turns a synchronous function into one returning a future. This should only be applied to non-blocking functions. Will do set_result() with the return value, or set_exc_info() if an exception is raised. """ @wraps(fn) def decorated(*args, **kwargs): ...
def post(self, content, endpoint=''): ''' Issue a POST request with `content` as the body to `endpoint` and return the result. ''' url = self.url(endpoint) post_content = json.dumps(content).encode('utf-8') headers = {'Content-Type': 'application/json'} re...
def function[post, parameter[self, content, endpoint]]: constant[ Issue a POST request with `content` as the body to `endpoint` and return the result. ] variable[url] assign[=] call[name[self].url, parameter[name[endpoint]]] variable[post_content] assign[=] call[call[name...
keyword[def] identifier[post] ( identifier[self] , identifier[content] , identifier[endpoint] = literal[string] ): literal[string] identifier[url] = identifier[self] . identifier[url] ( identifier[endpoint] ) identifier[post_content] = identifier[json] . identifier[dumps] ( identifier[cont...
def post(self, content, endpoint=''): """ Issue a POST request with `content` as the body to `endpoint` and return the result. """ url = self.url(endpoint) post_content = json.dumps(content).encode('utf-8') headers = {'Content-Type': 'application/json'} request = Request(url,...
def clear(self, scope = 'screen'): """see doc in Term class According to http://support.microsoft.com/kb/99261 the best way to clear the console is to write out empty spaces """ #TODO: clear attributes too if scope == 'screen': bos = (0, self._get_con...
def function[clear, parameter[self, scope]]: constant[see doc in Term class According to http://support.microsoft.com/kb/99261 the best way to clear the console is to write out empty spaces ] if compare[name[scope] equal[==] constant[screen]] begin[:] var...
keyword[def] identifier[clear] ( identifier[self] , identifier[scope] = literal[string] ): literal[string] keyword[if] identifier[scope] == literal[string] : identifier[bos] =( literal[int] , identifier[self] . identifier[_get_console_info] ()[ literal[string] ][ literal[stri...
def clear(self, scope='screen'): """see doc in Term class According to http://support.microsoft.com/kb/99261 the best way to clear the console is to write out empty spaces """ #TODO: clear attributes too if scope == 'screen': bos = (0, self._get_console_info()['windo...
def _handle_execute_reply(self, msg): """Save the reply to an execute_request into our results. execute messages are never actually used. apply is used instead. """ parent = msg['parent_header'] msg_id = parent['msg_id'] if msg_id not in self.outstanding: if...
def function[_handle_execute_reply, parameter[self, msg]]: constant[Save the reply to an execute_request into our results. execute messages are never actually used. apply is used instead. ] variable[parent] assign[=] call[name[msg]][constant[parent_header]] variable[msg_id] assi...
keyword[def] identifier[_handle_execute_reply] ( identifier[self] , identifier[msg] ): literal[string] identifier[parent] = identifier[msg] [ literal[string] ] identifier[msg_id] = identifier[parent] [ literal[string] ] keyword[if] identifier[msg_id] keyword[not] keyword[in] ...
def _handle_execute_reply(self, msg): """Save the reply to an execute_request into our results. execute messages are never actually used. apply is used instead. """ parent = msg['parent_header'] msg_id = parent['msg_id'] if msg_id not in self.outstanding: if msg_id in self.histo...
def _conan_user_home(self, conan, in_workdir=False): """Create the CONAN_USER_HOME for this task fingerprint and initialize the Conan remotes. See https://docs.conan.io/en/latest/reference/commands/consumer/config.html#conan-config-install for docs on configuring remotes. """ # This argument is exp...
def function[_conan_user_home, parameter[self, conan, in_workdir]]: constant[Create the CONAN_USER_HOME for this task fingerprint and initialize the Conan remotes. See https://docs.conan.io/en/latest/reference/commands/consumer/config.html#conan-config-install for docs on configuring remotes. ] ...
keyword[def] identifier[_conan_user_home] ( identifier[self] , identifier[conan] , identifier[in_workdir] = keyword[False] ): literal[string] keyword[if] identifier[in_workdir] : identifier[base_cache_dir] = identifier[self] . identifier[workdir] keyword[else] : identifier[base_ca...
def _conan_user_home(self, conan, in_workdir=False): """Create the CONAN_USER_HOME for this task fingerprint and initialize the Conan remotes. See https://docs.conan.io/en/latest/reference/commands/consumer/config.html#conan-config-install for docs on configuring remotes. """ # This argument is exp...
def read_entry(self, file_name): """ Args: file_name (str): Returns: pd.DataFrame: """ file_path = os.path.join(self.EXTRACTION_CACHE_PATH, file_name) logger.info(f'Reading cache entry: {file_path}') return joblib.load(file_path)
def function[read_entry, parameter[self, file_name]]: constant[ Args: file_name (str): Returns: pd.DataFrame: ] variable[file_path] assign[=] call[name[os].path.join, parameter[name[self].EXTRACTION_CACHE_PATH, name[file_name]]] call[name[logger]....
keyword[def] identifier[read_entry] ( identifier[self] , identifier[file_name] ): literal[string] identifier[file_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[EXTRACTION_CACHE_PATH] , identifier[file_name] ) identifier[logger] . identifier[in...
def read_entry(self, file_name): """ Args: file_name (str): Returns: pd.DataFrame: """ file_path = os.path.join(self.EXTRACTION_CACHE_PATH, file_name) logger.info(f'Reading cache entry: {file_path}') return joblib.load(file_path)
def flatten(d, parent_key='', separator='__'): """ Flatten a nested dictionary. Parameters ---------- d: dict_like Dictionary to flatten. parent_key: string, optional Concatenated names of the parent keys. separator: string, optional Separator between the names of th...
def function[flatten, parameter[d, parent_key, separator]]: constant[ Flatten a nested dictionary. Parameters ---------- d: dict_like Dictionary to flatten. parent_key: string, optional Concatenated names of the parent keys. separator: string, optional Separator ...
keyword[def] identifier[flatten] ( identifier[d] , identifier[parent_key] = literal[string] , identifier[separator] = literal[string] ): literal[string] identifier[items] =[] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[d] . identifier[items] (): identifier[new_key] = ...
def flatten(d, parent_key='', separator='__'): """ Flatten a nested dictionary. Parameters ---------- d: dict_like Dictionary to flatten. parent_key: string, optional Concatenated names of the parent keys. separator: string, optional Separator between the names of th...
def fromJSON(value): """loads the GP object from a JSON string """ j = json.loads(value) v = GPRecordSet() if "defaultValue" in j: v.value = j['defaultValue'] else: v.value = j['value'] if 'paramName' in j: v.paramName = j['paramName'] ...
def function[fromJSON, parameter[value]]: constant[loads the GP object from a JSON string ] variable[j] assign[=] call[name[json].loads, parameter[name[value]]] variable[v] assign[=] call[name[GPRecordSet], parameter[]] if compare[constant[defaultValue] in name[j]] begin[:] ...
keyword[def] identifier[fromJSON] ( identifier[value] ): literal[string] identifier[j] = identifier[json] . identifier[loads] ( identifier[value] ) identifier[v] = identifier[GPRecordSet] () keyword[if] literal[string] keyword[in] identifier[j] : identifier[v] . id...
def fromJSON(value): """loads the GP object from a JSON string """ j = json.loads(value) v = GPRecordSet() if 'defaultValue' in j: v.value = j['defaultValue'] # depends on [control=['if'], data=['j']] else: v.value = j['value'] if 'paramName' in j: v.paramName = j['param...
def get_exchange_rate(base, target, *args, **kwargs): """ Return the ::base:: to ::target:: exchange rate. Wraps around ::Cryptonator.get_exchange_rate::. """ return Cryptonator().get_exchange_rate(base, target, *args, **kwargs)
def function[get_exchange_rate, parameter[base, target]]: constant[ Return the ::base:: to ::target:: exchange rate. Wraps around ::Cryptonator.get_exchange_rate::. ] return[call[call[name[Cryptonator], parameter[]].get_exchange_rate, parameter[name[base], name[target], <ast.Starred object at 0x...
keyword[def] identifier[get_exchange_rate] ( identifier[base] , identifier[target] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[Cryptonator] (). identifier[get_exchange_rate] ( identifier[base] , identifier[target] ,* identifier[args] ,** identifier[kwargs] )
def get_exchange_rate(base, target, *args, **kwargs): """ Return the ::base:: to ::target:: exchange rate. Wraps around ::Cryptonator.get_exchange_rate::. """ return Cryptonator().get_exchange_rate(base, target, *args, **kwargs)
def _do_log(self, client, _entry_class, payload=None, **kw): """Helper for :meth:`log_empty`, :meth:`log_text`, etc. """ client = self._require_client(client) # Apply defaults kw["log_name"] = kw.pop("log_name", self.full_name) kw["labels"] = kw.pop("labels", self.labels...
def function[_do_log, parameter[self, client, _entry_class, payload]]: constant[Helper for :meth:`log_empty`, :meth:`log_text`, etc. ] variable[client] assign[=] call[name[self]._require_client, parameter[name[client]]] call[name[kw]][constant[log_name]] assign[=] call[name[kw].pop, para...
keyword[def] identifier[_do_log] ( identifier[self] , identifier[client] , identifier[_entry_class] , identifier[payload] = keyword[None] ,** identifier[kw] ): literal[string] identifier[client] = identifier[self] . identifier[_require_client] ( identifier[client] ) identifier[kw...
def _do_log(self, client, _entry_class, payload=None, **kw): """Helper for :meth:`log_empty`, :meth:`log_text`, etc. """ client = self._require_client(client) # Apply defaults kw['log_name'] = kw.pop('log_name', self.full_name) kw['labels'] = kw.pop('labels', self.labels) kw['resource'] ...
def square_root_mod_prime( a, p ): """Modular square root of a, mod p, p prime.""" # Based on the Handbook of Applied Cryptography, algorithms 3.34 to 3.39. # This module has been tested for all values in [0,p-1] for # every prime p from 3 to 1229. assert 0 <= a < p assert 1 < p if a == 0: return 0 ...
def function[square_root_mod_prime, parameter[a, p]]: constant[Modular square root of a, mod p, p prime.] assert[compare[constant[0] less_or_equal[<=] name[a]]] assert[compare[constant[1] less[<] name[p]]] if compare[name[a] equal[==] constant[0]] begin[:] return[constant[0]] if ...
keyword[def] identifier[square_root_mod_prime] ( identifier[a] , identifier[p] ): literal[string] keyword[assert] literal[int] <= identifier[a] < identifier[p] keyword[assert] literal[int] < identifier[p] keyword[if] identifier[a] == literal[int] : keyword[return] literal[int] keyw...
def square_root_mod_prime(a, p): """Modular square root of a, mod p, p prime.""" # Based on the Handbook of Applied Cryptography, algorithms 3.34 to 3.39. # This module has been tested for all values in [0,p-1] for # every prime p from 3 to 1229. assert 0 <= a < p assert 1 < p if a == 0: ...
def turn_on(self): """Turn bulb on (full brightness).""" command = "C {},,,,100,\r\n".format(self._zid) response = self._hub.send_command(command) _LOGGER.debug("Turn on %s: %s", repr(command), response) return response
def function[turn_on, parameter[self]]: constant[Turn bulb on (full brightness).] variable[command] assign[=] call[constant[C {},,,,100, ].format, parameter[name[self]._zid]] variable[response] assign[=] call[name[self]._hub.send_command, parameter[name[command]]] call[name[_LOGGER].deb...
keyword[def] identifier[turn_on] ( identifier[self] ): literal[string] identifier[command] = literal[string] . identifier[format] ( identifier[self] . identifier[_zid] ) identifier[response] = identifier[self] . identifier[_hub] . identifier[send_command] ( identifier[command] ) i...
def turn_on(self): """Turn bulb on (full brightness).""" command = 'C {},,,,100,\r\n'.format(self._zid) response = self._hub.send_command(command) _LOGGER.debug('Turn on %s: %s', repr(command), response) return response
def value(self): """ str: The value of the form element. """ if self.tag_name == "textarea": return inner_content(self.native) elif self.tag_name == "select": if self["multiple"] == "multiple": selected_options = self._find_xpath(".//option[@selected='sel...
def function[value, parameter[self]]: constant[ str: The value of the form element. ] if compare[name[self].tag_name equal[==] constant[textarea]] begin[:] return[call[name[inner_content], parameter[name[self].native]]]
keyword[def] identifier[value] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[tag_name] == literal[string] : keyword[return] identifier[inner_content] ( identifier[self] . identifier[native] ) keyword[elif] identifier[self] . identifier[tag...
def value(self): """ str: The value of the form element. """ if self.tag_name == 'textarea': return inner_content(self.native) # depends on [control=['if'], data=[]] elif self.tag_name == 'select': if self['multiple'] == 'multiple': selected_options = self._find_xpath(".//option...
def flush(self, exclude=None, include=None, dryrun=False): '''Flush :attr:`registered_models`. :param exclude: optional list of model names to exclude. :param include: optional list of model names to include. :param dryrun: Doesn't remove anything, simply collect managers to...
def function[flush, parameter[self, exclude, include, dryrun]]: constant[Flush :attr:`registered_models`. :param exclude: optional list of model names to exclude. :param include: optional list of model names to include. :param dryrun: Doesn't remove anything, simply collect managers ...
keyword[def] identifier[flush] ( identifier[self] , identifier[exclude] = keyword[None] , identifier[include] = keyword[None] , identifier[dryrun] = keyword[False] ): literal[string] identifier[exclude] = identifier[exclude] keyword[or] [] identifier[results] =[] keyword[for] id...
def flush(self, exclude=None, include=None, dryrun=False): """Flush :attr:`registered_models`. :param exclude: optional list of model names to exclude. :param include: optional list of model names to include. :param dryrun: Doesn't remove anything, simply collect managers to flu...
def sendATS_same(self, CorpNum, TemplateCode, Sender, Content, AltContent, AltSendType, SndDT, KakaoMessages, UserID=None, RequestNum=None, ButtonList=None): """ 알림톡 대량 전송 :param CorpNum: 팝빌회원 사업자번호 :param TemplateCode: 템플릿코드 :param Sender: 발신번호 :param Con...
def function[sendATS_same, parameter[self, CorpNum, TemplateCode, Sender, Content, AltContent, AltSendType, SndDT, KakaoMessages, UserID, RequestNum, ButtonList]]: constant[ 알림톡 대량 전송 :param CorpNum: 팝빌회원 사업자번호 :param TemplateCode: 템플릿코드 :param Sender: 발신번호 :param Content: [동보...
keyword[def] identifier[sendATS_same] ( identifier[self] , identifier[CorpNum] , identifier[TemplateCode] , identifier[Sender] , identifier[Content] , identifier[AltContent] , identifier[AltSendType] , identifier[SndDT] , identifier[KakaoMessages] , identifier[UserID] = keyword[None] , identifier[RequestNum] = keywo...
def sendATS_same(self, CorpNum, TemplateCode, Sender, Content, AltContent, AltSendType, SndDT, KakaoMessages, UserID=None, RequestNum=None, ButtonList=None): """ 알림톡 대량 전송 :param CorpNum: 팝빌회원 사업자번호 :param TemplateCode: 템플릿코드 :param Sender: 발신번호 :param Content: [동보] 알림톡 내용 ...
def getEthernetLinkStatus(self, wanInterfaceId=1, timeout=1): """Execute GetEthernetLinkStatus action to get the status of the ethernet link. :param int wanInterfaceId: the id of the WAN device :param float timeout: the timeout to wait for the action to be executed :return: status of th...
def function[getEthernetLinkStatus, parameter[self, wanInterfaceId, timeout]]: constant[Execute GetEthernetLinkStatus action to get the status of the ethernet link. :param int wanInterfaceId: the id of the WAN device :param float timeout: the timeout to wait for the action to be executed ...
keyword[def] identifier[getEthernetLinkStatus] ( identifier[self] , identifier[wanInterfaceId] = literal[int] , identifier[timeout] = literal[int] ): literal[string] identifier[namespace] = identifier[Wan] . identifier[getServiceType] ( literal[string] )+ identifier[str] ( identifier[wanInterfaceId...
def getEthernetLinkStatus(self, wanInterfaceId=1, timeout=1): """Execute GetEthernetLinkStatus action to get the status of the ethernet link. :param int wanInterfaceId: the id of the WAN device :param float timeout: the timeout to wait for the action to be executed :return: status of the et...
def to_rio(self): """Converts the colormap to a rasterio colormap. """ self.colors = (((self.colors * 1.0 - self.colors.min()) / (self.colors.max() - self.colors.min())) * 255) return dict(zip(self.values, tuple(map(tuple, self.colors))))
def function[to_rio, parameter[self]]: constant[Converts the colormap to a rasterio colormap. ] name[self].colors assign[=] binary_operation[binary_operation[binary_operation[binary_operation[name[self].colors * constant[1.0]] - call[name[self].colors.min, parameter[]]] / binary_operation[call[n...
keyword[def] identifier[to_rio] ( identifier[self] ): literal[string] identifier[self] . identifier[colors] =((( identifier[self] . identifier[colors] * literal[int] - identifier[self] . identifier[colors] . identifier[min] ())/ ( identifier[self] . identifier[colors] . identifier[max] ()- ...
def to_rio(self): """Converts the colormap to a rasterio colormap. """ self.colors = (self.colors * 1.0 - self.colors.min()) / (self.colors.max() - self.colors.min()) * 255 return dict(zip(self.values, tuple(map(tuple, self.colors))))
def run_checks(self, **kwargs): """ Check to see whether the system is expected to be computable. This is called by default for each set_value but will only raise a logger warning if fails. This is also called immediately when calling :meth:`run_compute`. kwargs are pa...
def function[run_checks, parameter[self]]: constant[ Check to see whether the system is expected to be computable. This is called by default for each set_value but will only raise a logger warning if fails. This is also called immediately when calling :meth:`run_compute`. ...
keyword[def] identifier[run_checks] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[changed_params] = identifier[self] . identifier[run_delayed_constraints] () identifier[hier] = identifier[self] . identifier[hierarchy] keyword[if] identifier[h...
def run_checks(self, **kwargs): """ Check to see whether the system is expected to be computable. This is called by default for each set_value but will only raise a logger warning if fails. This is also called immediately when calling :meth:`run_compute`. kwargs are passed...
def FromReadings(cls, uuid, readings): """Generate an instance of the report format from a list of readings and a uuid """ if len(readings) != 1: raise ArgumentError("IndividualReading reports must be created with exactly one reading", num_readings=le...
def function[FromReadings, parameter[cls, uuid, readings]]: constant[Generate an instance of the report format from a list of readings and a uuid ] if compare[call[name[len], parameter[name[readings]]] not_equal[!=] constant[1]] begin[:] <ast.Raise object at 0x7da20c76cca0> varia...
keyword[def] identifier[FromReadings] ( identifier[cls] , identifier[uuid] , identifier[readings] ): literal[string] keyword[if] identifier[len] ( identifier[readings] )!= literal[int] : keyword[raise] identifier[ArgumentError] ( literal[string] , identifier[num_reading...
def FromReadings(cls, uuid, readings): """Generate an instance of the report format from a list of readings and a uuid """ if len(readings) != 1: raise ArgumentError('IndividualReading reports must be created with exactly one reading', num_readings=len(readings)) # depends on [control=['if'], d...
def get_icon_by_extension(fname, scale_factor): """Return the icon depending on the file extension""" application_icons = {} application_icons.update(BIN_FILES) application_icons.update(DOCUMENT_FILES) if osp.isdir(fname): return icon('DirOpenIcon', scale_factor) else: basename =...
def function[get_icon_by_extension, parameter[fname, scale_factor]]: constant[Return the icon depending on the file extension] variable[application_icons] assign[=] dictionary[[], []] call[name[application_icons].update, parameter[name[BIN_FILES]]] call[name[application_icons].update, pa...
keyword[def] identifier[get_icon_by_extension] ( identifier[fname] , identifier[scale_factor] ): literal[string] identifier[application_icons] ={} identifier[application_icons] . identifier[update] ( identifier[BIN_FILES] ) identifier[application_icons] . identifier[update] ( identifier[DOCUMENT_...
def get_icon_by_extension(fname, scale_factor): """Return the icon depending on the file extension""" application_icons = {} application_icons.update(BIN_FILES) application_icons.update(DOCUMENT_FILES) if osp.isdir(fname): return icon('DirOpenIcon', scale_factor) # depends on [control=['if'...
def concat(self, other, inplace=False): '''Concatenate two ChemicalEntity of the same kind''' # Create new entity if inplace: obj = self else: obj = self.copy() # Stitch every attribute for name, attr in obj.__attributes__.items()...
def function[concat, parameter[self, other, inplace]]: constant[Concatenate two ChemicalEntity of the same kind] if name[inplace] begin[:] variable[obj] assign[=] name[self] for taget[tuple[[<ast.Name object at 0x7da18f810a00>, <ast.Name object at 0x7da18f812470>]]] in starred[ca...
keyword[def] identifier[concat] ( identifier[self] , identifier[other] , identifier[inplace] = keyword[False] ): literal[string] keyword[if] identifier[inplace] : identifier[obj] = identifier[self] keyword[else] : identifier[obj] = identifier[self] . i...
def concat(self, other, inplace=False): """Concatenate two ChemicalEntity of the same kind""" # Create new entity if inplace: obj = self # depends on [control=['if'], data=[]] else: obj = self.copy() # Stitch every attribute for (name, attr) in obj.__attributes__.items(): ...
def _pycall_path_simple( x1: int, y1: int, x2: int, y2: int, handle: Any ) -> float: """Does less and should run faster, just calls the handle function.""" return ffi.from_handle(handle)(x1, y1, x2, y2)
def function[_pycall_path_simple, parameter[x1, y1, x2, y2, handle]]: constant[Does less and should run faster, just calls the handle function.] return[call[call[name[ffi].from_handle, parameter[name[handle]]], parameter[name[x1], name[y1], name[x2], name[y2]]]]
keyword[def] identifier[_pycall_path_simple] ( identifier[x1] : identifier[int] , identifier[y1] : identifier[int] , identifier[x2] : identifier[int] , identifier[y2] : identifier[int] , identifier[handle] : identifier[Any] )-> identifier[float] : literal[string] keyword[return] identifier[ffi] . identi...
def _pycall_path_simple(x1: int, y1: int, x2: int, y2: int, handle: Any) -> float: """Does less and should run faster, just calls the handle function.""" return ffi.from_handle(handle)(x1, y1, x2, y2)
def insert(self, context): """ Create resource. :param resort.engine.execution.Context context: Current execution context. """ status_code, msg = self.__endpoint.post( "/resources/connector-resource", data={ "id": self.__name, "poolname": self.__pool_name } ) self.__available...
def function[insert, parameter[self, context]]: constant[ Create resource. :param resort.engine.execution.Context context: Current execution context. ] <ast.Tuple object at 0x7da18bc72350> assign[=] call[name[self].__endpoint.post, parameter[constant[/resources/connector-resource]]] ...
keyword[def] identifier[insert] ( identifier[self] , identifier[context] ): literal[string] identifier[status_code] , identifier[msg] = identifier[self] . identifier[__endpoint] . identifier[post] ( literal[string] , identifier[data] ={ literal[string] : identifier[self] . identifier[__name] , li...
def insert(self, context): """ Create resource. :param resort.engine.execution.Context context: Current execution context. """ (status_code, msg) = self.__endpoint.post('/resources/connector-resource', data={'id': self.__name, 'poolname': self.__pool_name}) self.__available = True
def repeat(mode): """Change repeat mode of current player.""" message = command(protobuf.CommandInfo_pb2.ChangeShuffleMode) send_command = message.inner() send_command.options.externalPlayerCommand = True send_command.options.repeatMode = mode return message
def function[repeat, parameter[mode]]: constant[Change repeat mode of current player.] variable[message] assign[=] call[name[command], parameter[name[protobuf].CommandInfo_pb2.ChangeShuffleMode]] variable[send_command] assign[=] call[name[message].inner, parameter[]] name[send_command].o...
keyword[def] identifier[repeat] ( identifier[mode] ): literal[string] identifier[message] = identifier[command] ( identifier[protobuf] . identifier[CommandInfo_pb2] . identifier[ChangeShuffleMode] ) identifier[send_command] = identifier[message] . identifier[inner] () identifier[send_command] . i...
def repeat(mode): """Change repeat mode of current player.""" message = command(protobuf.CommandInfo_pb2.ChangeShuffleMode) send_command = message.inner() send_command.options.externalPlayerCommand = True send_command.options.repeatMode = mode return message
def addDataToQueue(self, displacement, reset=False): """ Add the given displacement to the region's internal queue. Calls to compute will cause items in the queue to be dequeued in FIFO order. :param displacement: Two floats representing translation vector [dx, dy] to be passed...
def function[addDataToQueue, parameter[self, displacement, reset]]: constant[ Add the given displacement to the region's internal queue. Calls to compute will cause items in the queue to be dequeued in FIFO order. :param displacement: Two floats representing translation vector [dx, dy] to ...
keyword[def] identifier[addDataToQueue] ( identifier[self] , identifier[displacement] , identifier[reset] = keyword[False] ): literal[string] identifier[self] . identifier[queue] . identifier[appendleft] ({ literal[string] : identifier[list] ( identifier[displacement] ), literal[string] : identif...
def addDataToQueue(self, displacement, reset=False): """ Add the given displacement to the region's internal queue. Calls to compute will cause items in the queue to be dequeued in FIFO order. :param displacement: Two floats representing translation vector [dx, dy] to be passed...
def make_folium_polyline(edge, edge_color, edge_width, edge_opacity, popup_attribute=None): """ Turn a row from the gdf_edges GeoDataFrame into a folium PolyLine with attributes. Parameters ---------- edge : GeoSeries a row from the gdf_edges GeoDataFrame edge_color : string ...
def function[make_folium_polyline, parameter[edge, edge_color, edge_width, edge_opacity, popup_attribute]]: constant[ Turn a row from the gdf_edges GeoDataFrame into a folium PolyLine with attributes. Parameters ---------- edge : GeoSeries a row from the gdf_edges GeoDataFrame e...
keyword[def] identifier[make_folium_polyline] ( identifier[edge] , identifier[edge_color] , identifier[edge_width] , identifier[edge_opacity] , identifier[popup_attribute] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[folium] : keyword[raise] identifier[ImportErr...
def make_folium_polyline(edge, edge_color, edge_width, edge_opacity, popup_attribute=None): """ Turn a row from the gdf_edges GeoDataFrame into a folium PolyLine with attributes. Parameters ---------- edge : GeoSeries a row from the gdf_edges GeoDataFrame edge_color : string ...
def _task_periodic(self): """ This is a callback that is registered to be called periodically from the legion. The legion chooses when it might be called, typically when it is otherwise idle. """ log = self._params.get('log', self._discard) log.debug("periodic") ...
def function[_task_periodic, parameter[self]]: constant[ This is a callback that is registered to be called periodically from the legion. The legion chooses when it might be called, typically when it is otherwise idle. ] variable[log] assign[=] call[name[self]._params.get, p...
keyword[def] identifier[_task_periodic] ( identifier[self] ): literal[string] identifier[log] = identifier[self] . identifier[_params] . identifier[get] ( literal[string] , identifier[self] . identifier[_discard] ) identifier[log] . identifier[debug] ( literal[string] ) identifier...
def _task_periodic(self): """ This is a callback that is registered to be called periodically from the legion. The legion chooses when it might be called, typically when it is otherwise idle. """ log = self._params.get('log', self._discard) log.debug('periodic') self.manage(...
def start(self): """ Starts running the timer. If the timer is currently running, then this method will do nothing. :sa stop, reset """ if self._timer.isActive(): return self._starttime = datetime.datetime.now() self._timer.st...
def function[start, parameter[self]]: constant[ Starts running the timer. If the timer is currently running, then this method will do nothing. :sa stop, reset ] if call[name[self]._timer.isActive, parameter[]] begin[:] return[None] name[self]._startt...
keyword[def] identifier[start] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_timer] . identifier[isActive] (): keyword[return] identifier[self] . identifier[_starttime] = identifier[datetime] . identifier[datetime] . identifier[now] (...
def start(self): """ Starts running the timer. If the timer is currently running, then this method will do nothing. :sa stop, reset """ if self._timer.isActive(): return # depends on [control=['if'], data=[]] self._starttime = datetime.datetime.now() self._...
def initialize_hmac(self): # type: (EncryptionMetadata) -> hmac.HMAC """Initialize an hmac from a signing key if it exists :param EncryptionMetadata self: this :rtype: hmac.HMAC or None :return: hmac """ if self._signkey is not None: return hmac.new(se...
def function[initialize_hmac, parameter[self]]: constant[Initialize an hmac from a signing key if it exists :param EncryptionMetadata self: this :rtype: hmac.HMAC or None :return: hmac ] if compare[name[self]._signkey is_not constant[None]] begin[:] return[call[na...
keyword[def] identifier[initialize_hmac] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_signkey] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[hmac] . identifier[new] ( identifier[self] . identifier[_signkey] , identifier[di...
def initialize_hmac(self): # type: (EncryptionMetadata) -> hmac.HMAC 'Initialize an hmac from a signing key if it exists\n :param EncryptionMetadata self: this\n :rtype: hmac.HMAC or None\n :return: hmac\n ' if self._signkey is not None: return hmac.new(self._signkey, dig...
def wrap_list(item): """ Returns an object as a list. If the object is a list, it is returned directly. If it is a tuple or set, it is returned as a list. If it is another object, it is wrapped in a list and returned. """ if item is None: return [] elif isinstance(item, list): ...
def function[wrap_list, parameter[item]]: constant[ Returns an object as a list. If the object is a list, it is returned directly. If it is a tuple or set, it is returned as a list. If it is another object, it is wrapped in a list and returned. ] if compare[name[item] is constant[No...
keyword[def] identifier[wrap_list] ( identifier[item] ): literal[string] keyword[if] identifier[item] keyword[is] keyword[None] : keyword[return] [] keyword[elif] identifier[isinstance] ( identifier[item] , identifier[list] ): keyword[return] identifier[item] keyword[elif]...
def wrap_list(item): """ Returns an object as a list. If the object is a list, it is returned directly. If it is a tuple or set, it is returned as a list. If it is another object, it is wrapped in a list and returned. """ if item is None: return [] # depends on [control=['if'], dat...
def ignore_exception(exception_class): """A decorator that ignores `exception_class` exceptions""" def _decorator(func): def newfunc(*args, **kwds): try: return func(*args, **kwds) except exception_class: pass return newfunc return _dec...
def function[ignore_exception, parameter[exception_class]]: constant[A decorator that ignores `exception_class` exceptions] def function[_decorator, parameter[func]]: def function[newfunc, parameter[]]: <ast.Try object at 0x7da207f02a70> return[name[newfunc]] retu...
keyword[def] identifier[ignore_exception] ( identifier[exception_class] ): literal[string] keyword[def] identifier[_decorator] ( identifier[func] ): keyword[def] identifier[newfunc] (* identifier[args] ,** identifier[kwds] ): keyword[try] : keyword[return] identifi...
def ignore_exception(exception_class): """A decorator that ignores `exception_class` exceptions""" def _decorator(func): def newfunc(*args, **kwds): try: return func(*args, **kwds) # depends on [control=['try'], data=[]] except exception_class: ...
def DedupVcardFilenames(vcard_dict): """Make sure every vCard in the dictionary has a unique filename.""" remove_keys = [] add_pairs = [] for k, v in vcard_dict.items(): if not len(v) > 1: continue for idx, vcard in enumerate(v): fname, ext = os.path.splitext(k) ...
def function[DedupVcardFilenames, parameter[vcard_dict]]: constant[Make sure every vCard in the dictionary has a unique filename.] variable[remove_keys] assign[=] list[[]] variable[add_pairs] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da207f9a0b0>, <ast.Name object at 0x7...
keyword[def] identifier[DedupVcardFilenames] ( identifier[vcard_dict] ): literal[string] identifier[remove_keys] =[] identifier[add_pairs] =[] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[vcard_dict] . identifier[items] (): keyword[if] keyword[not] identifier[le...
def DedupVcardFilenames(vcard_dict): """Make sure every vCard in the dictionary has a unique filename.""" remove_keys = [] add_pairs = [] for (k, v) in vcard_dict.items(): if not len(v) > 1: continue # depends on [control=['if'], data=[]] for (idx, vcard) in enumerate(v): ...
def update_state(self, identifier, state): """Update state of identified model run. Raises exception if state change results in invalid run life cycle. Parameters ---------- identifier : string Unique model run identifier state : ModelRunState Ob...
def function[update_state, parameter[self, identifier, state]]: constant[Update state of identified model run. Raises exception if state change results in invalid run life cycle. Parameters ---------- identifier : string Unique model run identifier state : M...
keyword[def] identifier[update_state] ( identifier[self] , identifier[identifier] , identifier[state] ): literal[string] identifier[model_run] = identifier[self] . identifier[get_object] ( identifier[identifier] ) keyword[if] identifier[model_run] keyword[is] keyword[None] : ...
def update_state(self, identifier, state): """Update state of identified model run. Raises exception if state change results in invalid run life cycle. Parameters ---------- identifier : string Unique model run identifier state : ModelRunState Object...
def percentage_distance(cls, highmark, current): """Percentage of distance the current offset is behind the highmark.""" highmark = int(highmark) current = int(current) if highmark > 0: return round( (highmark - current) * 100.0 / highmark, 2, ...
def function[percentage_distance, parameter[cls, highmark, current]]: constant[Percentage of distance the current offset is behind the highmark.] variable[highmark] assign[=] call[name[int], parameter[name[highmark]]] variable[current] assign[=] call[name[int], parameter[name[current]]] ...
keyword[def] identifier[percentage_distance] ( identifier[cls] , identifier[highmark] , identifier[current] ): literal[string] identifier[highmark] = identifier[int] ( identifier[highmark] ) identifier[current] = identifier[int] ( identifier[current] ) keyword[if] identifier[high...
def percentage_distance(cls, highmark, current): """Percentage of distance the current offset is behind the highmark.""" highmark = int(highmark) current = int(current) if highmark > 0: return round((highmark - current) * 100.0 / highmark, 2) # depends on [control=['if'], data=['highmark']] ...
def parseCapabilities(self, capdict): """Parse a capabilities dictionary and adjust instance settings. At the time this function is called, the user has requested some settings (e.g., mode identifier), but we haven't yet asked the reader whether those requested settings are within its c...
def function[parseCapabilities, parameter[self, capdict]]: constant[Parse a capabilities dictionary and adjust instance settings. At the time this function is called, the user has requested some settings (e.g., mode identifier), but we haven't yet asked the reader whether those requeste...
keyword[def] identifier[parseCapabilities] ( identifier[self] , identifier[capdict] ): literal[string] identifier[gdc] = identifier[capdict] [ literal[string] ] identifier[max_ant] = identifier[gdc] [ literal[string] ] keyword[if] identifier[max] ( identifier[self] . ide...
def parseCapabilities(self, capdict): """Parse a capabilities dictionary and adjust instance settings. At the time this function is called, the user has requested some settings (e.g., mode identifier), but we haven't yet asked the reader whether those requested settings are within its capab...
def get_es_value(obj, def_obj): """ Returns the value for an object that goes into the elacticsearch 'value' field args: obj: data object to update def_obj: the class instance that has defintion values """ def get_dict_val(item): """ Returns the string representa...
def function[get_es_value, parameter[obj, def_obj]]: constant[ Returns the value for an object that goes into the elacticsearch 'value' field args: obj: data object to update def_obj: the class instance that has defintion values ] def function[get_dict_val, parameter[ite...
keyword[def] identifier[get_es_value] ( identifier[obj] , identifier[def_obj] ): literal[string] keyword[def] identifier[get_dict_val] ( identifier[item] ): literal[string] keyword[if] identifier[isinstance] ( identifier[item] , identifier[dict] ): keyword[return] identif...
def get_es_value(obj, def_obj): """ Returns the value for an object that goes into the elacticsearch 'value' field args: obj: data object to update def_obj: the class instance that has defintion values """ def get_dict_val(item): """ Returns the string represent...
def update(self, friendly_name=values.unset, max_size=values.unset): """ Update the QueueInstance :param unicode friendly_name: A string to describe this resource :param unicode max_size: The max number of calls allowed in the queue :returns: Updated QueueInstance :rtyp...
def function[update, parameter[self, friendly_name, max_size]]: constant[ Update the QueueInstance :param unicode friendly_name: A string to describe this resource :param unicode max_size: The max number of calls allowed in the queue :returns: Updated QueueInstance :rty...
keyword[def] identifier[update] ( identifier[self] , identifier[friendly_name] = identifier[values] . identifier[unset] , identifier[max_size] = identifier[values] . identifier[unset] ): literal[string] keyword[return] identifier[self] . identifier[_proxy] . identifier[update] ( identifier[friendl...
def update(self, friendly_name=values.unset, max_size=values.unset): """ Update the QueueInstance :param unicode friendly_name: A string to describe this resource :param unicode max_size: The max number of calls allowed in the queue :returns: Updated QueueInstance :rtype: t...
def format(self, obj, include=None, exclude=None): """Return a format data dict for an object. By default all format types will be computed. The following MIME types are currently implemented: * text/plain * text/html * text/latex * application/json * a...
def function[format, parameter[self, obj, include, exclude]]: constant[Return a format data dict for an object. By default all format types will be computed. The following MIME types are currently implemented: * text/plain * text/html * text/latex * application...
keyword[def] identifier[format] ( identifier[self] , identifier[obj] , identifier[include] = keyword[None] , identifier[exclude] = keyword[None] ): literal[string] identifier[format_dict] ={} keyword[if] identifier[self] . identifier[plain_text_only] : identifier[fo...
def format(self, obj, include=None, exclude=None): """Return a format data dict for an object. By default all format types will be computed. The following MIME types are currently implemented: * text/plain * text/html * text/latex * application/json * appli...
def get_relation_count_query(self, query, parent): """ Add the constraints for a relationship count query. :type query: Builder :type parent: Builder :rtype: Builder """ query = super(MorphOneOrMany, self).get_relation_count_query(query, parent) return ...
def function[get_relation_count_query, parameter[self, query, parent]]: constant[ Add the constraints for a relationship count query. :type query: Builder :type parent: Builder :rtype: Builder ] variable[query] assign[=] call[call[name[super], parameter[name[Mor...
keyword[def] identifier[get_relation_count_query] ( identifier[self] , identifier[query] , identifier[parent] ): literal[string] identifier[query] = identifier[super] ( identifier[MorphOneOrMany] , identifier[self] ). identifier[get_relation_count_query] ( identifier[query] , identifier[parent] ) ...
def get_relation_count_query(self, query, parent): """ Add the constraints for a relationship count query. :type query: Builder :type parent: Builder :rtype: Builder """ query = super(MorphOneOrMany, self).get_relation_count_query(query, parent) return query.where(s...
def connect_to_nsqd(self, host, port): """ Adds a connection to ``nsqd`` at the specified address. :param host: the address to connect to :param port: the port to connect to """ assert isinstance(host, string_types) assert isinstance(port, int) conn = As...
def function[connect_to_nsqd, parameter[self, host, port]]: constant[ Adds a connection to ``nsqd`` at the specified address. :param host: the address to connect to :param port: the port to connect to ] assert[call[name[isinstance], parameter[name[host], name[string_types]]]...
keyword[def] identifier[connect_to_nsqd] ( identifier[self] , identifier[host] , identifier[port] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[host] , identifier[string_types] ) keyword[assert] identifier[isinstance] ( identifier[port] , identifier[int] ) ...
def connect_to_nsqd(self, host, port): """ Adds a connection to ``nsqd`` at the specified address. :param host: the address to connect to :param port: the port to connect to """ assert isinstance(host, string_types) assert isinstance(port, int) conn = AsyncConn(host, por...
def add_new_spawn_method(obj): """ TODO """ def new_spawn(self): # TODO/FIXME: Check that this does the right thing: # (i) the spawned generator is independent of the original one (i.e. they can be reset independently without altering the other's behaviour) # (ii) ensure that it...
def function[add_new_spawn_method, parameter[obj]]: constant[ TODO ] def function[new_spawn, parameter[self]]: variable[new_instance] assign[=] call[name[self].__class__, parameter[]] return[name[new_instance]] name[obj]._spawn assign[=] name[new_spawn]
keyword[def] identifier[add_new_spawn_method] ( identifier[obj] ): literal[string] keyword[def] identifier[new_spawn] ( identifier[self] ): identifier[new_instance] = identifier[self] . identifier[__class__] () keyword[return] identifier[new_instance] identifier[o...
def add_new_spawn_method(obj): """ TODO """ def new_spawn(self): # TODO/FIXME: Check that this does the right thing: # (i) the spawned generator is independent of the original one (i.e. they can be reset independently without altering the other's behaviour) # (ii) ensure that it...
def validator(input_data): """Simple model input validator. Validator ensures the input data array is - two dimensional - has the correct number of features. """ global data # check num dims if input_data.ndim != 2: return False, 'Data should have two dimensions.' # ...
def function[validator, parameter[input_data]]: constant[Simple model input validator. Validator ensures the input data array is - two dimensional - has the correct number of features. ] <ast.Global object at 0x7da1b0653e50> if compare[name[input_data].ndim not_equal[!=] con...
keyword[def] identifier[validator] ( identifier[input_data] ): literal[string] keyword[global] identifier[data] keyword[if] identifier[input_data] . identifier[ndim] != literal[int] : keyword[return] keyword[False] , literal[string] keyword[if] identifier[input_data] ...
def validator(input_data): """Simple model input validator. Validator ensures the input data array is - two dimensional - has the correct number of features. """ global data # check num dims if input_data.ndim != 2: return (False, 'Data should have two dimensions.') # d...
def check_raw_string(self, string, is_bstring=True): """ Check whether the given string is properly UTF-8 encoded (if ``is_bytes`` is ``True``), it is not empty, and it does not contain reserved characters. :param string string: the byte string or Unicode string to be ch...
def function[check_raw_string, parameter[self, string, is_bstring]]: constant[ Check whether the given string is properly UTF-8 encoded (if ``is_bytes`` is ``True``), it is not empty, and it does not contain reserved characters. :param string string: the byte string or U...
keyword[def] identifier[check_raw_string] ( identifier[self] , identifier[string] , identifier[is_bstring] = keyword[True] ): literal[string] identifier[self] . identifier[log] ( literal[string] ) identifier[self] . identifier[result] = identifier[ValidatorResult] () keyword[if] ...
def check_raw_string(self, string, is_bstring=True): """ Check whether the given string is properly UTF-8 encoded (if ``is_bytes`` is ``True``), it is not empty, and it does not contain reserved characters. :param string string: the byte string or Unicode string to be checke...
def from_clock_time(cls, clock_time, epoch): """ Convert from a `.ClockTime` relative to a given epoch. """ clock_time = ClockTime(*clock_time) ts = clock_time.seconds % 86400 nanoseconds = int(1000000000 * ts + clock_time.nanoseconds) return Time.from_ticks(epoch.time()....
def function[from_clock_time, parameter[cls, clock_time, epoch]]: constant[ Convert from a `.ClockTime` relative to a given epoch. ] variable[clock_time] assign[=] call[name[ClockTime], parameter[<ast.Starred object at 0x7da1b2581db0>]] variable[ts] assign[=] binary_operation[name[clock_...
keyword[def] identifier[from_clock_time] ( identifier[cls] , identifier[clock_time] , identifier[epoch] ): literal[string] identifier[clock_time] = identifier[ClockTime] (* identifier[clock_time] ) identifier[ts] = identifier[clock_time] . identifier[seconds] % literal[int] ident...
def from_clock_time(cls, clock_time, epoch): """ Convert from a `.ClockTime` relative to a given epoch. """ clock_time = ClockTime(*clock_time) ts = clock_time.seconds % 86400 nanoseconds = int(1000000000 * ts + clock_time.nanoseconds) return Time.from_ticks(epoch.time().ticks + nanoseconds ...
def register(cls, range_mixin): """ Decorator for registering range set mixins for global use. This works the same as :meth:`~spans.settypes.MetaRangeSet.add` :param range_mixin: A :class:`~spans.types.Range` mixin class to to register a decorated range set m...
def function[register, parameter[cls, range_mixin]]: constant[ Decorator for registering range set mixins for global use. This works the same as :meth:`~spans.settypes.MetaRangeSet.add` :param range_mixin: A :class:`~spans.types.Range` mixin class to to regis...
keyword[def] identifier[register] ( identifier[cls] , identifier[range_mixin] ): literal[string] keyword[def] identifier[decorator] ( identifier[range_set_mixin] ): identifier[cls] . identifier[add] ( identifier[range_mixin] , identifier[range_set_mixin] ) keyword[return...
def register(cls, range_mixin): """ Decorator for registering range set mixins for global use. This works the same as :meth:`~spans.settypes.MetaRangeSet.add` :param range_mixin: A :class:`~spans.types.Range` mixin class to to register a decorated range set mixin...
def delete_and_upload_images(client, image_type, language, base_dir): """ Delete and upload images with given image_type and language. Function will stage delete and stage upload all found images in matching folders. """ print('{0} {1}'.format(image_type, language)) files_in_dir = os.listdi...
def function[delete_and_upload_images, parameter[client, image_type, language, base_dir]]: constant[ Delete and upload images with given image_type and language. Function will stage delete and stage upload all found images in matching folders. ] call[name[print], parameter[call[constant...
keyword[def] identifier[delete_and_upload_images] ( identifier[client] , identifier[image_type] , identifier[language] , identifier[base_dir] ): literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[image_type] , identifier[language] )) identifier[files_in_dir] = identi...
def delete_and_upload_images(client, image_type, language, base_dir): """ Delete and upload images with given image_type and language. Function will stage delete and stage upload all found images in matching folders. """ print('{0} {1}'.format(image_type, language)) files_in_dir = os.listdi...
def predict(self, X1new, X2new): """ Return the predictive mean and variance at a series of new points X1new, X2new Only returns the diagonal of the predictive variance, for now. :param X1new: The points at which to make a prediction :type X1new: np.ndarray, Nnew x self.input_di...
def function[predict, parameter[self, X1new, X2new]]: constant[ Return the predictive mean and variance at a series of new points X1new, X2new Only returns the diagonal of the predictive variance, for now. :param X1new: The points at which to make a prediction :type X1new: np.nd...
keyword[def] identifier[predict] ( identifier[self] , identifier[X1new] , identifier[X2new] ): literal[string] identifier[k1xf] = identifier[self] . identifier[kern1] . identifier[K] ( identifier[X1new] , identifier[self] . identifier[X1] ) identifier[k2xf] = identifier[self] . identifier[...
def predict(self, X1new, X2new): """ Return the predictive mean and variance at a series of new points X1new, X2new Only returns the diagonal of the predictive variance, for now. :param X1new: The points at which to make a prediction :type X1new: np.ndarray, Nnew x self.input_dim1 ...
def load_stack(stack): """ Loads the saved state of a CallStack and returns a whole instance given an instance with incomplete state. :param caliendo.hooks.CallStack stack: The stack to load :returns: A CallStack previously built in the context of a patch call. :rtype: caliendo.hooks.CallStack ...
def function[load_stack, parameter[stack]]: constant[ Loads the saved state of a CallStack and returns a whole instance given an instance with incomplete state. :param caliendo.hooks.CallStack stack: The stack to load :returns: A CallStack previously built in the context of a patch call. :rtyp...
keyword[def] identifier[load_stack] ( identifier[stack] ): literal[string] keyword[global] identifier[CACHE_] identifier[load_cache] ( keyword[True] ) identifier[key] = literal[string] . identifier[format] ( identifier[stack] . identifier[module] , identifier[stack] . identifier[caller] ) ...
def load_stack(stack): """ Loads the saved state of a CallStack and returns a whole instance given an instance with incomplete state. :param caliendo.hooks.CallStack stack: The stack to load :returns: A CallStack previously built in the context of a patch call. :rtype: caliendo.hooks.CallStack ...
def __add_relation(self, relation): """ <parRelation id="maz3377.1000" type="sequential"> <nucleus id="maz3377.1"/> <nucleus id="maz3377.2"/> </parRelation> """ rel_id = self.ns + ':' + relation.attrib['id'] rel_name = relation.attrib['...
def function[__add_relation, parameter[self, relation]]: constant[ <parRelation id="maz3377.1000" type="sequential"> <nucleus id="maz3377.1"/> <nucleus id="maz3377.2"/> </parRelation> ] variable[rel_id] assign[=] binary_operation[binary_operati...
keyword[def] identifier[__add_relation] ( identifier[self] , identifier[relation] ): literal[string] identifier[rel_id] = identifier[self] . identifier[ns] + literal[string] + identifier[relation] . identifier[attrib] [ literal[string] ] identifier[rel_name] = identifier[relation] . identi...
def __add_relation(self, relation): """ <parRelation id="maz3377.1000" type="sequential"> <nucleus id="maz3377.1"/> <nucleus id="maz3377.2"/> </parRelation> """ rel_id = self.ns + ':' + relation.attrib['id'] rel_name = relation.attrib['type'] r...
def last_post(self): """ Returns the latest post associated with the node or one of its descendants. """ posts = [n.last_post for n in self.children if n.last_post is not None] children_last_post = max(posts, key=lambda p: p.created) if posts else None if children_last_post and self.obj....
def function[last_post, parameter[self]]: constant[ Returns the latest post associated with the node or one of its descendants. ] variable[posts] assign[=] <ast.ListComp object at 0x7da1b2346980> variable[children_last_post] assign[=] <ast.IfExp object at 0x7da1b23455d0> if <ast.BoolOp o...
keyword[def] identifier[last_post] ( identifier[self] ): literal[string] identifier[posts] =[ identifier[n] . identifier[last_post] keyword[for] identifier[n] keyword[in] identifier[self] . identifier[children] keyword[if] identifier[n] . identifier[last_post] keyword[is] keyword[not] keyw...
def last_post(self): """ Returns the latest post associated with the node or one of its descendants. """ posts = [n.last_post for n in self.children if n.last_post is not None] children_last_post = max(posts, key=lambda p: p.created) if posts else None if children_last_post and self.obj.last_post_id: ...
def _get_pkg_ds_avail(): ''' Get the package information of the available packages, maintained by dselect. Note, this will be not very useful, if dselect isn't installed. :return: ''' avail = "/var/lib/dpkg/available" if not salt.utils.path.which('dselect') or not os.path.exists(avail): ...
def function[_get_pkg_ds_avail, parameter[]]: constant[ Get the package information of the available packages, maintained by dselect. Note, this will be not very useful, if dselect isn't installed. :return: ] variable[avail] assign[=] constant[/var/lib/dpkg/available] if <ast.Bo...
keyword[def] identifier[_get_pkg_ds_avail] (): literal[string] identifier[avail] = literal[string] keyword[if] keyword[not] identifier[salt] . identifier[utils] . identifier[path] . identifier[which] ( literal[string] ) keyword[or] keyword[not] identifier[os] . identifier[path] . identifier[exist...
def _get_pkg_ds_avail(): """ Get the package information of the available packages, maintained by dselect. Note, this will be not very useful, if dselect isn't installed. :return: """ avail = '/var/lib/dpkg/available' if not salt.utils.path.which('dselect') or not os.path.exists(avail): ...
def _send_and_wait(self, **kwargs): """ Send a frame to either the local ZigBee or a remote device and wait for a pre-defined amount of time for its response. """ frame_id = self.next_frame_id kwargs.update(dict(frame_id=frame_id)) self._send(**kwargs) tim...
def function[_send_and_wait, parameter[self]]: constant[ Send a frame to either the local ZigBee or a remote device and wait for a pre-defined amount of time for its response. ] variable[frame_id] assign[=] name[self].next_frame_id call[name[kwargs].update, parameter[call...
keyword[def] identifier[_send_and_wait] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[frame_id] = identifier[self] . identifier[next_frame_id] identifier[kwargs] . identifier[update] ( identifier[dict] ( identifier[frame_id] = identifier[frame_id] )) ide...
def _send_and_wait(self, **kwargs): """ Send a frame to either the local ZigBee or a remote device and wait for a pre-defined amount of time for its response. """ frame_id = self.next_frame_id kwargs.update(dict(frame_id=frame_id)) self._send(**kwargs) timeout = datetime.now(...
def update(self, render, force = False): """ Update view @param render: IRender @param force: force update """ if not force: return; drawArea = QtGui.QImage(self._width, self._height, render.getImageFormat()) drawArea.fill(self._backgroundColor...
def function[update, parameter[self, render, force]]: constant[ Update view @param render: IRender @param force: force update ] if <ast.UnaryOp object at 0x7da18ede4b50> begin[:] return[None] variable[drawArea] assign[=] call[name[QtGui].QImage, parameter[...
keyword[def] identifier[update] ( identifier[self] , identifier[render] , identifier[force] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[force] : keyword[return] ; identifier[drawArea] = identifier[QtGui] . identifier[QImage] ( identifier[self] . i...
def update(self, render, force=False): """ Update view @param render: IRender @param force: force update """ if not force: return # depends on [control=['if'], data=[]] drawArea = QtGui.QImage(self._width, self._height, render.getImageFormat()) drawArea.fill(self...
def stop(args): """ %prog stop Stop EC2 instance. """ p = OptionParser(stop.__doc__) p.add_option("--profile", default="mvrad-datasci-role", help="Profile name") opts, args = p.parse_args(args) if len(args) != 0: sys.exit(not p.print_help()) role(["htang"]) session = b...
def function[stop, parameter[args]]: constant[ %prog stop Stop EC2 instance. ] variable[p] assign[=] call[name[OptionParser], parameter[name[stop].__doc__]] call[name[p].add_option, parameter[constant[--profile]]] <ast.Tuple object at 0x7da18f8113f0> assign[=] call[name[p].p...
keyword[def] identifier[stop] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[stop] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[default] = literal[string] , identifier[help] = literal[string] ) identifie...
def stop(args): """ %prog stop Stop EC2 instance. """ p = OptionParser(stop.__doc__) p.add_option('--profile', default='mvrad-datasci-role', help='Profile name') (opts, args) = p.parse_args(args) if len(args) != 0: sys.exit(not p.print_help()) # depends on [control=['if'], data...
def convert_to_html(self, file, filename=None, file_content_type=None, model=None, **kwargs): """ Convert document to HTML. Converts a document to HTML. :param file f...
def function[convert_to_html, parameter[self, file, filename, file_content_type, model]]: constant[ Convert document to HTML. Converts a document to HTML. :param file file: The document to convert. :param str filename: The filename for file. :param str file_content_type...
keyword[def] identifier[convert_to_html] ( identifier[self] , identifier[file] , identifier[filename] = keyword[None] , identifier[file_content_type] = keyword[None] , identifier[model] = keyword[None] , ** identifier[kwargs] ): literal[string] keyword[if] identifier[file] keyword[is] keywo...
def convert_to_html(self, file, filename=None, file_content_type=None, model=None, **kwargs): """ Convert document to HTML. Converts a document to HTML. :param file file: The document to convert. :param str filename: The filename for file. :param str file_content_type: The ...
def from_unit_cube(self, x): """ Used by multinest :param x: 0 < x < 1 :param lower_bound: :param upper_bound: :return: """ cosdec_min = np.cos(deg2rad*(90.0 + self.lower_bound.value)) cosdec_max = np.cos(deg2rad*(90.0 + self.upper_bound.value)) ...
def function[from_unit_cube, parameter[self, x]]: constant[ Used by multinest :param x: 0 < x < 1 :param lower_bound: :param upper_bound: :return: ] variable[cosdec_min] assign[=] call[name[np].cos, parameter[binary_operation[name[deg2rad] * binary_operat...
keyword[def] identifier[from_unit_cube] ( identifier[self] , identifier[x] ): literal[string] identifier[cosdec_min] = identifier[np] . identifier[cos] ( identifier[deg2rad] *( literal[int] + identifier[self] . identifier[lower_bound] . identifier[value] )) identifier[cosdec_max] = identif...
def from_unit_cube(self, x): """ Used by multinest :param x: 0 < x < 1 :param lower_bound: :param upper_bound: :return: """ cosdec_min = np.cos(deg2rad * (90.0 + self.lower_bound.value)) cosdec_max = np.cos(deg2rad * (90.0 + self.upper_bound.value)) v = x...
def soaproot(self, node): """ Get whether the specified I{node} is a soap encoded root. This is determined by examining @soapenc:root='1'. The node is considered to be a root when the attribute is not specified. @param node: A node to evaluate. @type node: L{Eleme...
def function[soaproot, parameter[self, node]]: constant[ Get whether the specified I{node} is a soap encoded root. This is determined by examining @soapenc:root='1'. The node is considered to be a root when the attribute is not specified. @param node: A node to evaluate. ...
keyword[def] identifier[soaproot] ( identifier[self] , identifier[node] ): literal[string] identifier[root] = identifier[node] . identifier[getAttribute] ( literal[string] , identifier[ns] = identifier[soapenc] ) keyword[if] identifier[root] keyword[is] keyword[None] : keyw...
def soaproot(self, node): """ Get whether the specified I{node} is a soap encoded root. This is determined by examining @soapenc:root='1'. The node is considered to be a root when the attribute is not specified. @param node: A node to evaluate. @type node: L{Element} ...
def _process(self, envelope, session, mode, **kwargs): """ :meth:`.WMessengerOnionLayerProto.process` implementation """ if mode == WMessengerOnionPackerLayerProto.Mode.pack: return self.pack(envelope, session, **kwargs) else: # mode == WMessengerOnionPackerLayerProto.Mode.unpack return self.unpack(envel...
def function[_process, parameter[self, envelope, session, mode]]: constant[ :meth:`.WMessengerOnionLayerProto.process` implementation ] if compare[name[mode] equal[==] name[WMessengerOnionPackerLayerProto].Mode.pack] begin[:] return[call[name[self].pack, parameter[name[envelope], name[session]...
keyword[def] identifier[_process] ( identifier[self] , identifier[envelope] , identifier[session] , identifier[mode] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[mode] == identifier[WMessengerOnionPackerLayerProto] . identifier[Mode] . identifier[pack] : keyword[return] identifier[sel...
def _process(self, envelope, session, mode, **kwargs): """ :meth:`.WMessengerOnionLayerProto.process` implementation """ if mode == WMessengerOnionPackerLayerProto.Mode.pack: return self.pack(envelope, session, **kwargs) # depends on [control=['if'], data=[]] else: # mode == WMessengerOnionPacke...
def _segment_normalized_cnvkit(cnr_file, work_dir, paired): """Segmentation of normalized inputs using CNVkit. """ cnvkit_base = os.path.join(utils.safe_makedir(os.path.join(work_dir, "cnvkit")), dd.get_sample_name(paired.tumor_data)) cnr_file = chromhacks.bed_to_standard...
def function[_segment_normalized_cnvkit, parameter[cnr_file, work_dir, paired]]: constant[Segmentation of normalized inputs using CNVkit. ] variable[cnvkit_base] assign[=] call[name[os].path.join, parameter[call[name[utils].safe_makedir, parameter[call[name[os].path.join, parameter[name[work_dir], c...
keyword[def] identifier[_segment_normalized_cnvkit] ( identifier[cnr_file] , identifier[work_dir] , identifier[paired] ): literal[string] identifier[cnvkit_base] = identifier[os] . identifier[path] . identifier[join] ( identifier[utils] . identifier[safe_makedir] ( identifier[os] . identifier[path] . ident...
def _segment_normalized_cnvkit(cnr_file, work_dir, paired): """Segmentation of normalized inputs using CNVkit. """ cnvkit_base = os.path.join(utils.safe_makedir(os.path.join(work_dir, 'cnvkit')), dd.get_sample_name(paired.tumor_data)) cnr_file = chromhacks.bed_to_standardonly(cnr_file, paired.tumor_data...
def _prompt_for_values(d): """Update the descriptive metadata interactively. Uses values entered by the user. Note that the function keeps recursing whenever a value is another ``CommentedMap`` or a ``list``. The function works as passing dictionaries and lists into a function edits the values in p...
def function[_prompt_for_values, parameter[d]]: constant[Update the descriptive metadata interactively. Uses values entered by the user. Note that the function keeps recursing whenever a value is another ``CommentedMap`` or a ``list``. The function works as passing dictionaries and lists into a fun...
keyword[def] identifier[_prompt_for_values] ( identifier[d] ): literal[string] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[d] . identifier[items] (): keyword[if] identifier[isinstance] ( identifier[value] , identifier[CommentedMap] ): identifier[_prompt...
def _prompt_for_values(d): """Update the descriptive metadata interactively. Uses values entered by the user. Note that the function keeps recursing whenever a value is another ``CommentedMap`` or a ``list``. The function works as passing dictionaries and lists into a function edits the values in p...
def html(self) -> str: """Return string representation of this. Used in start tag of HTML representation of the Element node. """ if self._owner and self.name in self._owner._special_attr_boolean: return self.name else: value = self.value if i...
def function[html, parameter[self]]: constant[Return string representation of this. Used in start tag of HTML representation of the Element node. ] if <ast.BoolOp object at 0x7da20c7cac50> begin[:] return[name[self].name]
keyword[def] identifier[html] ( identifier[self] )-> identifier[str] : literal[string] keyword[if] identifier[self] . identifier[_owner] keyword[and] identifier[self] . identifier[name] keyword[in] identifier[self] . identifier[_owner] . identifier[_special_attr_boolean] : keyword...
def html(self) -> str: """Return string representation of this. Used in start tag of HTML representation of the Element node. """ if self._owner and self.name in self._owner._special_attr_boolean: return self.name # depends on [control=['if'], data=[]] else: value = self.va...
def _get_win_folder_from_registry(csidl_name): """ This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. """ import _winreg shell_folder_name = { "CSIDL_APPDATA": "AppData", "CSIDL_COMMON_APP...
def function[_get_win_folder_from_registry, parameter[csidl_name]]: constant[ This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. ] import module[_winreg] variable[shell_folder_name] assign[=] call[...
keyword[def] identifier[_get_win_folder_from_registry] ( identifier[csidl_name] ): literal[string] keyword[import] identifier[_winreg] identifier[shell_folder_name] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , }[ i...
def _get_win_folder_from_registry(csidl_name): """ This is a fallback technique at best. I'm not sure if using the registry for this guarantees us the correct answer for all CSIDL_* names. """ import _winreg shell_folder_name = {'CSIDL_APPDATA': 'AppData', 'CSIDL_COMMON_APPDATA': 'Common App...
def get_mcc(self, ip): ''' Get mcc ''' rec = self.get_all(ip) return rec and rec.mcc
def function[get_mcc, parameter[self, ip]]: constant[ Get mcc ] variable[rec] assign[=] call[name[self].get_all, parameter[name[ip]]] return[<ast.BoolOp object at 0x7da1b0d206d0>]
keyword[def] identifier[get_mcc] ( identifier[self] , identifier[ip] ): literal[string] identifier[rec] = identifier[self] . identifier[get_all] ( identifier[ip] ) keyword[return] identifier[rec] keyword[and] identifier[rec] . identifier[mcc]
def get_mcc(self, ip): """ Get mcc """ rec = self.get_all(ip) return rec and rec.mcc
def toml(uncertainty): """ Converts an uncertainty node into a TOML string """ text = uncertainty.text.strip() if not text.startswith('['): # a bare GSIM name was passed text = '[%s]' % text for k, v in uncertainty.attrib.items(): try: v = ast.literal_eval(v) ...
def function[toml, parameter[uncertainty]]: constant[ Converts an uncertainty node into a TOML string ] variable[text] assign[=] call[name[uncertainty].text.strip, parameter[]] if <ast.UnaryOp object at 0x7da204962a70> begin[:] variable[text] assign[=] binary_operation[co...
keyword[def] identifier[toml] ( identifier[uncertainty] ): literal[string] identifier[text] = identifier[uncertainty] . identifier[text] . identifier[strip] () keyword[if] keyword[not] identifier[text] . identifier[startswith] ( literal[string] ): identifier[text] = literal[string] % identi...
def toml(uncertainty): """ Converts an uncertainty node into a TOML string """ text = uncertainty.text.strip() if not text.startswith('['): # a bare GSIM name was passed text = '[%s]' % text # depends on [control=['if'], data=[]] for (k, v) in uncertainty.attrib.items(): try: ...