code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def parse_fixed_width(types, lines): """Parse a fixed width line.""" values = [] line = [] for width, parser in types: if not line: line = lines.pop(0).replace('\n', '') values.append(parser(line[:width])) line = line[width:] return values
def function[parse_fixed_width, parameter[types, lines]]: constant[Parse a fixed width line.] variable[values] assign[=] list[[]] variable[line] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b2347ca0>, <ast.Name object at 0x7da1b2347c70>]]] in starred[name[types]] begin[:...
keyword[def] identifier[parse_fixed_width] ( identifier[types] , identifier[lines] ): literal[string] identifier[values] =[] identifier[line] =[] keyword[for] identifier[width] , identifier[parser] keyword[in] identifier[types] : keyword[if] keyword[not] identifier[line] : ...
def parse_fixed_width(types, lines): """Parse a fixed width line.""" values = [] line = [] for (width, parser) in types: if not line: line = lines.pop(0).replace('\n', '') # depends on [control=['if'], data=[]] values.append(parser(line[:width])) line = line[width:] ...
def tile_to_path(self, tile): '''return full path to a tile''' return os.path.join(self.cache_path, self.service, tile.path())
def function[tile_to_path, parameter[self, tile]]: constant[return full path to a tile] return[call[name[os].path.join, parameter[name[self].cache_path, name[self].service, call[name[tile].path, parameter[]]]]]
keyword[def] identifier[tile_to_path] ( identifier[self] , identifier[tile] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[cache_path] , identifier[self] . identifier[service] , identifier[tile] . identifier[path] ())
def tile_to_path(self, tile): """return full path to a tile""" return os.path.join(self.cache_path, self.service, tile.path())
def inertia_tensor(self): """the intertia tensor of the molecule""" result = np.zeros((3,3), float) for i in range(self.size): r = self.coordinates[i] - self.com # the diagonal term result.ravel()[::4] += self.masses[i]*(r**2).sum() # the outer pro...
def function[inertia_tensor, parameter[self]]: constant[the intertia tensor of the molecule] variable[result] assign[=] call[name[np].zeros, parameter[tuple[[<ast.Constant object at 0x7da20c6a8280>, <ast.Constant object at 0x7da20c6a9ff0>]], name[float]]] for taget[name[i]] in starred[call[name[...
keyword[def] identifier[inertia_tensor] ( identifier[self] ): literal[string] identifier[result] = identifier[np] . identifier[zeros] (( literal[int] , literal[int] ), identifier[float] ) keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[self] . identifier[size] ): ...
def inertia_tensor(self): """the intertia tensor of the molecule""" result = np.zeros((3, 3), float) for i in range(self.size): r = self.coordinates[i] - self.com # the diagonal term result.ravel()[::4] += self.masses[i] * (r ** 2).sum() # the outer product term resul...
def logout(self): """ Logout and remove vid """ response = None try: response = requests.delete( urls.login(), headers={ 'Cookie': 'vid={}'.format(self._vid)}) except requests.exceptions.RequestException as ex: r...
def function[logout, parameter[self]]: constant[ Logout and remove vid ] variable[response] assign[=] constant[None] <ast.Try object at 0x7da1b1020f10> call[name[_validate_response], parameter[name[response]]]
keyword[def] identifier[logout] ( identifier[self] ): literal[string] identifier[response] = keyword[None] keyword[try] : identifier[response] = identifier[requests] . identifier[delete] ( identifier[urls] . identifier[login] (), identifier[headers] ...
def logout(self): """ Logout and remove vid """ response = None try: response = requests.delete(urls.login(), headers={'Cookie': 'vid={}'.format(self._vid)}) # depends on [control=['try'], data=[]] except requests.exceptions.RequestException as ex: raise RequestError(ex) # depends on [...
def analysis_summary_report(feature, parent): """Retrieve an HTML table report of current selected analysis. """ _ = feature, parent # NOQA project_context_scope = QgsExpressionContextUtils.projectScope( QgsProject.instance()) key = provenance_layer_analysis_impacted['provenance_key'] i...
def function[analysis_summary_report, parameter[feature, parent]]: constant[Retrieve an HTML table report of current selected analysis. ] variable[_] assign[=] tuple[[<ast.Name object at 0x7da1b0c513c0>, <ast.Name object at 0x7da1b0c50130>]] variable[project_context_scope] assign[=] call[nam...
keyword[def] identifier[analysis_summary_report] ( identifier[feature] , identifier[parent] ): literal[string] identifier[_] = identifier[feature] , identifier[parent] identifier[project_context_scope] = identifier[QgsExpressionContextUtils] . identifier[projectScope] ( identifier[QgsProject] . ...
def analysis_summary_report(feature, parent): """Retrieve an HTML table report of current selected analysis. """ _ = (feature, parent) # NOQA project_context_scope = QgsExpressionContextUtils.projectScope(QgsProject.instance()) key = provenance_layer_analysis_impacted['provenance_key'] if not p...
def get_graph_by_id(self, network_id: int) -> BELGraph: """Get a network from the database by its identifier and converts it to a BEL graph.""" network = self.get_network_by_id(network_id) log.debug('converting network [id=%d] %s to bel graph', network_id, network) return network.as_bel(...
def function[get_graph_by_id, parameter[self, network_id]]: constant[Get a network from the database by its identifier and converts it to a BEL graph.] variable[network] assign[=] call[name[self].get_network_by_id, parameter[name[network_id]]] call[name[log].debug, parameter[constant[converting ...
keyword[def] identifier[get_graph_by_id] ( identifier[self] , identifier[network_id] : identifier[int] )-> identifier[BELGraph] : literal[string] identifier[network] = identifier[self] . identifier[get_network_by_id] ( identifier[network_id] ) identifier[log] . identifier[debug] ( literal[...
def get_graph_by_id(self, network_id: int) -> BELGraph: """Get a network from the database by its identifier and converts it to a BEL graph.""" network = self.get_network_by_id(network_id) log.debug('converting network [id=%d] %s to bel graph', network_id, network) return network.as_bel()
def publish(self, load): ''' Publish "load" to minions ''' payload = {'enc': 'aes'} crypticle = salt.crypt.Crypticle(self.opts, salt.master.SMaster.secrets['aes']['secret'].value) payload['load'] = crypticle.dumps(load) if self.opts['sign_pub_messages']: ...
def function[publish, parameter[self, load]]: constant[ Publish "load" to minions ] variable[payload] assign[=] dictionary[[<ast.Constant object at 0x7da1b1f48fa0>], [<ast.Constant object at 0x7da1b1f49690>]] variable[crypticle] assign[=] call[name[salt].crypt.Crypticle, paramete...
keyword[def] identifier[publish] ( identifier[self] , identifier[load] ): literal[string] identifier[payload] ={ literal[string] : literal[string] } identifier[crypticle] = identifier[salt] . identifier[crypt] . identifier[Crypticle] ( identifier[self] . identifier[opts] , identifier[salt...
def publish(self, load): """ Publish "load" to minions """ payload = {'enc': 'aes'} crypticle = salt.crypt.Crypticle(self.opts, salt.master.SMaster.secrets['aes']['secret'].value) payload['load'] = crypticle.dumps(load) if self.opts['sign_pub_messages']: master_pem_path = os....
def read_abinit_hdr(self): """ Read the variables associated to the Abinit header. Return :class:`AbinitHeader` """ d = {} for hvar in _HDR_VARIABLES.values(): ncname = hvar.etsf_name if hvar.etsf_name is not None else hvar.name if ncname in self....
def function[read_abinit_hdr, parameter[self]]: constant[ Read the variables associated to the Abinit header. Return :class:`AbinitHeader` ] variable[d] assign[=] dictionary[[], []] for taget[name[hvar]] in starred[call[name[_HDR_VARIABLES].values, parameter[]]] begin[:]...
keyword[def] identifier[read_abinit_hdr] ( identifier[self] ): literal[string] identifier[d] ={} keyword[for] identifier[hvar] keyword[in] identifier[_HDR_VARIABLES] . identifier[values] (): identifier[ncname] = identifier[hvar] . identifier[etsf_name] keyword[if] identif...
def read_abinit_hdr(self): """ Read the variables associated to the Abinit header. Return :class:`AbinitHeader` """ d = {} for hvar in _HDR_VARIABLES.values(): ncname = hvar.etsf_name if hvar.etsf_name is not None else hvar.name if ncname in self.rootgrp.variables: ...
def bsrch(self, domain): """ This function uses the Bloomberg API to retrieve 'bsrch' (Bloomberg SRCH Data) queries. Returns list of tickers. Parameters ---------- domain: string A character string with the name of the domain to execute. It can be...
def function[bsrch, parameter[self, domain]]: constant[ This function uses the Bloomberg API to retrieve 'bsrch' (Bloomberg SRCH Data) queries. Returns list of tickers. Parameters ---------- domain: string A character string with the name of the domain to exe...
keyword[def] identifier[bsrch] ( identifier[self] , identifier[domain] ): literal[string] identifier[logger] = identifier[_get_logger] ( identifier[self] . identifier[debug] ) identifier[request] = identifier[self] . identifier[exrService] . identifier[createRequest] ( literal[string] ) ...
def bsrch(self, domain): """ This function uses the Bloomberg API to retrieve 'bsrch' (Bloomberg SRCH Data) queries. Returns list of tickers. Parameters ---------- domain: string A character string with the name of the domain to execute. It can be a u...
def chdir(path): """Change the working directory to `path` for the duration of this context manager. :param str path: The path to change to """ cur_cwd = os.getcwd() os.chdir(path) try: yield finally: os.chdir(cur_cwd)
def function[chdir, parameter[path]]: constant[Change the working directory to `path` for the duration of this context manager. :param str path: The path to change to ] variable[cur_cwd] assign[=] call[name[os].getcwd, parameter[]] call[name[os].chdir, parameter[name[path]]] <as...
keyword[def] identifier[chdir] ( identifier[path] ): literal[string] identifier[cur_cwd] = identifier[os] . identifier[getcwd] () identifier[os] . identifier[chdir] ( identifier[path] ) keyword[try] : keyword[yield] keyword[finally] : identifier[os] . identifier[chdir] ( i...
def chdir(path): """Change the working directory to `path` for the duration of this context manager. :param str path: The path to change to """ cur_cwd = os.getcwd() os.chdir(path) try: yield # depends on [control=['try'], data=[]] finally: os.chdir(cur_cwd)
def remove_collisions(self, min_dist=0.5): """ Remove vnodes that are too close to existing atoms in the structure Args: min_dist(float): The minimum distance that a vertex needs to be from existing atoms. """ vfcoords = [v.frac_coords for v in self.v...
def function[remove_collisions, parameter[self, min_dist]]: constant[ Remove vnodes that are too close to existing atoms in the structure Args: min_dist(float): The minimum distance that a vertex needs to be from existing atoms. ] variable[vfcoords] a...
keyword[def] identifier[remove_collisions] ( identifier[self] , identifier[min_dist] = literal[int] ): literal[string] identifier[vfcoords] =[ identifier[v] . identifier[frac_coords] keyword[for] identifier[v] keyword[in] identifier[self] . identifier[vnodes] ] identifier[sfcoords] = i...
def remove_collisions(self, min_dist=0.5): """ Remove vnodes that are too close to existing atoms in the structure Args: min_dist(float): The minimum distance that a vertex needs to be from existing atoms. """ vfcoords = [v.frac_coords for v in self.vnodes] ...
def load_positions(positions_path): """Load the positions of an image. Positions correspond to a set of pixels in the lensed source galaxy that are anticipated to come from the same \ multiply-imaged region of the source-plane. Mass models which do not trace the pixels within a threshold value of \ one...
def function[load_positions, parameter[positions_path]]: constant[Load the positions of an image. Positions correspond to a set of pixels in the lensed source galaxy that are anticipated to come from the same multiply-imaged region of the source-plane. Mass models which do not trace the pixels within a...
keyword[def] identifier[load_positions] ( identifier[positions_path] ): literal[string] keyword[with] identifier[open] ( identifier[positions_path] ) keyword[as] identifier[f] : identifier[position_string] = identifier[f] . identifier[readlines] () identifier[positions] =[] keyword[f...
def load_positions(positions_path): """Load the positions of an image. Positions correspond to a set of pixels in the lensed source galaxy that are anticipated to come from the same multiply-imaged region of the source-plane. Mass models which do not trace the pixels within a threshold value of one ano...
def make_new(self, rev): # type: (str) -> RevOptions """ Make a copy of the current instance, but with a new rev. Args: rev: the name of the revision for the new object. """ return self.vcs.make_rev_options(rev, extra_args=self.extra_args)
def function[make_new, parameter[self, rev]]: constant[ Make a copy of the current instance, but with a new rev. Args: rev: the name of the revision for the new object. ] return[call[name[self].vcs.make_rev_options, parameter[name[rev]]]]
keyword[def] identifier[make_new] ( identifier[self] , identifier[rev] ): literal[string] keyword[return] identifier[self] . identifier[vcs] . identifier[make_rev_options] ( identifier[rev] , identifier[extra_args] = identifier[self] . identifier[extra_args] )
def make_new(self, rev): # type: (str) -> RevOptions '\n Make a copy of the current instance, but with a new rev.\n\n Args:\n rev: the name of the revision for the new object.\n ' return self.vcs.make_rev_options(rev, extra_args=self.extra_args)
def _request_activity_data(self, athlete, filename): """Actually do the request for activity filename This call is slow and therefore this method is memory cached. Keyword arguments: athlete -- Full name of athlete filename -- filename of request activity (e.g. \'2015_04_29_09_0...
def function[_request_activity_data, parameter[self, athlete, filename]]: constant[Actually do the request for activity filename This call is slow and therefore this method is memory cached. Keyword arguments: athlete -- Full name of athlete filename -- filename of request activ...
keyword[def] identifier[_request_activity_data] ( identifier[self] , identifier[athlete] , identifier[filename] ): literal[string] identifier[response] = identifier[self] . identifier[_get_request] ( identifier[self] . identifier[_activity_endpoint] ( identifier[athlete] , identifier[filename] )). ...
def _request_activity_data(self, athlete, filename): """Actually do the request for activity filename This call is slow and therefore this method is memory cached. Keyword arguments: athlete -- Full name of athlete filename -- filename of request activity (e.g. '2015_04_29_09_03_16....
def resp_set_label(self, resp, label=None): """Default callback for get_label/set_label """ if label: self.label=label elif resp: self.label=resp.label.decode().replace("\x00", "")
def function[resp_set_label, parameter[self, resp, label]]: constant[Default callback for get_label/set_label ] if name[label] begin[:] name[self].label assign[=] name[label]
keyword[def] identifier[resp_set_label] ( identifier[self] , identifier[resp] , identifier[label] = keyword[None] ): literal[string] keyword[if] identifier[label] : identifier[self] . identifier[label] = identifier[label] keyword[elif] identifier[resp] : identi...
def resp_set_label(self, resp, label=None): """Default callback for get_label/set_label """ if label: self.label = label # depends on [control=['if'], data=[]] elif resp: self.label = resp.label.decode().replace('\x00', '') # depends on [control=['if'], data=[]]
def delete(self, *args, **kwargs): """Delete an object""" self.before_delete(args, kwargs) self.delete_object(kwargs) result = {'meta': {'message': 'Object successfully deleted'}} final_result = self.after_delete(result) return final_result
def function[delete, parameter[self]]: constant[Delete an object] call[name[self].before_delete, parameter[name[args], name[kwargs]]] call[name[self].delete_object, parameter[name[kwargs]]] variable[result] assign[=] dictionary[[<ast.Constant object at 0x7da1b17fb160>], [<ast.Dict object...
keyword[def] identifier[delete] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[before_delete] ( identifier[args] , identifier[kwargs] ) identifier[self] . identifier[delete_object] ( identifier[kwargs] ) identifier[...
def delete(self, *args, **kwargs): """Delete an object""" self.before_delete(args, kwargs) self.delete_object(kwargs) result = {'meta': {'message': 'Object successfully deleted'}} final_result = self.after_delete(result) return final_result
def calc_epc_v1(self): """Apply the evaporation correction factors and adjust evaporation to the altitude of the individual zones. Calculate the areal mean of (uncorrected) potential evaporation for the subbasin, adjust it to the individual zones in accordance with their heights and perform some co...
def function[calc_epc_v1, parameter[self]]: constant[Apply the evaporation correction factors and adjust evaporation to the altitude of the individual zones. Calculate the areal mean of (uncorrected) potential evaporation for the subbasin, adjust it to the individual zones in accordance with th...
keyword[def] identifier[calc_epc_v1] ( identifier[self] ): literal[string] identifier[con] = identifier[self] . identifier[parameters] . identifier[control] . identifier[fastaccess] identifier[flu] = identifier[self] . identifier[sequences] . identifier[fluxes] . identifier[fastaccess] keyword[...
def calc_epc_v1(self): """Apply the evaporation correction factors and adjust evaporation to the altitude of the individual zones. Calculate the areal mean of (uncorrected) potential evaporation for the subbasin, adjust it to the individual zones in accordance with their heights and perform some co...
def on_startup(self, callback: callable, polling=True, webhook=True): """ Register a callback for the startup process :param callback: :param polling: use with polling :param webhook: use with webhook """ self._check_frozen() if not webhook and not pollin...
def function[on_startup, parameter[self, callback, polling, webhook]]: constant[ Register a callback for the startup process :param callback: :param polling: use with polling :param webhook: use with webhook ] call[name[self]._check_frozen, parameter[]] i...
keyword[def] identifier[on_startup] ( identifier[self] , identifier[callback] : identifier[callable] , identifier[polling] = keyword[True] , identifier[webhook] = keyword[True] ): literal[string] identifier[self] . identifier[_check_frozen] () keyword[if] keyword[not] identifier[webhook]...
def on_startup(self, callback: callable, polling=True, webhook=True): """ Register a callback for the startup process :param callback: :param polling: use with polling :param webhook: use with webhook """ self._check_frozen() if not webhook and (not polling): ...
def visit_wavedrom(self, node): """ Visit the wavedrom node """ format = determine_format(self.builder.supported_image_types) if format is None: raise SphinxError(__("Cannot determine a suitable output format")) # Create random filename bname = "wavedrom-{}".format(uuid4()) outp...
def function[visit_wavedrom, parameter[self, node]]: constant[ Visit the wavedrom node ] variable[format] assign[=] call[name[determine_format], parameter[name[self].builder.supported_image_types]] if compare[name[format] is constant[None]] begin[:] <ast.Raise object at 0x7da20c6...
keyword[def] identifier[visit_wavedrom] ( identifier[self] , identifier[node] ): literal[string] identifier[format] = identifier[determine_format] ( identifier[self] . identifier[builder] . identifier[supported_image_types] ) keyword[if] identifier[format] keyword[is] keyword[None] : keywo...
def visit_wavedrom(self, node): """ Visit the wavedrom node """ format = determine_format(self.builder.supported_image_types) if format is None: raise SphinxError(__('Cannot determine a suitable output format')) # depends on [control=['if'], data=[]] # Create random filename bname =...
def elcm_session_delete(irmc_info, session_id, terminate=False): """send an eLCM request to remove a session from the session list :param irmc_info: node info :param session_id: session id :param terminate: a running session must be terminated before removing :raises: ELCMSessionNotFound if the ses...
def function[elcm_session_delete, parameter[irmc_info, session_id, terminate]]: constant[send an eLCM request to remove a session from the session list :param irmc_info: node info :param session_id: session id :param terminate: a running session must be terminated before removing :raises: ELCMS...
keyword[def] identifier[elcm_session_delete] ( identifier[irmc_info] , identifier[session_id] , identifier[terminate] = keyword[False] ): literal[string] keyword[if] identifier[terminate] : identifier[session] = identifier[elcm_session_get_status] ( identifier[irmc_info] , identifier[se...
def elcm_session_delete(irmc_info, session_id, terminate=False): """send an eLCM request to remove a session from the session list :param irmc_info: node info :param session_id: session id :param terminate: a running session must be terminated before removing :raises: ELCMSessionNotFound if the ses...
def delete_plate(self, plate_id, delete_meta_data=False): """ Delete a plate from the database :param plate_id: The plate id :param delete_meta_data: Optionally delete all meta data associated with this plate as well :return: None """ if plate_id not in ...
def function[delete_plate, parameter[self, plate_id, delete_meta_data]]: constant[ Delete a plate from the database :param plate_id: The plate id :param delete_meta_data: Optionally delete all meta data associated with this plate as well :return: None ] i...
keyword[def] identifier[delete_plate] ( identifier[self] , identifier[plate_id] , identifier[delete_meta_data] = keyword[False] ): literal[string] keyword[if] identifier[plate_id] keyword[not] keyword[in] identifier[self] . identifier[plates] : identifier[logging] . identifier[inf...
def delete_plate(self, plate_id, delete_meta_data=False): """ Delete a plate from the database :param plate_id: The plate id :param delete_meta_data: Optionally delete all meta data associated with this plate as well :return: None """ if plate_id not in self.plat...
def _render_content(self, content, **settings): """ Perform widget rendering, but do not print anything. """ bar_len = int(settings[self.SETTING_BAR_WIDTH]) if not bar_len: bar_len = TERMINAL_WIDTH - 10 percent = content progress = "" progress ...
def function[_render_content, parameter[self, content]]: constant[ Perform widget rendering, but do not print anything. ] variable[bar_len] assign[=] call[name[int], parameter[call[name[settings]][name[self].SETTING_BAR_WIDTH]]] if <ast.UnaryOp object at 0x7da2049615a0> begin[:] ...
keyword[def] identifier[_render_content] ( identifier[self] , identifier[content] ,** identifier[settings] ): literal[string] identifier[bar_len] = identifier[int] ( identifier[settings] [ identifier[self] . identifier[SETTING_BAR_WIDTH] ]) keyword[if] keyword[not] identifier[bar_len] : ...
def _render_content(self, content, **settings): """ Perform widget rendering, but do not print anything. """ bar_len = int(settings[self.SETTING_BAR_WIDTH]) if not bar_len: bar_len = TERMINAL_WIDTH - 10 # depends on [control=['if'], data=[]] percent = content progress = '' ...
def p_ty_funty_complex(self, p): "ty : '(' maybe_arg_types ')' ARROW ty" argument_types=p[2] return_type=p[5] # Check here whether too many kwarg or vararg types are present # Each item in the list uses the dictionary encoding of tagged variants arg_types = [argty['arg_t...
def function[p_ty_funty_complex, parameter[self, p]]: constant[ty : '(' maybe_arg_types ')' ARROW ty] variable[argument_types] assign[=] call[name[p]][constant[2]] variable[return_type] assign[=] call[name[p]][constant[5]] variable[arg_types] assign[=] <ast.ListComp object at 0x7da18f00d...
keyword[def] identifier[p_ty_funty_complex] ( identifier[self] , identifier[p] ): literal[string] identifier[argument_types] = identifier[p] [ literal[int] ] identifier[return_type] = identifier[p] [ literal[int] ] identifier[arg_types] =[ identifier[argty] [ li...
def p_ty_funty_complex(self, p): """ty : '(' maybe_arg_types ')' ARROW ty""" argument_types = p[2] return_type = p[5] # Check here whether too many kwarg or vararg types are present # Each item in the list uses the dictionary encoding of tagged variants arg_types = [argty['arg_type'] for argty i...
def image_list(self, lookup='all'): ''' Return a mapping of all image data for available providers ''' data = {} lookups = self.lookup_providers(lookup) if not lookups: return data for alias, driver in lookups: fun = '{0}.avail_images'.fo...
def function[image_list, parameter[self, lookup]]: constant[ Return a mapping of all image data for available providers ] variable[data] assign[=] dictionary[[], []] variable[lookups] assign[=] call[name[self].lookup_providers, parameter[name[lookup]]] if <ast.UnaryOp obj...
keyword[def] identifier[image_list] ( identifier[self] , identifier[lookup] = literal[string] ): literal[string] identifier[data] ={} identifier[lookups] = identifier[self] . identifier[lookup_providers] ( identifier[lookup] ) keyword[if] keyword[not] identifier[lookups] : ...
def image_list(self, lookup='all'): """ Return a mapping of all image data for available providers """ data = {} lookups = self.lookup_providers(lookup) if not lookups: return data # depends on [control=['if'], data=[]] for (alias, driver) in lookups: fun = '{0}.avai...
def verify(self, keys=None): """ Verify that the assertion is syntactically correct and the signature is correct if present. :param keys: If not the default key file should be used then use one of these. """ try: res = self._verify() except Assertion...
def function[verify, parameter[self, keys]]: constant[ Verify that the assertion is syntactically correct and the signature is correct if present. :param keys: If not the default key file should be used then use one of these. ] <ast.Try object at 0x7da18f811c30> if <...
keyword[def] identifier[verify] ( identifier[self] , identifier[keys] = keyword[None] ): literal[string] keyword[try] : identifier[res] = identifier[self] . identifier[_verify] () keyword[except] identifier[AssertionError] keyword[as] identifier[err] : identif...
def verify(self, keys=None): """ Verify that the assertion is syntactically correct and the signature is correct if present. :param keys: If not the default key file should be used then use one of these. """ try: res = self._verify() # depends on [control=['try'], data=...
def structure_analysis_summary_report(feature, parent): """Retrieve an HTML structure analysis table report from a multi exposure analysis. """ _ = feature, parent # NOQA analysis_dir = get_analysis_dir(exposure_structure['key']) if analysis_dir: return get_impact_report_as_string(analy...
def function[structure_analysis_summary_report, parameter[feature, parent]]: constant[Retrieve an HTML structure analysis table report from a multi exposure analysis. ] variable[_] assign[=] tuple[[<ast.Name object at 0x7da1b0c53d00>, <ast.Name object at 0x7da1b0c50280>]] variable[analys...
keyword[def] identifier[structure_analysis_summary_report] ( identifier[feature] , identifier[parent] ): literal[string] identifier[_] = identifier[feature] , identifier[parent] identifier[analysis_dir] = identifier[get_analysis_dir] ( identifier[exposure_structure] [ literal[string] ]) keyword[...
def structure_analysis_summary_report(feature, parent): """Retrieve an HTML structure analysis table report from a multi exposure analysis. """ _ = (feature, parent) # NOQA analysis_dir = get_analysis_dir(exposure_structure['key']) if analysis_dir: return get_impact_report_as_string(ana...
def consecutive(iterable, n): """ consecutive('ABCDEF', 3) --> ABC BCD CDE DEF consecutive(itertools.cycle(iter), n) to get looped sequence """ iterators = itertools.tee(iterable, n) for i, it in enumerate(iterators): for _ in range(i): next(it, None) return zip(*iterator...
def function[consecutive, parameter[iterable, n]]: constant[ consecutive('ABCDEF', 3) --> ABC BCD CDE DEF consecutive(itertools.cycle(iter), n) to get looped sequence ] variable[iterators] assign[=] call[name[itertools].tee, parameter[name[iterable], name[n]]] for taget[tuple[[<ast.N...
keyword[def] identifier[consecutive] ( identifier[iterable] , identifier[n] ): literal[string] identifier[iterators] = identifier[itertools] . identifier[tee] ( identifier[iterable] , identifier[n] ) keyword[for] identifier[i] , identifier[it] keyword[in] identifier[enumerate] ( identifier[iterator...
def consecutive(iterable, n): """ consecutive('ABCDEF', 3) --> ABC BCD CDE DEF consecutive(itertools.cycle(iter), n) to get looped sequence """ iterators = itertools.tee(iterable, n) for (i, it) in enumerate(iterators): for _ in range(i): next(it, None) # depends on [control...
def load_from_file_like(cls, flo, format=None): """ Load the object to a given file like object with the given protocol. """ format = self.format if format is None else format load = getattr(cls, "load_%s" % format, None) if load is None: raise ValueError(...
def function[load_from_file_like, parameter[cls, flo, format]]: constant[ Load the object to a given file like object with the given protocol. ] variable[format] assign[=] <ast.IfExp object at 0x7da18f812260> variable[load] assign[=] call[name[getattr], parameter[name[cls], b...
keyword[def] identifier[load_from_file_like] ( identifier[cls] , identifier[flo] , identifier[format] = keyword[None] ): literal[string] identifier[format] = identifier[self] . identifier[format] keyword[if] identifier[format] keyword[is] keyword[None] keyword[else] identifier[format] ...
def load_from_file_like(cls, flo, format=None): """ Load the object to a given file like object with the given protocol. """ format = self.format if format is None else format load = getattr(cls, 'load_%s' % format, None) if load is None: raise ValueError("Unknown format '%s'...
def convert_command_output(*command): """ Command line interface for ``coloredlogs --to-html``. Takes a command (and its arguments) and runs the program under ``script`` (emulating an interactive terminal), intercepts the output of the command and converts ANSI escape sequences in the output to HTM...
def function[convert_command_output, parameter[]]: constant[ Command line interface for ``coloredlogs --to-html``. Takes a command (and its arguments) and runs the program under ``script`` (emulating an interactive terminal), intercepts the output of the command and converts ANSI escape sequenc...
keyword[def] identifier[convert_command_output] (* identifier[command] ): literal[string] identifier[captured_output] = identifier[capture] ( identifier[command] ) identifier[converted_output] = identifier[convert] ( identifier[captured_output] ) keyword[if] identifier[connected_to_terminal] ():...
def convert_command_output(*command): """ Command line interface for ``coloredlogs --to-html``. Takes a command (and its arguments) and runs the program under ``script`` (emulating an interactive terminal), intercepts the output of the command and converts ANSI escape sequences in the output to HTM...
def collect_columns(self): """ Collect columns information from a given model. a column info contains the py3 informations exclude Should the column be excluded from the current context ? name the name of t...
def function[collect_columns, parameter[self]]: constant[ Collect columns information from a given model. a column info contains the py3 informations exclude Should the column be excluded from the current context ? name ...
keyword[def] identifier[collect_columns] ( identifier[self] ): literal[string] identifier[res] =[] keyword[for] identifier[prop] keyword[in] identifier[self] . identifier[get_sorted_columns] (): identifier[info_dict] = identifier[self] . identifier[get_info_field] ( identi...
def collect_columns(self): """ Collect columns information from a given model. a column info contains the py3 informations exclude Should the column be excluded from the current context ? name the name of the k...
def load_db(self): """Load the taxonomy into a sqlite3 database. This will set ``self.db`` to a sqlite3 database which contains all of the taxonomic information in the reference package. """ db = taxdb.Taxdb() db.create_tables() reader = csv.DictReader(self.open...
def function[load_db, parameter[self]]: constant[Load the taxonomy into a sqlite3 database. This will set ``self.db`` to a sqlite3 database which contains all of the taxonomic information in the reference package. ] variable[db] assign[=] call[name[taxdb].Taxdb, parameter[]] ...
keyword[def] identifier[load_db] ( identifier[self] ): literal[string] identifier[db] = identifier[taxdb] . identifier[Taxdb] () identifier[db] . identifier[create_tables] () identifier[reader] = identifier[csv] . identifier[DictReader] ( identifier[self] . identifier[open_resour...
def load_db(self): """Load the taxonomy into a sqlite3 database. This will set ``self.db`` to a sqlite3 database which contains all of the taxonomic information in the reference package. """ db = taxdb.Taxdb() db.create_tables() reader = csv.DictReader(self.open_resource('taxono...
def is_address_reserved(self, address): """ Determines if an address belongs to a reserved page. @note: Returns always C{False} for kernel mode addresses. @type address: int @param address: Memory address to query. @rtype: bool @return: C{True} if the address...
def function[is_address_reserved, parameter[self, address]]: constant[ Determines if an address belongs to a reserved page. @note: Returns always C{False} for kernel mode addresses. @type address: int @param address: Memory address to query. @rtype: bool @ret...
keyword[def] identifier[is_address_reserved] ( identifier[self] , identifier[address] ): literal[string] keyword[try] : identifier[mbi] = identifier[self] . identifier[mquery] ( identifier[address] ) keyword[except] identifier[WindowsError] : identifier[e] = iden...
def is_address_reserved(self, address): """ Determines if an address belongs to a reserved page. @note: Returns always C{False} for kernel mode addresses. @type address: int @param address: Memory address to query. @rtype: bool @return: C{True} if the address bel...
def per_base(x, windows, is_accessible=None, fill=np.nan): """Calculate the per-base value of a windowed statistic. Parameters ---------- x : array_like, shape (n_windows,) The statistic to average per-base. windows : array_like, int, shape (n_windows, 2) The windows used, as an ar...
def function[per_base, parameter[x, windows, is_accessible, fill]]: constant[Calculate the per-base value of a windowed statistic. Parameters ---------- x : array_like, shape (n_windows,) The statistic to average per-base. windows : array_like, int, shape (n_windows, 2) The win...
keyword[def] identifier[per_base] ( identifier[x] , identifier[windows] , identifier[is_accessible] = keyword[None] , identifier[fill] = identifier[np] . identifier[nan] ): literal[string] keyword[if] identifier[is_accessible] keyword[is] keyword[None] : identifier[n_bases] = identif...
def per_base(x, windows, is_accessible=None, fill=np.nan): """Calculate the per-base value of a windowed statistic. Parameters ---------- x : array_like, shape (n_windows,) The statistic to average per-base. windows : array_like, int, shape (n_windows, 2) The windows used, as an ar...
def default_links_factory(pid, record=None, **kwargs): """Factory for record links generation. :param pid: A Persistent Identifier instance. :returns: Dictionary containing a list of useful links for the record. """ endpoint = '.{0}_item'.format( current_records_rest.default_endpoint_prefix...
def function[default_links_factory, parameter[pid, record]]: constant[Factory for record links generation. :param pid: A Persistent Identifier instance. :returns: Dictionary containing a list of useful links for the record. ] variable[endpoint] assign[=] call[constant[.{0}_item].format, par...
keyword[def] identifier[default_links_factory] ( identifier[pid] , identifier[record] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[endpoint] = literal[string] . identifier[format] ( identifier[current_records_rest] . identifier[default_endpoint_prefixes] [ identifier[pid] . ide...
def default_links_factory(pid, record=None, **kwargs): """Factory for record links generation. :param pid: A Persistent Identifier instance. :returns: Dictionary containing a list of useful links for the record. """ endpoint = '.{0}_item'.format(current_records_rest.default_endpoint_prefixes[pid.pi...
def get_symbol_train(network, num_classes, from_layers, num_filters, strides, pads, sizes, ratios, normalizations=-1, steps=[], min_filter=128, nms_thresh=0.5, force_suppress=False, nms_topk=400, **kwargs): """Build network symbol for training SSD Parameters ------...
def function[get_symbol_train, parameter[network, num_classes, from_layers, num_filters, strides, pads, sizes, ratios, normalizations, steps, min_filter, nms_thresh, force_suppress, nms_topk]]: constant[Build network symbol for training SSD Parameters ---------- network : str base network s...
keyword[def] identifier[get_symbol_train] ( identifier[network] , identifier[num_classes] , identifier[from_layers] , identifier[num_filters] , identifier[strides] , identifier[pads] , identifier[sizes] , identifier[ratios] , identifier[normalizations] =- literal[int] , identifier[steps] =[], identifier[min_filter] ...
def get_symbol_train(network, num_classes, from_layers, num_filters, strides, pads, sizes, ratios, normalizations=-1, steps=[], min_filter=128, nms_thresh=0.5, force_suppress=False, nms_topk=400, **kwargs): """Build network symbol for training SSD Parameters ---------- network : str base networ...
def fit(self, features, class_labels): """Constructs the MDR feature map from the provided training data. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix class_labels: array-like {n_samples} List of true class labels ...
def function[fit, parameter[self, features, class_labels]]: constant[Constructs the MDR feature map from the provided training data. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix class_labels: array-like {n_samples} Lis...
keyword[def] identifier[fit] ( identifier[self] , identifier[features] , identifier[class_labels] ): literal[string] identifier[unique_labels] = identifier[sorted] ( identifier[np] . identifier[unique] ( identifier[class_labels] )) keyword[if] identifier[len] ( identifier[unique_labels] )...
def fit(self, features, class_labels): """Constructs the MDR feature map from the provided training data. Parameters ---------- features: array-like {n_samples, n_features} Feature matrix class_labels: array-like {n_samples} List of true class labels ...
def setitem_via_pathlist(ol,value,pathlist): ''' from elist.elist import * y = ['a',['b',["bb"]],'c'] y[1][1] setitem_via_pathlist(y,"500",[1,1]) y ''' this = ol for i in range(0,pathlist.__len__()-1): key = pathlist[i] this = this.__getitem__(key)...
def function[setitem_via_pathlist, parameter[ol, value, pathlist]]: constant[ from elist.elist import * y = ['a',['b',["bb"]],'c'] y[1][1] setitem_via_pathlist(y,"500",[1,1]) y ] variable[this] assign[=] name[ol] for taget[name[i]] in starred[call[name...
keyword[def] identifier[setitem_via_pathlist] ( identifier[ol] , identifier[value] , identifier[pathlist] ): literal[string] identifier[this] = identifier[ol] keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[pathlist] . identifier[__len__] ()- literal[int] ): ...
def setitem_via_pathlist(ol, value, pathlist): """ from elist.elist import * y = ['a',['b',["bb"]],'c'] y[1][1] setitem_via_pathlist(y,"500",[1,1]) y """ this = ol for i in range(0, pathlist.__len__() - 1): key = pathlist[i] this = this.__getitem__...
def _resolve_capability(self, atom): """Return a terminal code for a capname or a sugary name, or an empty Unicode. The return value is always Unicode, because otherwise it is clumsy (especially in Python 3) to concatenate with real (Unicode) strings. """ code = tigetst...
def function[_resolve_capability, parameter[self, atom]]: constant[Return a terminal code for a capname or a sugary name, or an empty Unicode. The return value is always Unicode, because otherwise it is clumsy (especially in Python 3) to concatenate with real (Unicode) strings. ...
keyword[def] identifier[_resolve_capability] ( identifier[self] , identifier[atom] ): literal[string] identifier[code] = identifier[tigetstr] ( identifier[self] . identifier[_sugar] . identifier[get] ( identifier[atom] , identifier[atom] )) keyword[if] identifier[code] : ...
def _resolve_capability(self, atom): """Return a terminal code for a capname or a sugary name, or an empty Unicode. The return value is always Unicode, because otherwise it is clumsy (especially in Python 3) to concatenate with real (Unicode) strings. """ code = tigetstr(self._...
def from_dicts(cls, mesh_name, vert_dict, normal_dict): """Returns a wavefront .obj string using pre-triangulated vertex dict and normal dict as reference.""" # Put header in string wavefront_str = "o {name}\n".format(name=mesh_name) # Write Vertex data from vert_dict for wall ...
def function[from_dicts, parameter[cls, mesh_name, vert_dict, normal_dict]]: constant[Returns a wavefront .obj string using pre-triangulated vertex dict and normal dict as reference.] variable[wavefront_str] assign[=] call[constant[o {name} ].format, parameter[]] for taget[name[wall]] in starred...
keyword[def] identifier[from_dicts] ( identifier[cls] , identifier[mesh_name] , identifier[vert_dict] , identifier[normal_dict] ): literal[string] identifier[wavefront_str] = literal[string] . identifier[format] ( identifier[name] = identifier[mesh_name] ) keyword[for] ...
def from_dicts(cls, mesh_name, vert_dict, normal_dict): """Returns a wavefront .obj string using pre-triangulated vertex dict and normal dict as reference.""" # Put header in string wavefront_str = 'o {name}\n'.format(name=mesh_name) # Write Vertex data from vert_dict for wall in vert_dict: ...
def hangul_to_jamo(hangul_string): """Convert a string of Hangul to jamo. Arguments may be iterables of characters. hangul_to_jamo should split every Hangul character into U+11xx jamo characters for any given string. Non-hangul characters are not changed. hangul_to_jamo is the generator version of...
def function[hangul_to_jamo, parameter[hangul_string]]: constant[Convert a string of Hangul to jamo. Arguments may be iterables of characters. hangul_to_jamo should split every Hangul character into U+11xx jamo characters for any given string. Non-hangul characters are not changed. hangul_to_j...
keyword[def] identifier[hangul_to_jamo] ( identifier[hangul_string] ): literal[string] keyword[return] ( identifier[_] keyword[for] identifier[_] keyword[in] identifier[chain] . identifier[from_iterable] ( identifier[_hangul_char_to_jamo] ( identifier[_] ) keyword[for] identifier[_] keyword[in] ...
def hangul_to_jamo(hangul_string): """Convert a string of Hangul to jamo. Arguments may be iterables of characters. hangul_to_jamo should split every Hangul character into U+11xx jamo characters for any given string. Non-hangul characters are not changed. hangul_to_jamo is the generator version of...
def per_month(start: datetime, end: datetime, n: int=1): """ Iterates over time range in one month steps. Clamps to number of days in given month. :param start: Start of time range (inclusive) :param end: End of time range (exclusive) :param n: Number of months to step. Default is 1. :retu...
def function[per_month, parameter[start, end, n]]: constant[ Iterates over time range in one month steps. Clamps to number of days in given month. :param start: Start of time range (inclusive) :param end: End of time range (exclusive) :param n: Number of months to step. Default is 1. :...
keyword[def] identifier[per_month] ( identifier[start] : identifier[datetime] , identifier[end] : identifier[datetime] , identifier[n] : identifier[int] = literal[int] ): literal[string] identifier[curr] = identifier[start] . identifier[replace] ( identifier[day] = literal[int] , identifier[hour] = literal...
def per_month(start: datetime, end: datetime, n: int=1): """ Iterates over time range in one month steps. Clamps to number of days in given month. :param start: Start of time range (inclusive) :param end: End of time range (exclusive) :param n: Number of months to step. Default is 1. :retu...
def get_principal_dictionary(graph_client, object_ids, raise_on_graph_call_error=False): """Retrieves Azure AD Objects for corresponding object ids passed. :param graph_client: A client for Microsoft Graph. :param object_ids: The object ids to retrieve Azure AD objects for. :param raise_...
def function[get_principal_dictionary, parameter[graph_client, object_ids, raise_on_graph_call_error]]: constant[Retrieves Azure AD Objects for corresponding object ids passed. :param graph_client: A client for Microsoft Graph. :param object_ids: The object ids to retrieve Azure AD objects for. ...
keyword[def] identifier[get_principal_dictionary] ( identifier[graph_client] , identifier[object_ids] , identifier[raise_on_graph_call_error] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[object_ids] : keyword[return] {} identifier[object_params] =...
def get_principal_dictionary(graph_client, object_ids, raise_on_graph_call_error=False): """Retrieves Azure AD Objects for corresponding object ids passed. :param graph_client: A client for Microsoft Graph. :param object_ids: The object ids to retrieve Azure AD objects for. :param raise_on_g...
def date(self, date): """ Returns the date of file creation as a python date object """ self.creation_year = date.year self.creation_day_of_year = date.timetuple().tm_yday
def function[date, parameter[self, date]]: constant[ Returns the date of file creation as a python date object ] name[self].creation_year assign[=] name[date].year name[self].creation_day_of_year assign[=] call[name[date].timetuple, parameter[]].tm_yday
keyword[def] identifier[date] ( identifier[self] , identifier[date] ): literal[string] identifier[self] . identifier[creation_year] = identifier[date] . identifier[year] identifier[self] . identifier[creation_day_of_year] = identifier[date] . identifier[timetuple] (). identifier[tm_yday]
def date(self, date): """ Returns the date of file creation as a python date object """ self.creation_year = date.year self.creation_day_of_year = date.timetuple().tm_yday
def eConnect(self, host, port, clientId=0, extraAuth=False): """eConnect(EClientSocketBase self, char const * host, unsigned int port, int clientId=0, bool extraAuth=False) -> bool""" return _swigibpy.EClientSocketBase_eConnect(self, host, port, clientId, extraAuth)
def function[eConnect, parameter[self, host, port, clientId, extraAuth]]: constant[eConnect(EClientSocketBase self, char const * host, unsigned int port, int clientId=0, bool extraAuth=False) -> bool] return[call[name[_swigibpy].EClientSocketBase_eConnect, parameter[name[self], name[host], name[port], name[...
keyword[def] identifier[eConnect] ( identifier[self] , identifier[host] , identifier[port] , identifier[clientId] = literal[int] , identifier[extraAuth] = keyword[False] ): literal[string] keyword[return] identifier[_swigibpy] . identifier[EClientSocketBase_eConnect] ( identifier[self] , identifie...
def eConnect(self, host, port, clientId=0, extraAuth=False): """eConnect(EClientSocketBase self, char const * host, unsigned int port, int clientId=0, bool extraAuth=False) -> bool""" return _swigibpy.EClientSocketBase_eConnect(self, host, port, clientId, extraAuth)
def set(self, x, y, value): """ Set the cell value from the specified location :param x: The column (x coord) of the character. :param y: The row (y coord) of the character. :param value: A 5-tuple of (unicode, foreground, attributes, background, width). """ self...
def function[set, parameter[self, x, y, value]]: constant[ Set the cell value from the specified location :param x: The column (x coord) of the character. :param y: The row (y coord) of the character. :param value: A 5-tuple of (unicode, foreground, attributes, background, width...
keyword[def] identifier[set] ( identifier[self] , identifier[x] , identifier[y] , identifier[value] ): literal[string] identifier[self] . identifier[_double_buffer] [ identifier[y] ][ identifier[x] ]= identifier[value]
def set(self, x, y, value): """ Set the cell value from the specified location :param x: The column (x coord) of the character. :param y: The row (y coord) of the character. :param value: A 5-tuple of (unicode, foreground, attributes, background, width). """ self._double...
def headerData(self, section, orientation, role=Qt.DisplayRole): """Override Qt method""" if role == Qt.TextAlignmentRole: if orientation == Qt.Horizontal: return to_qvariant(int(Qt.AlignHCenter | Qt.AlignVCenter)) return to_qvariant(int(Qt.AlignRight | Qt.AlignVC...
def function[headerData, parameter[self, section, orientation, role]]: constant[Override Qt method] if compare[name[role] equal[==] name[Qt].TextAlignmentRole] begin[:] if compare[name[orientation] equal[==] name[Qt].Horizontal] begin[:] return[call[name[to_qvariant], paramet...
keyword[def] identifier[headerData] ( identifier[self] , identifier[section] , identifier[orientation] , identifier[role] = identifier[Qt] . identifier[DisplayRole] ): literal[string] keyword[if] identifier[role] == identifier[Qt] . identifier[TextAlignmentRole] : keyword[if] identif...
def headerData(self, section, orientation, role=Qt.DisplayRole): """Override Qt method""" if role == Qt.TextAlignmentRole: if orientation == Qt.Horizontal: return to_qvariant(int(Qt.AlignHCenter | Qt.AlignVCenter)) # depends on [control=['if'], data=[]] return to_qvariant(int(Qt.Ali...
def blk_nd(blk, shape): """Iterate through the blocks that cover an array. This function first iterates trough the blocks that recover the part of the array given by max_blk_coverage and then iterates with smaller blocks for the rest of the array. :param blk: the N-dimensional shape of the blo...
def function[blk_nd, parameter[blk, shape]]: constant[Iterate through the blocks that cover an array. This function first iterates trough the blocks that recover the part of the array given by max_blk_coverage and then iterates with smaller blocks for the rest of the array. :param blk: the...
keyword[def] identifier[blk_nd] ( identifier[blk] , identifier[shape] ): literal[string] identifier[internals] =( identifier[blk_1d] ( identifier[b] , identifier[s] ) keyword[for] identifier[b] , identifier[s] keyword[in] identifier[zip] ( identifier[blk] , identifier[shape] )) keyword[return] ide...
def blk_nd(blk, shape): """Iterate through the blocks that cover an array. This function first iterates trough the blocks that recover the part of the array given by max_blk_coverage and then iterates with smaller blocks for the rest of the array. :param blk: the N-dimensional shape of the blo...
def optional(_object): """ This decorator has a double functionality, it can wrap validators and make them optional or it can wrap keys and make that entry optional. **Optional Validator:** Allows to have validators work only when there is a value that contains some data, otherwise it will just...
def function[optional, parameter[_object]]: constant[ This decorator has a double functionality, it can wrap validators and make them optional or it can wrap keys and make that entry optional. **Optional Validator:** Allows to have validators work only when there is a value that contains so...
keyword[def] identifier[optional] ( identifier[_object] ): literal[string] keyword[if] identifier[is_callable] ( identifier[_object] ): identifier[validator] = identifier[_object] @ identifier[wraps] ( identifier[validator] ) keyword[def] identifier[decorated] ( identifier[val...
def optional(_object): """ This decorator has a double functionality, it can wrap validators and make them optional or it can wrap keys and make that entry optional. **Optional Validator:** Allows to have validators work only when there is a value that contains some data, otherwise it will just...
def write_classdesc(self, obj, parent=None): """ Writes a class description :param obj: Class description to write :param parent: """ if obj not in self.references: # Add reference self.references.append(obj) logging.debug( ...
def function[write_classdesc, parameter[self, obj, parent]]: constant[ Writes a class description :param obj: Class description to write :param parent: ] if compare[name[obj] <ast.NotIn object at 0x7da2590d7190> name[self].references] begin[:] call[name[s...
keyword[def] identifier[write_classdesc] ( identifier[self] , identifier[obj] , identifier[parent] = keyword[None] ): literal[string] keyword[if] identifier[obj] keyword[not] keyword[in] identifier[self] . identifier[references] : identifier[self] . identifier[references] ...
def write_classdesc(self, obj, parent=None): """ Writes a class description :param obj: Class description to write :param parent: """ if obj not in self.references: # Add reference self.references.append(obj) logging.debug('*** Adding ref 0x%X for classde...
def _index(self, model): ''' Elasticsearch multi types has been removed Use multi index unless set __msearch_index__. ''' doc_type = model if not isinstance(model, str): doc_type = model.__table__.name index_name = doc_type if hasattr(model, "...
def function[_index, parameter[self, model]]: constant[ Elasticsearch multi types has been removed Use multi index unless set __msearch_index__. ] variable[doc_type] assign[=] name[model] if <ast.UnaryOp object at 0x7da18bccb520> begin[:] variable[doc_type...
keyword[def] identifier[_index] ( identifier[self] , identifier[model] ): literal[string] identifier[doc_type] = identifier[model] keyword[if] keyword[not] identifier[isinstance] ( identifier[model] , identifier[str] ): identifier[doc_type] = identifier[model] . identifier[...
def _index(self, model): """ Elasticsearch multi types has been removed Use multi index unless set __msearch_index__. """ doc_type = model if not isinstance(model, str): doc_type = model.__table__.name # depends on [control=['if'], data=[]] index_name = doc_type if h...
def delete(self, key): """Delete a document by id.""" assert key, "A key must be supplied for delete operations" self._collection.remove(spec_or_id={'_id': key}) LOG.debug("DB REMOVE: %s.%s", self.collection_name, key)
def function[delete, parameter[self, key]]: constant[Delete a document by id.] assert[name[key]] call[name[self]._collection.remove, parameter[]] call[name[LOG].debug, parameter[constant[DB REMOVE: %s.%s], name[self].collection_name, name[key]]]
keyword[def] identifier[delete] ( identifier[self] , identifier[key] ): literal[string] keyword[assert] identifier[key] , literal[string] identifier[self] . identifier[_collection] . identifier[remove] ( identifier[spec_or_id] ={ literal[string] : identifier[key] }) identifier[L...
def delete(self, key): """Delete a document by id.""" assert key, 'A key must be supplied for delete operations' self._collection.remove(spec_or_id={'_id': key}) LOG.debug('DB REMOVE: %s.%s', self.collection_name, key)
def fold_enrichment(self): """(property) Returns the fold enrichment at the XL-mHG cutoff.""" return self.k / (self.K*(self.cutoff/float(self.N)))
def function[fold_enrichment, parameter[self]]: constant[(property) Returns the fold enrichment at the XL-mHG cutoff.] return[binary_operation[name[self].k / binary_operation[name[self].K * binary_operation[name[self].cutoff / call[name[float], parameter[name[self].N]]]]]]
keyword[def] identifier[fold_enrichment] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[k] /( identifier[self] . identifier[K] *( identifier[self] . identifier[cutoff] / identifier[float] ( identifier[self] . identifier[N] )))
def fold_enrichment(self): """(property) Returns the fold enrichment at the XL-mHG cutoff.""" return self.k / (self.K * (self.cutoff / float(self.N)))
def fetch_document(url=None, host=None, path="/", timeout=10, raise_ssl_errors=True, extra_headers=None): """Helper method to fetch remote document. Must be given either the ``url`` or ``host``. If ``url`` is given, only that will be tried without falling back to http from https. If ``host`` given, `pa...
def function[fetch_document, parameter[url, host, path, timeout, raise_ssl_errors, extra_headers]]: constant[Helper method to fetch remote document. Must be given either the ``url`` or ``host``. If ``url`` is given, only that will be tried without falling back to http from https. If ``host`` given,...
keyword[def] identifier[fetch_document] ( identifier[url] = keyword[None] , identifier[host] = keyword[None] , identifier[path] = literal[string] , identifier[timeout] = literal[int] , identifier[raise_ssl_errors] = keyword[True] , identifier[extra_headers] = keyword[None] ): literal[string] keyword[if] k...
def fetch_document(url=None, host=None, path='/', timeout=10, raise_ssl_errors=True, extra_headers=None): """Helper method to fetch remote document. Must be given either the ``url`` or ``host``. If ``url`` is given, only that will be tried without falling back to http from https. If ``host`` given, `pa...
def frameworkMessage(self, driver, executorId, agentId, message): """ Invoked when an executor sends a message. """ # Take it out of base 64 encoding from Protobuf message = decode_data(message) log.debug('Got framework message from executor %s running o...
def function[frameworkMessage, parameter[self, driver, executorId, agentId, message]]: constant[ Invoked when an executor sends a message. ] variable[message] assign[=] call[name[decode_data], parameter[name[message]]] call[name[log].debug, parameter[constant[Got framework messag...
keyword[def] identifier[frameworkMessage] ( identifier[self] , identifier[driver] , identifier[executorId] , identifier[agentId] , identifier[message] ): literal[string] identifier[message] = identifier[decode_data] ( identifier[message] ) identifier[log] . identifier[debug] ( l...
def frameworkMessage(self, driver, executorId, agentId, message): """ Invoked when an executor sends a message. """ # Take it out of base 64 encoding from Protobuf message = decode_data(message) log.debug('Got framework message from executor %s running on agent %s: %s', executorId.value,...
def pt_fingerprint(query): """ Takes a query (in a string) and returns its 'fingerprint' """ if not have_program('pt-fingerprint'): # pragma: no cover raise OSError("pt-fingerprint doesn't appear to be installed") thread = PTFingerprintThread.get_thread() thread.in_queue.put(query) ...
def function[pt_fingerprint, parameter[query]]: constant[ Takes a query (in a string) and returns its 'fingerprint' ] if <ast.UnaryOp object at 0x7da1b061abf0> begin[:] <ast.Raise object at 0x7da1b0618940> variable[thread] assign[=] call[name[PTFingerprintThread].get_thread, para...
keyword[def] identifier[pt_fingerprint] ( identifier[query] ): literal[string] keyword[if] keyword[not] identifier[have_program] ( literal[string] ): keyword[raise] identifier[OSError] ( literal[string] ) identifier[thread] = identifier[PTFingerprintThread] . identifier[get_thread] () ...
def pt_fingerprint(query): """ Takes a query (in a string) and returns its 'fingerprint' """ if not have_program('pt-fingerprint'): # pragma: no cover raise OSError("pt-fingerprint doesn't appear to be installed") # depends on [control=['if'], data=[]] thread = PTFingerprintThread.get_thre...
def create_store_credit_transaction(cls, store_credit_transaction, **kwargs): """Create StoreCreditTransaction Create a new StoreCreditTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = a...
def function[create_store_credit_transaction, parameter[cls, store_credit_transaction]]: constant[Create StoreCreditTransaction Create a new StoreCreditTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True ...
keyword[def] identifier[create_store_credit_transaction] ( identifier[cls] , identifier[store_credit_transaction] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): ...
def create_store_credit_transaction(cls, store_credit_transaction, **kwargs): """Create StoreCreditTransaction Create a new StoreCreditTransaction This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True >>> thread = api.c...
def dim(self, dim): """Adjusts contrast to dim the display if dim is True, otherwise sets the contrast to normal brightness if dim is False. """ # Assume dim display. contrast = 0 # Adjust contrast based on VCC if not dimming. if not dim: if self._vccs...
def function[dim, parameter[self, dim]]: constant[Adjusts contrast to dim the display if dim is True, otherwise sets the contrast to normal brightness if dim is False. ] variable[contrast] assign[=] constant[0] if <ast.UnaryOp object at 0x7da1b1d36bc0> begin[:] if...
keyword[def] identifier[dim] ( identifier[self] , identifier[dim] ): literal[string] identifier[contrast] = literal[int] keyword[if] keyword[not] identifier[dim] : keyword[if] identifier[self] . identifier[_vccstate] == identifier[SSD1306_EXTERNALVCC] : ...
def dim(self, dim): """Adjusts contrast to dim the display if dim is True, otherwise sets the contrast to normal brightness if dim is False. """ # Assume dim display. contrast = 0 # Adjust contrast based on VCC if not dimming. if not dim: if self._vccstate == SSD1306_EXTERNAL...
def int_to_bytes(int_, width = None): """ .. _int_to_bytes: Converts the ``int`` ``int_`` to a ``bytes`` object. ``len(result) == width``. If ``width`` is None, a number of bytes that is able to hold the number is choosen, depending on ``int_.bit_length()``. See also: bytes_to_int_ """ if(width == None): ...
def function[int_to_bytes, parameter[int_, width]]: constant[ .. _int_to_bytes: Converts the ``int`` ``int_`` to a ``bytes`` object. ``len(result) == width``. If ``width`` is None, a number of bytes that is able to hold the number is choosen, depending on ``int_.bit_length()``. See also: bytes_to_int_ ...
keyword[def] identifier[int_to_bytes] ( identifier[int_] , identifier[width] = keyword[None] ): literal[string] keyword[if] ( identifier[width] == keyword[None] ): identifier[width] = identifier[int_] . identifier[bit_length] () identifier[byts] = identifier[math] . identifier[ceil] ( identifier[width] / li...
def int_to_bytes(int_, width=None): """ .. _int_to_bytes: Converts the ``int`` ``int_`` to a ``bytes`` object. ``len(result) == width``. If ``width`` is None, a number of bytes that is able to hold the number is choosen, depending on ``int_.bit_length()``. See also: bytes_to_int_ """ if width == None:...
def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=300.0, setup=None, init=None, loop=None, connection_class=connection.Connection, ...
def function[create_pool, parameter[dsn]]: constant[Create a connection pool. Can be used either with an ``async with`` block: .. code-block:: python async with asyncpg.create_pool(user='postgres', command_timeout=60) as pool: async with pool...
keyword[def] identifier[create_pool] ( identifier[dsn] = keyword[None] ,*, identifier[min_size] = literal[int] , identifier[max_size] = literal[int] , identifier[max_queries] = literal[int] , identifier[max_inactive_connection_lifetime] = literal[int] , identifier[setup] = keyword[None] , identifier[init] = key...
def create_pool(dsn=None, *, min_size=10, max_size=10, max_queries=50000, max_inactive_connection_lifetime=300.0, setup=None, init=None, loop=None, connection_class=connection.Connection, **connect_kwargs): """Create a connection pool. Can be used either with an ``async with`` block: .. code-block:: pytho...
def substring_search(word, collection): """Find all matches in the `collection` for the specified `word`. If `word` is empty, returns all items in `collection`. :type word: str :param word: The substring to search for. :type collection: collection, usually a list :param collection: A collecti...
def function[substring_search, parameter[word, collection]]: constant[Find all matches in the `collection` for the specified `word`. If `word` is empty, returns all items in `collection`. :type word: str :param word: The substring to search for. :type collection: collection, usually a list ...
keyword[def] identifier[substring_search] ( identifier[word] , identifier[collection] ): literal[string] keyword[return] [ identifier[item] keyword[for] identifier[item] keyword[in] identifier[sorted] ( identifier[collection] ) keyword[if] identifier[item] . identifier[startswith] ( identifier[word] )...
def substring_search(word, collection): """Find all matches in the `collection` for the specified `word`. If `word` is empty, returns all items in `collection`. :type word: str :param word: The substring to search for. :type collection: collection, usually a list :param collection: A collecti...
def _makeLocationElement(self, locationObject, name=None): """ Convert Location object to an locationElement.""" locElement = ET.Element("location") if name is not None: locElement.attrib['name'] = name for dimensionName, dimensionValue in locationObject.items(): d...
def function[_makeLocationElement, parameter[self, locationObject, name]]: constant[ Convert Location object to an locationElement.] variable[locElement] assign[=] call[name[ET].Element, parameter[constant[location]]] if compare[name[name] is_not constant[None]] begin[:] call[nam...
keyword[def] identifier[_makeLocationElement] ( identifier[self] , identifier[locationObject] , identifier[name] = keyword[None] ): literal[string] identifier[locElement] = identifier[ET] . identifier[Element] ( literal[string] ) keyword[if] identifier[name] keyword[is] keyword[not] k...
def _makeLocationElement(self, locationObject, name=None): """ Convert Location object to an locationElement.""" locElement = ET.Element('location') if name is not None: locElement.attrib['name'] = name # depends on [control=['if'], data=['name']] for (dimensionName, dimensionValue) in location...
def makePlot(gmag, pdf=False, png=False, rvs=False): """ Make a plot of a Mv vs (V-I) colour magnitude diagram containing lines of constant distance for stars at G=20. This will give an idea of the reach of Gaia. Parameters ---------- args - command line arguments """ vmini = np.linspace(-0.5,4.0,100)...
def function[makePlot, parameter[gmag, pdf, png, rvs]]: constant[ Make a plot of a Mv vs (V-I) colour magnitude diagram containing lines of constant distance for stars at G=20. This will give an idea of the reach of Gaia. Parameters ---------- args - command line arguments ] variable[vmini...
keyword[def] identifier[makePlot] ( identifier[gmag] , identifier[pdf] = keyword[False] , identifier[png] = keyword[False] , identifier[rvs] = keyword[False] ): literal[string] identifier[vmini] = identifier[np] . identifier[linspace] (- literal[int] , literal[int] , literal[int] ) keyword[if] ( identifier[...
def makePlot(gmag, pdf=False, png=False, rvs=False): """ Make a plot of a Mv vs (V-I) colour magnitude diagram containing lines of constant distance for stars at G=20. This will give an idea of the reach of Gaia. Parameters ---------- args - command line arguments """ vmini = np.linspace(-0.5, 4.0...
def load_module(self, name): """ Load the ``pygal.maps.name`` module from the previously loaded plugin """ if name not in sys.modules: sys.modules[name] = getattr(maps, name.split('.')[2]) return sys.modules[name]
def function[load_module, parameter[self, name]]: constant[ Load the ``pygal.maps.name`` module from the previously loaded plugin ] if compare[name[name] <ast.NotIn object at 0x7da2590d7190> name[sys].modules] begin[:] call[name[sys].modules][name[name]] assign[=]...
keyword[def] identifier[load_module] ( identifier[self] , identifier[name] ): literal[string] keyword[if] identifier[name] keyword[not] keyword[in] identifier[sys] . identifier[modules] : identifier[sys] . identifier[modules] [ identifier[name] ]= identifier[getattr] ( identifier[m...
def load_module(self, name): """ Load the ``pygal.maps.name`` module from the previously loaded plugin """ if name not in sys.modules: sys.modules[name] = getattr(maps, name.split('.')[2]) # depends on [control=['if'], data=['name']] return sys.modules[name]
def generate(self, batch_size, length, samples=1, fix_static=False, fix_dynamic=False): """Generate new sequences. Args: batch_size: Number of sequences to generate. length: Number of timesteps to generate for each sequence. samples: Number of samples to draw from the latent di...
def function[generate, parameter[self, batch_size, length, samples, fix_static, fix_dynamic]]: constant[Generate new sequences. Args: batch_size: Number of sequences to generate. length: Number of timesteps to generate for each sequence. samples: Number of samples to draw from the latent ...
keyword[def] identifier[generate] ( identifier[self] , identifier[batch_size] , identifier[length] , identifier[samples] = literal[int] , identifier[fix_static] = keyword[False] , identifier[fix_dynamic] = keyword[False] ): literal[string] identifier[static_sample] , identifier[_] = identifier[self] . ide...
def generate(self, batch_size, length, samples=1, fix_static=False, fix_dynamic=False): """Generate new sequences. Args: batch_size: Number of sequences to generate. length: Number of timesteps to generate for each sequence. samples: Number of samples to draw from the latent distributions. ...
def delete_object( request, model, post_delete_redirect, object_id=None, slug=None, slug_field='slug', template_name=None, template_loader=loader, extra_context=None, login_required=False, context_processors=None, template_object_name='object'): """ Generic object-delete function...
def function[delete_object, parameter[request, model, post_delete_redirect, object_id, slug, slug_field, template_name, template_loader, extra_context, login_required, context_processors, template_object_name]]: constant[ Generic object-delete function. The given template will be used to confirm delete...
keyword[def] identifier[delete_object] ( identifier[request] , identifier[model] , identifier[post_delete_redirect] , identifier[object_id] = keyword[None] , identifier[slug] = keyword[None] , identifier[slug_field] = literal[string] , identifier[template_name] = keyword[None] , identifier[template_loader] = ident...
def delete_object(request, model, post_delete_redirect, object_id=None, slug=None, slug_field='slug', template_name=None, template_loader=loader, extra_context=None, login_required=False, context_processors=None, template_object_name='object'): """ Generic object-delete function. The given template will be...
def get_redis_connection(config, use_strict_redis=False): """ Returns a redis connection from a connection config """ redis_cls = redis.StrictRedis if use_strict_redis else redis.Redis if 'URL' in config: return redis_cls.from_url(config['URL'], db=config.get('DB')) if 'USE_REDIS_CACHE...
def function[get_redis_connection, parameter[config, use_strict_redis]]: constant[ Returns a redis connection from a connection config ] variable[redis_cls] assign[=] <ast.IfExp object at 0x7da20e9558a0> if compare[constant[URL] in name[config]] begin[:] return[call[name[redis_cl...
keyword[def] identifier[get_redis_connection] ( identifier[config] , identifier[use_strict_redis] = keyword[False] ): literal[string] identifier[redis_cls] = identifier[redis] . identifier[StrictRedis] keyword[if] identifier[use_strict_redis] keyword[else] identifier[redis] . identifier[Redis] k...
def get_redis_connection(config, use_strict_redis=False): """ Returns a redis connection from a connection config """ redis_cls = redis.StrictRedis if use_strict_redis else redis.Redis if 'URL' in config: return redis_cls.from_url(config['URL'], db=config.get('DB')) # depends on [control=['...
def get_scenario_from_nrml(oqparam, fname): """ :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param fname: the NRML files containing the GMFs :returns: a pair (eids, gmf array) """ if not oqparam.imtls: oqparam.set_risk_imtls(get_r...
def function[get_scenario_from_nrml, parameter[oqparam, fname]]: constant[ :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param fname: the NRML files containing the GMFs :returns: a pair (eids, gmf array) ] if <ast.UnaryOp object at...
keyword[def] identifier[get_scenario_from_nrml] ( identifier[oqparam] , identifier[fname] ): literal[string] keyword[if] keyword[not] identifier[oqparam] . identifier[imtls] : identifier[oqparam] . identifier[set_risk_imtls] ( identifier[get_risk_models] ( identifier[oqparam] )) identifier[...
def get_scenario_from_nrml(oqparam, fname): """ :param oqparam: an :class:`openquake.commonlib.oqvalidation.OqParam` instance :param fname: the NRML files containing the GMFs :returns: a pair (eids, gmf array) """ if not oqparam.imtls: oqparam.set_risk_imtls(get_r...
def to_bigquery_ddl(self, name_case=DdlParseBase.NAME_CASE.original): """ Generate BigQuery CREATE TABLE statements :param name_case: name case type * DdlParse.NAME_CASE.original : Return to no convert * DdlParse.NAME_CASE.lower : Return to lower * DdlParse.N...
def function[to_bigquery_ddl, parameter[self, name_case]]: constant[ Generate BigQuery CREATE TABLE statements :param name_case: name case type * DdlParse.NAME_CASE.original : Return to no convert * DdlParse.NAME_CASE.lower : Return to lower * DdlParse.NAME_C...
keyword[def] identifier[to_bigquery_ddl] ( identifier[self] , identifier[name_case] = identifier[DdlParseBase] . identifier[NAME_CASE] . identifier[original] ): literal[string] keyword[if] identifier[self] . identifier[schema] keyword[is] keyword[None] : identifier[dataset] = liter...
def to_bigquery_ddl(self, name_case=DdlParseBase.NAME_CASE.original): """ Generate BigQuery CREATE TABLE statements :param name_case: name case type * DdlParse.NAME_CASE.original : Return to no convert * DdlParse.NAME_CASE.lower : Return to lower * DdlParse.NAME_...
def convert_celeba(which_format, directory, output_directory, output_filename=None): """Converts the CelebA dataset to HDF5. Converts the CelebA dataset to an HDF5 dataset compatible with :class:`fuel.datasets.CelebA`. The converted dataset is saved as 'celeba_aligned_cropped.hdf5' o...
def function[convert_celeba, parameter[which_format, directory, output_directory, output_filename]]: constant[Converts the CelebA dataset to HDF5. Converts the CelebA dataset to an HDF5 dataset compatible with :class:`fuel.datasets.CelebA`. The converted dataset is saved as 'celeba_aligned_cropped....
keyword[def] identifier[convert_celeba] ( identifier[which_format] , identifier[directory] , identifier[output_directory] , identifier[output_filename] = keyword[None] ): literal[string] keyword[if] identifier[which_format] keyword[not] keyword[in] ( literal[string] , literal[string] ): keywor...
def convert_celeba(which_format, directory, output_directory, output_filename=None): """Converts the CelebA dataset to HDF5. Converts the CelebA dataset to an HDF5 dataset compatible with :class:`fuel.datasets.CelebA`. The converted dataset is saved as 'celeba_aligned_cropped.hdf5' or 'celeba_64.hdf5',...
def getUniqueFeaturesLocationsInObject(self, name): """ Return two sets. The first set contains the unique locations Ids in the object. The second set contains the unique feature Ids in the object. """ uniqueFeatures = set() uniqueLocations = set() for pair in self.objects[name]: uniqu...
def function[getUniqueFeaturesLocationsInObject, parameter[self, name]]: constant[ Return two sets. The first set contains the unique locations Ids in the object. The second set contains the unique feature Ids in the object. ] variable[uniqueFeatures] assign[=] call[name[set], parameter[]] ...
keyword[def] identifier[getUniqueFeaturesLocationsInObject] ( identifier[self] , identifier[name] ): literal[string] identifier[uniqueFeatures] = identifier[set] () identifier[uniqueLocations] = identifier[set] () keyword[for] identifier[pair] keyword[in] identifier[self] . identifier[objects]...
def getUniqueFeaturesLocationsInObject(self, name): """ Return two sets. The first set contains the unique locations Ids in the object. The second set contains the unique feature Ids in the object. """ uniqueFeatures = set() uniqueLocations = set() for pair in self.objects[name]: uni...
def _set_bin_view(self, session): """Sets the underlying bin view to match current view""" if self._bin_view == COMPARATIVE: try: session.use_comparative_bin_view() except AttributeError: pass else: try: session....
def function[_set_bin_view, parameter[self, session]]: constant[Sets the underlying bin view to match current view] if compare[name[self]._bin_view equal[==] name[COMPARATIVE]] begin[:] <ast.Try object at 0x7da207f01de0>
keyword[def] identifier[_set_bin_view] ( identifier[self] , identifier[session] ): literal[string] keyword[if] identifier[self] . identifier[_bin_view] == identifier[COMPARATIVE] : keyword[try] : identifier[session] . identifier[use_comparative_bin_view] () ...
def _set_bin_view(self, session): """Sets the underlying bin view to match current view""" if self._bin_view == COMPARATIVE: try: session.use_comparative_bin_view() # depends on [control=['try'], data=[]] except AttributeError: pass # depends on [control=['except'], dat...
def write_lammps_inputs(output_dir, script_template, settings=None, data=None, script_filename="in.lammps", make_dir_if_not_present=True, **kwargs): """ Writes input files for a LAMMPS run. Input script is constructed from a str template with placeholders to b...
def function[write_lammps_inputs, parameter[output_dir, script_template, settings, data, script_filename, make_dir_if_not_present]]: constant[ Writes input files for a LAMMPS run. Input script is constructed from a str template with placeholders to be filled by custom settings. Data file is either w...
keyword[def] identifier[write_lammps_inputs] ( identifier[output_dir] , identifier[script_template] , identifier[settings] = keyword[None] , identifier[data] = keyword[None] , identifier[script_filename] = literal[string] , identifier[make_dir_if_not_present] = keyword[True] ,** identifier[kwargs] ): literal[s...
def write_lammps_inputs(output_dir, script_template, settings=None, data=None, script_filename='in.lammps', make_dir_if_not_present=True, **kwargs): """ Writes input files for a LAMMPS run. Input script is constructed from a str template with placeholders to be filled by custom settings. Data file is ei...
async def connect(self): """ Connect to target. """ self.tls_context = None if self.tls: self.tls_context = self.create_tls_context() (self.reader, self.writer) = await asyncio.open_connection( host=self.hostname, port=self.port, local_ad...
<ast.AsyncFunctionDef object at 0x7da207f00be0>
keyword[async] keyword[def] identifier[connect] ( identifier[self] ): literal[string] identifier[self] . identifier[tls_context] = keyword[None] keyword[if] identifier[self] . identifier[tls] : identifier[self] . identifier[tls_context] = identifier[self] . identifier[crea...
async def connect(self): """ Connect to target. """ self.tls_context = None if self.tls: self.tls_context = self.create_tls_context() # depends on [control=['if'], data=[]] (self.reader, self.writer) = await asyncio.open_connection(host=self.hostname, port=self.port, local_addr=self.source_addr...
def _gi_build_stub(parent): """ Inspect the passed module recursively and build stubs for functions, classes, etc. """ classes = {} functions = {} constants = {} methods = {} for name in dir(parent): if name.startswith("__"): continue # Check if this is a...
def function[_gi_build_stub, parameter[parent]]: constant[ Inspect the passed module recursively and build stubs for functions, classes, etc. ] variable[classes] assign[=] dictionary[[], []] variable[functions] assign[=] dictionary[[], []] variable[constants] assign[=] dictio...
keyword[def] identifier[_gi_build_stub] ( identifier[parent] ): literal[string] identifier[classes] ={} identifier[functions] ={} identifier[constants] ={} identifier[methods] ={} keyword[for] identifier[name] keyword[in] identifier[dir] ( identifier[parent] ): keyword[if] ...
def _gi_build_stub(parent): """ Inspect the passed module recursively and build stubs for functions, classes, etc. """ classes = {} functions = {} constants = {} methods = {} for name in dir(parent): if name.startswith('__'): continue # depends on [control=['if']...
def validate(config): ''' Validate the beacon configuration ''' VALID_ITEMS = [ 'type', 'bytes_sent', 'bytes_recv', 'packets_sent', 'packets_recv', 'errin', 'errout', 'dropin', 'dropout' ] # Configuration for load beacon should be a list of dicts if not isinstance(c...
def function[validate, parameter[config]]: constant[ Validate the beacon configuration ] variable[VALID_ITEMS] assign[=] list[[<ast.Constant object at 0x7da18bc70460>, <ast.Constant object at 0x7da18bc716c0>, <ast.Constant object at 0x7da18bc708e0>, <ast.Constant object at 0x7da18bc73df0>, <ast....
keyword[def] identifier[validate] ( identifier[config] ): literal[string] identifier[VALID_ITEMS] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ] keyword[if] ...
def validate(config): """ Validate the beacon configuration """ VALID_ITEMS = ['type', 'bytes_sent', 'bytes_recv', 'packets_sent', 'packets_recv', 'errin', 'errout', 'dropin', 'dropout'] # Configuration for load beacon should be a list of dicts if not isinstance(config, list): return (Fa...
def _listitemify(self, item): '''Creates an xbmcswift2.ListItem if the provided value for item is a dict. If item is already a valid xbmcswift2.ListItem, the item is returned unmodified. ''' info_type = self.info_type if hasattr(self, 'info_type') else 'video' # Create L...
def function[_listitemify, parameter[self, item]]: constant[Creates an xbmcswift2.ListItem if the provided value for item is a dict. If item is already a valid xbmcswift2.ListItem, the item is returned unmodified. ] variable[info_type] assign[=] <ast.IfExp object at 0x7da18dc04e5...
keyword[def] identifier[_listitemify] ( identifier[self] , identifier[item] ): literal[string] identifier[info_type] = identifier[self] . identifier[info_type] keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[else] literal[string] keywor...
def _listitemify(self, item): """Creates an xbmcswift2.ListItem if the provided value for item is a dict. If item is already a valid xbmcswift2.ListItem, the item is returned unmodified. """ info_type = self.info_type if hasattr(self, 'info_type') else 'video' # Create ListItems for ...
def isloaded(self, name): """Checks if given hook module has been loaded Args: name (str): The name of the module to check Returns: bool. The return code:: True -- Loaded False -- Not Loaded """ if name is None: ...
def function[isloaded, parameter[self, name]]: constant[Checks if given hook module has been loaded Args: name (str): The name of the module to check Returns: bool. The return code:: True -- Loaded False -- Not Loaded ] ...
keyword[def] identifier[isloaded] ( identifier[self] , identifier[name] ): literal[string] keyword[if] identifier[name] keyword[is] keyword[None] : keyword[return] keyword[True] keyword[if] identifier[isinstance] ( identifier[name] , identifier[str] ): keyw...
def isloaded(self, name): """Checks if given hook module has been loaded Args: name (str): The name of the module to check Returns: bool. The return code:: True -- Loaded False -- Not Loaded """ if name is None: return T...
def _round(self): """ Subclasses may override this method. """ for contour in self.contours: contour.round() for component in self.components: component.round() for anchor in self.anchors: anchor.round() for guideline in self.gu...
def function[_round, parameter[self]]: constant[ Subclasses may override this method. ] for taget[name[contour]] in starred[name[self].contours] begin[:] call[name[contour].round, parameter[]] for taget[name[component]] in starred[name[self].components] begin[:] ...
keyword[def] identifier[_round] ( identifier[self] ): literal[string] keyword[for] identifier[contour] keyword[in] identifier[self] . identifier[contours] : identifier[contour] . identifier[round] () keyword[for] identifier[component] keyword[in] identifier[self] . ident...
def _round(self): """ Subclasses may override this method. """ for contour in self.contours: contour.round() # depends on [control=['for'], data=['contour']] for component in self.components: component.round() # depends on [control=['for'], data=['component']] for ancho...
def translate_sbml_reaction(entry, new_id, compartment_map, compound_map): """Translate SBML reaction entry.""" new_entry = DictReactionEntry(entry, id=new_id) # Convert compound IDs in reaction equation if new_entry.equation is not None: compounds = [] for compound, value in new_entry....
def function[translate_sbml_reaction, parameter[entry, new_id, compartment_map, compound_map]]: constant[Translate SBML reaction entry.] variable[new_entry] assign[=] call[name[DictReactionEntry], parameter[name[entry]]] if compare[name[new_entry].equation is_not constant[None]] begin[:] ...
keyword[def] identifier[translate_sbml_reaction] ( identifier[entry] , identifier[new_id] , identifier[compartment_map] , identifier[compound_map] ): literal[string] identifier[new_entry] = identifier[DictReactionEntry] ( identifier[entry] , identifier[id] = identifier[new_id] ) keyword[if] ide...
def translate_sbml_reaction(entry, new_id, compartment_map, compound_map): """Translate SBML reaction entry.""" new_entry = DictReactionEntry(entry, id=new_id) # Convert compound IDs in reaction equation if new_entry.equation is not None: compounds = [] for (compound, value) in new_entry...
def launch_cambridge_hphi( jobname: str, cmd: str, memory_mb: int, qos: str, email: str, duration: timedelta, cpus_per_task: int, project: str = "hphi", tasks_per_node: int = 1, partition: str = "wbic-cs", # 2018-02: was "wbic", now "wbic-...
def function[launch_cambridge_hphi, parameter[jobname, cmd, memory_mb, qos, email, duration, cpus_per_task, project, tasks_per_node, partition, modules, directory, encoding]]: constant[ Specialization of :func:`launch_slurm` (q.v.) with defaults for the University of Cambridge WBIC HPHI. ] i...
keyword[def] identifier[launch_cambridge_hphi] ( identifier[jobname] : identifier[str] , identifier[cmd] : identifier[str] , identifier[memory_mb] : identifier[int] , identifier[qos] : identifier[str] , identifier[email] : identifier[str] , identifier[duration] : identifier[timedelta] , identifier[cpus_per_tas...
def launch_cambridge_hphi(jobname: str, cmd: str, memory_mb: int, qos: str, email: str, duration: timedelta, cpus_per_task: int, project: str='hphi', tasks_per_node: int=1, partition: str='wbic-cs', modules: List[str]=None, directory: str=os.getcwd(), encoding: str='ascii') -> None: # 2018-02: was "wbic", now "wbic-cs...
def as_objective(obj): """Convert obj into Objective class. Strings of the form "layer:n" become the Objective channel(layer, n). Objectives are returned unchanged. Args: obj: string or Objective. Returns: Objective """ if isinstance(obj, Objective): return obj elif callable(obj): ret...
def function[as_objective, parameter[obj]]: constant[Convert obj into Objective class. Strings of the form "layer:n" become the Objective channel(layer, n). Objectives are returned unchanged. Args: obj: string or Objective. Returns: Objective ] if call[name[isinstance], parameter[na...
keyword[def] identifier[as_objective] ( identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[Objective] ): keyword[return] identifier[obj] keyword[elif] identifier[callable] ( identifier[obj] ): keyword[return] identifier[obj] keyword[elif] ...
def as_objective(obj): """Convert obj into Objective class. Strings of the form "layer:n" become the Objective channel(layer, n). Objectives are returned unchanged. Args: obj: string or Objective. Returns: Objective """ if isinstance(obj, Objective): return obj # depends on [contro...
def _ip_route_linux(): ''' Return ip routing information for Linux distros (netstat is deprecated and may not be available) ''' # table main closest to old netstat inet output ret = [] cmd = 'ip -4 route show table main' out = __salt__['cmd.run'](cmd, python_shell=True) for line in o...
def function[_ip_route_linux, parameter[]]: constant[ Return ip routing information for Linux distros (netstat is deprecated and may not be available) ] variable[ret] assign[=] list[[]] variable[cmd] assign[=] constant[ip -4 route show table main] variable[out] assign[=] call...
keyword[def] identifier[_ip_route_linux] (): literal[string] identifier[ret] =[] identifier[cmd] = literal[string] identifier[out] = identifier[__salt__] [ literal[string] ]( identifier[cmd] , identifier[python_shell] = keyword[True] ) keyword[for] identifier[line] keyword[in] ident...
def _ip_route_linux(): """ Return ip routing information for Linux distros (netstat is deprecated and may not be available) """ # table main closest to old netstat inet output ret = [] cmd = 'ip -4 route show table main' out = __salt__['cmd.run'](cmd, python_shell=True) for line in o...
def UnitToLNode(u: Unit, node: Optional[LNode]=None, toL: Optional[dict]=None, optimizations=[]) -> LNode: """ Build LNode instance from Unit instance :attention: unit has to be synthesized """ if toL is None: toL = {} if node is None: root = LNod...
def function[UnitToLNode, parameter[u, node, toL, optimizations]]: constant[ Build LNode instance from Unit instance :attention: unit has to be synthesized ] if compare[name[toL] is constant[None]] begin[:] variable[toL] assign[=] dictionary[[], []] if compare[name[n...
keyword[def] identifier[UnitToLNode] ( identifier[u] : identifier[Unit] , identifier[node] : identifier[Optional] [ identifier[LNode] ]= keyword[None] , identifier[toL] : identifier[Optional] [ identifier[dict] ]= keyword[None] , identifier[optimizations] =[])-> identifier[LNode] : literal[string] keywor...
def UnitToLNode(u: Unit, node: Optional[LNode]=None, toL: Optional[dict]=None, optimizations=[]) -> LNode: """ Build LNode instance from Unit instance :attention: unit has to be synthesized """ if toL is None: toL = {} # depends on [control=['if'], data=['toL']] if node is None: ...
def user_remove(name, user=None, password=None, host=None, port=None, database='admin', authdb=None): ''' Remove a MongoDB user CLI Example: .. code-block:: bash salt '*' mongodb.user_remove <name> <user> <password> <host> <port> <database> ''' conn = _connect(user, pa...
def function[user_remove, parameter[name, user, password, host, port, database, authdb]]: constant[ Remove a MongoDB user CLI Example: .. code-block:: bash salt '*' mongodb.user_remove <name> <user> <password> <host> <port> <database> ] variable[conn] assign[=] call[name[_conn...
keyword[def] identifier[user_remove] ( identifier[name] , identifier[user] = keyword[None] , identifier[password] = keyword[None] , identifier[host] = keyword[None] , identifier[port] = keyword[None] , identifier[database] = literal[string] , identifier[authdb] = keyword[None] ): literal[string] identifie...
def user_remove(name, user=None, password=None, host=None, port=None, database='admin', authdb=None): """ Remove a MongoDB user CLI Example: .. code-block:: bash salt '*' mongodb.user_remove <name> <user> <password> <host> <port> <database> """ conn = _connect(user, password, host, po...
def create_pod_security_policy(self, body, **kwargs): """ create a PodSecurityPolicy This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_pod_security_policy(body, async_req=True) ...
def function[create_pod_security_policy, parameter[self, body]]: constant[ create a PodSecurityPolicy This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_pod_security_policy(body, async_...
keyword[def] identifier[create_pod_security_policy] ( identifier[self] , identifier[body] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] id...
def create_pod_security_policy(self, body, **kwargs): """ create a PodSecurityPolicy This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_pod_security_policy(body, async_req=True) >>>...
def validate(self): """ Validate the contents of a dimension data dictionary """ extents_valid = (0 <= self.lower_extent <= self.upper_extent <= self.global_size) if not extents_valid: raise ValueError("Dimension '{d}' fails 0 <= {el} <= {eu} <= {gs}" .f...
def function[validate, parameter[self]]: constant[ Validate the contents of a dimension data dictionary ] variable[extents_valid] assign[=] compare[constant[0] less_or_equal[<=] name[self].lower_extent] if <ast.UnaryOp object at 0x7da1b2525270> begin[:] <ast.Raise object at 0x7da1b25250f...
keyword[def] identifier[validate] ( identifier[self] ): literal[string] identifier[extents_valid] =( literal[int] <= identifier[self] . identifier[lower_extent] <= identifier[self] . identifier[upper_extent] <= identifier[self] . identifier[global_size] ) keyword[if] keyword[no...
def validate(self): """ Validate the contents of a dimension data dictionary """ extents_valid = 0 <= self.lower_extent <= self.upper_extent <= self.global_size if not extents_valid: raise ValueError("Dimension '{d}' fails 0 <= {el} <= {eu} <= {gs}".format(d=self.name, gs=self.global_size, el=self.l...
def detect_link_tag_time(self, tag): """ Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag. """ # if tag is nil - set current time newer_tag_time = self.get_time_of...
def function[detect_link_tag_time, parameter[self, tag]]: constant[ Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag. ] variable[newer_tag_time] assign[=] <ast.IfExp object...
keyword[def] identifier[detect_link_tag_time] ( identifier[self] , identifier[tag] ): literal[string] identifier[newer_tag_time] = identifier[self] . identifier[get_time_of_tag] ( identifier[tag] ) keyword[if] identifier[tag] keyword[else] identifier[datetime] . identifier[datetime] . ...
def detect_link_tag_time(self, tag): """ Detect link, name and time for specified tag. :param dict tag: Tag data. :rtype: str, str, datetime :return: Link, name and time of the tag. """ # if tag is nil - set current time newer_tag_time = self.get_time_of_tag(tag) if ...
def _sam_to_soft_clipped(self, sam): '''Returns tuple of whether or not the left and right end of the mapped read in the sam record is soft-clipped''' if sam.is_unmapped: raise Error('Cannot get soft clip info from an unmapped read') if sam.cigar is None or len(sam.cigar) == 0: ...
def function[_sam_to_soft_clipped, parameter[self, sam]]: constant[Returns tuple of whether or not the left and right end of the mapped read in the sam record is soft-clipped] if name[sam].is_unmapped begin[:] <ast.Raise object at 0x7da2044c0970> if <ast.BoolOp object at 0x7da2044c1f30> ...
keyword[def] identifier[_sam_to_soft_clipped] ( identifier[self] , identifier[sam] ): literal[string] keyword[if] identifier[sam] . identifier[is_unmapped] : keyword[raise] identifier[Error] ( literal[string] ) keyword[if] identifier[sam] . identifier[cigar] keyword[is] ...
def _sam_to_soft_clipped(self, sam): """Returns tuple of whether or not the left and right end of the mapped read in the sam record is soft-clipped""" if sam.is_unmapped: raise Error('Cannot get soft clip info from an unmapped read') # depends on [control=['if'], data=[]] if sam.cigar is None or le...
def save(self, file, *attributes, **options): """ Saves the selected field *attributes* for each :class:`Field` *nested* in the `Container` to an ``.ini`` *file*. :param str file: name and location of the ``.ini`` *file*. :param str attributes: selected :class:`Field` attributes. ...
def function[save, parameter[self, file]]: constant[ Saves the selected field *attributes* for each :class:`Field` *nested* in the `Container` to an ``.ini`` *file*. :param str file: name and location of the ``.ini`` *file*. :param str attributes: selected :class:`Field` attributes. ...
keyword[def] identifier[save] ( identifier[self] , identifier[file] ,* identifier[attributes] ,** identifier[options] ): literal[string] identifier[options] [ literal[string] ]= keyword[True] identifier[parser] = identifier[ConfigParser] () identifier[parser] . identifier[read_di...
def save(self, file, *attributes, **options): """ Saves the selected field *attributes* for each :class:`Field` *nested* in the `Container` to an ``.ini`` *file*. :param str file: name and location of the ``.ini`` *file*. :param str attributes: selected :class:`Field` attributes. ...
def split_once(self, horizontal: bool, position: int) -> None: """Split this partition into 2 sub-partitions. Args: horizontal (bool): position (int): """ cdata = self._as_cdata() lib.TCOD_bsp_split_once(cdata, horizontal, position) self._unpack_b...
def function[split_once, parameter[self, horizontal, position]]: constant[Split this partition into 2 sub-partitions. Args: horizontal (bool): position (int): ] variable[cdata] assign[=] call[name[self]._as_cdata, parameter[]] call[name[lib].TCOD_bsp_spli...
keyword[def] identifier[split_once] ( identifier[self] , identifier[horizontal] : identifier[bool] , identifier[position] : identifier[int] )-> keyword[None] : literal[string] identifier[cdata] = identifier[self] . identifier[_as_cdata] () identifier[lib] . identifier[TCOD_bsp_split_once] ...
def split_once(self, horizontal: bool, position: int) -> None: """Split this partition into 2 sub-partitions. Args: horizontal (bool): position (int): """ cdata = self._as_cdata() lib.TCOD_bsp_split_once(cdata, horizontal, position) self._unpack_bsp_tree(cdata)
def acknowledge_streamer(self, index, ack, force): """Acknowledge a streamer value as received from the remote side.""" if index >= len(self.graph.streamers): return _pack_sgerror(SensorGraphError.STREAMER_NOT_ALLOCATED) old_ack = self.streamer_acks.get(index, 0) if ack !=...
def function[acknowledge_streamer, parameter[self, index, ack, force]]: constant[Acknowledge a streamer value as received from the remote side.] if compare[name[index] greater_or_equal[>=] call[name[len], parameter[name[self].graph.streamers]]] begin[:] return[call[name[_pack_sgerror], parameter...
keyword[def] identifier[acknowledge_streamer] ( identifier[self] , identifier[index] , identifier[ack] , identifier[force] ): literal[string] keyword[if] identifier[index] >= identifier[len] ( identifier[self] . identifier[graph] . identifier[streamers] ): keyword[return] identifier...
def acknowledge_streamer(self, index, ack, force): """Acknowledge a streamer value as received from the remote side.""" if index >= len(self.graph.streamers): return _pack_sgerror(SensorGraphError.STREAMER_NOT_ALLOCATED) # depends on [control=['if'], data=[]] old_ack = self.streamer_acks.get(index,...
def add_arguments(parser): """ adds arguments for the deploy command """ parser.add_argument('-e', '--environment', help='Environment name', required=True) parser.add_argument('-w', '--dont-wait', help='Skip waiting for the init to finish', action='store_true') parser.add_argument('-...
def function[add_arguments, parameter[parser]]: constant[ adds arguments for the deploy command ] call[name[parser].add_argument, parameter[constant[-e], constant[--environment]]] call[name[parser].add_argument, parameter[constant[-w], constant[--dont-wait]]] call[name[parser].ad...
keyword[def] identifier[add_arguments] ( identifier[parser] ): literal[string] identifier[parser] . identifier[add_argument] ( literal[string] , literal[string] , identifier[help] = literal[string] , identifier[required] = keyword[True] ) identifier[parser] . identifier[add_argument] ( literal[string]...
def add_arguments(parser): """ adds arguments for the deploy command """ parser.add_argument('-e', '--environment', help='Environment name', required=True) parser.add_argument('-w', '--dont-wait', help='Skip waiting for the init to finish', action='store_true') parser.add_argument('-l', '--versi...
def cellbrowser( adata, data_dir, data_name, embedding_keys = None, annot_keys = ["louvain", "percent_mito", "n_genes", "n_counts"], cluster_field = "louvain", nb_marker = 50, skip_matrix = False, html_dir = None, port = None, do_debug = False ): """ Export adata to a UCSC Ce...
def function[cellbrowser, parameter[adata, data_dir, data_name, embedding_keys, annot_keys, cluster_field, nb_marker, skip_matrix, html_dir, port, do_debug]]: constant[ Export adata to a UCSC Cell Browser project directory. If `html_dir` is set, subsequently build the html files from the project directo...
keyword[def] identifier[cellbrowser] ( identifier[adata] , identifier[data_dir] , identifier[data_name] , identifier[embedding_keys] = keyword[None] , identifier[annot_keys] =[ literal[string] , literal[string] , literal[string] , literal[string] ], identifier[cluster_field] = literal[string] , identifier[nb_mar...
def cellbrowser(adata, data_dir, data_name, embedding_keys=None, annot_keys=['louvain', 'percent_mito', 'n_genes', 'n_counts'], cluster_field='louvain', nb_marker=50, skip_matrix=False, html_dir=None, port=None, do_debug=False): """ Export adata to a UCSC Cell Browser project directory. If `html_dir` is set...
def sync_headers(cloud_obj, headers=None, header_patterns=HEADER_PATTERNS): """ Overwrites the given cloud_obj's headers with the ones given as ``headers` and adds additional headers as defined in the HEADERS setting depending on the cloud_obj's file name. """ if headers is None: headers...
def function[sync_headers, parameter[cloud_obj, headers, header_patterns]]: constant[ Overwrites the given cloud_obj's headers with the ones given as ``headers` and adds additional headers as defined in the HEADERS setting depending on the cloud_obj's file name. ] if compare[name[headers...
keyword[def] identifier[sync_headers] ( identifier[cloud_obj] , identifier[headers] = keyword[None] , identifier[header_patterns] = identifier[HEADER_PATTERNS] ): literal[string] keyword[if] identifier[headers] keyword[is] keyword[None] : identifier[headers] ={} identifier[conten...
def sync_headers(cloud_obj, headers=None, header_patterns=HEADER_PATTERNS): """ Overwrites the given cloud_obj's headers with the ones given as ``headers` and adds additional headers as defined in the HEADERS setting depending on the cloud_obj's file name. """ if headers is None: headers...
def validate(self, metadata, path, value): """ Validate this requirement. """ if isinstance(value, Requirement): # if the RHS is still a Requirement object, it was not set if metadata.testing and self.mock_value is not None: value = self.mock_valu...
def function[validate, parameter[self, metadata, path, value]]: constant[ Validate this requirement. ] if call[name[isinstance], parameter[name[value], name[Requirement]]] begin[:] if <ast.BoolOp object at 0x7da1b0c40640> begin[:] variable[value] ...
keyword[def] identifier[validate] ( identifier[self] , identifier[metadata] , identifier[path] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[Requirement] ): keyword[if] identifier[metadata] . identifier[testing] k...
def validate(self, metadata, path, value): """ Validate this requirement. """ if isinstance(value, Requirement): # if the RHS is still a Requirement object, it was not set if metadata.testing and self.mock_value is not None: value = self.mock_value # depends on [con...
def commit_sell(self, account_id, sell_id, **params): """https://developers.coinbase.com/api/v2#commit-a-sell""" response = self._post( 'v2', 'accounts', account_id, 'sells', sell_id, 'commit', data=params) return self._make_api_object(response, Sell)
def function[commit_sell, parameter[self, account_id, sell_id]]: constant[https://developers.coinbase.com/api/v2#commit-a-sell] variable[response] assign[=] call[name[self]._post, parameter[constant[v2], constant[accounts], name[account_id], constant[sells], name[sell_id], constant[commit]]] return[...
keyword[def] identifier[commit_sell] ( identifier[self] , identifier[account_id] , identifier[sell_id] ,** identifier[params] ): literal[string] identifier[response] = identifier[self] . identifier[_post] ( literal[string] , literal[string] , identifier[account_id] , literal[string] , iden...
def commit_sell(self, account_id, sell_id, **params): """https://developers.coinbase.com/api/v2#commit-a-sell""" response = self._post('v2', 'accounts', account_id, 'sells', sell_id, 'commit', data=params) return self._make_api_object(response, Sell)
async def container(self, container=None, container_type=None, params=None): """ Loads/dumps container :return: """ if hasattr(container_type, 'blob_serialize'): container = container_type() if container is None else container return await container.blob_s...
<ast.AsyncFunctionDef object at 0x7da1b24071f0>
keyword[async] keyword[def] identifier[container] ( identifier[self] , identifier[container] = keyword[None] , identifier[container_type] = keyword[None] , identifier[params] = keyword[None] ): literal[string] keyword[if] identifier[hasattr] ( identifier[container_type] , literal[string] ): ...
async def container(self, container=None, container_type=None, params=None): """ Loads/dumps container :return: """ if hasattr(container_type, 'blob_serialize'): container = container_type() if container is None else container return await container.blob_serialize(self, e...
def lens_model_plot(ax, lensModel, kwargs_lens, numPix=500, deltaPix=0.01, sourcePos_x=0, sourcePos_y=0, point_source=False, with_caustics=False): """ plots a lens model (convergence) and the critical curves and caustics :param ax: :param kwargs_lens: :param numPix: :param d...
def function[lens_model_plot, parameter[ax, lensModel, kwargs_lens, numPix, deltaPix, sourcePos_x, sourcePos_y, point_source, with_caustics]]: constant[ plots a lens model (convergence) and the critical curves and caustics :param ax: :param kwargs_lens: :param numPix: :param deltaPix: :...
keyword[def] identifier[lens_model_plot] ( identifier[ax] , identifier[lensModel] , identifier[kwargs_lens] , identifier[numPix] = literal[int] , identifier[deltaPix] = literal[int] , identifier[sourcePos_x] = literal[int] , identifier[sourcePos_y] = literal[int] , identifier[point_source] = keyword[False] , identif...
def lens_model_plot(ax, lensModel, kwargs_lens, numPix=500, deltaPix=0.01, sourcePos_x=0, sourcePos_y=0, point_source=False, with_caustics=False): """ plots a lens model (convergence) and the critical curves and caustics :param ax: :param kwargs_lens: :param numPix: :param deltaPix: :return...
def run_processor( processorClass, ocrd_tool=None, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None, ): # pylint: disable=too-man...
def function[run_processor, parameter[processorClass, ocrd_tool, mets_url, resolver, workspace, page_id, log_level, input_file_grp, output_file_grp, parameter, working_dir]]: constant[ Create a workspace for mets_url and run processor through it Args: parameter (string): URL to the parameter ...
keyword[def] identifier[run_processor] ( identifier[processorClass] , identifier[ocrd_tool] = keyword[None] , identifier[mets_url] = keyword[None] , identifier[resolver] = keyword[None] , identifier[workspace] = keyword[None] , identifier[page_id] = keyword[None] , identifier[log_level] = keyword[None] , iden...
def run_processor(processorClass, ocrd_tool=None, mets_url=None, resolver=None, workspace=None, page_id=None, log_level=None, input_file_grp=None, output_file_grp=None, parameter=None, working_dir=None): # pylint: disable=too-many-locals '\n Create a workspace for mets_url and run processor through it\n\n Ar...
async def _throttled_request(self, request): '''Process a single request, respecting the concurrency limit.''' disconnect = False try: timeout = self.processing_timeout async with timeout_after(timeout): async with self._incoming_concurrency: ...
<ast.AsyncFunctionDef object at 0x7da18dc075b0>
keyword[async] keyword[def] identifier[_throttled_request] ( identifier[self] , identifier[request] ): literal[string] identifier[disconnect] = keyword[False] keyword[try] : identifier[timeout] = identifier[self] . identifier[processing_timeout] keyword[async] ...
async def _throttled_request(self, request): """Process a single request, respecting the concurrency limit.""" disconnect = False try: timeout = self.processing_timeout async with timeout_after(timeout): async with self._incoming_concurrency: if self.is_closing():...