code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def bottom(self): """ Move this object to the bottom of the ordered stack. """ o = self.get_ordering_queryset().aggregate(Max('order')).get('order__max') self.to(o)
def function[bottom, parameter[self]]: constant[ Move this object to the bottom of the ordered stack. ] variable[o] assign[=] call[call[call[name[self].get_ordering_queryset, parameter[]].aggregate, parameter[call[name[Max], parameter[constant[order]]]]].get, parameter[constant[order__ma...
keyword[def] identifier[bottom] ( identifier[self] ): literal[string] identifier[o] = identifier[self] . identifier[get_ordering_queryset] (). identifier[aggregate] ( identifier[Max] ( literal[string] )). identifier[get] ( literal[string] ) identifier[self] . identifier[to] ( identifier[o]...
def bottom(self): """ Move this object to the bottom of the ordered stack. """ o = self.get_ordering_queryset().aggregate(Max('order')).get('order__max') self.to(o)
def equal(mol, query, largest_only=True, ignore_hydrogen=True): """ if mol is exactly same structure as the query, return True Args: mol: Compound query: Compound """ m = molutil.clone(mol) q = molutil.clone(query) if largest_only: m = molutil.largest_graph(m) q = mol...
def function[equal, parameter[mol, query, largest_only, ignore_hydrogen]]: constant[ if mol is exactly same structure as the query, return True Args: mol: Compound query: Compound ] variable[m] assign[=] call[name[molutil].clone, parameter[name[mol]]] variable[q] assign[=] ca...
keyword[def] identifier[equal] ( identifier[mol] , identifier[query] , identifier[largest_only] = keyword[True] , identifier[ignore_hydrogen] = keyword[True] ): literal[string] identifier[m] = identifier[molutil] . identifier[clone] ( identifier[mol] ) identifier[q] = identifier[molutil] . identifier[...
def equal(mol, query, largest_only=True, ignore_hydrogen=True): """ if mol is exactly same structure as the query, return True Args: mol: Compound query: Compound """ m = molutil.clone(mol) q = molutil.clone(query) if largest_only: m = molutil.largest_graph(m) q = mol...
def _load_neighbors_from_external_source(self) -> None: """ Loads the neighbors of the node from the igraph `Graph` instance that is wrapped by the graph that has this node. """ graph: SpotifyArtistGraph = self._graph items: List[NameExternalIDPair] = graph.client.similar...
def function[_load_neighbors_from_external_source, parameter[self]]: constant[ Loads the neighbors of the node from the igraph `Graph` instance that is wrapped by the graph that has this node. ] <ast.AnnAssign object at 0x7da2054a7e50> <ast.AnnAssign object at 0x7da2054a4a30> ...
keyword[def] identifier[_load_neighbors_from_external_source] ( identifier[self] )-> keyword[None] : literal[string] identifier[graph] : identifier[SpotifyArtistGraph] = identifier[self] . identifier[_graph] identifier[items] : identifier[List] [ identifier[NameExternalIDPair] ]= identifi...
def _load_neighbors_from_external_source(self) -> None: """ Loads the neighbors of the node from the igraph `Graph` instance that is wrapped by the graph that has this node. """ graph: SpotifyArtistGraph = self._graph items: List[NameExternalIDPair] = graph.client.similar_artists(sel...
def read_component_sitemap( self, sitemapindex_uri, sitemap_uri, sitemap, sitemapindex_is_file): """Read a component sitemap of a Resource List with index. Each component must be a sitemap with the """ if (sitemapindex_is_file): if (not self.is_file_uri(sitemap_u...
def function[read_component_sitemap, parameter[self, sitemapindex_uri, sitemap_uri, sitemap, sitemapindex_is_file]]: constant[Read a component sitemap of a Resource List with index. Each component must be a sitemap with the ] if name[sitemapindex_is_file] begin[:] if <as...
keyword[def] identifier[read_component_sitemap] ( identifier[self] , identifier[sitemapindex_uri] , identifier[sitemap_uri] , identifier[sitemap] , identifier[sitemapindex_is_file] ): literal[string] keyword[if] ( identifier[sitemapindex_is_file] ): keyword[if] ( keyword[not] identif...
def read_component_sitemap(self, sitemapindex_uri, sitemap_uri, sitemap, sitemapindex_is_file): """Read a component sitemap of a Resource List with index. Each component must be a sitemap with the """ if sitemapindex_is_file: if not self.is_file_uri(sitemap_uri): # Attempt t...
def gen_relations(self): """Create the <relations> etree element of an RS3 file. This represents all relation types (both 'rst' and 'multinuc'). Example relation: <rel name="circumstance" type="rst" /> """ relations_elem = E('relations') for relname in sorted...
def function[gen_relations, parameter[self]]: constant[Create the <relations> etree element of an RS3 file. This represents all relation types (both 'rst' and 'multinuc'). Example relation: <rel name="circumstance" type="rst" /> ] variable[relations_elem] assign[=] c...
keyword[def] identifier[gen_relations] ( identifier[self] ): literal[string] identifier[relations_elem] = identifier[E] ( literal[string] ) keyword[for] identifier[relname] keyword[in] identifier[sorted] ( identifier[self] . identifier[relations] ): identifier[relations_ele...
def gen_relations(self): """Create the <relations> etree element of an RS3 file. This represents all relation types (both 'rst' and 'multinuc'). Example relation: <rel name="circumstance" type="rst" /> """ relations_elem = E('relations') for relname in sorted(self.relati...
def set_sds_name(self, name, sdsObj): """ Set name for SDS :param name: Name of SDS :param sdsObj: ScaleIO SDS object :return: POST request response :rtype: Requests POST response object """ # TODO: # Check if object parameters are the correct type...
def function[set_sds_name, parameter[self, name, sdsObj]]: constant[ Set name for SDS :param name: Name of SDS :param sdsObj: ScaleIO SDS object :return: POST request response :rtype: Requests POST response object ] call[name[self].conn.connection._check_l...
keyword[def] identifier[set_sds_name] ( identifier[self] , identifier[name] , identifier[sdsObj] ): literal[string] identifier[self] . identifier[conn] . identifier[connection] . identifier[_check_login] () identifier[sdsNameDict] ={ literal[string] : identifier[...
def set_sds_name(self, name, sdsObj): """ Set name for SDS :param name: Name of SDS :param sdsObj: ScaleIO SDS object :return: POST request response :rtype: Requests POST response object """ # TODO: # Check if object parameters are the correct type, otherwise ...
def set_expression(self, expression_dict): """Set protein expression amounts as initial conditions Parameters ---------- expression_dict : dict A dictionary in which the keys are gene names and the values are numbers representing the absolute amount (...
def function[set_expression, parameter[self, expression_dict]]: constant[Set protein expression amounts as initial conditions Parameters ---------- expression_dict : dict A dictionary in which the keys are gene names and the values are numbers representing the ab...
keyword[def] identifier[set_expression] ( identifier[self] , identifier[expression_dict] ): literal[string] keyword[if] identifier[self] . identifier[model] keyword[is] keyword[None] : keyword[return] identifier[monomers_found] =[] identifier[monomers_notfound] =...
def set_expression(self, expression_dict): """Set protein expression amounts as initial conditions Parameters ---------- expression_dict : dict A dictionary in which the keys are gene names and the values are numbers representing the absolute amount (coun...
def get(self, url, headers=None, parameters=None, get_json=True): ''' Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameters R...
def function[get, parameter[self, url, headers, parameters, get_json]]: constant[ Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameter...
keyword[def] identifier[get] ( identifier[self] , identifier[url] , identifier[headers] = keyword[None] , identifier[parameters] = keyword[None] , identifier[get_json] = keyword[True] ): literal[string] keyword[if] identifier[self] . identifier[debug] : identifier[print] ( literal[st...
def get(self, url, headers=None, parameters=None, get_json=True): """ Send a GET request with custome headers and parameters Args: url (str): URL to send the request to headers (str, optional): custom headers parameters (str, optional): optional parameters Retur...
def get_status(self): """ Returns the status of this router :returns: inactive, shutting down, running or suspended. """ status = yield from self._hypervisor.send('vm get_status "{name}"'.format(name=self._name)) if len(status) == 0: raise DynamipsError("Can...
def function[get_status, parameter[self]]: constant[ Returns the status of this router :returns: inactive, shutting down, running or suspended. ] variable[status] assign[=] <ast.YieldFrom object at 0x7da18f7231c0> if compare[call[name[len], parameter[name[status]]] equal...
keyword[def] identifier[get_status] ( identifier[self] ): literal[string] identifier[status] = keyword[yield] keyword[from] identifier[self] . identifier[_hypervisor] . identifier[send] ( literal[string] . identifier[format] ( identifier[name] = identifier[self] . identifier[_name] )) k...
def get_status(self): """ Returns the status of this router :returns: inactive, shutting down, running or suspended. """ status = (yield from self._hypervisor.send('vm get_status "{name}"'.format(name=self._name))) if len(status) == 0: raise DynamipsError("Can't get vm {name...
def listFormats(self, vendorSpecific=None): """See Also: listFormatsResponse() Args: vendorSpecific: Returns: """ response = self.listFormatsResponse(vendorSpecific) return self._read_dataone_type_response(response, 'ObjectFormatList')
def function[listFormats, parameter[self, vendorSpecific]]: constant[See Also: listFormatsResponse() Args: vendorSpecific: Returns: ] variable[response] assign[=] call[name[self].listFormatsResponse, parameter[name[vendorSpecific]]] return[call[name[self]._read_d...
keyword[def] identifier[listFormats] ( identifier[self] , identifier[vendorSpecific] = keyword[None] ): literal[string] identifier[response] = identifier[self] . identifier[listFormatsResponse] ( identifier[vendorSpecific] ) keyword[return] identifier[self] . identifier[_read_dataone_type...
def listFormats(self, vendorSpecific=None): """See Also: listFormatsResponse() Args: vendorSpecific: Returns: """ response = self.listFormatsResponse(vendorSpecific) return self._read_dataone_type_response(response, 'ObjectFormatList')
def from_jd(jd): '''Calculate Mayan long count from Julian day''' d = jd - EPOCH baktun = trunc(d / 144000) d = (d % 144000) katun = trunc(d / 7200) d = (d % 7200) tun = trunc(d / 360) d = (d % 360) uinal = trunc(d / 20) kin = int((d % 20)) return (baktun, katun, tun, uinal,...
def function[from_jd, parameter[jd]]: constant[Calculate Mayan long count from Julian day] variable[d] assign[=] binary_operation[name[jd] - name[EPOCH]] variable[baktun] assign[=] call[name[trunc], parameter[binary_operation[name[d] / constant[144000]]]] variable[d] assign[=] binary_ope...
keyword[def] identifier[from_jd] ( identifier[jd] ): literal[string] identifier[d] = identifier[jd] - identifier[EPOCH] identifier[baktun] = identifier[trunc] ( identifier[d] / literal[int] ) identifier[d] =( identifier[d] % literal[int] ) identifier[katun] = identifier[trunc] ( identifier[...
def from_jd(jd): """Calculate Mayan long count from Julian day""" d = jd - EPOCH baktun = trunc(d / 144000) d = d % 144000 katun = trunc(d / 7200) d = d % 7200 tun = trunc(d / 360) d = d % 360 uinal = trunc(d / 20) kin = int(d % 20) return (baktun, katun, tun, uinal, kin)
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :r...
def function[sanitize_for_archive, parameter[url, headers, payload]]: constant[Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP ...
keyword[def] identifier[sanitize_for_archive] ( identifier[url] , identifier[headers] , identifier[payload] ): literal[string] keyword[if] literal[string] keyword[in] identifier[payload] : identifier[payload] . identifier[pop] ( literal[string] ) keyword[return] identifie...
def sanitize_for_archive(url, headers, payload): """Sanitize payload of a HTTP request by removing the token information before storing/retrieving archived items :param: url: HTTP url request :param: headers: HTTP headers request :param: payload: HTTP payload request :retur...
def list_expiration_dates(self, base='roles/all/ssl'): """ Scans through all local .crt files and displays the expiration dates. """ max_fn_len = 0 max_date_len = 0 data = [] for fn in os.listdir(base): fqfn = os.path.join(base, fn) if not ...
def function[list_expiration_dates, parameter[self, base]]: constant[ Scans through all local .crt files and displays the expiration dates. ] variable[max_fn_len] assign[=] constant[0] variable[max_date_len] assign[=] constant[0] variable[data] assign[=] list[[]] ...
keyword[def] identifier[list_expiration_dates] ( identifier[self] , identifier[base] = literal[string] ): literal[string] identifier[max_fn_len] = literal[int] identifier[max_date_len] = literal[int] identifier[data] =[] keyword[for] identifier[fn] keyword[in] identi...
def list_expiration_dates(self, base='roles/all/ssl'): """ Scans through all local .crt files and displays the expiration dates. """ max_fn_len = 0 max_date_len = 0 data = [] for fn in os.listdir(base): fqfn = os.path.join(base, fn) if not os.path.isfile(fqfn): ...
def forwards(self, orm): "Write your forwards methods here." for a in orm.Article.objects.all(): if a.updated: a.last_updated = a.updated a.save(force_update=True)
def function[forwards, parameter[self, orm]]: constant[Write your forwards methods here.] for taget[name[a]] in starred[call[name[orm].Article.objects.all, parameter[]]] begin[:] if name[a].updated begin[:] name[a].last_updated assign[=] name[a].updated ...
keyword[def] identifier[forwards] ( identifier[self] , identifier[orm] ): literal[string] keyword[for] identifier[a] keyword[in] identifier[orm] . identifier[Article] . identifier[objects] . identifier[all] (): keyword[if] identifier[a] . identifier[updated] : iden...
def forwards(self, orm): """Write your forwards methods here.""" for a in orm.Article.objects.all(): if a.updated: a.last_updated = a.updated a.save(force_update=True) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['a']]
def sigma_to_pressure(sigma, psfc, ptop): r"""Calculate pressure from sigma values. Parameters ---------- sigma : ndarray The sigma levels to be converted to pressure levels. psfc : `pint.Quantity` The surface pressure value. ptop : `pint.Quantity` The pressure value a...
def function[sigma_to_pressure, parameter[sigma, psfc, ptop]]: constant[Calculate pressure from sigma values. Parameters ---------- sigma : ndarray The sigma levels to be converted to pressure levels. psfc : `pint.Quantity` The surface pressure value. ptop : `pint.Quantity...
keyword[def] identifier[sigma_to_pressure] ( identifier[sigma] , identifier[psfc] , identifier[ptop] ): literal[string] keyword[if] identifier[np] . identifier[any] ( identifier[sigma] < literal[int] ) keyword[or] identifier[np] . identifier[any] ( identifier[sigma] > literal[int] ): keyword[rai...
def sigma_to_pressure(sigma, psfc, ptop): """Calculate pressure from sigma values. Parameters ---------- sigma : ndarray The sigma levels to be converted to pressure levels. psfc : `pint.Quantity` The surface pressure value. ptop : `pint.Quantity` The pressure value at...
def get_ips(self, instance_id): """ Retrieves all IP addresses associated to a given instance. :return: tuple (IPs) """ self._init_az_api() cluster_name, node_name = instance_id # XXX: keep in sync with contents of `vm_deployment_template` ip_name = ('{no...
def function[get_ips, parameter[self, instance_id]]: constant[ Retrieves all IP addresses associated to a given instance. :return: tuple (IPs) ] call[name[self]._init_az_api, parameter[]] <ast.Tuple object at 0x7da1b088a8f0> assign[=] name[instance_id] variable[i...
keyword[def] identifier[get_ips] ( identifier[self] , identifier[instance_id] ): literal[string] identifier[self] . identifier[_init_az_api] () identifier[cluster_name] , identifier[node_name] = identifier[instance_id] identifier[ip_name] =( literal[string] . identifier[...
def get_ips(self, instance_id): """ Retrieves all IP addresses associated to a given instance. :return: tuple (IPs) """ self._init_az_api() (cluster_name, node_name) = instance_id # XXX: keep in sync with contents of `vm_deployment_template` ip_name = '{node_name}-public-ip'...
def _clean_ctx(self): """ Clears and deallocates context """ try: if self.ctx is not None: libcrypto.EVP_MD_CTX_free(self.ctx) del self.ctx except AttributeError: pass self.digest_out = None self.digest_final...
def function[_clean_ctx, parameter[self]]: constant[ Clears and deallocates context ] <ast.Try object at 0x7da1b28b9210> name[self].digest_out assign[=] constant[None] name[self].digest_finalized assign[=] constant[False]
keyword[def] identifier[_clean_ctx] ( identifier[self] ): literal[string] keyword[try] : keyword[if] identifier[self] . identifier[ctx] keyword[is] keyword[not] keyword[None] : identifier[libcrypto] . identifier[EVP_MD_CTX_free] ( identifier[self] . identifier[ctx]...
def _clean_ctx(self): """ Clears and deallocates context """ try: if self.ctx is not None: libcrypto.EVP_MD_CTX_free(self.ctx) del self.ctx # depends on [control=['if'], data=[]] # depends on [control=['try'], data=[]] except AttributeError: pass # ...
def set_or_clear_breakpoint(self): """Set/Clear breakpoint""" editorstack = self.get_current_editorstack() if editorstack is not None: self.switch_to_plugin() editorstack.set_or_clear_breakpoint()
def function[set_or_clear_breakpoint, parameter[self]]: constant[Set/Clear breakpoint] variable[editorstack] assign[=] call[name[self].get_current_editorstack, parameter[]] if compare[name[editorstack] is_not constant[None]] begin[:] call[name[self].switch_to_plugin, parameter[]]...
keyword[def] identifier[set_or_clear_breakpoint] ( identifier[self] ): literal[string] identifier[editorstack] = identifier[self] . identifier[get_current_editorstack] () keyword[if] identifier[editorstack] keyword[is] keyword[not] keyword[None] : identifier[self] . id...
def set_or_clear_breakpoint(self): """Set/Clear breakpoint""" editorstack = self.get_current_editorstack() if editorstack is not None: self.switch_to_plugin() editorstack.set_or_clear_breakpoint() # depends on [control=['if'], data=['editorstack']]
def workflow_describe(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /workflow-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fworkflow-xxxx%2Fdescribe """ return DXHTTPRequest('/%s/d...
def function[workflow_describe, parameter[object_id, input_params, always_retry]]: constant[ Invokes the /workflow-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fworkflow-xxxx%2Fdescribe ] return[call[name...
keyword[def] identifier[workflow_describe] ( identifier[object_id] , identifier[input_params] ={}, identifier[always_retry] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[DXHTTPRequest] ( literal[string] % identifier[object_id] , identifier[input_params] , identifier[...
def workflow_describe(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /workflow-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fworkflow-xxxx%2Fdescribe """ return DXHTTPRequest('/%s/d...
def run_supernova_keyring(ctx, action, environment, parameter): """ Sets or retrieves credentials stored in your system's keyring using the python-keyring module. Global credentials can be shared between multiple configuration sections: \b [prod] OS_PASSWORD=USE_KEYRING['sso_passwo...
def function[run_supernova_keyring, parameter[ctx, action, environment, parameter]]: constant[ Sets or retrieves credentials stored in your system's keyring using the python-keyring module. Global credentials can be shared between multiple configuration sections:  [prod] OS_PA...
keyword[def] identifier[run_supernova_keyring] ( identifier[ctx] , identifier[action] , identifier[environment] , identifier[parameter] ): literal[string] keyword[if] identifier[action] == literal[string] : identifier[result] = identifier[credentials] . identifier[get_user_password] ( identifier[...
def run_supernova_keyring(ctx, action, environment, parameter): """ Sets or retrieves credentials stored in your system's keyring using the python-keyring module. Global credentials can be shared between multiple configuration sections: \x08 [prod] OS_PASSWORD=USE_KEYRING['sso_pass...
def convert_acquire(self, shift, instruction): """Return converted `AcquireInstruction`. Args: shift(int): Offset time. instruction (AcquireInstruction): acquire instruction. Returns: dict: Dictionary of required parameters. """ meas_level = s...
def function[convert_acquire, parameter[self, shift, instruction]]: constant[Return converted `AcquireInstruction`. Args: shift(int): Offset time. instruction (AcquireInstruction): acquire instruction. Returns: dict: Dictionary of required parameters. ...
keyword[def] identifier[convert_acquire] ( identifier[self] , identifier[shift] , identifier[instruction] ): literal[string] identifier[meas_level] = identifier[self] . identifier[_run_config] . identifier[get] ( literal[string] , literal[int] ) identifier[command_dict] ={ litera...
def convert_acquire(self, shift, instruction): """Return converted `AcquireInstruction`. Args: shift(int): Offset time. instruction (AcquireInstruction): acquire instruction. Returns: dict: Dictionary of required parameters. """ meas_level = self._run...
def run(mapper=None, reducer=None, combiner=None, script_path=None, jobconfs=(), **kw): """Hadoopy entrance function This is to be called in all Hadoopy job's. Handles arguments passed in, calls the provided functions with input, and stores the output. TypedBytes are used if the following is True ...
def function[run, parameter[mapper, reducer, combiner, script_path, jobconfs]]: constant[Hadoopy entrance function This is to be called in all Hadoopy job's. Handles arguments passed in, calls the provided functions with input, and stores the output. TypedBytes are used if the following is True ...
keyword[def] identifier[run] ( identifier[mapper] = keyword[None] , identifier[reducer] = keyword[None] , identifier[combiner] = keyword[None] , identifier[script_path] = keyword[None] , identifier[jobconfs] =(),** identifier[kw] ): literal[string] keyword[if] identifier[script_path] keyword[is] keyword...
def run(mapper=None, reducer=None, combiner=None, script_path=None, jobconfs=(), **kw): """Hadoopy entrance function This is to be called in all Hadoopy job's. Handles arguments passed in, calls the provided functions with input, and stores the output. TypedBytes are used if the following is True ...
def unixtime_to_datetimestr(unixtime, timefmt='%Y/%m/%d %H:%M:%S', isutc=True): """ TODO: ranme to datetimestr """ try: if unixtime == -1: return 'NA' if unixtime is None: return None if isutc: return datetime.datetime.utcfromtimestamp(unixtime...
def function[unixtime_to_datetimestr, parameter[unixtime, timefmt, isutc]]: constant[ TODO: ranme to datetimestr ] <ast.Try object at 0x7da1b24b3f40>
keyword[def] identifier[unixtime_to_datetimestr] ( identifier[unixtime] , identifier[timefmt] = literal[string] , identifier[isutc] = keyword[True] ): literal[string] keyword[try] : keyword[if] identifier[unixtime] ==- literal[int] : keyword[return] literal[string] keyword...
def unixtime_to_datetimestr(unixtime, timefmt='%Y/%m/%d %H:%M:%S', isutc=True): """ TODO: ranme to datetimestr """ try: if unixtime == -1: return 'NA' # depends on [control=['if'], data=[]] if unixtime is None: return None # depends on [control=['if'], data=[]] ...
def createScanner(self, login, tableName, options): """ Parameters: - login - tableName - options """ self.send_createScanner(login, tableName, options) return self.recv_createScanner()
def function[createScanner, parameter[self, login, tableName, options]]: constant[ Parameters: - login - tableName - options ] call[name[self].send_createScanner, parameter[name[login], name[tableName], name[options]]] return[call[name[self].recv_createScanner, parameter[]]]
keyword[def] identifier[createScanner] ( identifier[self] , identifier[login] , identifier[tableName] , identifier[options] ): literal[string] identifier[self] . identifier[send_createScanner] ( identifier[login] , identifier[tableName] , identifier[options] ) keyword[return] identifier[self] . ident...
def createScanner(self, login, tableName, options): """ Parameters: - login - tableName - options """ self.send_createScanner(login, tableName, options) return self.recv_createScanner()
def data(args): """ %prog data data.bin samples.ids STR.ids meta.tsv Make data.tsv based on meta.tsv. """ p = OptionParser(data.__doc__) p.add_option("--notsv", default=False, action="store_true", help="Do not write data.tsv") opts, args = p.parse_args(args) if len(arg...
def function[data, parameter[args]]: constant[ %prog data data.bin samples.ids STR.ids meta.tsv Make data.tsv based on meta.tsv. ] variable[p] assign[=] call[name[OptionParser], parameter[name[data].__doc__]] call[name[p].add_option, parameter[constant[--notsv]]] <ast.Tuple ...
keyword[def] identifier[data] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[data] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[default] = keyword[False] , identifier[action] = literal[string] , identifi...
def data(args): """ %prog data data.bin samples.ids STR.ids meta.tsv Make data.tsv based on meta.tsv. """ p = OptionParser(data.__doc__) p.add_option('--notsv', default=False, action='store_true', help='Do not write data.tsv') (opts, args) = p.parse_args(args) if len(args) != 4: ...
def is_smart(self, value): """Set group is_smart property to value. Args: value: Boolean. """ self.set_bool("is_smart", value) if value is True: if self.find("criteria") is None: # pylint: disable=attribute-defined-outside-init ...
def function[is_smart, parameter[self, value]]: constant[Set group is_smart property to value. Args: value: Boolean. ] call[name[self].set_bool, parameter[constant[is_smart], name[value]]] if compare[name[value] is constant[True]] begin[:] if compare[...
keyword[def] identifier[is_smart] ( identifier[self] , identifier[value] ): literal[string] identifier[self] . identifier[set_bool] ( literal[string] , identifier[value] ) keyword[if] identifier[value] keyword[is] keyword[True] : keyword[if] identifier[self] . identifier[f...
def is_smart(self, value): """Set group is_smart property to value. Args: value: Boolean. """ self.set_bool('is_smart', value) if value is True: if self.find('criteria') is None: # pylint: disable=attribute-defined-outside-init self.criteria = Ele...
def convert_invalid_url(url): """Convert invalid url with adding extra 'http://' schema into it :param url: :return: """ regex_valid_url = re.compile( r'^(?:http|ftp)s?://' # http:// or https:// r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #do...
def function[convert_invalid_url, parameter[url]]: constant[Convert invalid url with adding extra 'http://' schema into it :param url: :return: ] variable[regex_valid_url] assign[=] call[name[re].compile, parameter[constant[^(?:http|ftp)s?://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:...
keyword[def] identifier[convert_invalid_url] ( identifier[url] ): literal[string] identifier[regex_valid_url] = identifier[re] . identifier[compile] ( literal[string] literal[string] literal[string] literal[string] literal[string] literal[string] , identifier[re] . identi...
def convert_invalid_url(url): """Convert invalid url with adding extra 'http://' schema into it :param url: :return: """ # http:// or https:// #domain... #localhost... # ...or ip # optional port regex_valid_url = re.compile('^(?:http|ftp)s?://(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9...
def dump_engines(target=sys.stderr): """Print successfully imported templating engines.""" print("Available templating engines:", file=target) width = max(len(engine) for engine in engines.engines) for handle, engine in sorted(engines.engines.items()): description = engine.__doc__.split('\n', 0...
def function[dump_engines, parameter[target]]: constant[Print successfully imported templating engines.] call[name[print], parameter[constant[Available templating engines:]]] variable[width] assign[=] call[name[max], parameter[<ast.GeneratorExp object at 0x7da1b15e7070>]] for taget[tuple...
keyword[def] identifier[dump_engines] ( identifier[target] = identifier[sys] . identifier[stderr] ): literal[string] identifier[print] ( literal[string] , identifier[file] = identifier[target] ) identifier[width] = identifier[max] ( identifier[len] ( identifier[engine] ) keyword[for] identifier[engi...
def dump_engines(target=sys.stderr): """Print successfully imported templating engines.""" print('Available templating engines:', file=target) width = max((len(engine) for engine in engines.engines)) for (handle, engine) in sorted(engines.engines.items()): description = engine.__doc__.split('\n'...
def multi_split(s, split): # type: (S, Iterable[S]) -> List[S] """Splits on multiple given separators.""" for r in split: s = s.replace(r, "|") return [i for i in s.split("|") if len(i) > 0]
def function[multi_split, parameter[s, split]]: constant[Splits on multiple given separators.] for taget[name[r]] in starred[name[split]] begin[:] variable[s] assign[=] call[name[s].replace, parameter[name[r], constant[|]]] return[<ast.ListComp object at 0x7da2044c04c0>]
keyword[def] identifier[multi_split] ( identifier[s] , identifier[split] ): literal[string] keyword[for] identifier[r] keyword[in] identifier[split] : identifier[s] = identifier[s] . identifier[replace] ( identifier[r] , literal[string] ) keyword[return] [ identifier[i] keyword[for] ide...
def multi_split(s, split): # type: (S, Iterable[S]) -> List[S] 'Splits on multiple given separators.' for r in split: s = s.replace(r, '|') # depends on [control=['for'], data=['r']] return [i for i in s.split('|') if len(i) > 0]
def _rollaxis_right(A, num_rolls): """ Roll the tensor `A` forward `num_rolls` times """ assert num_rolls > 0 rank = tf.rank(A) perm = tf.concat([rank - num_rolls + tf.range(num_rolls), tf.range(rank - num_rolls)], 0) return tf.transpose(A, perm)
def function[_rollaxis_right, parameter[A, num_rolls]]: constant[ Roll the tensor `A` forward `num_rolls` times ] assert[compare[name[num_rolls] greater[>] constant[0]]] variable[rank] assign[=] call[name[tf].rank, parameter[name[A]]] variable[perm] assign[=] call[name[tf].concat, parameter[...
keyword[def] identifier[_rollaxis_right] ( identifier[A] , identifier[num_rolls] ): literal[string] keyword[assert] identifier[num_rolls] > literal[int] identifier[rank] = identifier[tf] . identifier[rank] ( identifier[A] ) identifier[perm] = identifier[tf] . identifier[concat] ([ identifier[ra...
def _rollaxis_right(A, num_rolls): """ Roll the tensor `A` forward `num_rolls` times """ assert num_rolls > 0 rank = tf.rank(A) perm = tf.concat([rank - num_rolls + tf.range(num_rolls), tf.range(rank - num_rolls)], 0) return tf.transpose(A, perm)
def setPresence(self, status=SkypeUtils.Status.Online): """ Set the current user's presence on the network. Supports :attr:`.Status.Online`, :attr:`.Status.Busy` or :attr:`.Status.Hidden` (shown as :attr:`.Status.Offline` to others). Args: status (.Status): new availability...
def function[setPresence, parameter[self, status]]: constant[ Set the current user's presence on the network. Supports :attr:`.Status.Online`, :attr:`.Status.Busy` or :attr:`.Status.Hidden` (shown as :attr:`.Status.Offline` to others). Args: status (.Status): new availabili...
keyword[def] identifier[setPresence] ( identifier[self] , identifier[status] = identifier[SkypeUtils] . identifier[Status] . identifier[Online] ): literal[string] identifier[self] . identifier[conn] ( literal[string] , literal[string] . identifier[format] ( identifier[self] . identifier[conn] . ide...
def setPresence(self, status=SkypeUtils.Status.Online): """ Set the current user's presence on the network. Supports :attr:`.Status.Online`, :attr:`.Status.Busy` or :attr:`.Status.Hidden` (shown as :attr:`.Status.Offline` to others). Args: status (.Status): new availability to ...
def lpgamma(p, a): """ Multidimensional gamma / partial gamma function Parameters ---------- p : int something.... a : float something.... Returns ------- Multidimensional gamma / partial gamma function """ res = p * (p - 1.0) / 4.0 * log(pi) for ii in...
def function[lpgamma, parameter[p, a]]: constant[ Multidimensional gamma / partial gamma function Parameters ---------- p : int something.... a : float something.... Returns ------- Multidimensional gamma / partial gamma function ] variable[res] as...
keyword[def] identifier[lpgamma] ( identifier[p] , identifier[a] ): literal[string] identifier[res] = identifier[p] *( identifier[p] - literal[int] )/ literal[int] * identifier[log] ( identifier[pi] ) keyword[for] identifier[ii] keyword[in] identifier[range] ( literal[int] , identifier[p] + literal...
def lpgamma(p, a): """ Multidimensional gamma / partial gamma function Parameters ---------- p : int something.... a : float something.... Returns ------- Multidimensional gamma / partial gamma function """ res = p * (p - 1.0) / 4.0 * log(pi) for ii in...
def trajectory_set_item(self, idx, value): """ :param self: mdtraj.Trajectory :param idx: possible slices over frames, :param value: :return: """ import mdtraj assert isinstance(self, mdtraj.Trajectory), type(self) if not isinstance(value, mdtraj.Trajectory): raise TypeError(...
def function[trajectory_set_item, parameter[self, idx, value]]: constant[ :param self: mdtraj.Trajectory :param idx: possible slices over frames, :param value: :return: ] import module[mdtraj] assert[call[name[isinstance], parameter[name[self], name[mdtraj].Trajectory]]] if <...
keyword[def] identifier[trajectory_set_item] ( identifier[self] , identifier[idx] , identifier[value] ): literal[string] keyword[import] identifier[mdtraj] keyword[assert] identifier[isinstance] ( identifier[self] , identifier[mdtraj] . identifier[Trajectory] ), identifier[type] ( identifier[self] ...
def trajectory_set_item(self, idx, value): """ :param self: mdtraj.Trajectory :param idx: possible slices over frames, :param value: :return: """ import mdtraj assert isinstance(self, mdtraj.Trajectory), type(self) if not isinstance(value, mdtraj.Trajectory): raise TypeError(...
def _set(self, name, value): "Proxy to set a property of the widget element." return self.widget(self.widget_element._set(name, value))
def function[_set, parameter[self, name, value]]: constant[Proxy to set a property of the widget element.] return[call[name[self].widget, parameter[call[name[self].widget_element._set, parameter[name[name], name[value]]]]]]
keyword[def] identifier[_set] ( identifier[self] , identifier[name] , identifier[value] ): literal[string] keyword[return] identifier[self] . identifier[widget] ( identifier[self] . identifier[widget_element] . identifier[_set] ( identifier[name] , identifier[value] ))
def _set(self, name, value): """Proxy to set a property of the widget element.""" return self.widget(self.widget_element._set(name, value))
def account_application(self, customer_ip, first_name, last_name, tax_id, date_of_birth, address_line_1, city_name, state_code, postal_code, phone_number, email_address, citizenship_country, employment_status, product_id, funding_amount, account_number, routing_number, backup_withholding=False, phone_type='mobile', acc...
def function[account_application, parameter[self, customer_ip, first_name, last_name, tax_id, date_of_birth, address_line_1, city_name, state_code, postal_code, phone_number, email_address, citizenship_country, employment_status, product_id, funding_amount, account_number, routing_number, backup_withholding, phone_type...
keyword[def] identifier[account_application] ( identifier[self] , identifier[customer_ip] , identifier[first_name] , identifier[last_name] , identifier[tax_id] , identifier[date_of_birth] , identifier[address_line_1] , identifier[city_name] , identifier[state_code] , identifier[postal_code] , identifier[phone_number]...
def account_application(self, customer_ip, first_name, last_name, tax_id, date_of_birth, address_line_1, city_name, state_code, postal_code, phone_number, email_address, citizenship_country, employment_status, product_id, funding_amount, account_number, routing_number, backup_withholding=False, phone_type='mobile', acc...
def add_connection_throttle(self, loadbalancer, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied. ...
def function[add_connection_throttle, parameter[self, loadbalancer, maxConnectionRate, maxConnections, minConnections, rateInterval]]: constant[ Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied. ...
keyword[def] identifier[add_connection_throttle] ( identifier[self] , identifier[loadbalancer] , identifier[maxConnectionRate] = keyword[None] , identifier[maxConnections] = keyword[None] , identifier[minConnections] = keyword[None] , identifier[rateInterval] = keyword[None] ): literal[string] key...
def add_connection_throttle(self, loadbalancer, maxConnectionRate=None, maxConnections=None, minConnections=None, rateInterval=None): """ Updates the connection throttling information for the load balancer with the supplied values. At least one of the parameters must be supplied. """ ret...
def _filter(self, dict, keep): """ Remove any keys not in 'keep' """ if not keep: return dict result = {} for key, value in dict.iteritems(): if key in keep: result[key] = value return result
def function[_filter, parameter[self, dict, keep]]: constant[ Remove any keys not in 'keep' ] if <ast.UnaryOp object at 0x7da1b27e35b0> begin[:] return[name[dict]] variable[result] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da1b27e0820>, <ast.Name object...
keyword[def] identifier[_filter] ( identifier[self] , identifier[dict] , identifier[keep] ): literal[string] keyword[if] keyword[not] identifier[keep] : keyword[return] identifier[dict] identifier[result] ={} keyword[for] identifier[key] , identifier[value] key...
def _filter(self, dict, keep): """ Remove any keys not in 'keep' """ if not keep: return dict # depends on [control=['if'], data=[]] result = {} for (key, value) in dict.iteritems(): if key in keep: result[key] = value # depends on [control=['if'], data=['key']] # depends ...
def CheckOutput(*popenargs, **kwargs): """ Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. """ process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs) output, _ = process.communicate() retcode = pr...
def function[CheckOutput, parameter[]]: constant[ Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. ] variable[process] assign[=] call[name[subprocess].Popen, parameter[<ast.Starred object at 0x7da204621210>]...
keyword[def] identifier[CheckOutput] (* identifier[popenargs] ,** identifier[kwargs] ): literal[string] identifier[process] = identifier[subprocess] . identifier[Popen] ( identifier[stdout] = identifier[subprocess] . identifier[PIPE] ,* identifier[popenargs] ,** identifier[kwargs] ) identifier[output] , ide...
def CheckOutput(*popenargs, **kwargs): """ Run command with arguments and return its output as a byte string. Backported from Python 2.7 as it's implemented as pure python on stdlib. """ process = subprocess.Popen(*popenargs, stdout=subprocess.PIPE, **kwargs) (output, _) = process.communicate() re...
def score_n1(matrix, matrix_size): """\ Implements the penalty score feature 1. ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54) ============================================ ======================== ====== Feature Ev...
def function[score_n1, parameter[matrix, matrix_size]]: constant[ Implements the penalty score feature 1. ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54) ============================================ ======================== ====== Feature ...
keyword[def] identifier[score_n1] ( identifier[matrix] , identifier[matrix_size] ): literal[string] identifier[score] = literal[int] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[matrix_size] ): identifier[prev_bit_row] , identifier[prev_bit_col] =- literal[int] ,-...
def score_n1(matrix, matrix_size): """ Implements the penalty score feature 1. ISO/IEC 18004:2015(E) -- 7.8.3 Evaluation of data masking results - Table 11 (page 54) ============================================ ======================== ====== Feature Eval...
def parse_xml(data, handle_units): """Parse XML data returned by NCSS.""" root = ET.fromstring(data) return squish(parse_xml_dataset(root, handle_units))
def function[parse_xml, parameter[data, handle_units]]: constant[Parse XML data returned by NCSS.] variable[root] assign[=] call[name[ET].fromstring, parameter[name[data]]] return[call[name[squish], parameter[call[name[parse_xml_dataset], parameter[name[root], name[handle_units]]]]]]
keyword[def] identifier[parse_xml] ( identifier[data] , identifier[handle_units] ): literal[string] identifier[root] = identifier[ET] . identifier[fromstring] ( identifier[data] ) keyword[return] identifier[squish] ( identifier[parse_xml_dataset] ( identifier[root] , identifier[handle_units] ))
def parse_xml(data, handle_units): """Parse XML data returned by NCSS.""" root = ET.fromstring(data) return squish(parse_xml_dataset(root, handle_units))
def check_nocycles(Adj, verbosity=2): """\ Checks that there are no cycles in graph described by adjacancy matrix. Parameters ---------- Adj (np.array): adjancancy matrix of dimension (dim, dim) Returns ------- True if there is no cycle, False otherwise. """ dim = Adj.shape[0] ...
def function[check_nocycles, parameter[Adj, verbosity]]: constant[ Checks that there are no cycles in graph described by adjacancy matrix. Parameters ---------- Adj (np.array): adjancancy matrix of dimension (dim, dim) Returns ------- True if there is no cycle, False otherwise. ...
keyword[def] identifier[check_nocycles] ( identifier[Adj] , identifier[verbosity] = literal[int] ): literal[string] identifier[dim] = identifier[Adj] . identifier[shape] [ literal[int] ] keyword[for] identifier[g] keyword[in] identifier[range] ( identifier[dim] ): identifier[v] = identifie...
def check_nocycles(Adj, verbosity=2): """ Checks that there are no cycles in graph described by adjacancy matrix. Parameters ---------- Adj (np.array): adjancancy matrix of dimension (dim, dim) Returns ------- True if there is no cycle, False otherwise. """ dim = Adj.shape[0] ...
def domain_name(): """Return a random domain name. Lowercased result of :py:func:`~forgery_py.forgery.name.company_name()` plus :py:func:`~top_level_domain()`. """ result = random.choice(get_dictionary('company_names')).strip() result += '.' + top_level_domain() return result.lower()
def function[domain_name, parameter[]]: constant[Return a random domain name. Lowercased result of :py:func:`~forgery_py.forgery.name.company_name()` plus :py:func:`~top_level_domain()`. ] variable[result] assign[=] call[call[name[random].choice, parameter[call[name[get_dictionary], paramet...
keyword[def] identifier[domain_name] (): literal[string] identifier[result] = identifier[random] . identifier[choice] ( identifier[get_dictionary] ( literal[string] )). identifier[strip] () identifier[result] += literal[string] + identifier[top_level_domain] () keyword[return] identifier[result...
def domain_name(): """Return a random domain name. Lowercased result of :py:func:`~forgery_py.forgery.name.company_name()` plus :py:func:`~top_level_domain()`. """ result = random.choice(get_dictionary('company_names')).strip() result += '.' + top_level_domain() return result.lower()
def popitem(self): """Remove and return a random `(key, value)` pair.""" try: key = self.__choice(list(self)) except IndexError: raise KeyError('%s is empty' % self.__class__.__name__) else: return (key, self.pop(key))
def function[popitem, parameter[self]]: constant[Remove and return a random `(key, value)` pair.] <ast.Try object at 0x7da20c7c8640>
keyword[def] identifier[popitem] ( identifier[self] ): literal[string] keyword[try] : identifier[key] = identifier[self] . identifier[__choice] ( identifier[list] ( identifier[self] )) keyword[except] identifier[IndexError] : keyword[raise] identifier[KeyError] ...
def popitem(self): """Remove and return a random `(key, value)` pair.""" try: key = self.__choice(list(self)) # depends on [control=['try'], data=[]] except IndexError: raise KeyError('%s is empty' % self.__class__.__name__) # depends on [control=['except'], data=[]] else: retu...
def apply(self, root): """ Apply the import (rule) to the specified schema. If the schema does not already contain an import for the I{namespace} specified here, it is added. @param root: A schema root. @type root: L{Element} """ if not self.filter.match(r...
def function[apply, parameter[self, root]]: constant[ Apply the import (rule) to the specified schema. If the schema does not already contain an import for the I{namespace} specified here, it is added. @param root: A schema root. @type root: L{Element} ] i...
keyword[def] identifier[apply] ( identifier[self] , identifier[root] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[filter] . identifier[match] ( identifier[root] , identifier[self] . identifier[ns] ): keyword[return] keyword[if] identifier[self]...
def apply(self, root): """ Apply the import (rule) to the specified schema. If the schema does not already contain an import for the I{namespace} specified here, it is added. @param root: A schema root. @type root: L{Element} """ if not self.filter.match(root, sel...
def fix_variables(self, fixed): """Fix the value of the variables and remove it from a binary quadratic model. Args: fixed (dict): A dictionary of variable assignments. Examples: >>> bqm = dimod.BinaryQuadraticModel({'a': -.5, 'b': 0., 'c': 5}, {('a', 'b...
def function[fix_variables, parameter[self, fixed]]: constant[Fix the value of the variables and remove it from a binary quadratic model. Args: fixed (dict): A dictionary of variable assignments. Examples: >>> bqm = dimod.BinaryQuadraticModel({'a': -.5, ...
keyword[def] identifier[fix_variables] ( identifier[self] , identifier[fixed] ): literal[string] keyword[for] identifier[v] , identifier[val] keyword[in] identifier[fixed] . identifier[items] (): identifier[self] . identifier[fix_variable] ( identifier[v] , identifier[val] )
def fix_variables(self, fixed): """Fix the value of the variables and remove it from a binary quadratic model. Args: fixed (dict): A dictionary of variable assignments. Examples: >>> bqm = dimod.BinaryQuadraticModel({'a': -.5, 'b': 0., 'c': 5}, {('a', 'b'): ...
def _get_sessionless_launch_url(self, context, context_id, tool_id): """ Get a sessionless launch url for an external tool. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.generate_sessionless_launch """ url = context.format(context_id) + "/exter...
def function[_get_sessionless_launch_url, parameter[self, context, context_id, tool_id]]: constant[ Get a sessionless launch url for an external tool. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.generate_sessionless_launch ] variable[url] ass...
keyword[def] identifier[_get_sessionless_launch_url] ( identifier[self] , identifier[context] , identifier[context_id] , identifier[tool_id] ): literal[string] identifier[url] = identifier[context] . identifier[format] ( identifier[context_id] )+ literal[string] identifier[params] ={ lite...
def _get_sessionless_launch_url(self, context, context_id, tool_id): """ Get a sessionless launch url for an external tool. https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.generate_sessionless_launch """ url = context.format(context_id) + '/external_tool...
def generate_new_bracket(self): """generate a new bracket""" logger.debug( 'start to create a new SuccessiveHalving iteration, self.curr_s=%d', self.curr_s) if self.curr_s < 0: logger.info("s < 0, Finish this round of Hyperband in BOHB. Generate new round") se...
def function[generate_new_bracket, parameter[self]]: constant[generate a new bracket] call[name[logger].debug, parameter[constant[start to create a new SuccessiveHalving iteration, self.curr_s=%d], name[self].curr_s]] if compare[name[self].curr_s less[<] constant[0]] begin[:] cal...
keyword[def] identifier[generate_new_bracket] ( identifier[self] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[curr_s] ) keyword[if] identifier[self] . identifier[curr_s] < literal[int] : identifier[logger...
def generate_new_bracket(self): """generate a new bracket""" logger.debug('start to create a new SuccessiveHalving iteration, self.curr_s=%d', self.curr_s) if self.curr_s < 0: logger.info('s < 0, Finish this round of Hyperband in BOHB. Generate new round') self.curr_s = self.s_max # depends...
def prj_view_user(self, *args, **kwargs): """View the, in the user table view selected, user. :returns: None :rtype: None :raises: None """ if not self.cur_prj: return i = self.prj_user_tablev.currentIndex() item = i.internalPointer() ...
def function[prj_view_user, parameter[self]]: constant[View the, in the user table view selected, user. :returns: None :rtype: None :raises: None ] if <ast.UnaryOp object at 0x7da18f722350> begin[:] return[None] variable[i] assign[=] call[name[self].prj_u...
keyword[def] identifier[prj_view_user] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[cur_prj] : keyword[return] identifier[i] = identifier[self] . identifier[prj_user_tablev] . identif...
def prj_view_user(self, *args, **kwargs): """View the, in the user table view selected, user. :returns: None :rtype: None :raises: None """ if not self.cur_prj: return # depends on [control=['if'], data=[]] i = self.prj_user_tablev.currentIndex() item = i.intern...
def last_ehlo_response(self, response: SMTPResponse) -> None: """ When setting the last EHLO response, parse the message for supported extensions and auth methods. """ extensions, auth_methods = parse_esmtp_extensions(response.message) self._last_ehlo_response = response ...
def function[last_ehlo_response, parameter[self, response]]: constant[ When setting the last EHLO response, parse the message for supported extensions and auth methods. ] <ast.Tuple object at 0x7da204347e20> assign[=] call[name[parse_esmtp_extensions], parameter[name[response].me...
keyword[def] identifier[last_ehlo_response] ( identifier[self] , identifier[response] : identifier[SMTPResponse] )-> keyword[None] : literal[string] identifier[extensions] , identifier[auth_methods] = identifier[parse_esmtp_extensions] ( identifier[response] . identifier[message] ) identif...
def last_ehlo_response(self, response: SMTPResponse) -> None: """ When setting the last EHLO response, parse the message for supported extensions and auth methods. """ (extensions, auth_methods) = parse_esmtp_extensions(response.message) self._last_ehlo_response = response self.e...
def words(self): """Return a list of word tokens. This excludes punctuation characters. If you want to include punctuation characters, access the ``tokens`` property. :returns: A :class:`WordList <WordList>` of word tokens. """ return WordList( word_tokenize...
def function[words, parameter[self]]: constant[Return a list of word tokens. This excludes punctuation characters. If you want to include punctuation characters, access the ``tokens`` property. :returns: A :class:`WordList <WordList>` of word tokens. ] return[call[name[Word...
keyword[def] identifier[words] ( identifier[self] ): literal[string] keyword[return] identifier[WordList] ( identifier[word_tokenize] ( identifier[self] . identifier[raw] , identifier[self] . identifier[tokenizer] , identifier[include_punc] = keyword[False] ))
def words(self): """Return a list of word tokens. This excludes punctuation characters. If you want to include punctuation characters, access the ``tokens`` property. :returns: A :class:`WordList <WordList>` of word tokens. """ return WordList(word_tokenize(self.raw, self.token...
def connect(self, server): "Connects to a server and return a connection id." if 'connections' not in session: session['connections'] = {} session.save() conns = session['connections'] id = str(len(conns)) conn = Connection(server) conns[...
def function[connect, parameter[self, server]]: constant[Connects to a server and return a connection id.] if compare[constant[connections] <ast.NotIn object at 0x7da2590d7190> name[session]] begin[:] call[name[session]][constant[connections]] assign[=] dictionary[[], []] ...
keyword[def] identifier[connect] ( identifier[self] , identifier[server] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[session] : identifier[session] [ literal[string] ]={} identifier[session] . identifier[save] () i...
def connect(self, server): """Connects to a server and return a connection id.""" if 'connections' not in session: session['connections'] = {} session.save() # depends on [control=['if'], data=['session']] conns = session['connections'] id = str(len(conns)) conn = Connection(server)...
def from_rdata_list(name, ttl, rdatas): """Create an RRset with the specified name and TTL, and with the specified list of rdata objects. @rtype: dns.rrset.RRset object """ if isinstance(name, (str, unicode)): name = dns.name.from_text(name, None) if len(rdatas) == 0: raise Va...
def function[from_rdata_list, parameter[name, ttl, rdatas]]: constant[Create an RRset with the specified name and TTL, and with the specified list of rdata objects. @rtype: dns.rrset.RRset object ] if call[name[isinstance], parameter[name[name], tuple[[<ast.Name object at 0x7da1b2345b10>, <...
keyword[def] identifier[from_rdata_list] ( identifier[name] , identifier[ttl] , identifier[rdatas] ): literal[string] keyword[if] identifier[isinstance] ( identifier[name] ,( identifier[str] , identifier[unicode] )): identifier[name] = identifier[dns] . identifier[name] . identifier[from_text] (...
def from_rdata_list(name, ttl, rdatas): """Create an RRset with the specified name and TTL, and with the specified list of rdata objects. @rtype: dns.rrset.RRset object """ if isinstance(name, (str, unicode)): name = dns.name.from_text(name, None) # depends on [control=['if'], data=[]] ...
def __draw_constant_line(self, value_label_style): "Draw a constant line on the y-axis with the label" value, label, style = value_label_style start = self.transform_output_coordinates((0, value))[1] stop = self.graph_width path = etree.SubElement(self.graph, 'path', { 'd': 'M 0 %(start)s h%(stop)s' % loca...
def function[__draw_constant_line, parameter[self, value_label_style]]: constant[Draw a constant line on the y-axis with the label] <ast.Tuple object at 0x7da1b0215e70> assign[=] name[value_label_style] variable[start] assign[=] call[call[name[self].transform_output_coordinates, parameter[tuple[...
keyword[def] identifier[__draw_constant_line] ( identifier[self] , identifier[value_label_style] ): literal[string] identifier[value] , identifier[label] , identifier[style] = identifier[value_label_style] identifier[start] = identifier[self] . identifier[transform_output_coordinates] (( literal[int] , ide...
def __draw_constant_line(self, value_label_style): """Draw a constant line on the y-axis with the label""" (value, label, style) = value_label_style start = self.transform_output_coordinates((0, value))[1] stop = self.graph_width path = etree.SubElement(self.graph, 'path', {'d': 'M 0 %(start)s h%(st...
def create_config(self, env, conf): """ Set conf to env under service. pass None to env for root. """ if not isinstance(conf, collections.Mapping): raise ValueError("conf must be a collections.Mapping") self.zk.ensure_path(self.view_path) self._cre...
def function[create_config, parameter[self, env, conf]]: constant[ Set conf to env under service. pass None to env for root. ] if <ast.UnaryOp object at 0x7da18bc72290> begin[:] <ast.Raise object at 0x7da18bc73760> call[name[self].zk.ensure_path, parameter[name[s...
keyword[def] identifier[create_config] ( identifier[self] , identifier[env] , identifier[conf] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[conf] , identifier[collections] . identifier[Mapping] ): keyword[raise] identifier[ValueError] ( literal[st...
def create_config(self, env, conf): """ Set conf to env under service. pass None to env for root. """ if not isinstance(conf, collections.Mapping): raise ValueError('conf must be a collections.Mapping') # depends on [control=['if'], data=[]] self.zk.ensure_path(self.view_pa...
def __list_supybot_archives(self): """List the filepath of the archives stored in dirpath""" archives = [] for root, _, files in os.walk(self.dirpath): for filename in files: location = os.path.join(root, filename) archives.append(location) ...
def function[__list_supybot_archives, parameter[self]]: constant[List the filepath of the archives stored in dirpath] variable[archives] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b0315db0>, <ast.Name object at 0x7da1b0317c70>, <ast.Name object at 0x7da1b02857e0>]]] in starred...
keyword[def] identifier[__list_supybot_archives] ( identifier[self] ): literal[string] identifier[archives] =[] keyword[for] identifier[root] , identifier[_] , identifier[files] keyword[in] identifier[os] . identifier[walk] ( identifier[self] . identifier[dirpath] ): keyw...
def __list_supybot_archives(self): """List the filepath of the archives stored in dirpath""" archives = [] for (root, _, files) in os.walk(self.dirpath): for filename in files: location = os.path.join(root, filename) archives.append(location) # depends on [control=['for'], d...
def nullval(cls): """Create a new instance where all of the values are 0""" d = dict(cls.__dict__.items()) for k in d: d[k] = 0 d['sl'] = cls.sl d[cls.level] = 0 return cls(**d)
def function[nullval, parameter[cls]]: constant[Create a new instance where all of the values are 0] variable[d] assign[=] call[name[dict], parameter[call[name[cls].__dict__.items, parameter[]]]] for taget[name[k]] in starred[name[d]] begin[:] call[name[d]][name[k]] assign[=] con...
keyword[def] identifier[nullval] ( identifier[cls] ): literal[string] identifier[d] = identifier[dict] ( identifier[cls] . identifier[__dict__] . identifier[items] ()) keyword[for] identifier[k] keyword[in] identifier[d] : identifier[d] [ identifier[k] ]= literal[int] ...
def nullval(cls): """Create a new instance where all of the values are 0""" d = dict(cls.__dict__.items()) for k in d: d[k] = 0 # depends on [control=['for'], data=['k']] d['sl'] = cls.sl d[cls.level] = 0 return cls(**d)
def quartus_add_interface_port(self, buff: List[str], intfName: str, signal, logicName: str, packager: "IpCorePackager"): """ Add subinterface to Quartus interface :param buff: line buffer for output :param intfName: name of top interface :para...
def function[quartus_add_interface_port, parameter[self, buff, intfName, signal, logicName, packager]]: constant[ Add subinterface to Quartus interface :param buff: line buffer for output :param intfName: name of top interface :param signal: subinterface to create port for ...
keyword[def] identifier[quartus_add_interface_port] ( identifier[self] , identifier[buff] : identifier[List] [ identifier[str] ], identifier[intfName] : identifier[str] , identifier[signal] , identifier[logicName] : identifier[str] , identifier[packager] : literal[string] ): literal[string] identi...
def quartus_add_interface_port(self, buff: List[str], intfName: str, signal, logicName: str, packager: 'IpCorePackager'): """ Add subinterface to Quartus interface :param buff: line buffer for output :param intfName: name of top interface :param signal: subinterface to create port f...
def list_topics(self, request): """ List all topics in a logstore. Unsuccessful opertaion will cause an LogException. :type request: ListTopicsRequest :param request: the ListTopics request parameters class. :return: ListTopicsResponse ...
def function[list_topics, parameter[self, request]]: constant[ List all topics in a logstore. Unsuccessful opertaion will cause an LogException. :type request: ListTopicsRequest :param request: the ListTopics request parameters class. :return: ListTopicsResponse...
keyword[def] identifier[list_topics] ( identifier[self] , identifier[request] ): literal[string] identifier[headers] ={} identifier[params] ={} keyword[if] identifier[request] . identifier[get_token] () keyword[is] keyword[not] keyword[None] : identifier[param...
def list_topics(self, request): """ List all topics in a logstore. Unsuccessful opertaion will cause an LogException. :type request: ListTopicsRequest :param request: the ListTopics request parameters class. :return: ListTopicsResponse :raise: LogEx...
def _search_tree_backwards(self, template, parent_lanes): """Searches the process tree backwards in search of a provided process The search takes into consideration the provided parent lanes and searches only those Parameters ---------- template : str Name o...
def function[_search_tree_backwards, parameter[self, template, parent_lanes]]: constant[Searches the process tree backwards in search of a provided process The search takes into consideration the provided parent lanes and searches only those Parameters ---------- templa...
keyword[def] identifier[_search_tree_backwards] ( identifier[self] , identifier[template] , identifier[parent_lanes] ): literal[string] keyword[for] identifier[p] keyword[in] identifier[self] . identifier[processes] [::- literal[int] ]: keyword[if] identifier[p] . identi...
def _search_tree_backwards(self, template, parent_lanes): """Searches the process tree backwards in search of a provided process The search takes into consideration the provided parent lanes and searches only those Parameters ---------- template : str Name of th...
def peek(self, length): """ Returns up to length bytes from the current memory segment """ t = self.current_position + length if not self.current_segment.inrange(t): raise Exception('Would read over segment boundaries!') return self.current_segment.data[self.current_position - self.current_segment.start_...
def function[peek, parameter[self, length]]: constant[ Returns up to length bytes from the current memory segment ] variable[t] assign[=] binary_operation[name[self].current_position + name[length]] if <ast.UnaryOp object at 0x7da1b102a2c0> begin[:] <ast.Raise object at 0x7da1b1028d6...
keyword[def] identifier[peek] ( identifier[self] , identifier[length] ): literal[string] identifier[t] = identifier[self] . identifier[current_position] + identifier[length] keyword[if] keyword[not] identifier[self] . identifier[current_segment] . identifier[inrange] ( identifier[t] ): keyword[raise]...
def peek(self, length): """ Returns up to length bytes from the current memory segment """ t = self.current_position + length if not self.current_segment.inrange(t): raise Exception('Would read over segment boundaries!') # depends on [control=['if'], data=[]] return self.current_segment.dat...
def _init( self, default_prefix='_', fext=TMPL_FN_EXT, req_tmpl_name=REQ_TMPL_NAME, text_prefix=REQUIREJS_TEXT_PREFIX, auto_reload=False, *a, **kw): """ Arguments: registry_name The name of this registry. """ ...
def function[_init, parameter[self, default_prefix, fext, req_tmpl_name, text_prefix, auto_reload]]: constant[ Arguments: registry_name The name of this registry. ] name[self].default_prefix assign[=] name[default_prefix] name[self].molds assign[=] dictionary...
keyword[def] identifier[_init] ( identifier[self] , identifier[default_prefix] = literal[string] , identifier[fext] = identifier[TMPL_FN_EXT] , identifier[req_tmpl_name] = identifier[REQ_TMPL_NAME] , identifier[text_prefix] = identifier[REQUIREJS_TEXT_PREFIX] , identifier[auto_reload] = keyword[False] , * identif...
def _init(self, default_prefix='_', fext=TMPL_FN_EXT, req_tmpl_name=REQ_TMPL_NAME, text_prefix=REQUIREJS_TEXT_PREFIX, auto_reload=False, *a, **kw): """ Arguments: registry_name The name of this registry. """ self.default_prefix = default_prefix self.molds = {} self.t...
def build(self): """Do the query.""" result = [] for entry in self.sequence: ignore = False for filter_function in self.filter_functions: if not filter_function(entry): ignore = True break if not ignore: ...
def function[build, parameter[self]]: constant[Do the query.] variable[result] assign[=] list[[]] for taget[name[entry]] in starred[name[self].sequence] begin[:] variable[ignore] assign[=] constant[False] for taget[name[filter_function]] in starred[name[self].filt...
keyword[def] identifier[build] ( identifier[self] ): literal[string] identifier[result] =[] keyword[for] identifier[entry] keyword[in] identifier[self] . identifier[sequence] : identifier[ignore] = keyword[False] keyword[for] identifier[filter_function] keyw...
def build(self): """Do the query.""" result = [] for entry in self.sequence: ignore = False for filter_function in self.filter_functions: if not filter_function(entry): ignore = True break # depends on [control=['if'], data=[]] # depends on [cont...
def load_requirements(self): """If there are python library requirements set, append the python dir to the path.""" for module_name, pip_name in iteritems(self.metadata.requirements): extant = self.dataset.config.requirements[module_name].url force = (extant and extant ...
def function[load_requirements, parameter[self]]: constant[If there are python library requirements set, append the python dir to the path.] for taget[tuple[[<ast.Name object at 0x7da18c4cd660>, <ast.Name object at 0x7da18c4ceb00>]]] in starred[call[name[iteritems], parameter[name[self].metadata...
keyword[def] identifier[load_requirements] ( identifier[self] ): literal[string] keyword[for] identifier[module_name] , identifier[pip_name] keyword[in] identifier[iteritems] ( identifier[self] . identifier[metadata] . identifier[requirements] ): identifier[extant] = identifier[sel...
def load_requirements(self): """If there are python library requirements set, append the python dir to the path.""" for (module_name, pip_name) in iteritems(self.metadata.requirements): extant = self.dataset.config.requirements[module_name].url force = extant and extant != pip_name ...
def image_search(auth=None, **kwargs): ''' Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search ''' cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.search_images(**k...
def function[image_search, parameter[auth]]: constant[ Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search ] variable[cloud] assign[=] call[name[get_operator_cloud], parameter[name[auth]]] ...
keyword[def] identifier[image_search] ( identifier[auth] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[cloud] = identifier[get_operator_cloud] ( identifier[auth] ) identifier[kwargs] = identifier[_clean_kwargs] (** identifier[kwargs] ) keyword[return] identifier[cloud] . i...
def image_search(auth=None, **kwargs): """ Search for images CLI Example: .. code-block:: bash salt '*' glanceng.image_search name=image1 salt '*' glanceng.image_search """ cloud = get_operator_cloud(auth) kwargs = _clean_kwargs(**kwargs) return cloud.search_images(**k...
def getTmpFilename(self, tmp_dir=None, prefix='tmp', suffix='.txt', include_class_id=False, result_constructor=FilePath): """ Return a temp filename tmp_dir: directory where temporary files will be stored prefix: text to append to start of file name su...
def function[getTmpFilename, parameter[self, tmp_dir, prefix, suffix, include_class_id, result_constructor]]: constant[ Return a temp filename tmp_dir: directory where temporary files will be stored prefix: text to append to start of file name suffix: text to append to end o...
keyword[def] identifier[getTmpFilename] ( identifier[self] , identifier[tmp_dir] = keyword[None] , identifier[prefix] = literal[string] , identifier[suffix] = literal[string] , identifier[include_class_id] = keyword[False] , identifier[result_constructor] = identifier[FilePath] ): literal[string] ...
def getTmpFilename(self, tmp_dir=None, prefix='tmp', suffix='.txt', include_class_id=False, result_constructor=FilePath): """ Return a temp filename tmp_dir: directory where temporary files will be stored prefix: text to append to start of file name suffix: text to append to end...
def run(self, args): """Runs the information command. Args: self (InfoCommand): the ``InfoCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) if args.product: ...
def function[run, parameter[self, args]]: constant[Runs the information command. Args: self (InfoCommand): the ``InfoCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` ] variable[jlink] assign[=] call[na...
keyword[def] identifier[run] ( identifier[self] , identifier[args] ): literal[string] identifier[jlink] = identifier[self] . identifier[create_jlink] ( identifier[args] ) keyword[if] identifier[args] . identifier[product] : identifier[print] ( literal[string] % identifier[jli...
def run(self, args): """Runs the information command. Args: self (InfoCommand): the ``InfoCommand`` instance args (Namespace): the arguments passed on the command-line Returns: ``None`` """ jlink = self.create_jlink(args) if args.product: print...
def table_from_gwf(filename, name, columns=None, selection=None): """Read a Table from FrEvent structures in a GWF file (or files) Parameters ---------- filename : `str` path of GWF file to read name : `str` name associated with the `FrEvent` structures columns : `list` of `st...
def function[table_from_gwf, parameter[filename, name, columns, selection]]: constant[Read a Table from FrEvent structures in a GWF file (or files) Parameters ---------- filename : `str` path of GWF file to read name : `str` name associated with the `FrEvent` structures co...
keyword[def] identifier[table_from_gwf] ( identifier[filename] , identifier[name] , identifier[columns] = keyword[None] , identifier[selection] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[filename] , identifier[FILE_LIKE] ): identifier[filename] = ident...
def table_from_gwf(filename, name, columns=None, selection=None): """Read a Table from FrEvent structures in a GWF file (or files) Parameters ---------- filename : `str` path of GWF file to read name : `str` name associated with the `FrEvent` structures columns : `list` of `st...
def create_rule(self, txtrule=None, regex=None, extension=None, cmd=None, codes=[0, None], recurse=True): ''' Adds a set of rules to the extraction rule list. @txtrule - Rule string, or list of rule strings, in the format <regular expression>:<file extension>[:<command to run>] @regex...
def function[create_rule, parameter[self, txtrule, regex, extension, cmd, codes, recurse]]: constant[ Adds a set of rules to the extraction rule list. @txtrule - Rule string, or list of rule strings, in the format <regular expression>:<file extension>[:<command to run>] @regex - I...
keyword[def] identifier[create_rule] ( identifier[self] , identifier[txtrule] = keyword[None] , identifier[regex] = keyword[None] , identifier[extension] = keyword[None] , identifier[cmd] = keyword[None] , identifier[codes] =[ literal[int] , keyword[None] ], identifier[recurse] = keyword[True] ): literal[str...
def create_rule(self, txtrule=None, regex=None, extension=None, cmd=None, codes=[0, None], recurse=True): """ Adds a set of rules to the extraction rule list. @txtrule - Rule string, or list of rule strings, in the format <regular expression>:<file extension>[:<command to run>] @regex ...
def info(self, callback=None, **kwargs): """ Get the basic info from the current cluster. """ self.client.fetch( self.mk_req('', method='GET', **kwargs), callback = callback )
def function[info, parameter[self, callback]]: constant[ Get the basic info from the current cluster. ] call[name[self].client.fetch, parameter[call[name[self].mk_req, parameter[constant[]]]]]
keyword[def] identifier[info] ( identifier[self] , identifier[callback] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[client] . identifier[fetch] ( identifier[self] . identifier[mk_req] ( literal[string] , identifier[method] = literal[string] ,** i...
def info(self, callback=None, **kwargs): """ Get the basic info from the current cluster. """ self.client.fetch(self.mk_req('', method='GET', **kwargs), callback=callback)
def new_connection_status(self, conn_status): """Handle reception of a new ConnectionStatus.""" if conn_status.status == CONNECTION_STATUS_CONNECTED: self._mz.update_members() if (conn_status.status == CONNECTION_STATUS_DISCONNECTED or conn_status.status == CONNECTION...
def function[new_connection_status, parameter[self, conn_status]]: constant[Handle reception of a new ConnectionStatus.] if compare[name[conn_status].status equal[==] name[CONNECTION_STATUS_CONNECTED]] begin[:] call[name[self]._mz.update_members, parameter[]] if <ast.BoolOp objec...
keyword[def] identifier[new_connection_status] ( identifier[self] , identifier[conn_status] ): literal[string] keyword[if] identifier[conn_status] . identifier[status] == identifier[CONNECTION_STATUS_CONNECTED] : identifier[self] . identifier[_mz] . identifier[update_members] () ...
def new_connection_status(self, conn_status): """Handle reception of a new ConnectionStatus.""" if conn_status.status == CONNECTION_STATUS_CONNECTED: self._mz.update_members() # depends on [control=['if'], data=[]] if conn_status.status == CONNECTION_STATUS_DISCONNECTED or conn_status.status == CON...
def is_repetition(self, count: int = 3) -> bool: """ Checks if the current position has repeated 3 (or a given number of) times. Unlike :func:`~chess.Board.can_claim_threefold_repetition()`, this does not consider a repetition that can be played on the next move. ...
def function[is_repetition, parameter[self, count]]: constant[ Checks if the current position has repeated 3 (or a given number of) times. Unlike :func:`~chess.Board.can_claim_threefold_repetition()`, this does not consider a repetition that can be played on the next mov...
keyword[def] identifier[is_repetition] ( identifier[self] , identifier[count] : identifier[int] = literal[int] )-> identifier[bool] : literal[string] identifier[transposition_key] = identifier[self] . identifier[_transposition_key] () identifier[switchyard] =[] keyword[try] : ...
def is_repetition(self, count: int=3) -> bool: """ Checks if the current position has repeated 3 (or a given number of) times. Unlike :func:`~chess.Board.can_claim_threefold_repetition()`, this does not consider a repetition that can be played on the next move. Note...
def open(path, mode=None, ac_parser=None, **options): """ Open given configuration file with appropriate open flag. :param path: Configuration file path :param mode: Can be 'r' and 'rb' for reading (default) or 'w', 'wb' for writing. Please note that even if you specify 'r' or 'w', it w...
def function[open, parameter[path, mode, ac_parser]]: constant[ Open given configuration file with appropriate open flag. :param path: Configuration file path :param mode: Can be 'r' and 'rb' for reading (default) or 'w', 'wb' for writing. Please note that even if you specify 'r' or...
keyword[def] identifier[open] ( identifier[path] , identifier[mode] = keyword[None] , identifier[ac_parser] = keyword[None] ,** identifier[options] ): literal[string] identifier[psr] = identifier[find] ( identifier[path] , identifier[forced_type] = identifier[ac_parser] ) keyword[if] identifier[mode...
def open(path, mode=None, ac_parser=None, **options): """ Open given configuration file with appropriate open flag. :param path: Configuration file path :param mode: Can be 'r' and 'rb' for reading (default) or 'w', 'wb' for writing. Please note that even if you specify 'r' or 'w', it w...
def _encode_to_binary_string(message, on, off): """ >>> message = "SOS" >>> _encode_to_binary_string(message, on='1', off='0') '101010001110111011100010101' >>> message = " SOS" >>> _encode_to_binary_string(message, on='1', off='0') '0000000101010001110111011100010101' """ def to_st...
def function[_encode_to_binary_string, parameter[message, on, off]]: constant[ >>> message = "SOS" >>> _encode_to_binary_string(message, on='1', off='0') '101010001110111011100010101' >>> message = " SOS" >>> _encode_to_binary_string(message, on='1', off='0') '00000001010100011101110111...
keyword[def] identifier[_encode_to_binary_string] ( identifier[message] , identifier[on] , identifier[off] ): literal[string] keyword[def] identifier[to_string] ( identifier[i] , identifier[s] ): keyword[if] identifier[i] == literal[int] keyword[and] identifier[s] == identifier[off] : ...
def _encode_to_binary_string(message, on, off): """ >>> message = "SOS" >>> _encode_to_binary_string(message, on='1', off='0') '101010001110111011100010101' >>> message = " SOS" >>> _encode_to_binary_string(message, on='1', off='0') '0000000101010001110111011100010101' """ def to_s...
def project_from_files( files, func_wrapper=_astroid_wrapper, project_name="no name", black_list=("CVS",) ): """return a Project from a list of files or modules""" # build the project representation astroid_manager = manager.AstroidManager() project = Project(project_name) for something in files...
def function[project_from_files, parameter[files, func_wrapper, project_name, black_list]]: constant[return a Project from a list of files or modules] variable[astroid_manager] assign[=] call[name[manager].AstroidManager, parameter[]] variable[project] assign[=] call[name[Project], parameter[nam...
keyword[def] identifier[project_from_files] ( identifier[files] , identifier[func_wrapper] = identifier[_astroid_wrapper] , identifier[project_name] = literal[string] , identifier[black_list] =( literal[string] ,) ): literal[string] identifier[astroid_manager] = identifier[manager] . identifier[Astro...
def project_from_files(files, func_wrapper=_astroid_wrapper, project_name='no name', black_list=('CVS',)): """return a Project from a list of files or modules""" # build the project representation astroid_manager = manager.AstroidManager() project = Project(project_name) for something in files: ...
def _sub_latlon(self, other): ''' Called when subtracting a LatLon object from self ''' inv = self._pyproj_inv(other) heading = inv['heading_reverse'] distance = inv['distance'] return GeoVector(initial_heading = heading, distance = distance)
def function[_sub_latlon, parameter[self, other]]: constant[ Called when subtracting a LatLon object from self ] variable[inv] assign[=] call[name[self]._pyproj_inv, parameter[name[other]]] variable[heading] assign[=] call[name[inv]][constant[heading_reverse]] variable[di...
keyword[def] identifier[_sub_latlon] ( identifier[self] , identifier[other] ): literal[string] identifier[inv] = identifier[self] . identifier[_pyproj_inv] ( identifier[other] ) identifier[heading] = identifier[inv] [ literal[string] ] identifier[distance] = identifier[inv] [ lite...
def _sub_latlon(self, other): """ Called when subtracting a LatLon object from self """ inv = self._pyproj_inv(other) heading = inv['heading_reverse'] distance = inv['distance'] return GeoVector(initial_heading=heading, distance=distance)
def send(self, tids, session, **kwargs): '''taobao.topats.delivery.send 异步批量物流发货api 使用指南:http://open.taobao.com/dev/index.php/ATS%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97 - 1.提供异步批量物流发货功能 - 2.一次最多发货40个订单 - 3.提交任务会进行初步任务校验,如果成功会返回任务号和创建时间,如果失败就报错 - 4.可以接收淘...
def function[send, parameter[self, tids, session]]: constant[taobao.topats.delivery.send 异步批量物流发货api 使用指南:http://open.taobao.com/dev/index.php/ATS%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97 - 1.提供异步批量物流发货功能 - 2.一次最多发货40个订单 - 3.提交任务会进行初步任务校验,如果成功会返回任务号和创建时间,如果失败就报错 ...
keyword[def] identifier[send] ( identifier[self] , identifier[tids] , identifier[session] ,** identifier[kwargs] ): literal[string] identifier[request] = identifier[TOPRequest] ( literal[string] ) identifier[request] [ literal[string] ]= identifier[tids] keyword[for] identifier[...
def send(self, tids, session, **kwargs): """taobao.topats.delivery.send 异步批量物流发货api 使用指南:http://open.taobao.com/dev/index.php/ATS%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97 - 1.提供异步批量物流发货功能 - 2.一次最多发货40个订单 - 3.提交任务会进行初步任务校验,如果成功会返回任务号和创建时间,如果失败就报错 - 4.可以接收淘宝发出的...
def write_env_vars(env_vars=None): # type: (dict) -> None """Write the dictionary env_vars in the system, as environment variables. Args: env_vars (): Returns: """ env_vars = env_vars or {} env_vars['PYTHONPATH'] = ':'.join(sys.path) for name, value in env_vars.items(): ...
def function[write_env_vars, parameter[env_vars]]: constant[Write the dictionary env_vars in the system, as environment variables. Args: env_vars (): Returns: ] variable[env_vars] assign[=] <ast.BoolOp object at 0x7da1b16bd420> call[name[env_vars]][constant[PYTHONPATH]] as...
keyword[def] identifier[write_env_vars] ( identifier[env_vars] = keyword[None] ): literal[string] identifier[env_vars] = identifier[env_vars] keyword[or] {} identifier[env_vars] [ literal[string] ]= literal[string] . identifier[join] ( identifier[sys] . identifier[path] ) keyword[for] identifi...
def write_env_vars(env_vars=None): # type: (dict) -> None 'Write the dictionary env_vars in the system, as environment variables.\n\n Args:\n env_vars ():\n\n Returns:\n\n ' env_vars = env_vars or {} env_vars['PYTHONPATH'] = ':'.join(sys.path) for (name, value) in env_vars.items(): ...
def peak_memory_usage(): """Return peak memory usage in MB""" if sys.platform.startswith('win'): p = psutil.Process() return p.memory_info().peak_wset / 1024 / 1024 mem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss factor_mb = 1 / 1024 if sys.platform == 'darwin': fac...
def function[peak_memory_usage, parameter[]]: constant[Return peak memory usage in MB] if call[name[sys].platform.startswith, parameter[constant[win]]] begin[:] variable[p] assign[=] call[name[psutil].Process, parameter[]] return[binary_operation[binary_operation[call[name[p].mem...
keyword[def] identifier[peak_memory_usage] (): literal[string] keyword[if] identifier[sys] . identifier[platform] . identifier[startswith] ( literal[string] ): identifier[p] = identifier[psutil] . identifier[Process] () keyword[return] identifier[p] . identifier[memory_info] (). identif...
def peak_memory_usage(): """Return peak memory usage in MB""" if sys.platform.startswith('win'): p = psutil.Process() return p.memory_info().peak_wset / 1024 / 1024 # depends on [control=['if'], data=[]] mem = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss factor_mb = 1 / 1024 i...
def list_nsgs_all(access_token, subscription_id): '''List all network security groups in a subscription. Args: access_token (str): a valid Azure Authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of all network security groups in...
def function[list_nsgs_all, parameter[access_token, subscription_id]]: constant[List all network security groups in a subscription. Args: access_token (str): a valid Azure Authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of...
keyword[def] identifier[list_nsgs_all] ( identifier[access_token] , identifier[subscription_id] ): literal[string] identifier[endpoint] = literal[string] . identifier[join] ([ identifier[get_rm_endpoint] (), literal[string] , identifier[subscription_id] , literal[string] , literal[string] , ...
def list_nsgs_all(access_token, subscription_id): """List all network security groups in a subscription. Args: access_token (str): a valid Azure Authentication token. subscription_id (str): Azure subscription id. Returns: HTTP response. JSON body of all network security groups in...
def phrase_replace(self, replace_dict): """ Replace phrases with single token, mapping defined in replace_dict """ def r(tokens): text = ' ' + ' '.join(tokens) for k, v in replace_dict.items(): text = text.replace(...
def function[phrase_replace, parameter[self, replace_dict]]: constant[ Replace phrases with single token, mapping defined in replace_dict ] def function[r, parameter[tokens]]: variable[text] assign[=] binary_operation[constant[ ] + call[constant[ ].join, parameter[name[to...
keyword[def] identifier[phrase_replace] ( identifier[self] , identifier[replace_dict] ): literal[string] keyword[def] identifier[r] ( identifier[tokens] ): identifier[text] = literal[string] + literal[string] . identifier[join] ( identifier[tokens] ) keyword[for...
def phrase_replace(self, replace_dict): """ Replace phrases with single token, mapping defined in replace_dict """ def r(tokens): text = ' ' + ' '.join(tokens) for (k, v) in replace_dict.items(): text = text.replace(' ' + k + ' ', ' ' + v + ' ') # depends on [contro...
def get_default_field_names(self, declared_fields, model_info): """ Return the default list of field names that will be used if the `Meta.fields` option is not specified. """ return ( [model_info.pk.name] + list(declared_fields.keys()) + list(m...
def function[get_default_field_names, parameter[self, declared_fields, model_info]]: constant[ Return the default list of field names that will be used if the `Meta.fields` option is not specified. ] return[binary_operation[binary_operation[binary_operation[list[[<ast.Attribute objec...
keyword[def] identifier[get_default_field_names] ( identifier[self] , identifier[declared_fields] , identifier[model_info] ): literal[string] keyword[return] ( [ identifier[model_info] . identifier[pk] . identifier[name] ]+ identifier[list] ( identifier[declared_fields] . identifie...
def get_default_field_names(self, declared_fields, model_info): """ Return the default list of field names that will be used if the `Meta.fields` option is not specified. """ return [model_info.pk.name] + list(declared_fields.keys()) + list(model_info.fields.keys()) + list(model_info.for...
def p_args(self, p): """args : LPAR pos_args_list COMMA kw_args RPAR | LPAR pos_args_list RPAR | LPAR kw_args RPAR | LPAR RPAR | empty""" if len(p) > 3: if p[3] == ',': p[0] = (p[2], p[4]) elif isinst...
def function[p_args, parameter[self, p]]: constant[args : LPAR pos_args_list COMMA kw_args RPAR | LPAR pos_args_list RPAR | LPAR kw_args RPAR | LPAR RPAR | empty] if compare[call[name[len], parameter[name[p]]] greater[>] constant[3]] begin[...
keyword[def] identifier[p_args] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )> literal[int] : keyword[if] identifier[p] [ literal[int] ]== literal[string] : identifier[p] [ literal[int] ]=( identifier[p] [ literal...
def p_args(self, p): """args : LPAR pos_args_list COMMA kw_args RPAR | LPAR pos_args_list RPAR | LPAR kw_args RPAR | LPAR RPAR | empty""" if len(p) > 3: if p[3] == ',': p[0] = (p[2], p[4]) # depends on [control=['if'], data=[]]...
def main(): '''Main routine.''' # validate command line arguments arg_parser = argparse.ArgumentParser() arg_parser.add_argument('--add', '-a', action='store_true', default=False, help='add a key vault') arg_parser.add_argument('--delete', '-d', action='store_true', default=False, help='delete a ...
def function[main, parameter[]]: constant[Main routine.] variable[arg_parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[arg_parser].add_argument, parameter[constant[--add], constant[-a]]] call[name[arg_parser].add_argument, parameter[constant[--delete], constan...
keyword[def] identifier[main] (): literal[string] identifier[arg_parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[arg_parser] . identifier[add_argument] ( literal[string] , literal[string] , identifier[action] = literal[string] , identifier[default] = keyword[False] , id...
def main(): """Main routine.""" # validate command line arguments arg_parser = argparse.ArgumentParser() arg_parser.add_argument('--add', '-a', action='store_true', default=False, help='add a key vault') arg_parser.add_argument('--delete', '-d', action='store_true', default=False, help='delete a key...
def generate_raml_docs(module, fields, shared_types, user=None, title="My API", version="v1", api_root="api", base_uri="http://mysite.com/{version}"): """Return a RAML file of a Pale module's documentation as a string. The user argument is optional. If included, it expects the user to be an object with an "is_...
def function[generate_raml_docs, parameter[module, fields, shared_types, user, title, version, api_root, base_uri]]: constant[Return a RAML file of a Pale module's documentation as a string. The user argument is optional. If included, it expects the user to be an object with an "is_admin" boolean attri...
keyword[def] identifier[generate_raml_docs] ( identifier[module] , identifier[fields] , identifier[shared_types] , identifier[user] = keyword[None] , identifier[title] = literal[string] , identifier[version] = literal[string] , identifier[api_root] = literal[string] , identifier[base_uri] = literal[string] ): li...
def generate_raml_docs(module, fields, shared_types, user=None, title='My API', version='v1', api_root='api', base_uri='http://mysite.com/{version}'): """Return a RAML file of a Pale module's documentation as a string. The user argument is optional. If included, it expects the user to be an object with an "is_...
def login_required(func=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the user is logged in, redirecting to the log in page if necessary. """ def decorator(view_func): @functools.wraps(view_func, assigned=available_attrs(view_func)) ...
def function[login_required, parameter[func, redirect_field_name, login_url]]: constant[ Decorator for views that checks that the user is logged in, redirecting to the log in page if necessary. ] def function[decorator, parameter[view_func]]: def function[_wrapped_view, param...
keyword[def] identifier[login_required] ( identifier[func] = keyword[None] , identifier[redirect_field_name] = identifier[REDIRECT_FIELD_NAME] , identifier[login_url] = keyword[None] ): literal[string] keyword[def] identifier[decorator] ( identifier[view_func] ): @ identifier[functools] . identifi...
def login_required(func=None, redirect_field_name=REDIRECT_FIELD_NAME, login_url=None): """ Decorator for views that checks that the user is logged in, redirecting to the log in page if necessary. """ def decorator(view_func): @functools.wraps(view_func, assigned=available_attrs(view_func)...
def get_params(): """ get the cmdline params """ parser = argparse.ArgumentParser() parser.add_argument("--connect-timeout", type=float, default=10.0, help="ZK connect timeout") parser.add_argument("--run-once", ...
def function[get_params, parameter[]]: constant[ get the cmdline params ] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[--connect-timeout]]] call[name[parser].add_argument, parameter[constant[--run-once]]] ...
keyword[def] identifier[get_params] (): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] () identifier[parser] . identifier[add_argument] ( literal[string] , identifier[type] = identifier[float] , identifier[default] = literal[int] , identifier[help...
def get_params(): """ get the cmdline params """ parser = argparse.ArgumentParser() parser.add_argument('--connect-timeout', type=float, default=10.0, help='ZK connect timeout') parser.add_argument('--run-once', type=str, default='', help='Run a command non-interactively and exit') parser.add_argume...
def isActiveDashboardOverlay(self, ulOverlayHandle): """returns true if the dashboard is visible and the specified overlay is the active system Overlay""" fn = self.function_table.isActiveDashboardOverlay result = fn(ulOverlayHandle) return result
def function[isActiveDashboardOverlay, parameter[self, ulOverlayHandle]]: constant[returns true if the dashboard is visible and the specified overlay is the active system Overlay] variable[fn] assign[=] name[self].function_table.isActiveDashboardOverlay variable[result] assign[=] call[name[fn], ...
keyword[def] identifier[isActiveDashboardOverlay] ( identifier[self] , identifier[ulOverlayHandle] ): literal[string] identifier[fn] = identifier[self] . identifier[function_table] . identifier[isActiveDashboardOverlay] identifier[result] = identifier[fn] ( identifier[ulOverlayHandle] ) ...
def isActiveDashboardOverlay(self, ulOverlayHandle): """returns true if the dashboard is visible and the specified overlay is the active system Overlay""" fn = self.function_table.isActiveDashboardOverlay result = fn(ulOverlayHandle) return result
def _set_selected_action(self, action): """Setter method for the selected_action property.""" assert action in self._action_sets if self._selected_action is not None: raise ValueError("The action has already been selected.") self._selected_action = action
def function[_set_selected_action, parameter[self, action]]: constant[Setter method for the selected_action property.] assert[compare[name[action] in name[self]._action_sets]] if compare[name[self]._selected_action is_not constant[None]] begin[:] <ast.Raise object at 0x7da1b0fe9060> ...
keyword[def] identifier[_set_selected_action] ( identifier[self] , identifier[action] ): literal[string] keyword[assert] identifier[action] keyword[in] identifier[self] . identifier[_action_sets] keyword[if] identifier[self] . identifier[_selected_action] keyword[is] keyword[not] ...
def _set_selected_action(self, action): """Setter method for the selected_action property.""" assert action in self._action_sets if self._selected_action is not None: raise ValueError('The action has already been selected.') # depends on [control=['if'], data=[]] self._selected_action = action
def imread(filename): ''' Like cv2.imread This function will make sure filename exists ''' im = cv2.imread(filename) if im is None: raise RuntimeError("file: '%s' not exists" % filename) return im
def function[imread, parameter[filename]]: constant[ Like cv2.imread This function will make sure filename exists ] variable[im] assign[=] call[name[cv2].imread, parameter[name[filename]]] if compare[name[im] is constant[None]] begin[:] <ast.Raise object at 0x7da20c6a9ff0> ...
keyword[def] identifier[imread] ( identifier[filename] ): literal[string] identifier[im] = identifier[cv2] . identifier[imread] ( identifier[filename] ) keyword[if] identifier[im] keyword[is] keyword[None] : keyword[raise] identifier[RuntimeError] ( literal[string] % identifier[filename] ...
def imread(filename): """ Like cv2.imread This function will make sure filename exists """ im = cv2.imread(filename) if im is None: raise RuntimeError("file: '%s' not exists" % filename) # depends on [control=['if'], data=[]] return im
def encode(self, obj, qualifier: str): """Encodes a dictionary-like object to a Lua string :param qualifier: :param obj: object to encode :return: valid Lua string """ LOGGER.debug('encoding dictionary to text') if not obj: if qualifier.replace('=', ''...
def function[encode, parameter[self, obj, qualifier]]: constant[Encodes a dictionary-like object to a Lua string :param qualifier: :param obj: object to encode :return: valid Lua string ] call[name[LOGGER].debug, parameter[constant[encoding dictionary to text]]] i...
keyword[def] identifier[encode] ( identifier[self] , identifier[obj] , identifier[qualifier] : identifier[str] ): literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] ) keyword[if] keyword[not] identifier[obj] : keyword[if] identifier[qualifier] . identi...
def encode(self, obj, qualifier: str): """Encodes a dictionary-like object to a Lua string :param qualifier: :param obj: object to encode :return: valid Lua string """ LOGGER.debug('encoding dictionary to text') if not obj: if qualifier.replace('=', '').rstrip() == 'm...
def _computeforceArray(self,dr_dx, dtheta_dx, dphi_dx, R, z, phi): """ NAME: _computeforceArray PURPOSE: evaluate the forces in the x direction for a given array of coordinates INPUT: dr_dx - the derivative of r with respect to the chosen variable x ...
def function[_computeforceArray, parameter[self, dr_dx, dtheta_dx, dphi_dx, R, z, phi]]: constant[ NAME: _computeforceArray PURPOSE: evaluate the forces in the x direction for a given array of coordinates INPUT: dr_dx - the derivative of r with respect to...
keyword[def] identifier[_computeforceArray] ( identifier[self] , identifier[dr_dx] , identifier[dtheta_dx] , identifier[dphi_dx] , identifier[R] , identifier[z] , identifier[phi] ): literal[string] identifier[R] = identifier[nu] . identifier[array] ( identifier[R] , identifier[dtype] = identifier[f...
def _computeforceArray(self, dr_dx, dtheta_dx, dphi_dx, R, z, phi): """ NAME: _computeforceArray PURPOSE: evaluate the forces in the x direction for a given array of coordinates INPUT: dr_dx - the derivative of r with respect to the chosen variable x ...
def call_once(self, request=None, *args, **kwargs): """ Performs one API request. Raises exception on failure. :param request: :param args: :param kwargs: :return: response """ if request is not None: self.request = request co...
def function[call_once, parameter[self, request]]: constant[ Performs one API request. Raises exception on failure. :param request: :param args: :param kwargs: :return: response ] if compare[name[request] is_not constant[None]] begin[:] ...
keyword[def] identifier[call_once] ( identifier[self] , identifier[request] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[request] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[request] = identifier[req...
def call_once(self, request=None, *args, **kwargs): """ Performs one API request. Raises exception on failure. :param request: :param args: :param kwargs: :return: response """ if request is not None: self.request = request # depends on [control=...
def read_memory(self, addr, transfer_size=32, now=True): """! @brief Read a memory location. By default, a word will be read. """ assert transfer_size in (8, 16, 32) if transfer_size == 32: result = conversion.byte_list_to_u32le_list(self._link.read_mem32(add...
def function[read_memory, parameter[self, addr, transfer_size, now]]: constant[! @brief Read a memory location. By default, a word will be read. ] assert[compare[name[transfer_size] in tuple[[<ast.Constant object at 0x7da1b18ae1d0>, <ast.Constant object at 0x7da1b18aef80>, <ast.Cons...
keyword[def] identifier[read_memory] ( identifier[self] , identifier[addr] , identifier[transfer_size] = literal[int] , identifier[now] = keyword[True] ): literal[string] keyword[assert] identifier[transfer_size] keyword[in] ( literal[int] , literal[int] , literal[int] ) keyword[if] ide...
def read_memory(self, addr, transfer_size=32, now=True): """! @brief Read a memory location. By default, a word will be read. """ assert transfer_size in (8, 16, 32) if transfer_size == 32: result = conversion.byte_list_to_u32le_list(self._link.read_mem32(addr, 4, self._apse...
def get_caption_comments(content): """Retrieve an id and a caption from a code cell. If the code cell content begins with a commented block that looks like ## fig:id # multi-line or single-line # caption then the 'fig:id' and the caption will be returned. The '#' are stripped. """...
def function[get_caption_comments, parameter[content]]: constant[Retrieve an id and a caption from a code cell. If the code cell content begins with a commented block that looks like ## fig:id # multi-line or single-line # caption then the 'fig:id' and the caption will be returned. ...
keyword[def] identifier[get_caption_comments] ( identifier[content] ): literal[string] keyword[if] keyword[not] identifier[content] . identifier[startswith] ( literal[string] ): keyword[return] keyword[None] , keyword[None] identifier[content] = identifier[content] . identifier[splitlin...
def get_caption_comments(content): """Retrieve an id and a caption from a code cell. If the code cell content begins with a commented block that looks like ## fig:id # multi-line or single-line # caption then the 'fig:id' and the caption will be returned. The '#' are stripped. """...
def deprecated(msg, dep_version): """Decorate a function, method or class to mark as deprecated. Raise DeprecationWarning and add a deprecation notice to the docstring. """ def wrapper(func): docstring = func.__doc__ or '' docstring_msg = '.. deprecated:: {version} {msg}'.format( version=dep_version, msg...
def function[deprecated, parameter[msg, dep_version]]: constant[Decorate a function, method or class to mark as deprecated. Raise DeprecationWarning and add a deprecation notice to the docstring. ] def function[wrapper, parameter[func]]: variable[docstring] assign[=] <ast.BoolOp objec...
keyword[def] identifier[deprecated] ( identifier[msg] , identifier[dep_version] ): literal[string] keyword[def] identifier[wrapper] ( identifier[func] ): identifier[docstring] = identifier[func] . identifier[__doc__] keyword[or] literal[string] identifier[docstring_msg] = literal[string] . identifier[f...
def deprecated(msg, dep_version): """Decorate a function, method or class to mark as deprecated. Raise DeprecationWarning and add a deprecation notice to the docstring. """ def wrapper(func): docstring = func.__doc__ or '' docstring_msg = '.. deprecated:: {version} {msg}'.format(version=dep_...
def apply_mask(self, mask_img): """First set_mask and the get_masked_data. Parameters ---------- mask_img: nifti-like image, NeuroImage or str 3D mask array: True where a voxel should be used. Can either be: - a file path to a Nifti image ...
def function[apply_mask, parameter[self, mask_img]]: constant[First set_mask and the get_masked_data. Parameters ---------- mask_img: nifti-like image, NeuroImage or str 3D mask array: True where a voxel should be used. Can either be: - a file path t...
keyword[def] identifier[apply_mask] ( identifier[self] , identifier[mask_img] ): literal[string] identifier[self] . identifier[set_mask] ( identifier[mask_img] ) keyword[return] identifier[self] . identifier[get_data] ( identifier[masked] = keyword[True] , identifier[smoothed] = keyword[T...
def apply_mask(self, mask_img): """First set_mask and the get_masked_data. Parameters ---------- mask_img: nifti-like image, NeuroImage or str 3D mask array: True where a voxel should be used. Can either be: - a file path to a Nifti image - a...
def to_xml(self, opts = defaultdict(lambda: None)): ''' Generate XML from the current settings. ''' if not self.launch_url or not self.secure_launch_url: raise InvalidLTIConfigError('Invalid LTI configuration') root = etree.Element('cartridge_basiclti_link', attrib ...
def function[to_xml, parameter[self, opts]]: constant[ Generate XML from the current settings. ] if <ast.BoolOp object at 0x7da1b1b9d750> begin[:] <ast.Raise object at 0x7da1b1b9d690> variable[root] assign[=] call[name[etree].Element, parameter[constant[cartridge_basiclti...
keyword[def] identifier[to_xml] ( identifier[self] , identifier[opts] = identifier[defaultdict] ( keyword[lambda] : keyword[None] )): literal[string] keyword[if] keyword[not] identifier[self] . identifier[launch_url] keyword[or] keyword[not] identifier[self] . identifier[secure_launch_url] : ...
def to_xml(self, opts=defaultdict(lambda : None)): """ Generate XML from the current settings. """ if not self.launch_url or not self.secure_launch_url: raise InvalidLTIConfigError('Invalid LTI configuration') # depends on [control=['if'], data=[]] root = etree.Element('cartridge_ba...
def formatExcept(cls, error, trace): """ Formats the inputted class, error, and traceback information to the standard output commonly found in Python interpreters. :param cls | <type> error | <str> trace | <traceback> :return <str> """ ...
def function[formatExcept, parameter[cls, error, trace]]: constant[ Formats the inputted class, error, and traceback information to the standard output commonly found in Python interpreters. :param cls | <type> error | <str> trace | <traceback> ...
keyword[def] identifier[formatExcept] ( identifier[cls] , identifier[error] , identifier[trace] ): literal[string] identifier[clsname] = identifier[cls] . identifier[__name__] keyword[if] identifier[cls] keyword[else] literal[string] identifier[tb] = literal[string] identifier[tb] += litera...
def formatExcept(cls, error, trace): """ Formats the inputted class, error, and traceback information to the standard output commonly found in Python interpreters. :param cls | <type> error | <str> trace | <traceback> :return <str> """ ...
def QA_fetch_financial_report(code, report_date, ltype='EN', db=DATABASE): """获取专业财务报表 Arguments: code {[type]} -- [description] report_date {[type]} -- [description] Keyword Arguments: ltype {str} -- [description] (default: {'EN'}) db {[type]} -- [description] (default: {DAT...
def function[QA_fetch_financial_report, parameter[code, report_date, ltype, db]]: constant[获取专业财务报表 Arguments: code {[type]} -- [description] report_date {[type]} -- [description] Keyword Arguments: ltype {str} -- [description] (default: {'EN'}) db {[type]} -- [descriptio...
keyword[def] identifier[QA_fetch_financial_report] ( identifier[code] , identifier[report_date] , identifier[ltype] = literal[string] , identifier[db] = identifier[DATABASE] ): literal[string] keyword[if] identifier[isinstance] ( identifier[code] , identifier[str] ): identifier[code] =[ identifi...
def QA_fetch_financial_report(code, report_date, ltype='EN', db=DATABASE): """获取专业财务报表 Arguments: code {[type]} -- [description] report_date {[type]} -- [description] Keyword Arguments: ltype {str} -- [description] (default: {'EN'}) db {[type]} -- [description] (default: {DAT...
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if (self.locked and not force_refresh): return self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_string...
def function[set_object_text, parameter[self, text, force_refresh, ignore_unknown]]: constant[Set object analyzed by Help] if <ast.BoolOp object at 0x7da1b21d4730> begin[:] return[None] call[name[self].switch_to_console_source, parameter[]] variable[add_to_combo] assign[=] consta...
keyword[def] identifier[set_object_text] ( identifier[self] , identifier[text] , identifier[force_refresh] = keyword[False] , identifier[ignore_unknown] = keyword[False] ): literal[string] keyword[if] ( identifier[self] . identifier[locked] keyword[and] keyword[not] identifier[force_refresh] )...
def set_object_text(self, text, force_refresh=False, ignore_unknown=False): """Set object analyzed by Help""" if self.locked and (not force_refresh): return # depends on [control=['if'], data=[]] self.switch_to_console_source() add_to_combo = True if text is None: text = to_text_str...