code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def save(self, *args): """ Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function. """ with open(self.file_root + '.pkl', "wb") as f: ...
def function[save, parameter[self]]: constant[ Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function. ] with call[name[open], paramet...
keyword[def] identifier[save] ( identifier[self] ,* identifier[args] ): literal[string] keyword[with] identifier[open] ( identifier[self] . identifier[file_root] + literal[string] , literal[string] ) keyword[as] identifier[f] : identifier[pickle] . identifier[dump] ( identifier[args]...
def save(self, *args): """ Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function. """ with open(self.file_root + '.pkl', 'wb') as f: ...
def distribute_covar_matrix_to_match_covariance_type( tied_cv, covariance_type, n_components): """Create all the covariance matrices from a given template.""" if covariance_type == 'spherical': cv = np.tile(tied_cv.mean() * np.ones(tied_cv.shape[1]), (n_components, 1)) e...
def function[distribute_covar_matrix_to_match_covariance_type, parameter[tied_cv, covariance_type, n_components]]: constant[Create all the covariance matrices from a given template.] if compare[name[covariance_type] equal[==] constant[spherical]] begin[:] variable[cv] assign[=] call[name...
keyword[def] identifier[distribute_covar_matrix_to_match_covariance_type] ( identifier[tied_cv] , identifier[covariance_type] , identifier[n_components] ): literal[string] keyword[if] identifier[covariance_type] == literal[string] : identifier[cv] = identifier[np] . identifier[tile] ( identifier...
def distribute_covar_matrix_to_match_covariance_type(tied_cv, covariance_type, n_components): """Create all the covariance matrices from a given template.""" if covariance_type == 'spherical': cv = np.tile(tied_cv.mean() * np.ones(tied_cv.shape[1]), (n_components, 1)) # depends on [control=['if'], data...
def _get_rows(self, table): """Returns rows from table""" childnodes = table.childNodes qname_childnodes = [(s.qname[1], s) for s in childnodes] return [node for name, node in qname_childnodes if name == u'table-row']
def function[_get_rows, parameter[self, table]]: constant[Returns rows from table] variable[childnodes] assign[=] name[table].childNodes variable[qname_childnodes] assign[=] <ast.ListComp object at 0x7da1b26adb70> return[<ast.ListComp object at 0x7da1b26ae6e0>]
keyword[def] identifier[_get_rows] ( identifier[self] , identifier[table] ): literal[string] identifier[childnodes] = identifier[table] . identifier[childNodes] identifier[qname_childnodes] =[( identifier[s] . identifier[qname] [ literal[int] ], identifier[s] ) keyword[for] identifier[s...
def _get_rows(self, table): """Returns rows from table""" childnodes = table.childNodes qname_childnodes = [(s.qname[1], s) for s in childnodes] return [node for (name, node) in qname_childnodes if name == u'table-row']
def get_exchange_group_info(self, symprec=1e-2, angle_tolerance=5.0): """ Returns the information on the symmetry of the Hamiltonian describing the exchange energy of the system, taking into account relative direction of magnetic moments but not their absolute direction. ...
def function[get_exchange_group_info, parameter[self, symprec, angle_tolerance]]: constant[ Returns the information on the symmetry of the Hamiltonian describing the exchange energy of the system, taking into account relative direction of magnetic moments but not their absolute d...
keyword[def] identifier[get_exchange_group_info] ( identifier[self] , identifier[symprec] = literal[int] , identifier[angle_tolerance] = literal[int] ): literal[string] identifier[structure] = identifier[self] . identifier[get_structure_with_spin] () keyword[return] identifier[structure...
def get_exchange_group_info(self, symprec=0.01, angle_tolerance=5.0): """ Returns the information on the symmetry of the Hamiltonian describing the exchange energy of the system, taking into account relative direction of magnetic moments but not their absolute direction. Thi...
def get_volumes_for_instance(self, arg, device=None): """ Return all EC2 Volume objects attached to ``arg`` instance name or ID. May specify ``device`` to limit to the (single) volume attached as that device. """ instance = self.get(arg) filters = {'attachment.in...
def function[get_volumes_for_instance, parameter[self, arg, device]]: constant[ Return all EC2 Volume objects attached to ``arg`` instance name or ID. May specify ``device`` to limit to the (single) volume attached as that device. ] variable[instance] assign[=] call[name...
keyword[def] identifier[get_volumes_for_instance] ( identifier[self] , identifier[arg] , identifier[device] = keyword[None] ): literal[string] identifier[instance] = identifier[self] . identifier[get] ( identifier[arg] ) identifier[filters] ={ literal[string] : identifier[instance] . ident...
def get_volumes_for_instance(self, arg, device=None): """ Return all EC2 Volume objects attached to ``arg`` instance name or ID. May specify ``device`` to limit to the (single) volume attached as that device. """ instance = self.get(arg) filters = {'attachment.instance-id': ...
def run_mutation_aggregator(job, mutation_results, univ_options): """ Aggregate all the called mutations. :param dict mutation_results: Dict of dicts of the various mutation callers in a per chromosome format :param dict univ_options: Dict of universal options used by almost all tools :r...
def function[run_mutation_aggregator, parameter[job, mutation_results, univ_options]]: constant[ Aggregate all the called mutations. :param dict mutation_results: Dict of dicts of the various mutation callers in a per chromosome format :param dict univ_options: Dict of universal options ...
keyword[def] identifier[run_mutation_aggregator] ( identifier[job] , identifier[mutation_results] , identifier[univ_options] ): literal[string] identifier[out] ={} keyword[for] identifier[chrom] keyword[in] identifier[mutation_results] [ literal[string] ]. identifier[keys] (): identif...
def run_mutation_aggregator(job, mutation_results, univ_options): """ Aggregate all the called mutations. :param dict mutation_results: Dict of dicts of the various mutation callers in a per chromosome format :param dict univ_options: Dict of universal options used by almost all tools :r...
def dict_match(self, match_dict): ''' Accept a dictionary of keys and return the current state of the specified keys ''' ret = {} cur_keys = self.list_keys() for status, keys in six.iteritems(match_dict): for key in salt.utils.data.sorted_ignorecase(ke...
def function[dict_match, parameter[self, match_dict]]: constant[ Accept a dictionary of keys and return the current state of the specified keys ] variable[ret] assign[=] dictionary[[], []] variable[cur_keys] assign[=] call[name[self].list_keys, parameter[]] for ta...
keyword[def] identifier[dict_match] ( identifier[self] , identifier[match_dict] ): literal[string] identifier[ret] ={} identifier[cur_keys] = identifier[self] . identifier[list_keys] () keyword[for] identifier[status] , identifier[keys] keyword[in] identifier[six] . identifier[...
def dict_match(self, match_dict): """ Accept a dictionary of keys and return the current state of the specified keys """ ret = {} cur_keys = self.list_keys() for (status, keys) in six.iteritems(match_dict): for key in salt.utils.data.sorted_ignorecase(keys): f...
def sample(self): """ This is the core sampling method. Samples a state from a demonstration, in accordance with the configuration. """ # chooses a sampling scheme randomly based on the mixing ratios seed = random.uniform(0, 1) ratio = np.cumsum(self.scheme_ratio...
def function[sample, parameter[self]]: constant[ This is the core sampling method. Samples a state from a demonstration, in accordance with the configuration. ] variable[seed] assign[=] call[name[random].uniform, parameter[constant[0], constant[1]]] variable[ratio] assign...
keyword[def] identifier[sample] ( identifier[self] ): literal[string] identifier[seed] = identifier[random] . identifier[uniform] ( literal[int] , literal[int] ) identifier[ratio] = identifier[np] . identifier[cumsum] ( identifier[self] . identifier[scheme_ratios] ) iden...
def sample(self): """ This is the core sampling method. Samples a state from a demonstration, in accordance with the configuration. """ # chooses a sampling scheme randomly based on the mixing ratios seed = random.uniform(0, 1) ratio = np.cumsum(self.scheme_ratios) ratio = ra...
def _mnl_utility_transform(systematic_utilities, *args, **kwargs): """ Parameters ---------- systematic_utilities : 1D ndarray. Should contain the systematic utilities for each each available alternative for each observation. Returns ------- `systematic_utilities[:, None]` ...
def function[_mnl_utility_transform, parameter[systematic_utilities]]: constant[ Parameters ---------- systematic_utilities : 1D ndarray. Should contain the systematic utilities for each each available alternative for each observation. Returns ------- `systematic_utiliti...
keyword[def] identifier[_mnl_utility_transform] ( identifier[systematic_utilities] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[len] ( identifier[systematic_utilities] . identifier[shape] )== literal[int] : identifier[systematic_utilities] = identifier...
def _mnl_utility_transform(systematic_utilities, *args, **kwargs): """ Parameters ---------- systematic_utilities : 1D ndarray. Should contain the systematic utilities for each each available alternative for each observation. Returns ------- `systematic_utilities[:, None]` ...
def from_string(string): """ Reads an Incar object from a string. Args: string (str): Incar string Returns: Incar object """ lines = list(clean_lines(string.splitlines())) params = {} for line in lines: for sline in li...
def function[from_string, parameter[string]]: constant[ Reads an Incar object from a string. Args: string (str): Incar string Returns: Incar object ] variable[lines] assign[=] call[name[list], parameter[call[name[clean_lines], parameter[call[name...
keyword[def] identifier[from_string] ( identifier[string] ): literal[string] identifier[lines] = identifier[list] ( identifier[clean_lines] ( identifier[string] . identifier[splitlines] ())) identifier[params] ={} keyword[for] identifier[line] keyword[in] identifier[lines] : ...
def from_string(string): """ Reads an Incar object from a string. Args: string (str): Incar string Returns: Incar object """ lines = list(clean_lines(string.splitlines())) params = {} for line in lines: for sline in line.split(';'): ...
def memory_allocation(library, session, size, extended=False): """Allocates memory from a resource's memory region. Corresponds to viMemAlloc* functions of the VISA library. :param library: the visa library wrapped by ctypes. :param session: Unique logical identifier to a session. :param size: Spe...
def function[memory_allocation, parameter[library, session, size, extended]]: constant[Allocates memory from a resource's memory region. Corresponds to viMemAlloc* functions of the VISA library. :param library: the visa library wrapped by ctypes. :param session: Unique logical identifier to a sess...
keyword[def] identifier[memory_allocation] ( identifier[library] , identifier[session] , identifier[size] , identifier[extended] = keyword[False] ): literal[string] identifier[offset] = identifier[ViBusAddress] () keyword[if] identifier[extended] : identifier[ret] = identifier[library] . ide...
def memory_allocation(library, session, size, extended=False): """Allocates memory from a resource's memory region. Corresponds to viMemAlloc* functions of the VISA library. :param library: the visa library wrapped by ctypes. :param session: Unique logical identifier to a session. :param size: Spe...
def get_oceania_temp_and_alt(wxlist: [str]) -> ([str], [str], [str]): # type: ignore """ Get Temperature and Altimeter lists for Oceania TAFs """ tlist, qlist = [], [] # type: ignore if 'T' in wxlist: wxlist, tlist = _get_digit_list(wxlist, wxlist.index('T')) if 'Q' in wxlist: ...
def function[get_oceania_temp_and_alt, parameter[wxlist]]: constant[ Get Temperature and Altimeter lists for Oceania TAFs ] <ast.Tuple object at 0x7da20c7c8d00> assign[=] tuple[[<ast.List object at 0x7da20c7c8040>, <ast.List object at 0x7da20c7c94e0>]] if compare[constant[T] in name[wxli...
keyword[def] identifier[get_oceania_temp_and_alt] ( identifier[wxlist] :[ identifier[str] ])->([ identifier[str] ],[ identifier[str] ],[ identifier[str] ]): literal[string] identifier[tlist] , identifier[qlist] =[],[] keyword[if] literal[string] keyword[in] identifier[wxlist] : identifier[...
def get_oceania_temp_and_alt(wxlist: [str]) -> ([str], [str], [str]): # type: ignore '\n Get Temperature and Altimeter lists for Oceania TAFs\n ' (tlist, qlist) = ([], []) # type: ignore if 'T' in wxlist: (wxlist, tlist) = _get_digit_list(wxlist, wxlist.index('T')) # depends on [control=['i...
def synchronizeLayout(primary, secondary, surface_size): """Synchronizes given layouts by normalizing height by using max height of given layouts to avoid transistion dirty effects. :param primary: Primary layout used. :param secondary: Secondary layout used. :param surface_size: Target surface siz...
def function[synchronizeLayout, parameter[primary, secondary, surface_size]]: constant[Synchronizes given layouts by normalizing height by using max height of given layouts to avoid transistion dirty effects. :param primary: Primary layout used. :param secondary: Secondary layout used. :param s...
keyword[def] identifier[synchronizeLayout] ( identifier[primary] , identifier[secondary] , identifier[surface_size] ): literal[string] identifier[primary] . identifier[configure_bound] ( identifier[surface_size] ) identifier[secondary] . identifier[configure_bound] ( identifier[surface_size] ) ...
def synchronizeLayout(primary, secondary, surface_size): """Synchronizes given layouts by normalizing height by using max height of given layouts to avoid transistion dirty effects. :param primary: Primary layout used. :param secondary: Secondary layout used. :param surface_size: Target surface siz...
def error_keys_not_found(self, keys): """ Check if the requested keys are found in the dict. :param keys: keys to be looked for """ try: log.error("Filename: {0}".format(self['meta']['location'])) except: log.error("Filename: {0}".format(self['loc...
def function[error_keys_not_found, parameter[self, keys]]: constant[ Check if the requested keys are found in the dict. :param keys: keys to be looked for ] <ast.Try object at 0x7da20cabda80> call[name[log].error, parameter[call[constant[Key '{0}' does not exist].format, par...
keyword[def] identifier[error_keys_not_found] ( identifier[self] , identifier[keys] ): literal[string] keyword[try] : identifier[log] . identifier[error] ( literal[string] . identifier[format] ( identifier[self] [ literal[string] ][ literal[string] ])) keyword[except] : ...
def error_keys_not_found(self, keys): """ Check if the requested keys are found in the dict. :param keys: keys to be looked for """ try: log.error('Filename: {0}'.format(self['meta']['location'])) # depends on [control=['try'], data=[]] except: log.error('Filename: ...
def check_auto_merge_labeler(repo: GithubRepository, pull_id: int ) -> Optional[CannotAutomergeError]: """ References: https://developer.github.com/v3/issues/events/#list-events-for-an-issue """ url = ("https://api.github.com/repos/{}/{}/issues/{}/events" ...
def function[check_auto_merge_labeler, parameter[repo, pull_id]]: constant[ References: https://developer.github.com/v3/issues/events/#list-events-for-an-issue ] variable[url] assign[=] call[constant[https://api.github.com/repos/{}/{}/issues/{}/events?access_token={}].format, parameter[n...
keyword[def] identifier[check_auto_merge_labeler] ( identifier[repo] : identifier[GithubRepository] , identifier[pull_id] : identifier[int] )-> identifier[Optional] [ identifier[CannotAutomergeError] ]: literal[string] identifier[url] =( literal[string] literal[string] . identifier[format] ( identif...
def check_auto_merge_labeler(repo: GithubRepository, pull_id: int) -> Optional[CannotAutomergeError]: """ References: https://developer.github.com/v3/issues/events/#list-events-for-an-issue """ url = 'https://api.github.com/repos/{}/{}/issues/{}/events?access_token={}'.format(repo.organization, ...
def load_module_from_file_object(fp, filename='<unknown>', code_objects=None, fast_load=False, get_code=True): """load a module from a file object without importing it. See :func:load_module for a list of return values. """ if code_objects is None: code_objects = {} timest...
def function[load_module_from_file_object, parameter[fp, filename, code_objects, fast_load, get_code]]: constant[load a module from a file object without importing it. See :func:load_module for a list of return values. ] if compare[name[code_objects] is constant[None]] begin[:] ...
keyword[def] identifier[load_module_from_file_object] ( identifier[fp] , identifier[filename] = literal[string] , identifier[code_objects] = keyword[None] , identifier[fast_load] = keyword[False] , identifier[get_code] = keyword[True] ): literal[string] keyword[if] identifier[code_objects] keyword[is] ...
def load_module_from_file_object(fp, filename='<unknown>', code_objects=None, fast_load=False, get_code=True): """load a module from a file object without importing it. See :func:load_module for a list of return values. """ if code_objects is None: code_objects = {} # depends on [control=['if'...
def to_json(el, schema=None): """Convert an element to VDOM JSON If you wish to validate the JSON, pass in a schema via the schema keyword argument. If a schema is provided, this raises a ValidationError if JSON does not match the schema. """ if type(el) is str: json_el = el elif ty...
def function[to_json, parameter[el, schema]]: constant[Convert an element to VDOM JSON If you wish to validate the JSON, pass in a schema via the schema keyword argument. If a schema is provided, this raises a ValidationError if JSON does not match the schema. ] if compare[call[name[typ...
keyword[def] identifier[to_json] ( identifier[el] , identifier[schema] = keyword[None] ): literal[string] keyword[if] identifier[type] ( identifier[el] ) keyword[is] identifier[str] : identifier[json_el] = identifier[el] keyword[elif] identifier[type] ( identifier[el] ) keyword[is] ident...
def to_json(el, schema=None): """Convert an element to VDOM JSON If you wish to validate the JSON, pass in a schema via the schema keyword argument. If a schema is provided, this raises a ValidationError if JSON does not match the schema. """ if type(el) is str: json_el = el # depends ...
def _make_authorization_header(region, service, canonical_request, credentials, instant): """ Construct an AWS version 4 authorization value for use in an C{Authorization} header. ...
def function[_make_authorization_header, parameter[region, service, canonical_request, credentials, instant]]: constant[ Construct an AWS version 4 authorization value for use in an C{Authorization} header. @param region: The AWS region name (e.g., C{'us-east-1'}). @type region: L{str} @pa...
keyword[def] identifier[_make_authorization_header] ( identifier[region] , identifier[service] , identifier[canonical_request] , identifier[credentials] , identifier[instant] ): literal[string] identifier[date_stamp] = identifier[makeDateStamp] ( identifier[instant] ) identifier[amz_date] = identi...
def _make_authorization_header(region, service, canonical_request, credentials, instant): """ Construct an AWS version 4 authorization value for use in an C{Authorization} header. @param region: The AWS region name (e.g., C{'us-east-1'}). @type region: L{str} @param service: The AWS service's ...
def novo2(args): """ %prog novo2 trimmed projectname Reference-free tGBS pipeline v2. """ p = OptionParser(novo2.__doc__) p.set_fastq_names() p.set_align(pctid=95) opts, args = p.parse_args(args) if len(args) != 2: sys.exit(not p.print_help()) trimmed, pf = args pc...
def function[novo2, parameter[args]]: constant[ %prog novo2 trimmed projectname Reference-free tGBS pipeline v2. ] variable[p] assign[=] call[name[OptionParser], parameter[name[novo2].__doc__]] call[name[p].set_fastq_names, parameter[]] call[name[p].set_align, parameter[]] ...
keyword[def] identifier[novo2] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[novo2] . identifier[__doc__] ) identifier[p] . identifier[set_fastq_names] () identifier[p] . identifier[set_align] ( identifier[pctid] = literal[int] ) identifier[opts]...
def novo2(args): """ %prog novo2 trimmed projectname Reference-free tGBS pipeline v2. """ p = OptionParser(novo2.__doc__) p.set_fastq_names() p.set_align(pctid=95) (opts, args) = p.parse_args(args) if len(args) != 2: sys.exit(not p.print_help()) # depends on [control=['if']...
def grep_file(query, item): """This function performs the actual grep on a given file.""" return ['%s: %s' % (item, line) for line in open(item) if re.search(query, line)]
def function[grep_file, parameter[query, item]]: constant[This function performs the actual grep on a given file.] return[<ast.ListComp object at 0x7da1b18039a0>]
keyword[def] identifier[grep_file] ( identifier[query] , identifier[item] ): literal[string] keyword[return] [ literal[string] %( identifier[item] , identifier[line] ) keyword[for] identifier[line] keyword[in] identifier[open] ( identifier[item] ) keyword[if] identifier[re] . identifier[search] ( ...
def grep_file(query, item): """This function performs the actual grep on a given file.""" return ['%s: %s' % (item, line) for line in open(item) if re.search(query, line)]
def recv(self, maxsize=None): ''' Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If any of those is ``None`` we can no longer communicate with the terminal's child process. ''' if maxsize is None: maxsize = 1024 elif maxsize < 1: ...
def function[recv, parameter[self, maxsize]]: constant[ Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If any of those is ``None`` we can no longer communicate with the terminal's child process. ] if compare[name[maxsize] is constant[None]] begin[:] ...
keyword[def] identifier[recv] ( identifier[self] , identifier[maxsize] = keyword[None] ): literal[string] keyword[if] identifier[maxsize] keyword[is] keyword[None] : identifier[maxsize] = literal[int] keyword[elif] identifier[maxsize] < literal[int] : identif...
def recv(self, maxsize=None): """ Receive data from the terminal as a (``stdout``, ``stderr``) tuple. If any of those is ``None`` we can no longer communicate with the terminal's child process. """ if maxsize is None: maxsize = 1024 # depends on [control=['if'], data=['m...
def walk_files_relative_path(self, relativePath=""): """ Walk the repository and yield all found files relative path joined with file name. :parameters: #. relativePath (str): The relative path from which start the walk. """ def walk_files(directory, relativePath): ...
def function[walk_files_relative_path, parameter[self, relativePath]]: constant[ Walk the repository and yield all found files relative path joined with file name. :parameters: #. relativePath (str): The relative path from which start the walk. ] def function[walk_fi...
keyword[def] identifier[walk_files_relative_path] ( identifier[self] , identifier[relativePath] = literal[string] ): literal[string] keyword[def] identifier[walk_files] ( identifier[directory] , identifier[relativePath] ): identifier[directories] = identifier[dict] . identifier[__geti...
def walk_files_relative_path(self, relativePath=''): """ Walk the repository and yield all found files relative path joined with file name. :parameters: #. relativePath (str): The relative path from which start the walk. """ def walk_files(directory, relativePath): ...
def create_data_iters_and_vocab(args: argparse.Namespace, max_seq_len_source: int, max_seq_len_target: int, resume_training: bool, output_folder: str) -> Tuple['data_io.BaseParallelSampleIter'...
def function[create_data_iters_and_vocab, parameter[args, max_seq_len_source, max_seq_len_target, resume_training, output_folder]]: constant[ Create the data iterators and the vocabularies. :param args: Arguments as returned by argparse. :param max_seq_len_source: Source maximum sequence length. ...
keyword[def] identifier[create_data_iters_and_vocab] ( identifier[args] : identifier[argparse] . identifier[Namespace] , identifier[max_seq_len_source] : identifier[int] , identifier[max_seq_len_target] : identifier[int] , identifier[resume_training] : identifier[bool] , identifier[output_folder] : identifier[str...
def create_data_iters_and_vocab(args: argparse.Namespace, max_seq_len_source: int, max_seq_len_target: int, resume_training: bool, output_folder: str) -> Tuple['data_io.BaseParallelSampleIter', 'data_io.BaseParallelSampleIter', 'data_io.DataConfig', Dict]: """ Create the data iterators and the vocabularies. ...
def make_column_suffixes(self): """ Make sure we have the right column suffixes. These will be appended to `id` when generating the query. """ if self.column_suffixes: return self.column_suffixes if len(self.columns) == 0: return () elif len(self...
def function[make_column_suffixes, parameter[self]]: constant[ Make sure we have the right column suffixes. These will be appended to `id` when generating the query. ] if name[self].column_suffixes begin[:] return[name[self].column_suffixes] if compare[call[name[len], par...
keyword[def] identifier[make_column_suffixes] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[column_suffixes] : keyword[return] identifier[self] . identifier[column_suffixes] keyword[if] identifier[len] ( identifier[self] . identifier[colu...
def make_column_suffixes(self): """ Make sure we have the right column suffixes. These will be appended to `id` when generating the query. """ if self.column_suffixes: return self.column_suffixes # depends on [control=['if'], data=[]] if len(self.columns) == 0: return () # ...
def updateTargetState(self, newState): """ Updates the system target state and propagates that to all devices. :param newState: :return: """ self._targetStateProvider.state = loadTargetState(newState, self._targetStateProvider.state) for device in self.deviceContr...
def function[updateTargetState, parameter[self, newState]]: constant[ Updates the system target state and propagates that to all devices. :param newState: :return: ] name[self]._targetStateProvider.state assign[=] call[name[loadTargetState], parameter[name[newState], name...
keyword[def] identifier[updateTargetState] ( identifier[self] , identifier[newState] ): literal[string] identifier[self] . identifier[_targetStateProvider] . identifier[state] = identifier[loadTargetState] ( identifier[newState] , identifier[self] . identifier[_targetStateProvider] . identifier[sta...
def updateTargetState(self, newState): """ Updates the system target state and propagates that to all devices. :param newState: :return: """ self._targetStateProvider.state = loadTargetState(newState, self._targetStateProvider.state) for device in self.deviceController.getDev...
def start(self, max): """ Displays the progress bar for a given maximum value. :param float max: Maximum value of the progress bar. """ try: self.widget.max = max display(self.widget) except: pass
def function[start, parameter[self, max]]: constant[ Displays the progress bar for a given maximum value. :param float max: Maximum value of the progress bar. ] <ast.Try object at 0x7da1b0c00490>
keyword[def] identifier[start] ( identifier[self] , identifier[max] ): literal[string] keyword[try] : identifier[self] . identifier[widget] . identifier[max] = identifier[max] identifier[display] ( identifier[self] . identifier[widget] ) keyword[except] : ...
def start(self, max): """ Displays the progress bar for a given maximum value. :param float max: Maximum value of the progress bar. """ try: self.widget.max = max display(self.widget) # depends on [control=['try'], data=[]] except: pass # depends on [contro...
async def pin_chat_message(self, chat_id: typing.Union[base.Integer, base.String], message_id: base.Integer, disable_notification: typing.Union[base.Boolean, None] = None) -> base.Boolean: """ Use this method to pin a message in a supergroup. The bot must be an adm...
<ast.AsyncFunctionDef object at 0x7da1b17aabf0>
keyword[async] keyword[def] identifier[pin_chat_message] ( identifier[self] , identifier[chat_id] : identifier[typing] . identifier[Union] [ identifier[base] . identifier[Integer] , identifier[base] . identifier[String] ], identifier[message_id] : identifier[base] . identifier[Integer] , identifier[disable_notifica...
async def pin_chat_message(self, chat_id: typing.Union[base.Integer, base.String], message_id: base.Integer, disable_notification: typing.Union[base.Boolean, None]=None) -> base.Boolean: """ Use this method to pin a message in a supergroup. The bot must be an administrator in the chat for this to wo...
def _determine_nTrackIterations(self,nTrackIterations): """Determine a good value for nTrackIterations based on the misalignment between stream and orbit; just based on some rough experience for now""" if not nTrackIterations is None: self.nTrackIterations= nTrackIterations retur...
def function[_determine_nTrackIterations, parameter[self, nTrackIterations]]: constant[Determine a good value for nTrackIterations based on the misalignment between stream and orbit; just based on some rough experience for now] if <ast.UnaryOp object at 0x7da1b0da2e90> begin[:] name[self...
keyword[def] identifier[_determine_nTrackIterations] ( identifier[self] , identifier[nTrackIterations] ): literal[string] keyword[if] keyword[not] identifier[nTrackIterations] keyword[is] keyword[None] : identifier[self] . identifier[nTrackIterations] = identifier[nTrackIterations]...
def _determine_nTrackIterations(self, nTrackIterations): """Determine a good value for nTrackIterations based on the misalignment between stream and orbit; just based on some rough experience for now""" if not nTrackIterations is None: self.nTrackIterations = nTrackIterations return None # depe...
def refresh(func): """ Decorator that can be applied to model method that forces a refresh of the model. Note this decorator ensures the state of the model is what is currently within the database and therefore overwrites any current field changes. For example, assume we have the following...
def function[refresh, parameter[func]]: constant[ Decorator that can be applied to model method that forces a refresh of the model. Note this decorator ensures the state of the model is what is currently within the database and therefore overwrites any current field changes. For exampl...
keyword[def] identifier[refresh] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[inner] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): identifier[new_self] = identifier[self] . identifier[__class__] . identifier[_b...
def refresh(func): """ Decorator that can be applied to model method that forces a refresh of the model. Note this decorator ensures the state of the model is what is currently within the database and therefore overwrites any current field changes. For example, assume we have the following...
def list_resource_commands(self): """Returns a list of multi-commands for each resource type. """ resource_path = os.path.abspath(os.path.join( os.path.dirname(__file__), os.pardir, 'resources' )) answer = set([]) for _, name, _ in pkgu...
def function[list_resource_commands, parameter[self]]: constant[Returns a list of multi-commands for each resource type. ] variable[resource_path] assign[=] call[name[os].path.abspath, parameter[call[name[os].path.join, parameter[call[name[os].path.dirname, parameter[name[__file__]]], name[os].p...
keyword[def] identifier[list_resource_commands] ( identifier[self] ): literal[string] identifier[resource_path] = identifier[os] . identifier[path] . identifier[abspath] ( identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[dirname] ( ident...
def list_resource_commands(self): """Returns a list of multi-commands for each resource type. """ resource_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'resources')) answer = set([]) for (_, name, _) in pkgutil.iter_modules([resource_path]): res = tower_cli.g...
def send_im(self, user, text): """ Sends a message to a user as an IM * user - The user to send to. This can be a SlackUser object, a user id, or the username (without the @) * text - String to send """ if isinstance(user, SlackUser): user = user.id ...
def function[send_im, parameter[self, user, text]]: constant[ Sends a message to a user as an IM * user - The user to send to. This can be a SlackUser object, a user id, or the username (without the @) * text - String to send ] if call[name[isinstance], parameter[name[u...
keyword[def] identifier[send_im] ( identifier[self] , identifier[user] , identifier[text] ): literal[string] keyword[if] identifier[isinstance] ( identifier[user] , identifier[SlackUser] ): identifier[user] = identifier[user] . identifier[id] identifier[channelid] = iden...
def send_im(self, user, text): """ Sends a message to a user as an IM * user - The user to send to. This can be a SlackUser object, a user id, or the username (without the @) * text - String to send """ if isinstance(user, SlackUser): user = user.id channelid = ...
def send(self, tid, out_sid, company_code, session, sender_id=None, cancel_id=None, feature=None): '''taobao.logistics.offline.send 自己联系物流(线下物流)发货 用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。''' request = TOPRequest('taobao.logistics.offline.send') request[...
def function[send, parameter[self, tid, out_sid, company_code, session, sender_id, cancel_id, feature]]: constant[taobao.logistics.offline.send 自己联系物流(线下物流)发货 用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。] variable[request] assign[=] call[name[TOPRequest], parameter...
keyword[def] identifier[send] ( identifier[self] , identifier[tid] , identifier[out_sid] , identifier[company_code] , identifier[session] , identifier[sender_id] = keyword[None] , identifier[cancel_id] = keyword[None] , identifier[feature] = keyword[None] ): literal[string] identifier[request] = id...
def send(self, tid, out_sid, company_code, session, sender_id=None, cancel_id=None, feature=None): """taobao.logistics.offline.send 自己联系物流(线下物流)发货 用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。""" request = TOPRequest('taobao.logistics.offline.send') request['tid'] = tid...
def calc_radius(latitude, ellipsoid='WGS84'): """Calculate earth radius for a given latitude. This function is most useful when dealing with datasets that are very localised and require the accuracy of an ellipsoid model without the complexity of code necessary to actually use one. The results are mea...
def function[calc_radius, parameter[latitude, ellipsoid]]: constant[Calculate earth radius for a given latitude. This function is most useful when dealing with datasets that are very localised and require the accuracy of an ellipsoid model without the complexity of code necessary to actually use on...
keyword[def] identifier[calc_radius] ( identifier[latitude] , identifier[ellipsoid] = literal[string] ): literal[string] identifier[ellipsoids] ={ literal[string] :( literal[int] , literal[int] ), literal[string] :( literal[int] , literal[int] ), literal[string] :( literal[int] , literal[int...
def calc_radius(latitude, ellipsoid='WGS84'): """Calculate earth radius for a given latitude. This function is most useful when dealing with datasets that are very localised and require the accuracy of an ellipsoid model without the complexity of code necessary to actually use one. The results are mea...
def render_toolbar(context, config): """Render the toolbar for the given config.""" quill_config = getattr(quill_app, config) t = template.loader.get_template(quill_config['toolbar_template']) return t.render(context)
def function[render_toolbar, parameter[context, config]]: constant[Render the toolbar for the given config.] variable[quill_config] assign[=] call[name[getattr], parameter[name[quill_app], name[config]]] variable[t] assign[=] call[name[template].loader.get_template, parameter[call[name[quill_con...
keyword[def] identifier[render_toolbar] ( identifier[context] , identifier[config] ): literal[string] identifier[quill_config] = identifier[getattr] ( identifier[quill_app] , identifier[config] ) identifier[t] = identifier[template] . identifier[loader] . identifier[get_template] ( identifier[quill_co...
def render_toolbar(context, config): """Render the toolbar for the given config.""" quill_config = getattr(quill_app, config) t = template.loader.get_template(quill_config['toolbar_template']) return t.render(context)
def verify(self, obj): """Verify that the object conforms to this verifier's schema Args: obj (object): A python object to verify Returns: bytes or byterray: The decoded byte buffer Raises: ValidationError: If there is a problem verifying the object...
def function[verify, parameter[self, obj]]: constant[Verify that the object conforms to this verifier's schema Args: obj (object): A python object to verify Returns: bytes or byterray: The decoded byte buffer Raises: ValidationError: If there is a p...
keyword[def] identifier[verify] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] identifier[self] . identifier[encoding] == literal[string] keyword[and] keyword[not] identifier[isinstance] ( identifier[obj] ,( identifier[bytes] , identifier[bytearray] )): keywor...
def verify(self, obj): """Verify that the object conforms to this verifier's schema Args: obj (object): A python object to verify Returns: bytes or byterray: The decoded byte buffer Raises: ValidationError: If there is a problem verifying the object, a ...
def number_to_day(self, day_number): """Returns localized day name by its CRON number Args: day_number: Number of a day Returns: Day corresponding to day_number Raises: IndexError: When day_number is not found """ return [ ...
def function[number_to_day, parameter[self, day_number]]: constant[Returns localized day name by its CRON number Args: day_number: Number of a day Returns: Day corresponding to day_number Raises: IndexError: When day_number is not found ] ...
keyword[def] identifier[number_to_day] ( identifier[self] , identifier[day_number] ): literal[string] keyword[return] [ identifier[calendar] . identifier[day_name] [ literal[int] ], identifier[calendar] . identifier[day_name] [ literal[int] ], identifier[calendar] . ident...
def number_to_day(self, day_number): """Returns localized day name by its CRON number Args: day_number: Number of a day Returns: Day corresponding to day_number Raises: IndexError: When day_number is not found """ return [calendar.day_name[6],...
def loadJSON(self, jdata): """ Loads JSON data for this column type. :param jdata: <dict> """ super(StringColumn, self).loadJSON(jdata) # load additional info self.__maxLength = jdata.get('maxLength') or self.__maxLength
def function[loadJSON, parameter[self, jdata]]: constant[ Loads JSON data for this column type. :param jdata: <dict> ] call[call[name[super], parameter[name[StringColumn], name[self]]].loadJSON, parameter[name[jdata]]] name[self].__maxLength assign[=] <ast.BoolOp object ...
keyword[def] identifier[loadJSON] ( identifier[self] , identifier[jdata] ): literal[string] identifier[super] ( identifier[StringColumn] , identifier[self] ). identifier[loadJSON] ( identifier[jdata] ) identifier[self] . identifier[__maxLength] = identifier[jdata] . identifier[ge...
def loadJSON(self, jdata): """ Loads JSON data for this column type. :param jdata: <dict> """ super(StringColumn, self).loadJSON(jdata) # load additional info self.__maxLength = jdata.get('maxLength') or self.__maxLength
def index(self, date): """ Returns the index of a date in the table. """ for (i, (start, end, ruler)) in enumerate(self.table): if start <= date.jd <= end: return i return None
def function[index, parameter[self, date]]: constant[ Returns the index of a date in the table. ] for taget[tuple[[<ast.Name object at 0x7da1b2346f20>, <ast.Tuple object at 0x7da1b2345090>]]] in starred[call[name[enumerate], parameter[name[self].table]]] begin[:] if compare[name[start] l...
keyword[def] identifier[index] ( identifier[self] , identifier[date] ): literal[string] keyword[for] ( identifier[i] ,( identifier[start] , identifier[end] , identifier[ruler] )) keyword[in] identifier[enumerate] ( identifier[self] . identifier[table] ): keyword[if] identifier[start]...
def index(self, date): """ Returns the index of a date in the table. """ for (i, (start, end, ruler)) in enumerate(self.table): if start <= date.jd <= end: return i # depends on [control=['if'], data=[]] # depends on [control=['for'], data=[]] return None
def to_netflux(flux): r"""Compute the netflux from the gross flux. f_ij^{+}=max{0, f_ij-f_ji} for all pairs i,j Parameters ---------- flux : (M, M) ndarray Matrix of flux values between pairs of states. Returns ------- netflux : (M, M) ndarray Matrix of net...
def function[to_netflux, parameter[flux]]: constant[Compute the netflux from the gross flux. f_ij^{+}=max{0, f_ij-f_ji} for all pairs i,j Parameters ---------- flux : (M, M) ndarray Matrix of flux values between pairs of states. Returns ------- netflux : (M, M)...
keyword[def] identifier[to_netflux] ( identifier[flux] ): literal[string] identifier[netflux] = identifier[flux] - identifier[np] . identifier[transpose] ( identifier[flux] ) literal[string] identifier[ind] =( identifier[netflux] < literal[int] ) identifier[netflux] [ identifier[ind] ]= lit...
def to_netflux(flux): """Compute the netflux from the gross flux. f_ij^{+}=max{0, f_ij-f_ji} for all pairs i,j Parameters ---------- flux : (M, M) ndarray Matrix of flux values between pairs of states. Returns ------- netflux : (M, M) ndarray Matrix of netf...
def remove_from_model(self, remove_orphans=False): """Removes the reaction from a model. This removes all associations between a reaction the associated model, metabolites and genes. The change is reverted upon exit when using the model as a context. Parameters -------...
def function[remove_from_model, parameter[self, remove_orphans]]: constant[Removes the reaction from a model. This removes all associations between a reaction the associated model, metabolites and genes. The change is reverted upon exit when using the model as a context. Param...
keyword[def] identifier[remove_from_model] ( identifier[self] , identifier[remove_orphans] = keyword[False] ): literal[string] identifier[self] . identifier[_model] . identifier[remove_reactions] ([ identifier[self] ], identifier[remove_orphans] = identifier[remove_orphans] )
def remove_from_model(self, remove_orphans=False): """Removes the reaction from a model. This removes all associations between a reaction the associated model, metabolites and genes. The change is reverted upon exit when using the model as a context. Parameters ---------- ...
def proximal_step(self, gradf=None): """Compute proximal update (gradient descent + constraint). Variables are mapped back and forth between input and frequency domains. """ if gradf is None: gradf = self.eval_grad() self.Vf[:] = self.Yf - (1. / self.L) * gr...
def function[proximal_step, parameter[self, gradf]]: constant[Compute proximal update (gradient descent + constraint). Variables are mapped back and forth between input and frequency domains. ] if compare[name[gradf] is constant[None]] begin[:] variable[gradf] ass...
keyword[def] identifier[proximal_step] ( identifier[self] , identifier[gradf] = keyword[None] ): literal[string] keyword[if] identifier[gradf] keyword[is] keyword[None] : identifier[gradf] = identifier[self] . identifier[eval_grad] () identifier[self] . identifier[Vf] [:]...
def proximal_step(self, gradf=None): """Compute proximal update (gradient descent + constraint). Variables are mapped back and forth between input and frequency domains. """ if gradf is None: gradf = self.eval_grad() # depends on [control=['if'], data=['gradf']] self.Vf[:] =...
def run_command(self): """Replication factor command, checks replication factor settings and compare it with min.isr in the cluster.""" topics = get_topic_partition_metadata(self.cluster_config.broker_list) topics_with_wrong_rf = _find_topics_with_wrong_rp( topics, ...
def function[run_command, parameter[self]]: constant[Replication factor command, checks replication factor settings and compare it with min.isr in the cluster.] variable[topics] assign[=] call[name[get_topic_partition_metadata], parameter[name[self].cluster_config.broker_list]] variable[...
keyword[def] identifier[run_command] ( identifier[self] ): literal[string] identifier[topics] = identifier[get_topic_partition_metadata] ( identifier[self] . identifier[cluster_config] . identifier[broker_list] ) identifier[topics_with_wrong_rf] = identifier[_find_topics_with_wrong_rp] ( ...
def run_command(self): """Replication factor command, checks replication factor settings and compare it with min.isr in the cluster.""" topics = get_topic_partition_metadata(self.cluster_config.broker_list) topics_with_wrong_rf = _find_topics_with_wrong_rp(topics, self.zk, self.args.default_min_isr)...
def check_loops_in_grpah(self, current=None, visited=[]): ''' :param current: current node to check if visited :param visited: list of visited fields :raise: KittyException if loop found ''' if current in visited: path = ' -> '.join(v.get_name() for v in (visi...
def function[check_loops_in_grpah, parameter[self, current, visited]]: constant[ :param current: current node to check if visited :param visited: list of visited fields :raise: KittyException if loop found ] if compare[name[current] in name[visited]] begin[:] ...
keyword[def] identifier[check_loops_in_grpah] ( identifier[self] , identifier[current] = keyword[None] , identifier[visited] =[]): literal[string] keyword[if] identifier[current] keyword[in] identifier[visited] : identifier[path] = literal[string] . identifier[join] ( identifier[v] ...
def check_loops_in_grpah(self, current=None, visited=[]): """ :param current: current node to check if visited :param visited: list of visited fields :raise: KittyException if loop found """ if current in visited: path = ' -> '.join((v.get_name() for v in visited + [curre...
def init_db_conn(connection_name, HOSTS=None): """ Initialize a redis connection by each connection string defined in the configuration file """ el = elasticsearch.Elasticsearch(hosts=HOSTS) el_pool.connections[connection_name] = ElasticSearchClient(el)
def function[init_db_conn, parameter[connection_name, HOSTS]]: constant[ Initialize a redis connection by each connection string defined in the configuration file ] variable[el] assign[=] call[name[elasticsearch].Elasticsearch, parameter[]] call[name[el_pool].connections][name[connec...
keyword[def] identifier[init_db_conn] ( identifier[connection_name] , identifier[HOSTS] = keyword[None] ): literal[string] identifier[el] = identifier[elasticsearch] . identifier[Elasticsearch] ( identifier[hosts] = identifier[HOSTS] ) identifier[el_pool] . identifier[connections] [ identifier[connect...
def init_db_conn(connection_name, HOSTS=None): """ Initialize a redis connection by each connection string defined in the configuration file """ el = elasticsearch.Elasticsearch(hosts=HOSTS) el_pool.connections[connection_name] = ElasticSearchClient(el)
def show_as(**mappings): """ Show a set of request and/or response fields in logs using a different key. Example: @show_as(id="foo_id") def create_foo(): return Foo(id=uuid4()) """ def decorator(func): @wraps(func) def wrapper(*args, **kwargs): ...
def function[show_as, parameter[]]: constant[ Show a set of request and/or response fields in logs using a different key. Example: @show_as(id="foo_id") def create_foo(): return Foo(id=uuid4()) ] def function[decorator, parameter[func]]: def fun...
keyword[def] identifier[show_as] (** identifier[mappings] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapper] (* identifier[args] ,** identifier[kwargs] ): identifier[g] . ident...
def show_as(**mappings): """ Show a set of request and/or response fields in logs using a different key. Example: @show_as(id="foo_id") def create_foo(): return Foo(id=uuid4()) """ def decorator(func): @wraps(func) def wrapper(*args, **kwargs): ...
async def _handle_home(self, request: Request) -> Response: """Home page request handler.""" if self.description: title = f'{self.name} - {self.description}' else: title = self.name text = dedent( f'''<!DOCTYPE html> <html> <...
<ast.AsyncFunctionDef object at 0x7da1b034bb50>
keyword[async] keyword[def] identifier[_handle_home] ( identifier[self] , identifier[request] : identifier[Request] )-> identifier[Response] : literal[string] keyword[if] identifier[self] . identifier[description] : identifier[title] = literal[string] keyword[else] : ...
async def _handle_home(self, request: Request) -> Response: """Home page request handler.""" if self.description: title = f'{self.name} - {self.description}' # depends on [control=['if'], data=[]] else: title = self.name text = dedent(f'<!DOCTYPE html>\n <html>\n ...
def get_value_with_source(self, layer=None): """Returns a tuple of the value's source and the value at the specified layer. If no layer is specified then the outer layer is used. Parameters ---------- layer : str Name of the layer to use. If None then the outermost w...
def function[get_value_with_source, parameter[self, layer]]: constant[Returns a tuple of the value's source and the value at the specified layer. If no layer is specified then the outer layer is used. Parameters ---------- layer : str Name of the layer to use. If Non...
keyword[def] identifier[get_value_with_source] ( identifier[self] , identifier[layer] = keyword[None] ): literal[string] keyword[if] identifier[layer] : keyword[return] identifier[self] . identifier[_values] [ identifier[layer] ] keyword[for] identifier[layer] keyword[in]...
def get_value_with_source(self, layer=None): """Returns a tuple of the value's source and the value at the specified layer. If no layer is specified then the outer layer is used. Parameters ---------- layer : str Name of the layer to use. If None then the outermost where...
def _handle_parameter(self, default): """Handle a case where a parameter is at the head of the tokens. *default* is the value to use if no parameter name is defined. """ key = None showkey = False self._push() while self._tokens: token = self._tokens....
def function[_handle_parameter, parameter[self, default]]: constant[Handle a case where a parameter is at the head of the tokens. *default* is the value to use if no parameter name is defined. ] variable[key] assign[=] constant[None] variable[showkey] assign[=] constant[False] ...
keyword[def] identifier[_handle_parameter] ( identifier[self] , identifier[default] ): literal[string] identifier[key] = keyword[None] identifier[showkey] = keyword[False] identifier[self] . identifier[_push] () keyword[while] identifier[self] . identifier[_tokens] : ...
def _handle_parameter(self, default): """Handle a case where a parameter is at the head of the tokens. *default* is the value to use if no parameter name is defined. """ key = None showkey = False self._push() while self._tokens: token = self._tokens.pop() if isinsta...
def intersection(self, other): """ Create a new DateRange representing the maximal range enclosed by this range and other """ startopen = other.startopen if self.start is None \ else self.startopen if other.start is None \ else other.startopen if self.start < othe...
def function[intersection, parameter[self, other]]: constant[ Create a new DateRange representing the maximal range enclosed by this range and other ] variable[startopen] assign[=] <ast.IfExp object at 0x7da20c76ca00> variable[endopen] assign[=] <ast.IfExp object at 0x7da1b234677...
keyword[def] identifier[intersection] ( identifier[self] , identifier[other] ): literal[string] identifier[startopen] = identifier[other] . identifier[startopen] keyword[if] identifier[self] . identifier[start] keyword[is] keyword[None] keyword[else] identifier[self] . identifier[startopen] ...
def intersection(self, other): """ Create a new DateRange representing the maximal range enclosed by this range and other """ startopen = other.startopen if self.start is None else self.startopen if other.start is None else other.startopen if self.start < other.start else self.startopen if self....
def _update_record(self, identifier, rtype=None, name=None, content=None): """ Update a record. Returns `False` if no matching record is found. """ result = False # TODO: some providers allow content-based updates without supplying an # ID, and therefore `identifier` is ...
def function[_update_record, parameter[self, identifier, rtype, name, content]]: constant[ Update a record. Returns `False` if no matching record is found. ] variable[result] assign[=] constant[False] if <ast.BoolOp object at 0x7da1b1d35d50> begin[:] variable[reco...
keyword[def] identifier[_update_record] ( identifier[self] , identifier[identifier] , identifier[rtype] = keyword[None] , identifier[name] = keyword[None] , identifier[content] = keyword[None] ): literal[string] identifier[result] = keyword[False] keyword[if] ...
def _update_record(self, identifier, rtype=None, name=None, content=None): """ Update a record. Returns `False` if no matching record is found. """ result = False # TODO: some providers allow content-based updates without supplying an # ID, and therefore `identifier` is here optional. If...
def hash_sha256(buf): """AuthenticationHelper.hash""" a = hashlib.sha256(buf).hexdigest() return (64 - len(a)) * '0' + a
def function[hash_sha256, parameter[buf]]: constant[AuthenticationHelper.hash] variable[a] assign[=] call[call[name[hashlib].sha256, parameter[name[buf]]].hexdigest, parameter[]] return[binary_operation[binary_operation[binary_operation[constant[64] - call[name[len], parameter[name[a]]]] * constant[...
keyword[def] identifier[hash_sha256] ( identifier[buf] ): literal[string] identifier[a] = identifier[hashlib] . identifier[sha256] ( identifier[buf] ). identifier[hexdigest] () keyword[return] ( literal[int] - identifier[len] ( identifier[a] ))* literal[string] + identifier[a]
def hash_sha256(buf): """AuthenticationHelper.hash""" a = hashlib.sha256(buf).hexdigest() return (64 - len(a)) * '0' + a
def percent_point(self, U): """Given a cumulated distribution value, returns a value in original space. Arguments: U: `np.ndarray` of shape (n, 1) and values in [0,1] Returns: `np.ndarray`: Estimated values in original space. """ self.check_fit() ...
def function[percent_point, parameter[self, U]]: constant[Given a cumulated distribution value, returns a value in original space. Arguments: U: `np.ndarray` of shape (n, 1) and values in [0,1] Returns: `np.ndarray`: Estimated values in original space. ] ...
keyword[def] identifier[percent_point] ( identifier[self] , identifier[U] ): literal[string] identifier[self] . identifier[check_fit] () keyword[return] identifier[norm] . identifier[ppf] ( identifier[U] , identifier[loc] = identifier[self] . identifier[mean] , identifier[scale] = identif...
def percent_point(self, U): """Given a cumulated distribution value, returns a value in original space. Arguments: U: `np.ndarray` of shape (n, 1) and values in [0,1] Returns: `np.ndarray`: Estimated values in original space. """ self.check_fit() return norm...
def get_info_from_service(service, zconf): """ Resolve service_info from service. """ service_info = None try: service_info = zconf.get_service_info('_googlecast._tcp.local.', service) if service_info: _LOGGER.debug( "...
def function[get_info_from_service, parameter[service, zconf]]: constant[ Resolve service_info from service. ] variable[service_info] assign[=] constant[None] <ast.Try object at 0x7da18bc71f90> return[name[service_info]]
keyword[def] identifier[get_info_from_service] ( identifier[service] , identifier[zconf] ): literal[string] identifier[service_info] = keyword[None] keyword[try] : identifier[service_info] = identifier[zconf] . identifier[get_service_info] ( literal[string] , identifier[service] ) ...
def get_info_from_service(service, zconf): """ Resolve service_info from service. """ service_info = None try: service_info = zconf.get_service_info('_googlecast._tcp.local.', service) if service_info: _LOGGER.debug('get_info_from_service resolved service %s to service_info %s', ...
def mod(cmd, params): """ Mod management command rqalpha mod list \n rqalpha mod install xxx \n rqalpha mod uninstall xxx \n rqalpha mod enable xxx \n rqalpha mod disable xxx \n """ def list(params): """ List all mod configuration """ from tabulate i...
def function[mod, parameter[cmd, params]]: constant[ Mod management command rqalpha mod list rqalpha mod install xxx rqalpha mod uninstall xxx rqalpha mod enable xxx rqalpha mod disable xxx ] def function[list, parameter[params]]: constant[ ...
keyword[def] identifier[mod] ( identifier[cmd] , identifier[params] ): literal[string] keyword[def] identifier[list] ( identifier[params] ): literal[string] keyword[from] identifier[tabulate] keyword[import] identifier[tabulate] keyword[from] identifier[rqalpha] . identifi...
def mod(cmd, params): """ Mod management command rqalpha mod list rqalpha mod install xxx rqalpha mod uninstall xxx rqalpha mod enable xxx rqalpha mod disable xxx """ def list(params): """ List all mod configuration """ from tabulate impor...
def _is_leap_year(year): """Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools """ isleap = ((np.mod(year, 4) == 0) & ((np.mod(year, 100) != 0) | (np.mod(year, 400) == 0))) return isleap
def function[_is_leap_year, parameter[year]]: constant[Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools ] variable[isleap] assign[=] binary_operation[compare[call[name[np].mod, parameter[name[year], constant[4]]]...
keyword[def] identifier[_is_leap_year] ( identifier[year] ): literal[string] identifier[isleap] =(( identifier[np] . identifier[mod] ( identifier[year] , literal[int] )== literal[int] )& (( identifier[np] . identifier[mod] ( identifier[year] , literal[int] )!= literal[int] )|( identifier[np] . identifi...
def _is_leap_year(year): """Determine if a year is leap year. Parameters ---------- year : numeric Returns ------- isleap : array of bools """ isleap = (np.mod(year, 4) == 0) & ((np.mod(year, 100) != 0) | (np.mod(year, 400) == 0)) return isleap
def send_video(self, *args, **kwargs): """See :func:`send_video`""" return send_video(*args, **self._merge_overrides(**kwargs)).run()
def function[send_video, parameter[self]]: constant[See :func:`send_video`] return[call[call[name[send_video], parameter[<ast.Starred object at 0x7da18dc9b820>]].run, parameter[]]]
keyword[def] identifier[send_video] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[send_video] (* identifier[args] ,** identifier[self] . identifier[_merge_overrides] (** identifier[kwargs] )). identifier[run] ()
def send_video(self, *args, **kwargs): """See :func:`send_video`""" return send_video(*args, **self._merge_overrides(**kwargs)).run()
def create_new_metadata(self, rsa_public_key): # type: (EncryptionMetadata, # cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey) # -> None """Create new metadata entries for encryption (upload) :param EncryptionMetadata self: this :param cryptograph...
def function[create_new_metadata, parameter[self, rsa_public_key]]: constant[Create new metadata entries for encryption (upload) :param EncryptionMetadata self: this :param cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey: rsa public key ] name[self]._rsa_pu...
keyword[def] identifier[create_new_metadata] ( identifier[self] , identifier[rsa_public_key] ): literal[string] identifier[self] . identifier[_rsa_public_key] = identifier[rsa_public_key] identifier[self] . identifier[_symkey] = identifier[os] . identifier[urandom] ( identifie...
def create_new_metadata(self, rsa_public_key): # type: (EncryptionMetadata, # cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey) # -> None 'Create new metadata entries for encryption (upload)\n :param EncryptionMetadata self: this\n :param cryptography.hazmat.primiti...
def _set_bind_interfaces(self, v, load=False): """ Setter method for bind_interfaces, mapped from YANG variable /overlay_service_policy_state/bind_interfaces (container) If this variable is read-only (config: false) in the source YANG file, then _set_bind_interfaces is considered as a private method...
def function[_set_bind_interfaces, parameter[self, v, load]]: constant[ Setter method for bind_interfaces, mapped from YANG variable /overlay_service_policy_state/bind_interfaces (container) If this variable is read-only (config: false) in the source YANG file, then _set_bind_interfaces is considere...
keyword[def] identifier[_set_bind_interfaces] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ...
def _set_bind_interfaces(self, v, load=False): """ Setter method for bind_interfaces, mapped from YANG variable /overlay_service_policy_state/bind_interfaces (container) If this variable is read-only (config: false) in the source YANG file, then _set_bind_interfaces is considered as a private method...
def parse_exiobase3(path): """ Parses the public EXIOBASE 3 system This parser works with either the compressed zip archive as downloaded or the extracted system. Note ---- The exiobase 3 parser does so far not include population and characterization data. Parameters ---------- ...
def function[parse_exiobase3, parameter[path]]: constant[ Parses the public EXIOBASE 3 system This parser works with either the compressed zip archive as downloaded or the extracted system. Note ---- The exiobase 3 parser does so far not include population and characterization data. ...
keyword[def] identifier[parse_exiobase3] ( identifier[path] ): literal[string] identifier[io] = identifier[load_all] ( identifier[path] ) keyword[try] : identifier[io] . identifier[satellite] . identifier[FY] = identifier[io] . identifier[satellite] . identifier[F_hh] . identifier[c...
def parse_exiobase3(path): """ Parses the public EXIOBASE 3 system This parser works with either the compressed zip archive as downloaded or the extracted system. Note ---- The exiobase 3 parser does so far not include population and characterization data. Parameters ---------- ...
def count_params(self): """Returns the number of parameters in the network.""" n_params = 0 for _i, p in enumerate(self.all_params): n = 1 # for s in p.eval().shape: for s in p.get_shape(): try: s = int(s) ex...
def function[count_params, parameter[self]]: constant[Returns the number of parameters in the network.] variable[n_params] assign[=] constant[0] for taget[tuple[[<ast.Name object at 0x7da18bc72950>, <ast.Name object at 0x7da18bc71e10>]]] in starred[call[name[enumerate], parameter[name[self].all_...
keyword[def] identifier[count_params] ( identifier[self] ): literal[string] identifier[n_params] = literal[int] keyword[for] identifier[_i] , identifier[p] keyword[in] identifier[enumerate] ( identifier[self] . identifier[all_params] ): identifier[n] = literal[int] ...
def count_params(self): """Returns the number of parameters in the network.""" n_params = 0 for (_i, p) in enumerate(self.all_params): n = 1 # for s in p.eval().shape: for s in p.get_shape(): try: s = int(s) # depends on [control=['try'], data=[]] ...
def oscillating_setpoint(_square_wave=False, shift=0): """A basic example of a target that you may want to approximate. If you have a thermostat, this is a temperature setting. This target can't change too often """ import math c = 0 while 1: if _square_wave: yield ((c %...
def function[oscillating_setpoint, parameter[_square_wave, shift]]: constant[A basic example of a target that you may want to approximate. If you have a thermostat, this is a temperature setting. This target can't change too often ] import module[math] variable[c] assign[=] constant[0] ...
keyword[def] identifier[oscillating_setpoint] ( identifier[_square_wave] = keyword[False] , identifier[shift] = literal[int] ): literal[string] keyword[import] identifier[math] identifier[c] = literal[int] keyword[while] literal[int] : keyword[if] identifier[_square_wave] : ...
def oscillating_setpoint(_square_wave=False, shift=0): """A basic example of a target that you may want to approximate. If you have a thermostat, this is a temperature setting. This target can't change too often """ import math c = 0 while 1: if _square_wave: yield ((c %...
def next_state_scope(self, next_state_fluents: Sequence[tf.Tensor]) -> Dict[str, TensorFluent]: '''Returns a partial scope with current next state-fluents. Args: next_state_fluents (Sequence[tf.Tensor]): The next state fluents. Returns: A mapping from next state fluent ...
def function[next_state_scope, parameter[self, next_state_fluents]]: constant[Returns a partial scope with current next state-fluents. Args: next_state_fluents (Sequence[tf.Tensor]): The next state fluents. Returns: A mapping from next state fluent names to :obj:`rddl2t...
keyword[def] identifier[next_state_scope] ( identifier[self] , identifier[next_state_fluents] : identifier[Sequence] [ identifier[tf] . identifier[Tensor] ])-> identifier[Dict] [ identifier[str] , identifier[TensorFluent] ]: literal[string] keyword[return] identifier[dict] ( identifier[zip] ( iden...
def next_state_scope(self, next_state_fluents: Sequence[tf.Tensor]) -> Dict[str, TensorFluent]: """Returns a partial scope with current next state-fluents. Args: next_state_fluents (Sequence[tf.Tensor]): The next state fluents. Returns: A mapping from next state fluent name...
def load(path_or_file, validate=True, strict=True, fmt='auto'): r"""Load a JAMS Annotation from a file. Parameters ---------- path_or_file : str or file-like Path to the JAMS file to load OR An open file handle to load from. validate : bool Attempt to validate the ...
def function[load, parameter[path_or_file, validate, strict, fmt]]: constant[Load a JAMS Annotation from a file. Parameters ---------- path_or_file : str or file-like Path to the JAMS file to load OR An open file handle to load from. validate : bool Attempt to ...
keyword[def] identifier[load] ( identifier[path_or_file] , identifier[validate] = keyword[True] , identifier[strict] = keyword[True] , identifier[fmt] = literal[string] ): literal[string] keyword[with] identifier[_open] ( identifier[path_or_file] , identifier[mode] = literal[string] , identifier[fmt] = i...
def load(path_or_file, validate=True, strict=True, fmt='auto'): """Load a JAMS Annotation from a file. Parameters ---------- path_or_file : str or file-like Path to the JAMS file to load OR An open file handle to load from. validate : bool Attempt to validate the J...
def zrevrangebyscore(self, key, max=float('inf'), min=float('-inf'), *, exclude=None, withscores=False, offset=None, count=None, encoding=_NOTSET): """Return a range of members in a sorted set, by score, with scores ordered from high to low. :ra...
def function[zrevrangebyscore, parameter[self, key, max, min]]: constant[Return a range of members in a sorted set, by score, with scores ordered from high to low. :raises TypeError: if min or max is not float or int :raises TypeError: if both offset and count are not specified ...
keyword[def] identifier[zrevrangebyscore] ( identifier[self] , identifier[key] , identifier[max] = identifier[float] ( literal[string] ), identifier[min] = identifier[float] ( literal[string] ), *, identifier[exclude] = keyword[None] , identifier[withscores] = keyword[False] , identifier[offset] = keyword[None] , id...
def zrevrangebyscore(self, key, max=float('inf'), min=float('-inf'), *, exclude=None, withscores=False, offset=None, count=None, encoding=_NOTSET): """Return a range of members in a sorted set, by score, with scores ordered from high to low. :raises TypeError: if min or max is not float or int ...
def child_cardinality(self, child): """ Return the cardinality of a child element :param child: The name of the child element :return: The cardinality as a 2-tuple (min, max). The max value is either a number or the string "unbounded". The min value is always a number. ...
def function[child_cardinality, parameter[self, child]]: constant[ Return the cardinality of a child element :param child: The name of the child element :return: The cardinality as a 2-tuple (min, max). The max value is either a number or the string "unbounded". The min ...
keyword[def] identifier[child_cardinality] ( identifier[self] , identifier[child] ): literal[string] keyword[for] identifier[prop] , identifier[klassdef] keyword[in] identifier[self] . identifier[c_children] . identifier[values] (): keyword[if] identifier[child] == identifier[prop]...
def child_cardinality(self, child): """ Return the cardinality of a child element :param child: The name of the child element :return: The cardinality as a 2-tuple (min, max). The max value is either a number or the string "unbounded". The min value is always a number. ...
def mdaOnes(shap, dtype=numpy.float, mask=None): """ One constructor for masked distributed array @param shap the shape of the array @param dtype the numpy data type @param mask mask array (or None if all data elements are valid) """ res = MaskedDistArray(shap, dtype) res[:] = 1 res....
def function[mdaOnes, parameter[shap, dtype, mask]]: constant[ One constructor for masked distributed array @param shap the shape of the array @param dtype the numpy data type @param mask mask array (or None if all data elements are valid) ] variable[res] assign[=] call[name[MaskedDi...
keyword[def] identifier[mdaOnes] ( identifier[shap] , identifier[dtype] = identifier[numpy] . identifier[float] , identifier[mask] = keyword[None] ): literal[string] identifier[res] = identifier[MaskedDistArray] ( identifier[shap] , identifier[dtype] ) identifier[res] [:]= literal[int] identifie...
def mdaOnes(shap, dtype=numpy.float, mask=None): """ One constructor for masked distributed array @param shap the shape of the array @param dtype the numpy data type @param mask mask array (or None if all data elements are valid) """ res = MaskedDistArray(shap, dtype) res[:] = 1 res....
def inverse(self): """Inverse of this operator. The inverse of ``scalar * op`` is given by ``op.inverse * 1/scalar`` if ``scalar != 0``. If ``scalar == 0``, the inverse is not defined. ``OperatorLeftScalarMult(op, s).inverse == OperatorRightScalarMult(op.inverse...
def function[inverse, parameter[self]]: constant[Inverse of this operator. The inverse of ``scalar * op`` is given by ``op.inverse * 1/scalar`` if ``scalar != 0``. If ``scalar == 0``, the inverse is not defined. ``OperatorLeftScalarMult(op, s).inverse == Operato...
keyword[def] identifier[inverse] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[scalar] == literal[int] : keyword[raise] identifier[ZeroDivisionError] ( literal[string] . identifier[format] ( identifier[self] )) keyword[return] identifier[s...
def inverse(self): """Inverse of this operator. The inverse of ``scalar * op`` is given by ``op.inverse * 1/scalar`` if ``scalar != 0``. If ``scalar == 0``, the inverse is not defined. ``OperatorLeftScalarMult(op, s).inverse == OperatorRightScalarMult(op.inverse, 1/...
def parse_unicode(self, i, wide=False): """Parse Unicode.""" text = self.get_wide_unicode(i) if wide else self.get_narrow_unicode(i) value = int(text, 16) single = self.get_single_stack() if self.span_stack: text = self.convert_case(chr(value), self.span_stack[-1]) ...
def function[parse_unicode, parameter[self, i, wide]]: constant[Parse Unicode.] variable[text] assign[=] <ast.IfExp object at 0x7da18ede7d60> variable[value] assign[=] call[name[int], parameter[name[text], constant[16]]] variable[single] assign[=] call[name[self].get_single_stack, parame...
keyword[def] identifier[parse_unicode] ( identifier[self] , identifier[i] , identifier[wide] = keyword[False] ): literal[string] identifier[text] = identifier[self] . identifier[get_wide_unicode] ( identifier[i] ) keyword[if] identifier[wide] keyword[else] identifier[self] . identifier[get_narr...
def parse_unicode(self, i, wide=False): """Parse Unicode.""" text = self.get_wide_unicode(i) if wide else self.get_narrow_unicode(i) value = int(text, 16) single = self.get_single_stack() if self.span_stack: text = self.convert_case(chr(value), self.span_stack[-1]) value = ord(self.c...
def replace(path, pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, backup='.bak', dry_run=False, search_only=False...
def function[replace, parameter[path, pattern, repl, count, flags, bufsize, append_if_not_found, prepend_if_not_found, not_found_content, backup, dry_run, search_only, show_changes, ignore_if_missing, preserve_inode, backslash_literal]]: constant[ .. versionadded:: 0.17.0 Replace occurrences of a patte...
keyword[def] identifier[replace] ( identifier[path] , identifier[pattern] , identifier[repl] , identifier[count] = literal[int] , identifier[flags] = literal[int] , identifier[bufsize] = literal[int] , identifier[append_if_not_found] = keyword[False] , identifier[prepend_if_not_found] = keyword[False] , ident...
def replace(path, pattern, repl, count=0, flags=8, bufsize=1, append_if_not_found=False, prepend_if_not_found=False, not_found_content=None, backup='.bak', dry_run=False, search_only=False, show_changes=True, ignore_if_missing=False, preserve_inode=True, backslash_literal=False): """ .. versionadded:: 0.17.0 ...
def start_time(self): """Start timestamp of the dataset""" dt = self.nc['time'].dt return datetime(year=dt.year, month=dt.month, day=dt.day, hour=dt.hour, minute=dt.minute, second=dt.second, microsecond=dt.microsecond)
def function[start_time, parameter[self]]: constant[Start timestamp of the dataset] variable[dt] assign[=] call[name[self].nc][constant[time]].dt return[call[name[datetime], parameter[]]]
keyword[def] identifier[start_time] ( identifier[self] ): literal[string] identifier[dt] = identifier[self] . identifier[nc] [ literal[string] ]. identifier[dt] keyword[return] identifier[datetime] ( identifier[year] = identifier[dt] . identifier[year] , identifier[month] = identifier[dt...
def start_time(self): """Start timestamp of the dataset""" dt = self.nc['time'].dt return datetime(year=dt.year, month=dt.month, day=dt.day, hour=dt.hour, minute=dt.minute, second=dt.second, microsecond=dt.microsecond)
def set_session(self, session): """ Set the session to be used when the TLS/SSL connection is established. :param session: A Session instance representing the session to use. :returns: None .. versionadded:: 0.14 """ if not isinstance(session, Session): ...
def function[set_session, parameter[self, session]]: constant[ Set the session to be used when the TLS/SSL connection is established. :param session: A Session instance representing the session to use. :returns: None .. versionadded:: 0.14 ] if <ast.UnaryOp obje...
keyword[def] identifier[set_session] ( identifier[self] , identifier[session] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[session] , identifier[Session] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[result] = ide...
def set_session(self, session): """ Set the session to be used when the TLS/SSL connection is established. :param session: A Session instance representing the session to use. :returns: None .. versionadded:: 0.14 """ if not isinstance(session, Session): raise Ty...
def _handle_resize(self, signum=None, frame=None): 'Tries to catch resize signals sent from the terminal.' w, h = utils.get_terminal_size() self.term_width = w
def function[_handle_resize, parameter[self, signum, frame]]: constant[Tries to catch resize signals sent from the terminal.] <ast.Tuple object at 0x7da20c796050> assign[=] call[name[utils].get_terminal_size, parameter[]] name[self].term_width assign[=] name[w]
keyword[def] identifier[_handle_resize] ( identifier[self] , identifier[signum] = keyword[None] , identifier[frame] = keyword[None] ): literal[string] identifier[w] , identifier[h] = identifier[utils] . identifier[get_terminal_size] () identifier[self] . identifier[term_width] = identifie...
def _handle_resize(self, signum=None, frame=None): """Tries to catch resize signals sent from the terminal.""" (w, h) = utils.get_terminal_size() self.term_width = w
def _phase_kuramoto(self, teta, t, argv): """! @brief Returns result of phase calculation for specified oscillator in the network. @param[in] teta (double): Phase of the oscillator that is differentiated. @param[in] t (double): Current time of simulation. @param[in...
def function[_phase_kuramoto, parameter[self, teta, t, argv]]: constant[! @brief Returns result of phase calculation for specified oscillator in the network. @param[in] teta (double): Phase of the oscillator that is differentiated. @param[in] t (double): Current time of simulati...
keyword[def] identifier[_phase_kuramoto] ( identifier[self] , identifier[teta] , identifier[t] , identifier[argv] ): literal[string] identifier[index] = identifier[argv] ; identifier[phase] = literal[int] ; keyword[for] identifier[k] keyword[in] identifier[range] ( litera...
def _phase_kuramoto(self, teta, t, argv): """! @brief Returns result of phase calculation for specified oscillator in the network. @param[in] teta (double): Phase of the oscillator that is differentiated. @param[in] t (double): Current time of simulation. @param[in] argv (tu...
def wait_idle(self, timeout=1.0): """Wait until the rpc queue is empty. This method may be called either from within the event loop or from outside of it. If it is called outside of the event loop it will block the calling thread until the rpc queue is temporarily empty. If it...
def function[wait_idle, parameter[self, timeout]]: constant[Wait until the rpc queue is empty. This method may be called either from within the event loop or from outside of it. If it is called outside of the event loop it will block the calling thread until the rpc queue is temporaril...
keyword[def] identifier[wait_idle] ( identifier[self] , identifier[timeout] = literal[int] ): literal[string] keyword[async] keyword[def] identifier[_awaiter] (): identifier[background_work] ={ identifier[x] . identifier[join] () keyword[for] identifier[x] keyword[in] identifier[...
def wait_idle(self, timeout=1.0): """Wait until the rpc queue is empty. This method may be called either from within the event loop or from outside of it. If it is called outside of the event loop it will block the calling thread until the rpc queue is temporarily empty. If it is ...
def pre_filter(self, conditions, user): ''' Returns all of the items from conditions which are enabled by a user being member of a Django Auth Group. ''' return conditions.filter(group__in=user.groups.all())
def function[pre_filter, parameter[self, conditions, user]]: constant[ Returns all of the items from conditions which are enabled by a user being member of a Django Auth Group. ] return[call[name[conditions].filter, parameter[]]]
keyword[def] identifier[pre_filter] ( identifier[self] , identifier[conditions] , identifier[user] ): literal[string] keyword[return] identifier[conditions] . identifier[filter] ( identifier[group__in] = identifier[user] . identifier[groups] . identifier[all] ())
def pre_filter(self, conditions, user): """ Returns all of the items from conditions which are enabled by a user being member of a Django Auth Group. """ return conditions.filter(group__in=user.groups.all())
def do_GET(self): """Serve a GET request.""" f = self.send_head() if f: self.copyfile(f, self.wfile) f.close()
def function[do_GET, parameter[self]]: constant[Serve a GET request.] variable[f] assign[=] call[name[self].send_head, parameter[]] if name[f] begin[:] call[name[self].copyfile, parameter[name[f], name[self].wfile]] call[name[f].close, parameter[]]
keyword[def] identifier[do_GET] ( identifier[self] ): literal[string] identifier[f] = identifier[self] . identifier[send_head] () keyword[if] identifier[f] : identifier[self] . identifier[copyfile] ( identifier[f] , identifier[self] . identifier[wfile] ) identifi...
def do_GET(self): """Serve a GET request.""" f = self.send_head() if f: self.copyfile(f, self.wfile) f.close() # depends on [control=['if'], data=[]]
def prob_classify(self, text): """Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = MaxEntClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this morning.") >>> prob_di...
def function[prob_classify, parameter[self, text]]: constant[Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = MaxEntClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this morning...
keyword[def] identifier[prob_classify] ( identifier[self] , identifier[text] ): literal[string] identifier[feats] = identifier[self] . identifier[extract_features] ( identifier[text] ) keyword[return] identifier[self] . identifier[classifier] . identifier[prob_classify] ( identifier[feats...
def prob_classify(self, text): """Return the label probability distribution for classifying a string of text. Example: :: >>> classifier = MaxEntClassifier(train_data) >>> prob_dist = classifier.prob_classify("I feel happy this morning.") >>> prob_dist.m...
def accept_record(self, record): """Accept a record for inclusion in the community. :param record: Record object. """ with db.session.begin_nested(): req = InclusionRequest.get(self.id, record.id) if req is None: raise InclusionRequestMissingError...
def function[accept_record, parameter[self, record]]: constant[Accept a record for inclusion in the community. :param record: Record object. ] with call[name[db].session.begin_nested, parameter[]] begin[:] variable[req] assign[=] call[name[InclusionRequest].get, paramete...
keyword[def] identifier[accept_record] ( identifier[self] , identifier[record] ): literal[string] keyword[with] identifier[db] . identifier[session] . identifier[begin_nested] (): identifier[req] = identifier[InclusionRequest] . identifier[get] ( identifier[self] . identifier[id] , id...
def accept_record(self, record): """Accept a record for inclusion in the community. :param record: Record object. """ with db.session.begin_nested(): req = InclusionRequest.get(self.id, record.id) if req is None: raise InclusionRequestMissingError(community=self, rec...
def subdict(name, *keys, **kw): """ Subdict key. Takes a `name`, any number of keys as args and keyword argument `trafaret`. Use it like: def check_passwords_equal(data): if data['password'] != data['password_confirm']: return t.DataError('Passwords are not equal') ...
def function[subdict, parameter[name]]: constant[ Subdict key. Takes a `name`, any number of keys as args and keyword argument `trafaret`. Use it like: def check_passwords_equal(data): if data['password'] != data['password_confirm']: return t.DataError('Password...
keyword[def] identifier[subdict] ( identifier[name] ,* identifier[keys] ,** identifier[kw] ): literal[string] identifier[trafaret] = identifier[kw] . identifier[pop] ( literal[string] ) keyword[def] identifier[inner] ( identifier[data] , identifier[context] = keyword[None] ): identifier[err...
def subdict(name, *keys, **kw): """ Subdict key. Takes a `name`, any number of keys as args and keyword argument `trafaret`. Use it like: def check_passwords_equal(data): if data['password'] != data['password_confirm']: return t.DataError('Passwords are not equal') ...
def read_from_file(filename): """ Arguments: | ``filename`` -- the filename of the input file Use as follows:: >>> if = CP2KInputFile.read_from_file("somefile.inp") >>> for section in if: ... print section.name """ ...
def function[read_from_file, parameter[filename]]: constant[ Arguments: | ``filename`` -- the filename of the input file Use as follows:: >>> if = CP2KInputFile.read_from_file("somefile.inp") >>> for section in if: ... print sectio...
keyword[def] identifier[read_from_file] ( identifier[filename] ): literal[string] keyword[with] identifier[open] ( identifier[filename] ) keyword[as] identifier[f] : identifier[result] = identifier[CP2KInputFile] () keyword[try] : keyword[while] keyword...
def read_from_file(filename): """ Arguments: | ``filename`` -- the filename of the input file Use as follows:: >>> if = CP2KInputFile.read_from_file("somefile.inp") >>> for section in if: ... print section.name """ with ope...
def metric_griffiths_2004(logliks): """ Thomas L. Griffiths and Mark Steyvers. 2004. Finding scientific topics. Proceedings of the National Academy of Sciences 101, suppl 1: 5228–5235. http://doi.org/10.1073/pnas.0307752101 Calculates the harmonic mean of the loglikelihood values `logliks` as in Griffi...
def function[metric_griffiths_2004, parameter[logliks]]: constant[ Thomas L. Griffiths and Mark Steyvers. 2004. Finding scientific topics. Proceedings of the National Academy of Sciences 101, suppl 1: 5228–5235. http://doi.org/10.1073/pnas.0307752101 Calculates the harmonic mean of the loglikelihoo...
keyword[def] identifier[metric_griffiths_2004] ( identifier[logliks] ): literal[string] keyword[import] identifier[gmpy2] identifier[ll_med] = identifier[np] . identifier[median] ( identifier[logliks] ) identifier[ps] =[ identifier[gmpy2] . identifier[exp] ( identifier[ll_med] - identifi...
def metric_griffiths_2004(logliks): """ Thomas L. Griffiths and Mark Steyvers. 2004. Finding scientific topics. Proceedings of the National Academy of Sciences 101, suppl 1: 5228–5235. http://doi.org/10.1073/pnas.0307752101 Calculates the harmonic mean of the loglikelihood values `logliks` as in Griffi...
def add_random_file_from_present_folder(machine_ip, port, zone): """Add a random non-py file from this folder and subfolders to soco""" # Make a list of music files, right now it is done by collection all files # below the current folder whose extension does not start with .py # This will probably need ...
def function[add_random_file_from_present_folder, parameter[machine_ip, port, zone]]: constant[Add a random non-py file from this folder and subfolders to soco] variable[music_files] assign[=] list[[]] call[name[print], parameter[constant[Looking for music files]]] for taget[tuple[[<ast....
keyword[def] identifier[add_random_file_from_present_folder] ( identifier[machine_ip] , identifier[port] , identifier[zone] ): literal[string] identifier[music_files] =[] identifier[print] ( literal[string] ) keyword[for] identifier[path] , identifier[dirs] , identifier[files] ke...
def add_random_file_from_present_folder(machine_ip, port, zone): """Add a random non-py file from this folder and subfolders to soco""" # Make a list of music files, right now it is done by collection all files # below the current folder whose extension does not start with .py # This will probably need ...
def get_max_days_to_liquidate_by_ticker(positions, market_data, max_bar_consumption=0.2, capital_base=1e6, mean_volume_window=5, last_n_days=None): """ ...
def function[get_max_days_to_liquidate_by_ticker, parameter[positions, market_data, max_bar_consumption, capital_base, mean_volume_window, last_n_days]]: constant[ Finds the longest estimated liquidation time for each traded name over the course of backtest (or last n days of the backtest). Paramet...
keyword[def] identifier[get_max_days_to_liquidate_by_ticker] ( identifier[positions] , identifier[market_data] , identifier[max_bar_consumption] = literal[int] , identifier[capital_base] = literal[int] , identifier[mean_volume_window] = literal[int] , identifier[last_n_days] = keyword[None] ): literal[string...
def get_max_days_to_liquidate_by_ticker(positions, market_data, max_bar_consumption=0.2, capital_base=1000000.0, mean_volume_window=5, last_n_days=None): """ Finds the longest estimated liquidation time for each traded name over the course of backtest (or last n days of the backtest). Parameters --...
def overlaps(self, other, permissive=False): """ Test if intervals have any overlapping value. If 'permissive' is set to True (default is False), then [1, 2) and [2, 3] are considered as having an overlap on value 2 (but not [1, 2) and (2, 3]). :param other: an atomic interval....
def function[overlaps, parameter[self, other, permissive]]: constant[ Test if intervals have any overlapping value. If 'permissive' is set to True (default is False), then [1, 2) and [2, 3] are considered as having an overlap on value 2 (but not [1, 2) and (2, 3]). :param other...
keyword[def] identifier[overlaps] ( identifier[self] , identifier[other] , identifier[permissive] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[other] , identifier[AtomicInterval] ): keyword[raise] identifier[TypeError] ( literal[st...
def overlaps(self, other, permissive=False): """ Test if intervals have any overlapping value. If 'permissive' is set to True (default is False), then [1, 2) and [2, 3] are considered as having an overlap on value 2 (but not [1, 2) and (2, 3]). :param other: an atomic interval. ...
def get_cursor_position(self, file_path): """ Gets the cached cursor position for file_path :param file_path: path of the file in the cache :return: Cached cursor position or (0, 0) """ try: map = json.loads(self._settings.value('cachedCursorPosition')) ...
def function[get_cursor_position, parameter[self, file_path]]: constant[ Gets the cached cursor position for file_path :param file_path: path of the file in the cache :return: Cached cursor position or (0, 0) ] <ast.Try object at 0x7da18f09df90> <ast.Try object at 0x7da1...
keyword[def] identifier[get_cursor_position] ( identifier[self] , identifier[file_path] ): literal[string] keyword[try] : identifier[map] = identifier[json] . identifier[loads] ( identifier[self] . identifier[_settings] . identifier[value] ( literal[string] )) keyword[except] ...
def get_cursor_position(self, file_path): """ Gets the cached cursor position for file_path :param file_path: path of the file in the cache :return: Cached cursor position or (0, 0) """ try: map = json.loads(self._settings.value('cachedCursorPosition')) # depends on [co...
def accepts(self): # type: Union[Iterable[Type[T]], Type[Any]] """The types of objects the data sink can store.""" types = set() any_dispatch = False try: types.update(getattr(self.__class__, "put")._accepts) any_dispatch = True except AttributeError: ...
def function[accepts, parameter[self]]: constant[The types of objects the data sink can store.] variable[types] assign[=] call[name[set], parameter[]] variable[any_dispatch] assign[=] constant[False] <ast.Try object at 0x7da1b1932cb0> <ast.Try object at 0x7da1b1931c90> return[<ast.If...
keyword[def] identifier[accepts] ( identifier[self] ): literal[string] identifier[types] = identifier[set] () identifier[any_dispatch] = keyword[False] keyword[try] : identifier[types] . identifier[update] ( identifier[getattr] ( identifier[self] . identifier[__class...
def accepts(self): # type: Union[Iterable[Type[T]], Type[Any]] 'The types of objects the data sink can store.' types = set() any_dispatch = False try: types.update(getattr(self.__class__, 'put')._accepts) any_dispatch = True # depends on [control=['try'], data=[]] except AttributeE...
def _classify_segment(self, address, length): """Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of SparseMemoryMap.prepended ...
def function[_classify_segment, parameter[self, address, length]]: constant[Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of Spar...
keyword[def] identifier[_classify_segment] ( identifier[self] , identifier[address] , identifier[length] ): literal[string] identifier[end_address] = identifier[address] + identifier[length] - literal[int] identifier[_] , identifier[start_seg] = identifier[self] . identifier[_find_addre...
def _classify_segment(self, address, length): """Determine how a new data segment fits into our existing world Params: address (int): The address we wish to classify length (int): The length of the segment Returns: int: One of SparseMemoryMap.prepended "...
def parse(self, element): """Extracts the values from the specified XML element that is being converted.""" #All the children of this element are what we are trying to parse. result = [] for child in element: if child.tag in self.lines: values = { child.tag: s...
def function[parse, parameter[self, element]]: constant[Extracts the values from the specified XML element that is being converted.] variable[result] assign[=] list[[]] for taget[name[child]] in starred[name[element]] begin[:] if compare[name[child].tag in name[self].lines] begin...
keyword[def] identifier[parse] ( identifier[self] , identifier[element] ): literal[string] identifier[result] =[] keyword[for] identifier[child] keyword[in] identifier[element] : keyword[if] identifier[child] . identifier[tag] keyword[in] identifier[self] . iden...
def parse(self, element): """Extracts the values from the specified XML element that is being converted.""" #All the children of this element are what we are trying to parse. result = [] for child in element: if child.tag in self.lines: values = {child.tag: self.lines[child.tag].pars...
def _preprocess_nodes_for_pydot(nodes_with_data): """throw away all node attributes, except for 'label'""" for (node_id, attrs) in nodes_with_data: if 'label' in attrs: yield (quote_for_pydot(node_id), {'label': quote_for_pydot(attrs['label'])}) else: y...
def function[_preprocess_nodes_for_pydot, parameter[nodes_with_data]]: constant[throw away all node attributes, except for 'label'] for taget[tuple[[<ast.Name object at 0x7da204620e20>, <ast.Name object at 0x7da2046214e0>]]] in starred[name[nodes_with_data]] begin[:] if compare[constant[...
keyword[def] identifier[_preprocess_nodes_for_pydot] ( identifier[nodes_with_data] ): literal[string] keyword[for] ( identifier[node_id] , identifier[attrs] ) keyword[in] identifier[nodes_with_data] : keyword[if] literal[string] keyword[in] identifier[attrs] : keyword[yield] ( ide...
def _preprocess_nodes_for_pydot(nodes_with_data): """throw away all node attributes, except for 'label'""" for (node_id, attrs) in nodes_with_data: if 'label' in attrs: yield (quote_for_pydot(node_id), {'label': quote_for_pydot(attrs['label'])}) # depends on [control=['if'], data=['attrs']]...
def printrec(recst): """ Pretty-printing rtsp strings """ try: recst = recst.decode('UTF-8') except AttributeError: pass recs=[ x for x in recst.split('\r\n') if x ] for rec in recs: print(rec) print("\n")
def function[printrec, parameter[recst]]: constant[ Pretty-printing rtsp strings ] <ast.Try object at 0x7da20cabc400> variable[recs] assign[=] <ast.ListComp object at 0x7da20cabeef0> for taget[name[rec]] in starred[name[recs]] begin[:] call[name[print], parameter[name[rec...
keyword[def] identifier[printrec] ( identifier[recst] ): literal[string] keyword[try] : identifier[recst] = identifier[recst] . identifier[decode] ( literal[string] ) keyword[except] identifier[AttributeError] : keyword[pass] identifier[recs] =[ identifier[x] keyword[for] id...
def printrec(recst): """ Pretty-printing rtsp strings """ try: recst = recst.decode('UTF-8') # depends on [control=['try'], data=[]] except AttributeError: pass # depends on [control=['except'], data=[]] recs = [x for x in recst.split('\r\n') if x] for rec in recs: prin...
def release_client(self, cb): """ Return a Connection object to the pool :param Connection cb: the client to release """ if cb: self._q.put(cb, True) self._clients_in_use -= 1
def function[release_client, parameter[self, cb]]: constant[ Return a Connection object to the pool :param Connection cb: the client to release ] if name[cb] begin[:] call[name[self]._q.put, parameter[name[cb], constant[True]]] <ast.AugAssign object at 0x7...
keyword[def] identifier[release_client] ( identifier[self] , identifier[cb] ): literal[string] keyword[if] identifier[cb] : identifier[self] . identifier[_q] . identifier[put] ( identifier[cb] , keyword[True] ) identifier[self] . identifier[_clients_in_use] -= literal[int...
def release_client(self, cb): """ Return a Connection object to the pool :param Connection cb: the client to release """ if cb: self._q.put(cb, True) self._clients_in_use -= 1 # depends on [control=['if'], data=[]]
def iter_edges(self, cached_content=None): """ Iterate over the list of edges of a tree. Each egde is represented as a tuple of two elements, each containing the list of nodes separated by the edge. """ if not cached_content: cached_content = self.get_cached_c...
def function[iter_edges, parameter[self, cached_content]]: constant[ Iterate over the list of edges of a tree. Each egde is represented as a tuple of two elements, each containing the list of nodes separated by the edge. ] if <ast.UnaryOp object at 0x7da1b0e2ee00> begin[:...
keyword[def] identifier[iter_edges] ( identifier[self] , identifier[cached_content] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[cached_content] : identifier[cached_content] = identifier[self] . identifier[get_cached_content] () identifier[all_leave...
def iter_edges(self, cached_content=None): """ Iterate over the list of edges of a tree. Each egde is represented as a tuple of two elements, each containing the list of nodes separated by the edge. """ if not cached_content: cached_content = self.get_cached_content() # ...
def run(self): """ Main interface. Instantiate the SlackAPI, connect to RTM and start the client. """ slack = SlackAPI(token=self.token) rtm = slack.rtm_start() factory = SlackClientFactory(rtm['url']) # Attach attributes factory.protocol = SlackC...
def function[run, parameter[self]]: constant[ Main interface. Instantiate the SlackAPI, connect to RTM and start the client. ] variable[slack] assign[=] call[name[SlackAPI], parameter[]] variable[rtm] assign[=] call[name[slack].rtm_start, parameter[]] variable[fac...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[slack] = identifier[SlackAPI] ( identifier[token] = identifier[self] . identifier[token] ) identifier[rtm] = identifier[slack] . identifier[rtm_start] () identifier[factory] = identifier[SlackClientFact...
def run(self): """ Main interface. Instantiate the SlackAPI, connect to RTM and start the client. """ slack = SlackAPI(token=self.token) rtm = slack.rtm_start() factory = SlackClientFactory(rtm['url']) # Attach attributes factory.protocol = SlackClientProtocol factory...
def _set_passive(self, v, load=False): """ Setter method for passive, mapped from YANG variable /rbridge_id/openflow/logical_instance/passive (container) If this variable is read-only (config: false) in the source YANG file, then _set_passive is considered as a private method. Backends looking to po...
def function[_set_passive, parameter[self, v, load]]: constant[ Setter method for passive, mapped from YANG variable /rbridge_id/openflow/logical_instance/passive (container) If this variable is read-only (config: false) in the source YANG file, then _set_passive is considered as a private metho...
keyword[def] identifier[_set_passive] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : identi...
def _set_passive(self, v, load=False): """ Setter method for passive, mapped from YANG variable /rbridge_id/openflow/logical_instance/passive (container) If this variable is read-only (config: false) in the source YANG file, then _set_passive is considered as a private method. Backends looking to po...
def determine_2(self, container_name, container_alias, meta, val): """"Default the alias to the name of the container""" if container_alias is not NotSpecified: return container_alias return container_name[container_name.rfind(":")+1:].replace('/', '-')
def function[determine_2, parameter[self, container_name, container_alias, meta, val]]: constant["Default the alias to the name of the container] if compare[name[container_alias] is_not name[NotSpecified]] begin[:] return[name[container_alias]] return[call[call[name[container_name]][<ast.Sli...
keyword[def] identifier[determine_2] ( identifier[self] , identifier[container_name] , identifier[container_alias] , identifier[meta] , identifier[val] ): literal[string] keyword[if] identifier[container_alias] keyword[is] keyword[not] identifier[NotSpecified] : keyword[return] id...
def determine_2(self, container_name, container_alias, meta, val): """"Default the alias to the name of the container""" if container_alias is not NotSpecified: return container_alias # depends on [control=['if'], data=['container_alias']] return container_name[container_name.rfind(':') + 1:].repla...
def update_many(path,points): """update_many(path,points) path is a string points is a list of (timestamp,value) points """ if not points: return points = [ (int(t),float(v)) for (t,v) in points] points.sort(key=lambda p: p[0],reverse=True) #order points by timestamp, newest first fh = None try: fh = o...
def function[update_many, parameter[path, points]]: constant[update_many(path,points) path is a string points is a list of (timestamp,value) points ] if <ast.UnaryOp object at 0x7da1b23448e0> begin[:] return[None] variable[points] assign[=] <ast.ListComp object at 0x7da1b2345960> ...
keyword[def] identifier[update_many] ( identifier[path] , identifier[points] ): literal[string] keyword[if] keyword[not] identifier[points] : keyword[return] identifier[points] =[( identifier[int] ( identifier[t] ), identifier[float] ( identifier[v] )) keyword[for] ( identifier[t] , identifier[v] ) keywo...
def update_many(path, points): """update_many(path,points) path is a string points is a list of (timestamp,value) points """ if not points: return # depends on [control=['if'], data=[]] points = [(int(t), float(v)) for (t, v) in points] points.sort(key=lambda p: p[0], reverse=True) #order poi...
def wireshark(pktlist, *args): """Run wireshark on a list of packets""" fname = get_temp_file() wrpcap(fname, pktlist) subprocess.Popen([conf.prog.wireshark, "-r", fname] + list(args))
def function[wireshark, parameter[pktlist]]: constant[Run wireshark on a list of packets] variable[fname] assign[=] call[name[get_temp_file], parameter[]] call[name[wrpcap], parameter[name[fname], name[pktlist]]] call[name[subprocess].Popen, parameter[binary_operation[list[[<ast.Attribut...
keyword[def] identifier[wireshark] ( identifier[pktlist] ,* identifier[args] ): literal[string] identifier[fname] = identifier[get_temp_file] () identifier[wrpcap] ( identifier[fname] , identifier[pktlist] ) identifier[subprocess] . identifier[Popen] ([ identifier[conf] . identifier[prog] . ident...
def wireshark(pktlist, *args): """Run wireshark on a list of packets""" fname = get_temp_file() wrpcap(fname, pktlist) subprocess.Popen([conf.prog.wireshark, '-r', fname] + list(args))
def _generateGraphData(data, oldData=nx.Graph()): """ Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all the attribute startin...
def function[_generateGraphData, parameter[data, oldData]]: constant[ Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all t...
keyword[def] identifier[_generateGraphData] ( identifier[data] , identifier[oldData] = identifier[nx] . identifier[Graph] ()): literal[string] keyword[def] identifier[_addNewNode] ( identifier[ent] , identifier[g] ): literal[string] keyword[try] : identifier[label] = identi...
def _generateGraphData(data, oldData=nx.Graph()): """ Processing the data from i3visio structures to generate nodes and edges This function uses the networkx graph library. It will create a new node for each and i3visio.<something> entities while it will add properties for all the attribute startin...
def _gen_array_table(self): """ 2D array describing each registered array together with headers - for use in __str__ """ headers = ['Array Name', 'Size', 'Type', 'Shape'] # Reify arrays to work out their actual size reified_arrays = self.arrays(reify=True) ...
def function[_gen_array_table, parameter[self]]: constant[ 2D array describing each registered array together with headers - for use in __str__ ] variable[headers] assign[=] list[[<ast.Constant object at 0x7da204622b60>, <ast.Constant object at 0x7da204623190>, <ast.Constant obje...
keyword[def] identifier[_gen_array_table] ( identifier[self] ): literal[string] identifier[headers] =[ literal[string] , literal[string] , literal[string] , literal[string] ] identifier[reified_arrays] = identifier[self] . identifier[arrays] ( identifier[reify] = keyword[True] ) ...
def _gen_array_table(self): """ 2D array describing each registered array together with headers - for use in __str__ """ headers = ['Array Name', 'Size', 'Type', 'Shape'] # Reify arrays to work out their actual size reified_arrays = self.arrays(reify=True) table = [] for ...
def unlist(ctx, unlist_account, account): """ Remove an account from any list """ account = Account(account, blockchain_instance=ctx.blockchain) print_tx(account.nolist(unlist_account))
def function[unlist, parameter[ctx, unlist_account, account]]: constant[ Remove an account from any list ] variable[account] assign[=] call[name[Account], parameter[name[account]]] call[name[print_tx], parameter[call[name[account].nolist, parameter[name[unlist_account]]]]]
keyword[def] identifier[unlist] ( identifier[ctx] , identifier[unlist_account] , identifier[account] ): literal[string] identifier[account] = identifier[Account] ( identifier[account] , identifier[blockchain_instance] = identifier[ctx] . identifier[blockchain] ) identifier[print_tx] ( identifier[accou...
def unlist(ctx, unlist_account, account): """ Remove an account from any list """ account = Account(account, blockchain_instance=ctx.blockchain) print_tx(account.nolist(unlist_account))