code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _tree_grow(self, y_true, X, cost_mat, level=0): """ Private recursive function to grow the decision tree. Parameters ---------- y_true : array indicator matrix Ground truth (correct) labels. X : array-like of shape = [n_samples, n_features] The input...
def function[_tree_grow, parameter[self, y_true, X, cost_mat, level]]: constant[ Private recursive function to grow the decision tree. Parameters ---------- y_true : array indicator matrix Ground truth (correct) labels. X : array-like of shape = [n_samples, n_featur...
keyword[def] identifier[_tree_grow] ( identifier[self] , identifier[y_true] , identifier[X] , identifier[cost_mat] , identifier[level] = literal[int] ): literal[string] keyword[if] identifier[len] ( identifier[X] . identifier[shape] )== literal[int] : identifier[tree] = iden...
def _tree_grow(self, y_true, X, cost_mat, level=0): """ Private recursive function to grow the decision tree. Parameters ---------- y_true : array indicator matrix Ground truth (correct) labels. X : array-like of shape = [n_samples, n_features] The input sam...
def dist_calc_matrix(surf, cortex, labels, exceptions = ['Unknown', 'Medial_wall'], verbose = True): """ Calculate exact geodesic distance along cortical surface from set of source nodes. "labels" specifies the freesurfer label file to use. All values will be used other than those specified in "exceptio...
def function[dist_calc_matrix, parameter[surf, cortex, labels, exceptions, verbose]]: constant[ Calculate exact geodesic distance along cortical surface from set of source nodes. "labels" specifies the freesurfer label file to use. All values will be used other than those specified in "exceptions" (...
keyword[def] identifier[dist_calc_matrix] ( identifier[surf] , identifier[cortex] , identifier[labels] , identifier[exceptions] =[ literal[string] , literal[string] ], identifier[verbose] = keyword[True] ): literal[string] identifier[cortex_vertices] , identifier[cortex_triangles] = identifier[surf_keep_c...
def dist_calc_matrix(surf, cortex, labels, exceptions=['Unknown', 'Medial_wall'], verbose=True): """ Calculate exact geodesic distance along cortical surface from set of source nodes. "labels" specifies the freesurfer label file to use. All values will be used other than those specified in "exceptions" ...
def angle(x1, y1, x2, y2): """ The angle in degrees between two vectors. """ sign = 1.0 usign = (x1*y2 - y1*x2) if usign < 0: sign = -1.0 num = x1*x2 + y1*y2 den = hypot(x1,y1) * hypot(x2,y2) ratio = min(max(num/den, -1.0), 1.0) return sign * degrees(acos(ratio))
def function[angle, parameter[x1, y1, x2, y2]]: constant[ The angle in degrees between two vectors. ] variable[sign] assign[=] constant[1.0] variable[usign] assign[=] binary_operation[binary_operation[name[x1] * name[y2]] - binary_operation[name[y1] * name[x2]]] if compare[name[usign...
keyword[def] identifier[angle] ( identifier[x1] , identifier[y1] , identifier[x2] , identifier[y2] ): literal[string] identifier[sign] = literal[int] identifier[usign] =( identifier[x1] * identifier[y2] - identifier[y1] * identifier[x2] ) keyword[if] identifier[usign] < literal[int] : ...
def angle(x1, y1, x2, y2): """ The angle in degrees between two vectors. """ sign = 1.0 usign = x1 * y2 - y1 * x2 if usign < 0: sign = -1.0 # depends on [control=['if'], data=[]] num = x1 * x2 + y1 * y2 den = hypot(x1, y1) * hypot(x2, y2) ratio = min(max(num / den, -1.0), 1.0) ...
def _compute_jars_to_resolve_and_pin(raw_jars, artifact_set, manager): """ This method provides settled lists of jar dependencies and coordinates based on conflict management. :param raw_jars: a collection of `JarDependencies` :param artifact_set: PinnedJarArtifactSet :param manager: JarDepende...
def function[_compute_jars_to_resolve_and_pin, parameter[raw_jars, artifact_set, manager]]: constant[ This method provides settled lists of jar dependencies and coordinates based on conflict management. :param raw_jars: a collection of `JarDependencies` :param artifact_set: PinnedJarArtifactSet...
keyword[def] identifier[_compute_jars_to_resolve_and_pin] ( identifier[raw_jars] , identifier[artifact_set] , identifier[manager] ): literal[string] keyword[if] identifier[artifact_set] keyword[is] keyword[None] : identifier[artifact_set] = identifier[PinnedJarArtifactSet] () identifier[unt...
def _compute_jars_to_resolve_and_pin(raw_jars, artifact_set, manager): """ This method provides settled lists of jar dependencies and coordinates based on conflict management. :param raw_jars: a collection of `JarDependencies` :param artifact_set: PinnedJarArtifactSet :param manager: JarDepende...
async def skiplast(source, n): """Forward an asynchronous sequence, skipping the last ``n`` elements. If ``n`` is negative, no elements are skipped. Note: it is required to reach the ``n+1`` th element of the source before the first element is generated. """ queue = collections.deque(maxlen=n ...
<ast.AsyncFunctionDef object at 0x7da18dc98f40>
keyword[async] keyword[def] identifier[skiplast] ( identifier[source] , identifier[n] ): literal[string] identifier[queue] = identifier[collections] . identifier[deque] ( identifier[maxlen] = identifier[n] keyword[if] identifier[n] > literal[int] keyword[else] literal[int] ) keyword[async] keywo...
async def skiplast(source, n): """Forward an asynchronous sequence, skipping the last ``n`` elements. If ``n`` is negative, no elements are skipped. Note: it is required to reach the ``n+1`` th element of the source before the first element is generated. """ queue = collections.deque(maxlen=n ...
def save(df, path, write_frequency=5000): """ Args: df (DataFlow): the DataFlow to serialize. path (str): output path. Either a directory or an lmdb file. write_frequency (int): the frequency to write back data to disk. """ assert isinstance(df, DataFl...
def function[save, parameter[df, path, write_frequency]]: constant[ Args: df (DataFlow): the DataFlow to serialize. path (str): output path. Either a directory or an lmdb file. write_frequency (int): the frequency to write back data to disk. ] assert[call[...
keyword[def] identifier[save] ( identifier[df] , identifier[path] , identifier[write_frequency] = literal[int] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[df] , identifier[DataFlow] ), identifier[type] ( identifier[df] ) identifier[isdir] = identifier[os] . iden...
def save(df, path, write_frequency=5000): """ Args: df (DataFlow): the DataFlow to serialize. path (str): output path. Either a directory or an lmdb file. write_frequency (int): the frequency to write back data to disk. """ assert isinstance(df, DataFlow), typ...
def clean(self, value, model_instance): """ Convert the value's type and run validation. Validation errors from to_python and validate are propagated. The correct value is returned if no error is raised. """ #: return constant's name instead of constant itself val...
def function[clean, parameter[self, value, model_instance]]: constant[ Convert the value's type and run validation. Validation errors from to_python and validate are propagated. The correct value is returned if no error is raised. ] variable[value] assign[=] call[name[sel...
keyword[def] identifier[clean] ( identifier[self] , identifier[value] , identifier[model_instance] ): literal[string] identifier[value] = identifier[self] . identifier[to_python] ( identifier[value] ). identifier[name] identifier[self] . identifier[validate] ( identifier[value] ,...
def clean(self, value, model_instance): """ Convert the value's type and run validation. Validation errors from to_python and validate are propagated. The correct value is returned if no error is raised. """ #: return constant's name instead of constant itself value = self.to...
def surface_velocity(msg): """Decode surface velocity from from a surface position message Args: msg (string): 28 bytes hexadecimal message string Returns: (int, float, int, string): speed (kt), ground track (degree), rate of climb/descend (ft/min), and speed type ('...
def function[surface_velocity, parameter[msg]]: constant[Decode surface velocity from from a surface position message Args: msg (string): 28 bytes hexadecimal message string Returns: (int, float, int, string): speed (kt), ground track (degree), rate of climb/descend (ft/min)...
keyword[def] identifier[surface_velocity] ( identifier[msg] ): literal[string] keyword[if] identifier[common] . identifier[typecode] ( identifier[msg] )< literal[int] keyword[or] identifier[common] . identifier[typecode] ( identifier[msg] )> literal[int] : keyword[raise] identifier[RuntimeErr...
def surface_velocity(msg): """Decode surface velocity from from a surface position message Args: msg (string): 28 bytes hexadecimal message string Returns: (int, float, int, string): speed (kt), ground track (degree), rate of climb/descend (ft/min), and speed type ('...
def iterator(n: Union[Node, CompatNodeIterator, dict], order: TreeOrder = TreeOrder.PRE_ORDER) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator. """ if isinstance(n, CompatNodeIterator): return...
def function[iterator, parameter[n, order]]: constant[ This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator. ] if call[name[isinstance], parameter[name[n], name[CompatNodeIterator]]] begin[:] return[call[name[CompatNodeIterat...
keyword[def] identifier[iterator] ( identifier[n] : identifier[Union] [ identifier[Node] , identifier[CompatNodeIterator] , identifier[dict] ], identifier[order] : identifier[TreeOrder] = identifier[TreeOrder] . identifier[PRE_ORDER] )-> identifier[CompatNodeIterator] : literal[string] keyword[if] ident...
def iterator(n: Union[Node, CompatNodeIterator, dict], order: TreeOrder=TreeOrder.PRE_ORDER) -> CompatNodeIterator: """ This function has the same signature as the pre-v3 iterator() call returning a compatibility CompatNodeIterator. """ if isinstance(n, CompatNodeIterator): return CompatNode...
def shelter_find(self, **kwargs): """ shelter.find wrapper. Returns a generator of shelter record dicts matching your search criteria. :rtype: generator :returns: A generator of shelter record dicts. :raises: :py:exc:`petfinder.exceptions.LimitExceeded` once you have ...
def function[shelter_find, parameter[self]]: constant[ shelter.find wrapper. Returns a generator of shelter record dicts matching your search criteria. :rtype: generator :returns: A generator of shelter record dicts. :raises: :py:exc:`petfinder.exceptions.LimitExceeded` ...
keyword[def] identifier[shelter_find] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[shelter_find_parser] ( identifier[root] , identifier[has_records] ): literal[string] keyword[for] identifier[shelter] keyword[in] identifier[roo...
def shelter_find(self, **kwargs): """ shelter.find wrapper. Returns a generator of shelter record dicts matching your search criteria. :rtype: generator :returns: A generator of shelter record dicts. :raises: :py:exc:`petfinder.exceptions.LimitExceeded` once you have ...
def parse_value(cls, itype, value): """Parse the input value.""" parsed = None if itype == "date": m = RE_DATE.match(value) if m: year = int(m.group('year'), 10) month = int(m.group('month'), 10) day = int(m.group('day'), 1...
def function[parse_value, parameter[cls, itype, value]]: constant[Parse the input value.] variable[parsed] assign[=] constant[None] if compare[name[itype] equal[==] constant[date]] begin[:] variable[m] assign[=] call[name[RE_DATE].match, parameter[name[value]]] if...
keyword[def] identifier[parse_value] ( identifier[cls] , identifier[itype] , identifier[value] ): literal[string] identifier[parsed] = keyword[None] keyword[if] identifier[itype] == literal[string] : identifier[m] = identifier[RE_DATE] . identifier[match] ( identifier[value...
def parse_value(cls, itype, value): """Parse the input value.""" parsed = None if itype == 'date': m = RE_DATE.match(value) if m: year = int(m.group('year'), 10) month = int(m.group('month'), 10) day = int(m.group('day'), 10) if cls.validate_ye...
def _constructClient(client_version, username, user_domain, password, project_name, project_domain, auth_url): """Return a novaclient from the given args.""" loader = loading.get_plugin_loader('password') # These only work with v3 if user_domain is not None or p...
def function[_constructClient, parameter[client_version, username, user_domain, password, project_name, project_domain, auth_url]]: constant[Return a novaclient from the given args.] variable[loader] assign[=] call[name[loading].get_plugin_loader, parameter[constant[password]]] if <ast.BoolOp ob...
keyword[def] identifier[_constructClient] ( identifier[client_version] , identifier[username] , identifier[user_domain] , identifier[password] , identifier[project_name] , identifier[project_domain] , identifier[auth_url] ): literal[string] identifier[loader] = identifier[loading] . identifier[get...
def _constructClient(client_version, username, user_domain, password, project_name, project_domain, auth_url): """Return a novaclient from the given args.""" loader = loading.get_plugin_loader('password') # These only work with v3 if user_domain is not None or project_domain is not None: auth = ...
async def lookup(source_id: str, schema_id: str): """ Create a new schema object from an existing ledger schema :param source_id: Institution's personal identification for the schema :param schema_id: Ledger schema ID for lookup Example: source_id = 'foobar123' n...
<ast.AsyncFunctionDef object at 0x7da2041dab00>
keyword[async] keyword[def] identifier[lookup] ( identifier[source_id] : identifier[str] , identifier[schema_id] : identifier[str] ): literal[string] keyword[try] : identifier[schema] = identifier[Schema] ( identifier[source_id] , literal[string] , literal[string] ,[]) k...
async def lookup(source_id: str, schema_id: str): """ Create a new schema object from an existing ledger schema :param source_id: Institution's personal identification for the schema :param schema_id: Ledger schema ID for lookup Example: source_id = 'foobar123' name ...
def wait_for_completion(self, job_id, timeout=None): """ Wait for the job given by job_id to change to COMPLETED or CANCELED. Raises a iceqube.exceptions.TimeoutError if timeout is exceeded before each job change. :param job_id: the id of the job to wait for. :param timeout: how...
def function[wait_for_completion, parameter[self, job_id, timeout]]: constant[ Wait for the job given by job_id to change to COMPLETED or CANCELED. Raises a iceqube.exceptions.TimeoutError if timeout is exceeded before each job change. :param job_id: the id of the job to wait for. ...
keyword[def] identifier[wait_for_completion] ( identifier[self] , identifier[job_id] , identifier[timeout] = keyword[None] ): literal[string] keyword[while] literal[int] : identifier[job] = identifier[self] . identifier[wait] ( identifier[job_id] , identifier[timeout] = identifier[tim...
def wait_for_completion(self, job_id, timeout=None): """ Wait for the job given by job_id to change to COMPLETED or CANCELED. Raises a iceqube.exceptions.TimeoutError if timeout is exceeded before each job change. :param job_id: the id of the job to wait for. :param timeout: how lon...
def _find_corresponding_multicol_key(key, keys_multicol): """Find the corresponding multicolumn key.""" for mk in keys_multicol: if key.startswith(mk) and 'of' in key: return mk return None
def function[_find_corresponding_multicol_key, parameter[key, keys_multicol]]: constant[Find the corresponding multicolumn key.] for taget[name[mk]] in starred[name[keys_multicol]] begin[:] if <ast.BoolOp object at 0x7da1b206baf0> begin[:] return[name[mk]] return[constant...
keyword[def] identifier[_find_corresponding_multicol_key] ( identifier[key] , identifier[keys_multicol] ): literal[string] keyword[for] identifier[mk] keyword[in] identifier[keys_multicol] : keyword[if] identifier[key] . identifier[startswith] ( identifier[mk] ) keyword[and] literal[string] ...
def _find_corresponding_multicol_key(key, keys_multicol): """Find the corresponding multicolumn key.""" for mk in keys_multicol: if key.startswith(mk) and 'of' in key: return mk # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['mk']] return None
def get_by_id(self, id_networkv4): """Get IPv4 network :param id_networkv4: ID for NetworkIPv4 :return: IPv4 Network """ uri = 'api/networkv4/%s/' % id_networkv4 return super(ApiNetworkIPv4, self).get(uri)
def function[get_by_id, parameter[self, id_networkv4]]: constant[Get IPv4 network :param id_networkv4: ID for NetworkIPv4 :return: IPv4 Network ] variable[uri] assign[=] binary_operation[constant[api/networkv4/%s/] <ast.Mod object at 0x7da2590d6920> name[id_networkv4]] retu...
keyword[def] identifier[get_by_id] ( identifier[self] , identifier[id_networkv4] ): literal[string] identifier[uri] = literal[string] % identifier[id_networkv4] keyword[return] identifier[super] ( identifier[ApiNetworkIPv4] , identifier[self] ). identifier[get] ( identifier[uri] )
def get_by_id(self, id_networkv4): """Get IPv4 network :param id_networkv4: ID for NetworkIPv4 :return: IPv4 Network """ uri = 'api/networkv4/%s/' % id_networkv4 return super(ApiNetworkIPv4, self).get(uri)
def importSignedCertificate(self, alias, certFile): """ This operation imports a certificate authority (CA) signed SSL certificate into the key store. """ params = { "f" : "json" } files = {"file" : certFile} url = self._url + \ "/sslCertificates/{cert...
def function[importSignedCertificate, parameter[self, alias, certFile]]: constant[ This operation imports a certificate authority (CA) signed SSL certificate into the key store. ] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b1248130>], [<ast.Constant obje...
keyword[def] identifier[importSignedCertificate] ( identifier[self] , identifier[alias] , identifier[certFile] ): literal[string] identifier[params] ={ literal[string] : literal[string] } identifier[files] ={ literal[string] : identifier[certFile] } identifier[url] = identifier[se...
def importSignedCertificate(self, alias, certFile): """ This operation imports a certificate authority (CA) signed SSL certificate into the key store. """ params = {'f': 'json'} files = {'file': certFile} url = self._url + '/sslCertificates/{cert}/importSignedCertificate'.format(...
def int_check(*args, func=None): """Check if arguments are integrals.""" func = func or inspect.stack()[2][3] for var in args: if not isinstance(var, numbers.Integral): name = type(var).__name__ raise ComplexError( f'Function {func} expected integral number, {...
def function[int_check, parameter[]]: constant[Check if arguments are integrals.] variable[func] assign[=] <ast.BoolOp object at 0x7da18bc721a0> for taget[name[var]] in starred[name[args]] begin[:] if <ast.UnaryOp object at 0x7da18bc710c0> begin[:] variabl...
keyword[def] identifier[int_check] (* identifier[args] , identifier[func] = keyword[None] ): literal[string] identifier[func] = identifier[func] keyword[or] identifier[inspect] . identifier[stack] ()[ literal[int] ][ literal[int] ] keyword[for] identifier[var] keyword[in] identifier[args] : ...
def int_check(*args, func=None): """Check if arguments are integrals.""" func = func or inspect.stack()[2][3] for var in args: if not isinstance(var, numbers.Integral): name = type(var).__name__ raise ComplexError(f'Function {func} expected integral number, {name} got instead...
def subnet_delete(name, virtual_network, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Delete a subnet. :param name: The name of the subnet to delete. :param virtual_network: The virtual network name containing the subnet. :param resource_group: The resource group name as...
def function[subnet_delete, parameter[name, virtual_network, resource_group]]: constant[ .. versionadded:: 2019.2.0 Delete a subnet. :param name: The name of the subnet to delete. :param virtual_network: The virtual network name containing the subnet. :param resource_group: The r...
keyword[def] identifier[subnet_delete] ( identifier[name] , identifier[virtual_network] , identifier[resource_group] ,** identifier[kwargs] ): literal[string] identifier[result] = keyword[False] identifier[netconn] = identifier[__utils__] [ literal[string] ]( literal[string] ,** identifier[kwargs] ) ...
def subnet_delete(name, virtual_network, resource_group, **kwargs): """ .. versionadded:: 2019.2.0 Delete a subnet. :param name: The name of the subnet to delete. :param virtual_network: The virtual network name containing the subnet. :param resource_group: The resource group name as...
def tab(self, n=1, interval=0, pre_dl=None, post_dl=None): """Tap ``tab`` key for ``n`` times, with ``interval`` seconds of interval. **中文文档** 以 ``interval`` 中定义的频率按下某个tab键 ``n`` 次。 """ self.delay(pre_dl) self.k.tap_key(self.k.tab_key, n, interval) self.delay(po...
def function[tab, parameter[self, n, interval, pre_dl, post_dl]]: constant[Tap ``tab`` key for ``n`` times, with ``interval`` seconds of interval. **中文文档** 以 ``interval`` 中定义的频率按下某个tab键 ``n`` 次。 ] call[name[self].delay, parameter[name[pre_dl]]] call[name[self].k.tap_key...
keyword[def] identifier[tab] ( identifier[self] , identifier[n] = literal[int] , identifier[interval] = literal[int] , identifier[pre_dl] = keyword[None] , identifier[post_dl] = keyword[None] ): literal[string] identifier[self] . identifier[delay] ( identifier[pre_dl] ) identifier[self] . ...
def tab(self, n=1, interval=0, pre_dl=None, post_dl=None): """Tap ``tab`` key for ``n`` times, with ``interval`` seconds of interval. **中文文档** 以 ``interval`` 中定义的频率按下某个tab键 ``n`` 次。 """ self.delay(pre_dl) self.k.tap_key(self.k.tab_key, n, interval) self.delay(post_dl)
def file_set_properties(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /file-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Properties#API-method%3A-%2Fclass-xxxx%2FsetProperties """ return DXHTTPRequest('/%s/setPrope...
def function[file_set_properties, parameter[object_id, input_params, always_retry]]: constant[ Invokes the /file-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Properties#API-method%3A-%2Fclass-xxxx%2FsetProperties ] return[call[name[DXHTTP...
keyword[def] identifier[file_set_properties] ( 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] , identifie...
def file_set_properties(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /file-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Properties#API-method%3A-%2Fclass-xxxx%2FsetProperties """ return DXHTTPRequest('/%s/setPrope...
def add_firewall_rule(self, direction, action, src=None, dst=None): """Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". :param str|un...
def function[add_firewall_rule, parameter[self, direction, action, src, dst]]: constant[Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". ...
keyword[def] identifier[add_firewall_rule] ( identifier[self] , identifier[direction] , identifier[action] , identifier[src] = keyword[None] , identifier[dst] = keyword[None] ): literal[string] identifier[value] =[ identifier[action] ] keyword[if] identifier[src] : identifie...
def add_firewall_rule(self, direction, action, src=None, dst=None): """Adds a firewall rule to the router. The TunTap router includes a very simple firewall for governing vassal's traffic. The first matching rule stops the chain, if no rule applies, the policy is "allow". :param str|unicod...
def unpack(self, fmt): """ unpacks the given fmt from the underlying stream and returns the results. Will raise an UnpackException if there is not enough data to satisfy the fmt """ sfmt = compile_struct(fmt) size = sfmt.size if not self.data: ...
def function[unpack, parameter[self, fmt]]: constant[ unpacks the given fmt from the underlying stream and returns the results. Will raise an UnpackException if there is not enough data to satisfy the fmt ] variable[sfmt] assign[=] call[name[compile_struct], parameter[nam...
keyword[def] identifier[unpack] ( identifier[self] , identifier[fmt] ): literal[string] identifier[sfmt] = identifier[compile_struct] ( identifier[fmt] ) identifier[size] = identifier[sfmt] . identifier[size] keyword[if] keyword[not] identifier[self] . identifier[data] : ...
def unpack(self, fmt): """ unpacks the given fmt from the underlying stream and returns the results. Will raise an UnpackException if there is not enough data to satisfy the fmt """ sfmt = compile_struct(fmt) size = sfmt.size if not self.data: raise UnpackExceptio...
def _ensure_sparse_format(spmatrix, accept_sparse, dtype, order, copy, force_all_finite): """Convert a sparse matrix to a given format. Checks the sparse format of spmatrix and converts if necessary. Parameters ---------- spmatrix : scipy sparse matrix Input to va...
def function[_ensure_sparse_format, parameter[spmatrix, accept_sparse, dtype, order, copy, force_all_finite]]: constant[Convert a sparse matrix to a given format. Checks the sparse format of spmatrix and converts if necessary. Parameters ---------- spmatrix : scipy sparse matrix Input ...
keyword[def] identifier[_ensure_sparse_format] ( identifier[spmatrix] , identifier[accept_sparse] , identifier[dtype] , identifier[order] , identifier[copy] , identifier[force_all_finite] ): literal[string] keyword[if] identifier[accept_sparse] keyword[is] keyword[None] : keyword[raise] ident...
def _ensure_sparse_format(spmatrix, accept_sparse, dtype, order, copy, force_all_finite): """Convert a sparse matrix to a given format. Checks the sparse format of spmatrix and converts if necessary. Parameters ---------- spmatrix : scipy sparse matrix Input to validate and convert. a...
def get_metrics(awsclient, name): """Print out cloudformation metrics for a lambda function. :param awsclient :param name: name of the lambda function :return: exit_code """ metrics = ['Duration', 'Errors', 'Invocations', 'Throttles'] client_cw = awsclient.get_client('cloudwatch') for m...
def function[get_metrics, parameter[awsclient, name]]: constant[Print out cloudformation metrics for a lambda function. :param awsclient :param name: name of the lambda function :return: exit_code ] variable[metrics] assign[=] list[[<ast.Constant object at 0x7da20e74b3d0>, <ast.Constant...
keyword[def] identifier[get_metrics] ( identifier[awsclient] , identifier[name] ): literal[string] identifier[metrics] =[ literal[string] , literal[string] , literal[string] , literal[string] ] identifier[client_cw] = identifier[awsclient] . identifier[get_client] ( literal[string] ) keyword[for]...
def get_metrics(awsclient, name): """Print out cloudformation metrics for a lambda function. :param awsclient :param name: name of the lambda function :return: exit_code """ metrics = ['Duration', 'Errors', 'Invocations', 'Throttles'] client_cw = awsclient.get_client('cloudwatch') for m...
def getrawblob(self, project_id, sha1): """ Get the raw file contents for a blob by blob SHA. :param project_id: The ID of a project :param sha1: the commit sha :return: raw blob """ request = requests.get( '{0}/{1}/repository/raw_blobs/{2}'.format(se...
def function[getrawblob, parameter[self, project_id, sha1]]: constant[ Get the raw file contents for a blob by blob SHA. :param project_id: The ID of a project :param sha1: the commit sha :return: raw blob ] variable[request] assign[=] call[name[requests].get, pa...
keyword[def] identifier[getrawblob] ( identifier[self] , identifier[project_id] , identifier[sha1] ): literal[string] identifier[request] = identifier[requests] . identifier[get] ( literal[string] . identifier[format] ( identifier[self] . identifier[projects_url] , identifier[project_id] ,...
def getrawblob(self, project_id, sha1): """ Get the raw file contents for a blob by blob SHA. :param project_id: The ID of a project :param sha1: the commit sha :return: raw blob """ request = requests.get('{0}/{1}/repository/raw_blobs/{2}'.format(self.projects_url, proj...
def remove_neighbours(self): """ Removes from the MOC instance the HEALPix cells located at its border. The depth of the HEALPix cells removed is equal to the maximum depth of the MOC instance. Returns ------- moc : `~mocpy.moc.MOC` self minus its HEALPix ce...
def function[remove_neighbours, parameter[self]]: constant[ Removes from the MOC instance the HEALPix cells located at its border. The depth of the HEALPix cells removed is equal to the maximum depth of the MOC instance. Returns ------- moc : `~mocpy.moc.MOC` ...
keyword[def] identifier[remove_neighbours] ( identifier[self] ): literal[string] identifier[ipix] = identifier[self] . identifier[_best_res_pixels] () identifier[hp] = identifier[HEALPix] ( identifier[nside] =( literal[int] << identifier[self] . identifier[max_order] ), identifie...
def remove_neighbours(self): """ Removes from the MOC instance the HEALPix cells located at its border. The depth of the HEALPix cells removed is equal to the maximum depth of the MOC instance. Returns ------- moc : `~mocpy.moc.MOC` self minus its HEALPix cells ...
def fix_paths(project_data, rel_path, extensions): """ Fix paths for extension list """ norm_func = lambda path : os.path.normpath(os.path.join(rel_path, path)) for key in extensions: if type(project_data[key]) is dict: for k,v in project_data[key].items(): project_data[k...
def function[fix_paths, parameter[project_data, rel_path, extensions]]: constant[ Fix paths for extension list ] variable[norm_func] assign[=] <ast.Lambda object at 0x7da1b0c92bc0> for taget[name[key]] in starred[name[extensions]] begin[:] if compare[call[name[type], parameter[ca...
keyword[def] identifier[fix_paths] ( identifier[project_data] , identifier[rel_path] , identifier[extensions] ): literal[string] identifier[norm_func] = keyword[lambda] identifier[path] : identifier[os] . identifier[path] . identifier[normpath] ( identifier[os] . identifier[path] . identifier[join] ( iden...
def fix_paths(project_data, rel_path, extensions): """ Fix paths for extension list """ norm_func = lambda path: os.path.normpath(os.path.join(rel_path, path)) for key in extensions: if type(project_data[key]) is dict: for (k, v) in project_data[key].items(): project_data...
def list(): """Print a listing of known running TensorBoard instances. TensorBoard instances that were killed uncleanly (e.g., with SIGKILL or SIGQUIT) may appear in this list even if they are no longer running. Conversely, this list may be missing some entries if your operating system's temporary directory ...
def function[list, parameter[]]: constant[Print a listing of known running TensorBoard instances. TensorBoard instances that were killed uncleanly (e.g., with SIGKILL or SIGQUIT) may appear in this list even if they are no longer running. Conversely, this list may be missing some entries if your operat...
keyword[def] identifier[list] (): literal[string] identifier[infos] = identifier[manager] . identifier[get_all] () keyword[if] keyword[not] identifier[infos] : identifier[print] ( literal[string] ) keyword[return] identifier[print] ( literal[string] ) keyword[for] identifier[info] keyw...
def list(): """Print a listing of known running TensorBoard instances. TensorBoard instances that were killed uncleanly (e.g., with SIGKILL or SIGQUIT) may appear in this list even if they are no longer running. Conversely, this list may be missing some entries if your operating system's temporary director...
def _maybe_call_fn(fn, fn_arg_list, fn_result=None, description='target_log_prob'): """Helper which computes `fn_result` if needed.""" fn_arg_list = (list(fn_arg_list) if mcmc_util.is_list_like(fn_arg_list) else [fn_arg_list]) if fn_result ...
def function[_maybe_call_fn, parameter[fn, fn_arg_list, fn_result, description]]: constant[Helper which computes `fn_result` if needed.] variable[fn_arg_list] assign[=] <ast.IfExp object at 0x7da1b03226b0> if compare[name[fn_result] is constant[None]] begin[:] variable[fn_result]...
keyword[def] identifier[_maybe_call_fn] ( identifier[fn] , identifier[fn_arg_list] , identifier[fn_result] = keyword[None] , identifier[description] = literal[string] ): literal[string] identifier[fn_arg_list] =( identifier[list] ( identifier[fn_arg_list] ) keyword[if] identifier[mcmc_util] . identifier[is...
def _maybe_call_fn(fn, fn_arg_list, fn_result=None, description='target_log_prob'): """Helper which computes `fn_result` if needed.""" fn_arg_list = list(fn_arg_list) if mcmc_util.is_list_like(fn_arg_list) else [fn_arg_list] if fn_result is None: fn_result = fn(*fn_arg_list) # depends on [control=[...
def _round_frac(x, precision): """ Round the fractional part of the given number """ if not np.isfinite(x) or x == 0: return x else: frac, whole = np.modf(x) if whole == 0: digits = -int(np.floor(np.log10(abs(frac)))) - 1 + precision else: digi...
def function[_round_frac, parameter[x, precision]]: constant[ Round the fractional part of the given number ] if <ast.BoolOp object at 0x7da18dc989d0> begin[:] return[name[x]]
keyword[def] identifier[_round_frac] ( identifier[x] , identifier[precision] ): literal[string] keyword[if] keyword[not] identifier[np] . identifier[isfinite] ( identifier[x] ) keyword[or] identifier[x] == literal[int] : keyword[return] identifier[x] keyword[else] : identifier[f...
def _round_frac(x, precision): """ Round the fractional part of the given number """ if not np.isfinite(x) or x == 0: return x # depends on [control=['if'], data=[]] else: (frac, whole) = np.modf(x) if whole == 0: digits = -int(np.floor(np.log10(abs(frac)))) - 1 ...
def cmd(send, msg, args): """Handles permissions Syntax: {command} (--add|--remove) --nick (nick) --role (admin) """ parser = arguments.ArgParser(args['config']) parser.add_argument('--nick', action=arguments.NickParser, required=True) parser.add_argument('--role', choices=['admin'], required=Tr...
def function[cmd, parameter[send, msg, args]]: constant[Handles permissions Syntax: {command} (--add|--remove) --nick (nick) --role (admin) ] variable[parser] assign[=] call[name[arguments].ArgParser, parameter[call[name[args]][constant[config]]]] call[name[parser].add_argument, paramete...
keyword[def] identifier[cmd] ( identifier[send] , identifier[msg] , identifier[args] ): literal[string] identifier[parser] = identifier[arguments] . identifier[ArgParser] ( identifier[args] [ literal[string] ]) identifier[parser] . identifier[add_argument] ( literal[string] , identifier[action] = iden...
def cmd(send, msg, args): """Handles permissions Syntax: {command} (--add|--remove) --nick (nick) --role (admin) """ parser = arguments.ArgParser(args['config']) parser.add_argument('--nick', action=arguments.NickParser, required=True) parser.add_argument('--role', choices=['admin'], required=Tr...
def qw(words,flat=0,sep=None,maxsplit=-1): """Similar to Perl's qw() operator, but with some more options. qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit) words can also be a list itself, and with flat=1, the output will be recursively flattened. Examples: >>> qw('1 2') ...
def function[qw, parameter[words, flat, sep, maxsplit]]: constant[Similar to Perl's qw() operator, but with some more options. qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit) words can also be a list itself, and with flat=1, the output will be recursively flattened. Examples...
keyword[def] identifier[qw] ( identifier[words] , identifier[flat] = literal[int] , identifier[sep] = keyword[None] , identifier[maxsplit] =- literal[int] ): literal[string] keyword[if] identifier[isinstance] ( identifier[words] , identifier[basestring] ): keyword[return] [ identifier[word] . id...
def qw(words, flat=0, sep=None, maxsplit=-1): """Similar to Perl's qw() operator, but with some more options. qw(words,flat=0,sep=' ',maxsplit=-1) -> words.split(sep,maxsplit) words can also be a list itself, and with flat=1, the output will be recursively flattened. Examples: >>> qw('1 2') ...
def get_params(self, deep=True): """ Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters """ out = dic...
def function[get_params, parameter[self, deep]]: constant[ Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters ...
keyword[def] identifier[get_params] ( identifier[self] , identifier[deep] = keyword[True] ): literal[string] identifier[out] = identifier[dict] () keyword[for] identifier[key] , identifier[value] keyword[in] identifier[self] . identifier[parms] . identifier[items] (): keywo...
def get_params(self, deep=True): """ Obtain parameters for this estimator. Used primarily for sklearn Pipelines and sklearn grid search. :param deep: If True, return parameters of all sub-objects that are estimators. :returns: A dict of parameters """ out = dict() ...
def get_metadata_for_nifti(in_file, bids_dir=None, validate=True): """Fetch metadata for a given nifti file >>> metadata = get_metadata_for_nifti( ... datadir / 'ds054' / 'sub-100185' / 'fmap' / 'sub-100185_phasediff.nii.gz', ... validate=False) >>> metadata['Manufacturer'] 'SIEMENS' ...
def function[get_metadata_for_nifti, parameter[in_file, bids_dir, validate]]: constant[Fetch metadata for a given nifti file >>> metadata = get_metadata_for_nifti( ... datadir / 'ds054' / 'sub-100185' / 'fmap' / 'sub-100185_phasediff.nii.gz', ... validate=False) >>> metadata['Manufactur...
keyword[def] identifier[get_metadata_for_nifti] ( identifier[in_file] , identifier[bids_dir] = keyword[None] , identifier[validate] = keyword[True] ): literal[string] keyword[return] identifier[_init_layout] ( identifier[in_file] , identifier[bids_dir] , identifier[validate] ). identifier[get_metadata] ( ...
def get_metadata_for_nifti(in_file, bids_dir=None, validate=True): """Fetch metadata for a given nifti file >>> metadata = get_metadata_for_nifti( ... datadir / 'ds054' / 'sub-100185' / 'fmap' / 'sub-100185_phasediff.nii.gz', ... validate=False) >>> metadata['Manufacturer'] 'SIEMENS' ...
def submit_job(self, bundle, job_config=None): """Submit a Streams Application Bundle (sab file) to this Streaming Analytics service. Args: bundle(str): path to a Streams application bundle (sab file) containing the application to be submitted job...
def function[submit_job, parameter[self, bundle, job_config]]: constant[Submit a Streams Application Bundle (sab file) to this Streaming Analytics service. Args: bundle(str): path to a Streams application bundle (sab file) containing the application to be sub...
keyword[def] identifier[submit_job] ( identifier[self] , identifier[bundle] , identifier[job_config] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_delegator] . identifier[_submit_job] ( identifier[bundle] = identifier[bundle] , identifier[job_config] = identifie...
def submit_job(self, bundle, job_config=None): """Submit a Streams Application Bundle (sab file) to this Streaming Analytics service. Args: bundle(str): path to a Streams application bundle (sab file) containing the application to be submitted job_con...
async def eap_options(request: web.Request) -> web.Response: """ Get request returns the available configuration options for WPA-EAP. Because the options for connecting to WPA-EAP secured networks are quite complex, to avoid duplicating logic this endpoint returns a json object describing the structure...
<ast.AsyncFunctionDef object at 0x7da1b26adb40>
keyword[async] keyword[def] identifier[eap_options] ( identifier[request] : identifier[web] . identifier[Request] )-> identifier[web] . identifier[Response] : literal[string] keyword[return] identifier[web] . identifier[json_response] ( identifier[EAP_CONFIG_SHAPE] , identifier[status] = literal[int] )
async def eap_options(request: web.Request) -> web.Response: """ Get request returns the available configuration options for WPA-EAP. Because the options for connecting to WPA-EAP secured networks are quite complex, to avoid duplicating logic this endpoint returns a json object describing the structure...
def __calculate_dataset_difference(self, amount_clusters): """! @brief Calculate distance from each point to each cluster center. """ dataset_differences = numpy.zeros((amount_clusters, len(self.__pointer_data))) for index_center in range(amount_clusters): if ...
def function[__calculate_dataset_difference, parameter[self, amount_clusters]]: constant[! @brief Calculate distance from each point to each cluster center. ] variable[dataset_differences] assign[=] call[name[numpy].zeros, parameter[tuple[[<ast.Name object at 0x7da1b01b1510>, <ast.Call ...
keyword[def] identifier[__calculate_dataset_difference] ( identifier[self] , identifier[amount_clusters] ): literal[string] identifier[dataset_differences] = identifier[numpy] . identifier[zeros] (( identifier[amount_clusters] , identifier[len] ( identifier[self] . identifier[__pointer_data] ))) ...
def __calculate_dataset_difference(self, amount_clusters): """! @brief Calculate distance from each point to each cluster center. """ dataset_differences = numpy.zeros((amount_clusters, len(self.__pointer_data))) for index_center in range(amount_clusters): if self.__metric.get_type(...
def master_etcd(info, meta, max_pod_cluster, label): """ Function used to create the response for all master node types """ nodes = meta.get(label, []) or [] info = info[info["machine_id"].isin(nodes)] if info.empty: return cpu_factor = max_pod_cluster / 1000.0 nocpu_expected = MASTER_M...
def function[master_etcd, parameter[info, meta, max_pod_cluster, label]]: constant[ Function used to create the response for all master node types ] variable[nodes] assign[=] <ast.BoolOp object at 0x7da1b184be50> variable[info] assign[=] call[name[info]][call[call[name[info]][constant[machine_id...
keyword[def] identifier[master_etcd] ( identifier[info] , identifier[meta] , identifier[max_pod_cluster] , identifier[label] ): literal[string] identifier[nodes] = identifier[meta] . identifier[get] ( identifier[label] ,[]) keyword[or] [] identifier[info] = identifier[info] [ identifier[info] [ litera...
def master_etcd(info, meta, max_pod_cluster, label): """ Function used to create the response for all master node types """ nodes = meta.get(label, []) or [] info = info[info['machine_id'].isin(nodes)] if info.empty: return # depends on [control=['if'], data=[]] cpu_factor = max_pod_cluster...
def fit(self, X): """Compute the distribution for each variable and then its covariance matrix. Args: X(numpy.ndarray or pandas.DataFrame): Data to model. Returns: None """ LOGGER.debug('Fitting Gaussian Copula') column_names = self.get_column_na...
def function[fit, parameter[self, X]]: constant[Compute the distribution for each variable and then its covariance matrix. Args: X(numpy.ndarray or pandas.DataFrame): Data to model. Returns: None ] call[name[LOGGER].debug, parameter[constant[Fitting Gaus...
keyword[def] identifier[fit] ( identifier[self] , identifier[X] ): literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] ) identifier[column_names] = identifier[self] . identifier[get_column_names] ( identifier[X] ) identifier[distribution_class] = identifier[im...
def fit(self, X): """Compute the distribution for each variable and then its covariance matrix. Args: X(numpy.ndarray or pandas.DataFrame): Data to model. Returns: None """ LOGGER.debug('Fitting Gaussian Copula') column_names = self.get_column_names(X) d...
def create_manager(self, base_manager=models.Manager): """ This will create the custom Manager that will use the fields_model and values_model respectively. :param base_manager: the base manager class to inherit from :return: """ _builder = self class C...
def function[create_manager, parameter[self, base_manager]]: constant[ This will create the custom Manager that will use the fields_model and values_model respectively. :param base_manager: the base manager class to inherit from :return: ] variable[_builder] assi...
keyword[def] identifier[create_manager] ( identifier[self] , identifier[base_manager] = identifier[models] . identifier[Manager] ): literal[string] identifier[_builder] = identifier[self] keyword[class] identifier[CustomManager] ( identifier[base_manager] ): keyword[def] ...
def create_manager(self, base_manager=models.Manager): """ This will create the custom Manager that will use the fields_model and values_model respectively. :param base_manager: the base manager class to inherit from :return: """ _builder = self class CustomManager(...
def native_contracts(address: int, data: BaseCalldata) -> List[int]: """Takes integer address 1, 2, 3, 4. :param address: :param data: :return: """ functions = (ecrecover, sha256, ripemd160, identity) if isinstance(data, ConcreteCalldata): concrete_data = data.concrete(None) el...
def function[native_contracts, parameter[address, data]]: constant[Takes integer address 1, 2, 3, 4. :param address: :param data: :return: ] variable[functions] assign[=] tuple[[<ast.Name object at 0x7da1b1dde500>, <ast.Name object at 0x7da1b1ddfb50>, <ast.Name object at 0x7da1b1ddfdf0>...
keyword[def] identifier[native_contracts] ( identifier[address] : identifier[int] , identifier[data] : identifier[BaseCalldata] )-> identifier[List] [ identifier[int] ]: literal[string] identifier[functions] =( identifier[ecrecover] , identifier[sha256] , identifier[ripemd160] , identifier[identity] ) ...
def native_contracts(address: int, data: BaseCalldata) -> List[int]: """Takes integer address 1, 2, 3, 4. :param address: :param data: :return: """ functions = (ecrecover, sha256, ripemd160, identity) if isinstance(data, ConcreteCalldata): concrete_data = data.concrete(None) # depe...
def dimensions(self, copy=True): """ Return a dictionary of :class:`~hypercube.dims.Dimension` objects. Parameters ---------- copy : boolean: Returns a copy of the dimension dictionary if True (Default value = True) Returns ------- dict ...
def function[dimensions, parameter[self, copy]]: constant[ Return a dictionary of :class:`~hypercube.dims.Dimension` objects. Parameters ---------- copy : boolean: Returns a copy of the dimension dictionary if True (Default value = True) Returns ----...
keyword[def] identifier[dimensions] ( identifier[self] , identifier[copy] = keyword[True] ): literal[string] keyword[return] identifier[self] . identifier[_dims] . identifier[copy] () keyword[if] identifier[copy] keyword[else] identifier[self] . identifier[_dims]
def dimensions(self, copy=True): """ Return a dictionary of :class:`~hypercube.dims.Dimension` objects. Parameters ---------- copy : boolean: Returns a copy of the dimension dictionary if True (Default value = True) Returns ------- dict ...
def id_unique(dict_id, name, lineno): """Returns True if dict_id not already used. Otherwise, invokes error""" if dict_id in name_dict: global error_occurred error_occurred = True print( "ERROR - {0:s} definition {1:s} at line {2:d} conflicts with {3:s}" .format(...
def function[id_unique, parameter[dict_id, name, lineno]]: constant[Returns True if dict_id not already used. Otherwise, invokes error] if compare[name[dict_id] in name[name_dict]] begin[:] <ast.Global object at 0x7da1b170cac0> variable[error_occurred] assign[=] constant[True] ...
keyword[def] identifier[id_unique] ( identifier[dict_id] , identifier[name] , identifier[lineno] ): literal[string] keyword[if] identifier[dict_id] keyword[in] identifier[name_dict] : keyword[global] identifier[error_occurred] identifier[error_occurred] = keyword[True] iden...
def id_unique(dict_id, name, lineno): """Returns True if dict_id not already used. Otherwise, invokes error""" if dict_id in name_dict: global error_occurred error_occurred = True print('ERROR - {0:s} definition {1:s} at line {2:d} conflicts with {3:s}'.format(name, dict_id, lineno, nam...
def visit_project(self, node): """visit a pyreverse.utils.Project node * optionally tag the node with a unique id """ if self.tag: node.uid = self.generate_id() for module in node.modules: self.visit(module)
def function[visit_project, parameter[self, node]]: constant[visit a pyreverse.utils.Project node * optionally tag the node with a unique id ] if name[self].tag begin[:] name[node].uid assign[=] call[name[self].generate_id, parameter[]] for taget[name[module]] i...
keyword[def] identifier[visit_project] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[self] . identifier[tag] : identifier[node] . identifier[uid] = identifier[self] . identifier[generate_id] () keyword[for] identifier[module] keyword[in] i...
def visit_project(self, node): """visit a pyreverse.utils.Project node * optionally tag the node with a unique id """ if self.tag: node.uid = self.generate_id() # depends on [control=['if'], data=[]] for module in node.modules: self.visit(module) # depends on [control=['f...
def Imm(extended_map, s, lmax): """Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions. """ import numpy as np extended_map = np.ascontiguous...
def function[Imm, parameter[extended_map, s, lmax]]: constant[Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions. ] import module[numpy] as ...
keyword[def] identifier[Imm] ( identifier[extended_map] , identifier[s] , identifier[lmax] ): literal[string] keyword[import] identifier[numpy] keyword[as] identifier[np] identifier[extended_map] = identifier[np] . identifier[ascontiguousarray] ( identifier[extended_map] , identifier[dtype] = iden...
def Imm(extended_map, s, lmax): """Take the fft of the theta extended map, then zero pad and reorganize it This is mostly an internal function, included here for backwards compatibility. See map2salm and salm2map for more useful functions. """ import numpy as np extended_map = np.ascontiguous...
def fastp_general_stats_table(self): """ Take the parsed stats from the fastp report and add it to the General Statistics table at the top of the report """ headers = OrderedDict() headers['pct_duplication'] = { 'title': '% Duplication', 'description': 'Duplicati...
def function[fastp_general_stats_table, parameter[self]]: constant[ Take the parsed stats from the fastp report and add it to the General Statistics table at the top of the report ] variable[headers] assign[=] call[name[OrderedDict], parameter[]] call[name[headers]][constant[pct_duplicat...
keyword[def] identifier[fastp_general_stats_table] ( identifier[self] ): literal[string] identifier[headers] = identifier[OrderedDict] () identifier[headers] [ literal[string] ]={ literal[string] : literal[string] , literal[string] : literal[string] , literal[st...
def fastp_general_stats_table(self): """ Take the parsed stats from the fastp report and add it to the General Statistics table at the top of the report """ headers = OrderedDict() headers['pct_duplication'] = {'title': '% Duplication', 'description': 'Duplication rate in filtered reads', 'max': 100...
def put(self, data): """ Write an item (will overwrite existing data) Parameters ---------- data : dict Item data """ self._to_put.append(data) if self.should_flush(): self.flush()
def function[put, parameter[self, data]]: constant[ Write an item (will overwrite existing data) Parameters ---------- data : dict Item data ] call[name[self]._to_put.append, parameter[name[data]]] if call[name[self].should_flush, parameter[]...
keyword[def] identifier[put] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[_to_put] . identifier[append] ( identifier[data] ) keyword[if] identifier[self] . identifier[should_flush] (): identifier[self] . identifier[flush] ()
def put(self, data): """ Write an item (will overwrite existing data) Parameters ---------- data : dict Item data """ self._to_put.append(data) if self.should_flush(): self.flush() # depends on [control=['if'], data=[]]
def count_comments_handler(sender, **kwargs): """ Update Entry.comment_count when a public comment was posted. """ comment = kwargs['comment'] if comment.is_public: entry = comment.content_object if isinstance(entry, Entry): entry.comment_count = F('comment_count') + 1 ...
def function[count_comments_handler, parameter[sender]]: constant[ Update Entry.comment_count when a public comment was posted. ] variable[comment] assign[=] call[name[kwargs]][constant[comment]] if name[comment].is_public begin[:] variable[entry] assign[=] name[comment]....
keyword[def] identifier[count_comments_handler] ( identifier[sender] ,** identifier[kwargs] ): literal[string] identifier[comment] = identifier[kwargs] [ literal[string] ] keyword[if] identifier[comment] . identifier[is_public] : identifier[entry] = identifier[comment] . identifier[content_o...
def count_comments_handler(sender, **kwargs): """ Update Entry.comment_count when a public comment was posted. """ comment = kwargs['comment'] if comment.is_public: entry = comment.content_object if isinstance(entry, Entry): entry.comment_count = F('comment_count') + 1 ...
def _read(self, mux, gain, data_rate, mode): """Perform an ADC read with the provided mux, gain, data_rate, and mode values. Returns the signed integer result of the read. """ config = ADS1x15_CONFIG_OS_SINGLE # Go out of power-down mode for conversion. # Specify mux value. ...
def function[_read, parameter[self, mux, gain, data_rate, mode]]: constant[Perform an ADC read with the provided mux, gain, data_rate, and mode values. Returns the signed integer result of the read. ] variable[config] assign[=] name[ADS1x15_CONFIG_OS_SINGLE] <ast.AugAssign object at...
keyword[def] identifier[_read] ( identifier[self] , identifier[mux] , identifier[gain] , identifier[data_rate] , identifier[mode] ): literal[string] identifier[config] = identifier[ADS1x15_CONFIG_OS_SINGLE] identifier[config] |=( identifier[mux] & literal[int] )<< identifier[ADS1...
def _read(self, mux, gain, data_rate, mode): """Perform an ADC read with the provided mux, gain, data_rate, and mode values. Returns the signed integer result of the read. """ config = ADS1x15_CONFIG_OS_SINGLE # Go out of power-down mode for conversion. # Specify mux value. config |= (...
def write_shared_locations(self, paths, dry_run=False): """ Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is ...
def function[write_shared_locations, parameter[self, paths, dry_run]]: constant[ Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is l...
keyword[def] identifier[write_shared_locations] ( identifier[self] , identifier[paths] , identifier[dry_run] = keyword[False] ): literal[string] identifier[shared_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[path] , literal[string] ) identifi...
def write_shared_locations(self, paths, dry_run=False): """ Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actu...
def _traceroute_callback(self, line, kill_switch): """ Callback function to handle traceroute. :param self: :param line: :param kill_switch: :return: """ line = line.lower() if "traceroute to" in line: self.started = True # need to run as root but not running as root. ...
def function[_traceroute_callback, parameter[self, line, kill_switch]]: constant[ Callback function to handle traceroute. :param self: :param line: :param kill_switch: :return: ] variable[line] assign[=] call[name[line].lower, parameter[]] if compare[constant[traceroute ...
keyword[def] identifier[_traceroute_callback] ( identifier[self] , identifier[line] , identifier[kill_switch] ): literal[string] identifier[line] = identifier[line] . identifier[lower] () keyword[if] literal[string] keyword[in] identifier[line] : identifier[self] . identifier[started] = k...
def _traceroute_callback(self, line, kill_switch): """ Callback function to handle traceroute. :param self: :param line: :param kill_switch: :return: """ line = line.lower() if 'traceroute to' in line: self.started = True # depends on [control=['if'], data=[]] # need to...
def find_node(endpoint_url=None, nid=None, selector=None, name=None, cid=None, pnid=None): """ find node according to endpoint url or node ID. if both are defined then search will focus on ID only :param endpoint_url: endpoint's url owned by node to found :param nid: node id :par...
def function[find_node, parameter[endpoint_url, nid, selector, name, cid, pnid]]: constant[ find node according to endpoint url or node ID. if both are defined then search will focus on ID only :param endpoint_url: endpoint's url owned by node to found :param nid: node id :param ...
keyword[def] identifier[find_node] ( identifier[endpoint_url] = keyword[None] , identifier[nid] = keyword[None] , identifier[selector] = keyword[None] , identifier[name] = keyword[None] , identifier[cid] = keyword[None] , identifier[pnid] = keyword[None] ): literal[string] identifier[LOGGER] . iden...
def find_node(endpoint_url=None, nid=None, selector=None, name=None, cid=None, pnid=None): """ find node according to endpoint url or node ID. if both are defined then search will focus on ID only :param endpoint_url: endpoint's url owned by node to found :param nid: node id :param s...
def encode_corpus(self, corpus, output_path): """ Encode all utterances of the given corpus and store them in a :class:`audiomate.container.Container`. Args: corpus (Corpus): The corpus to process. output_path (str): The path to store the container with the encoded data....
def function[encode_corpus, parameter[self, corpus, output_path]]: constant[ Encode all utterances of the given corpus and store them in a :class:`audiomate.container.Container`. Args: corpus (Corpus): The corpus to process. output_path (str): The path to store the conta...
keyword[def] identifier[encode_corpus] ( identifier[self] , identifier[corpus] , identifier[output_path] ): literal[string] identifier[out_container] = identifier[containers] . identifier[Container] ( identifier[output_path] ) identifier[out_container] . identifier[open] () keyw...
def encode_corpus(self, corpus, output_path): """ Encode all utterances of the given corpus and store them in a :class:`audiomate.container.Container`. Args: corpus (Corpus): The corpus to process. output_path (str): The path to store the container with the encoded data. ...
def split_stdout_lines(stdout): """ Given the standard output from NetMHC/NetMHCpan/NetMHCcons tools, drop all {comments, lines of hyphens, empty lines} and split the remaining lines by whitespace. """ # all the NetMHC formats use lines full of dashes before any actual # binding results ...
def function[split_stdout_lines, parameter[stdout]]: constant[ Given the standard output from NetMHC/NetMHCpan/NetMHCcons tools, drop all {comments, lines of hyphens, empty lines} and split the remaining lines by whitespace. ] variable[seen_dash] assign[=] constant[False] for tag...
keyword[def] identifier[split_stdout_lines] ( identifier[stdout] ): literal[string] identifier[seen_dash] = keyword[False] keyword[for] identifier[l] keyword[in] identifier[stdout] . identifier[split] ( literal[string] ): identifier[l] = identifier[l] . identifier[strip] () ...
def split_stdout_lines(stdout): """ Given the standard output from NetMHC/NetMHCpan/NetMHCcons tools, drop all {comments, lines of hyphens, empty lines} and split the remaining lines by whitespace. """ # all the NetMHC formats use lines full of dashes before any actual # binding results ...
def SystemFee(self): """ Get the system fee. Returns: Fixed8: """ if self.AssetType == AssetType.GoverningToken or self.AssetType == AssetType.UtilityToken: return Fixed8.Zero() return super(RegisterTransaction, self).SystemFee()
def function[SystemFee, parameter[self]]: constant[ Get the system fee. Returns: Fixed8: ] if <ast.BoolOp object at 0x7da1b22ae530> begin[:] return[call[name[Fixed8].Zero, parameter[]]] return[call[call[name[super], parameter[name[RegisterTransaction], na...
keyword[def] identifier[SystemFee] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[AssetType] == identifier[AssetType] . identifier[GoverningToken] keyword[or] identifier[self] . identifier[AssetType] == identifier[AssetType] . identifier[UtilityToken] : ...
def SystemFee(self): """ Get the system fee. Returns: Fixed8: """ if self.AssetType == AssetType.GoverningToken or self.AssetType == AssetType.UtilityToken: return Fixed8.Zero() # depends on [control=['if'], data=[]] return super(RegisterTransaction, self).Syste...
def lux_unit(self): """Get unit of lux.""" if CONST.UNIT_LUX in self._get_status(CONST.LUX_STATUS_KEY): return CONST.LUX return None
def function[lux_unit, parameter[self]]: constant[Get unit of lux.] if compare[name[CONST].UNIT_LUX in call[name[self]._get_status, parameter[name[CONST].LUX_STATUS_KEY]]] begin[:] return[name[CONST].LUX] return[constant[None]]
keyword[def] identifier[lux_unit] ( identifier[self] ): literal[string] keyword[if] identifier[CONST] . identifier[UNIT_LUX] keyword[in] identifier[self] . identifier[_get_status] ( identifier[CONST] . identifier[LUX_STATUS_KEY] ): keyword[return] identifier[CONST] . identifier[LUX...
def lux_unit(self): """Get unit of lux.""" if CONST.UNIT_LUX in self._get_status(CONST.LUX_STATUS_KEY): return CONST.LUX # depends on [control=['if'], data=[]] return None
def get_coin_list(coins='all'): """ Get general information about all the coins available on cryptocompare.com. Args: coins: Default value of 'all' returns information about all the coins available on the site. Otherwise a single string or list of coin symbols can be used. Returns: The function retu...
def function[get_coin_list, parameter[coins]]: constant[ Get general information about all the coins available on cryptocompare.com. Args: coins: Default value of 'all' returns information about all the coins available on the site. Otherwise a single string or list of coin symbols can be used. ...
keyword[def] identifier[get_coin_list] ( identifier[coins] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[coins] , identifier[list] ) keyword[and] identifier[coins] != literal[string] : identifier[coins] =[ identifier[coins] ] identifier[url] = id...
def get_coin_list(coins='all'): """ Get general information about all the coins available on cryptocompare.com. Args: coins: Default value of 'all' returns information about all the coins available on the site. Otherwise a single string or list of coin symbols can be used. Returns: The function r...
def Laliberte_heat_capacity_i(T, w_w, a1, a2, a3, a4, a5, a6): r'''Calculate the heat capacity of a solute using the form proposed by [1]_ Parameters are needed, and a temperature, and water fraction. .. math:: Cp_i = a_1 e^\alpha + a_5(1-w_w)^{a_6} \alpha = a_2 t + a_3 \exp(0.01t) + a_4(1-...
def function[Laliberte_heat_capacity_i, parameter[T, w_w, a1, a2, a3, a4, a5, a6]]: constant[Calculate the heat capacity of a solute using the form proposed by [1]_ Parameters are needed, and a temperature, and water fraction. .. math:: Cp_i = a_1 e^\alpha + a_5(1-w_w)^{a_6} \alpha = a_...
keyword[def] identifier[Laliberte_heat_capacity_i] ( identifier[T] , identifier[w_w] , identifier[a1] , identifier[a2] , identifier[a3] , identifier[a4] , identifier[a5] , identifier[a6] ): literal[string] identifier[t] = identifier[T] - literal[int] identifier[alpha] = identifier[a2] * identifier[t]...
def Laliberte_heat_capacity_i(T, w_w, a1, a2, a3, a4, a5, a6): """Calculate the heat capacity of a solute using the form proposed by [1]_ Parameters are needed, and a temperature, and water fraction. .. math:: Cp_i = a_1 e^\\alpha + a_5(1-w_w)^{a_6} \\alpha = a_2 t + a_3 \\exp(0.01t) + a_4(...
def _get_view_infos( self, trimmed=False): """query the sherlock-catalogues database view metadata """ self.log.debug('starting the ``_get_view_infos`` method') sqlQuery = u""" SELECT v.*, t.description as "master table" FROM crossmatch_catalogues.tcs...
def function[_get_view_infos, parameter[self, trimmed]]: constant[query the sherlock-catalogues database view metadata ] call[name[self].log.debug, parameter[constant[starting the ``_get_view_infos`` method]]] variable[sqlQuery] assign[=] binary_operation[constant[ SELECT v.*...
keyword[def] identifier[_get_view_infos] ( identifier[self] , identifier[trimmed] = keyword[False] ): literal[string] identifier[self] . identifier[log] . identifier[debug] ( literal[string] ) identifier[sqlQuery] = literal[string] % identifier[locals] () identifier[viewInfo] =...
def _get_view_infos(self, trimmed=False): """query the sherlock-catalogues database view metadata """ self.log.debug('starting the ``_get_view_infos`` method') sqlQuery = u'\n SELECT v.*, t.description as "master table" FROM crossmatch_catalogues.tcs_helper_catalogue_views_info as v, cro...
def _is_sort_order_unique_together_with_something(self): """ Is the sort_order field unique_together with something """ unique_together = self._meta.unique_together for fields in unique_together: if 'sort_order' in fields and len(fields) > 1: return Tr...
def function[_is_sort_order_unique_together_with_something, parameter[self]]: constant[ Is the sort_order field unique_together with something ] variable[unique_together] assign[=] name[self]._meta.unique_together for taget[name[fields]] in starred[name[unique_together]] begin[:]...
keyword[def] identifier[_is_sort_order_unique_together_with_something] ( identifier[self] ): literal[string] identifier[unique_together] = identifier[self] . identifier[_meta] . identifier[unique_together] keyword[for] identifier[fields] keyword[in] identifier[unique_together] : ...
def _is_sort_order_unique_together_with_something(self): """ Is the sort_order field unique_together with something """ unique_together = self._meta.unique_together for fields in unique_together: if 'sort_order' in fields and len(fields) > 1: return True # depends on [co...
def parse_JSON(self, JSON_string): """ Parses an *UVIndex* instance out of raw JSON data. Only certain properties of the data are used: if these properties are not found or cannot be parsed, an error is issued. :param JSON_string: a raw JSON string :type JSON_string: str...
def function[parse_JSON, parameter[self, JSON_string]]: constant[ Parses an *UVIndex* instance out of raw JSON data. Only certain properties of the data are used: if these properties are not found or cannot be parsed, an error is issued. :param JSON_string: a raw JSON string ...
keyword[def] identifier[parse_JSON] ( identifier[self] , identifier[JSON_string] ): literal[string] keyword[if] identifier[JSON_string] keyword[is] keyword[None] : keyword[raise] identifier[parse_response_error] . identifier[ParseResponseError] ( literal[string] ) identifi...
def parse_JSON(self, JSON_string): """ Parses an *UVIndex* instance out of raw JSON data. Only certain properties of the data are used: if these properties are not found or cannot be parsed, an error is issued. :param JSON_string: a raw JSON string :type JSON_string: str ...
def create_model(self, ModelName, PrimaryContainer, *args, **kwargs): # pylint: disable=unused-argument """Create a Local Model Object Args: ModelName (str): the Model Name PrimaryContainer (dict): a SageMaker primary container definition """ LocalSagemakerClien...
def function[create_model, parameter[self, ModelName, PrimaryContainer]]: constant[Create a Local Model Object Args: ModelName (str): the Model Name PrimaryContainer (dict): a SageMaker primary container definition ] call[name[LocalSagemakerClient]._models][name[...
keyword[def] identifier[create_model] ( identifier[self] , identifier[ModelName] , identifier[PrimaryContainer] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[LocalSagemakerClient] . identifier[_models] [ identifier[ModelName] ]= identifier[_LocalModel] ( identifier[ModelN...
def create_model(self, ModelName, PrimaryContainer, *args, **kwargs): # pylint: disable=unused-argument 'Create a Local Model Object\n\n Args:\n ModelName (str): the Model Name\n PrimaryContainer (dict): a SageMaker primary container definition\n ' LocalSagemakerClient._mode...
def QA_util_time_stamp(time_): """ 字符串 '2018-01-01 00:00:00' 转变成 float 类型时间 类似 time.time() 返回的类型 :param time_: 字符串str -- 数据格式 最好是%Y-%m-%d %H:%M:%S 中间要有空格 :return: 类型float """ if len(str(time_)) == 10: # yyyy-mm-dd格式 return time.mktime(time.strptime(time_, '%Y-%m-%d')) elif l...
def function[QA_util_time_stamp, parameter[time_]]: constant[ 字符串 '2018-01-01 00:00:00' 转变成 float 类型时间 类似 time.time() 返回的类型 :param time_: 字符串str -- 数据格式 最好是%Y-%m-%d %H:%M:%S 中间要有空格 :return: 类型float ] if compare[call[name[len], parameter[call[name[str], parameter[name[time_]]]]] equal[==...
keyword[def] identifier[QA_util_time_stamp] ( identifier[time_] ): literal[string] keyword[if] identifier[len] ( identifier[str] ( identifier[time_] ))== literal[int] : keyword[return] identifier[time] . identifier[mktime] ( identifier[time] . identifier[strptime] ( identifier[time_] , lite...
def QA_util_time_stamp(time_): """ 字符串 '2018-01-01 00:00:00' 转变成 float 类型时间 类似 time.time() 返回的类型 :param time_: 字符串str -- 数据格式 最好是%Y-%m-%d %H:%M:%S 中间要有空格 :return: 类型float """ if len(str(time_)) == 10: # yyyy-mm-dd格式 return time.mktime(time.strptime(time_, '%Y-%m-%d')) # depends...
def _get_major_minor_revision(self, version_string): """Split a version string into major, minor and (optionally) revision parts. This is complicated by the fact that a version string can be something like 3.2b1.""" version = version_string.split(' ')[0].split('.') v_maj...
def function[_get_major_minor_revision, parameter[self, version_string]]: constant[Split a version string into major, minor and (optionally) revision parts. This is complicated by the fact that a version string can be something like 3.2b1.] variable[version] assign[=] call[call[...
keyword[def] identifier[_get_major_minor_revision] ( identifier[self] , identifier[version_string] ): literal[string] identifier[version] = identifier[version_string] . identifier[split] ( literal[string] )[ literal[int] ]. identifier[split] ( literal[string] ) identifier[v_major] = identi...
def _get_major_minor_revision(self, version_string): """Split a version string into major, minor and (optionally) revision parts. This is complicated by the fact that a version string can be something like 3.2b1.""" version = version_string.split(' ')[0].split('.') v_major = int(ver...
def hook(klass): """ monkey-patch pdb.Pdb class adds a 'vim' (and 'v') command: it switches to debugging with vimpdb """ if not hasattr(klass, 'do_vim'): setupMethod(klass, trace_dispatch) klass.__bases__ += (SwitcherToVimpdb, )
def function[hook, parameter[klass]]: constant[ monkey-patch pdb.Pdb class adds a 'vim' (and 'v') command: it switches to debugging with vimpdb ] if <ast.UnaryOp object at 0x7da1b1040a90> begin[:] call[name[setupMethod], parameter[name[klass], name[trace_dispatch]]] ...
keyword[def] identifier[hook] ( identifier[klass] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[klass] , literal[string] ): identifier[setupMethod] ( identifier[klass] , identifier[trace_dispatch] ) identifier[klass] . identifier[__bases__] +=( identifier...
def hook(klass): """ monkey-patch pdb.Pdb class adds a 'vim' (and 'v') command: it switches to debugging with vimpdb """ if not hasattr(klass, 'do_vim'): setupMethod(klass, trace_dispatch) klass.__bases__ += (SwitcherToVimpdb,) # depends on [control=['if'], data=[]]
def open_this(self, file, how): # type: (str,str) -> Any """ Open file while detecting encoding. Use cached when possible. :param file: :param how: :return: """ # BUG: risky code here, allowing relative if not file.startswith("/"): # raise Typ...
def function[open_this, parameter[self, file, how]]: constant[ Open file while detecting encoding. Use cached when possible. :param file: :param how: :return: ] if <ast.UnaryOp object at 0x7da18bc726b0> begin[:] pass if compare[name[file] in name[s...
keyword[def] identifier[open_this] ( identifier[self] , identifier[file] , identifier[how] ): literal[string] keyword[if] keyword[not] identifier[file] . identifier[startswith] ( literal[string] ): keyword[pass] keyword[if] identifier[file] keyword[in] ...
def open_this(self, file, how): # type: (str,str) -> Any '\n Open file while detecting encoding. Use cached when possible.\n :param file:\n :param how:\n :return:\n ' # BUG: risky code here, allowing relative if not file.startswith('/'): # raise TypeError("this is...
def _check_exclude(self, val): """ Validate the excluded metrics. Returns the set of excluded params. """ if val is None: exclude = frozenset() elif isinstance(val, str): exclude = frozenset([val.lower()]) else: exclude = frozenset(map(...
def function[_check_exclude, parameter[self, val]]: constant[ Validate the excluded metrics. Returns the set of excluded params. ] if compare[name[val] is constant[None]] begin[:] variable[exclude] assign[=] call[name[frozenset], parameter[]] if compare[call[name[...
keyword[def] identifier[_check_exclude] ( identifier[self] , identifier[val] ): literal[string] keyword[if] identifier[val] keyword[is] keyword[None] : identifier[exclude] = identifier[frozenset] () keyword[elif] identifier[isinstance] ( identifier[val] , identifier[str] )...
def _check_exclude(self, val): """ Validate the excluded metrics. Returns the set of excluded params. """ if val is None: exclude = frozenset() # depends on [control=['if'], data=[]] elif isinstance(val, str): exclude = frozenset([val.lower()]) # depends on [control=['if'],...
def GetOobResult(self, param, user_ip, gitkit_token=None): """Gets out-of-band code for ResetPassword/ChangeEmail request. Args: param: dict of HTTP POST params user_ip: string, end user's IP address gitkit_token: string, the gitkit token if user logged in Returns: A dict of { ...
def function[GetOobResult, parameter[self, param, user_ip, gitkit_token]]: constant[Gets out-of-band code for ResetPassword/ChangeEmail request. Args: param: dict of HTTP POST params user_ip: string, end user's IP address gitkit_token: string, the gitkit token if user logged in Retur...
keyword[def] identifier[GetOobResult] ( identifier[self] , identifier[param] , identifier[user_ip] , identifier[gitkit_token] = keyword[None] ): literal[string] keyword[if] literal[string] keyword[in] identifier[param] : keyword[try] : keyword[if] identifier[param] [ literal[string] ]==...
def GetOobResult(self, param, user_ip, gitkit_token=None): """Gets out-of-band code for ResetPassword/ChangeEmail request. Args: param: dict of HTTP POST params user_ip: string, end user's IP address gitkit_token: string, the gitkit token if user logged in Returns: A dict of { ...
def limit(self, n, skip=None): """ Limit the result set. However when the query set already has limit field before, this would raise an exception :Parameters: - n : The maximum number of rows returned - skip: how many rows to skip :Return: a new QuerySet object so...
def function[limit, parameter[self, n, skip]]: constant[ Limit the result set. However when the query set already has limit field before, this would raise an exception :Parameters: - n : The maximum number of rows returned - skip: how many rows to skip :Return: a ...
keyword[def] identifier[limit] ( identifier[self] , identifier[n] , identifier[skip] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[query] . identifier[limit] keyword[is] keyword[not] keyword[None] : keyword[raise] identifier[MonSQLException] ( litera...
def limit(self, n, skip=None): """ Limit the result set. However when the query set already has limit field before, this would raise an exception :Parameters: - n : The maximum number of rows returned - skip: how many rows to skip :Return: a new QuerySet object so we ...
def get_jobs(self, job_ids = None): """Returns a list of jobs that are stored in the database.""" if job_ids is not None and len(job_ids) == 0: return [] q = self.session.query(Job) if job_ids is not None: q = q.filter(Job.unique.in_(job_ids)) return sorted(list(q), key=lambda job: job.u...
def function[get_jobs, parameter[self, job_ids]]: constant[Returns a list of jobs that are stored in the database.] if <ast.BoolOp object at 0x7da18f723b50> begin[:] return[list[[]]] variable[q] assign[=] call[name[self].session.query, parameter[name[Job]]] if compare[name[job_id...
keyword[def] identifier[get_jobs] ( identifier[self] , identifier[job_ids] = keyword[None] ): literal[string] keyword[if] identifier[job_ids] keyword[is] keyword[not] keyword[None] keyword[and] identifier[len] ( identifier[job_ids] )== literal[int] : keyword[return] [] identifier[q] = ide...
def get_jobs(self, job_ids=None): """Returns a list of jobs that are stored in the database.""" if job_ids is not None and len(job_ids) == 0: return [] # depends on [control=['if'], data=[]] q = self.session.query(Job) if job_ids is not None: q = q.filter(Job.unique.in_(job_ids)) # dep...
def contacts(self, uid=0, **kwargs): """ Fetch user contacts by given group id. A useful synonym for "contacts/search" command with provided `groupId` parameter. :Example: lists = client.lists.contacts(1901010) :param int uid: The unique id of the List. Required. ...
def function[contacts, parameter[self, uid]]: constant[ Fetch user contacts by given group id. A useful synonym for "contacts/search" command with provided `groupId` parameter. :Example: lists = client.lists.contacts(1901010) :param int uid: The unique id of the List...
keyword[def] identifier[contacts] ( identifier[self] , identifier[uid] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[contacts] = identifier[Contacts] ( identifier[self] . identifier[base_uri] , identifier[self] . identifier[auth] ) keyword[return] identifier[self] . ...
def contacts(self, uid=0, **kwargs): """ Fetch user contacts by given group id. A useful synonym for "contacts/search" command with provided `groupId` parameter. :Example: lists = client.lists.contacts(1901010) :param int uid: The unique id of the List. Required. ...
def do_set(self, args: argparse.Namespace) -> None: """Set a settable parameter or show current settings of parameters""" # Check if param was passed in if not args.param: return self.show(args) param = utils.norm_fold(args.param.strip()) # Check if value was passed...
def function[do_set, parameter[self, args]]: constant[Set a settable parameter or show current settings of parameters] if <ast.UnaryOp object at 0x7da1b26af4f0> begin[:] return[call[name[self].show, parameter[name[args]]]] variable[param] assign[=] call[name[utils].norm_fold, parameter[c...
keyword[def] identifier[do_set] ( identifier[self] , identifier[args] : identifier[argparse] . identifier[Namespace] )-> keyword[None] : literal[string] keyword[if] keyword[not] identifier[args] . identifier[param] : keyword[return] identifier[self] . identifier[show] ( id...
def do_set(self, args: argparse.Namespace) -> None: """Set a settable parameter or show current settings of parameters""" # Check if param was passed in if not args.param: return self.show(args) # depends on [control=['if'], data=[]] param = utils.norm_fold(args.param.strip()) # Check if va...
def _get_axes(dim, subplots_kwargs=dict()): """ Parameters ---------- dim : int Dimensionality of the orbit. subplots_kwargs : dict (optional) Dictionary of kwargs passed to :func:`~matplotlib.pyplot.subplots`. """ import matplotlib.pyplot as plt if dim > 1: n_p...
def function[_get_axes, parameter[dim, subplots_kwargs]]: constant[ Parameters ---------- dim : int Dimensionality of the orbit. subplots_kwargs : dict (optional) Dictionary of kwargs passed to :func:`~matplotlib.pyplot.subplots`. ] import module[matplotlib.pyplot] as ali...
keyword[def] identifier[_get_axes] ( identifier[dim] , identifier[subplots_kwargs] = identifier[dict] ()): literal[string] keyword[import] identifier[matplotlib] . identifier[pyplot] keyword[as] identifier[plt] keyword[if] identifier[dim] > literal[int] : identifier[n_panels] = identif...
def _get_axes(dim, subplots_kwargs=dict()): """ Parameters ---------- dim : int Dimensionality of the orbit. subplots_kwargs : dict (optional) Dictionary of kwargs passed to :func:`~matplotlib.pyplot.subplots`. """ import matplotlib.pyplot as plt if dim > 1: n_pan...
def create_load_string(upload_dir, groups=None, organism=None): """ create the code necessary to load the bcbioRNAseq object """ libraryline = 'library(bcbioRNASeq)' load_template = Template( ('bcb <- bcbioRNASeq(uploadDir="$upload_dir",' 'interestingGroups=$groups,' 'organ...
def function[create_load_string, parameter[upload_dir, groups, organism]]: constant[ create the code necessary to load the bcbioRNAseq object ] variable[libraryline] assign[=] constant[library(bcbioRNASeq)] variable[load_template] assign[=] call[name[Template], parameter[constant[bcb <- ...
keyword[def] identifier[create_load_string] ( identifier[upload_dir] , identifier[groups] = keyword[None] , identifier[organism] = keyword[None] ): literal[string] identifier[libraryline] = literal[string] identifier[load_template] = identifier[Template] ( ( literal[string] literal[string] ...
def create_load_string(upload_dir, groups=None, organism=None): """ create the code necessary to load the bcbioRNAseq object """ libraryline = 'library(bcbioRNASeq)' load_template = Template('bcb <- bcbioRNASeq(uploadDir="$upload_dir",interestingGroups=$groups,organism="$organism")') load_noorga...
def _extract(cls, compressed_file, videofile, exts): """ 解压字幕文件,如果无法解压,则直接返回 compressed_file。 exts 参数用于过滤掉非字幕文件,只有文件的扩展名在 exts 中,才解压该文件。 """ if not CompressedFile.is_compressed_file(compressed_file): return [compressed_file] root = os.path.dirname(compressed_file) ...
def function[_extract, parameter[cls, compressed_file, videofile, exts]]: constant[ 解压字幕文件,如果无法解压,则直接返回 compressed_file。 exts 参数用于过滤掉非字幕文件,只有文件的扩展名在 exts 中,才解压该文件。 ] if <ast.UnaryOp object at 0x7da1b2272e60> begin[:] return[list[[<ast.Name object at 0x7da1b2271f60>]]] var...
keyword[def] identifier[_extract] ( identifier[cls] , identifier[compressed_file] , identifier[videofile] , identifier[exts] ): literal[string] keyword[if] keyword[not] identifier[CompressedFile] . identifier[is_compressed_file] ( identifier[compressed_file] ): keyword[return] [ iden...
def _extract(cls, compressed_file, videofile, exts): """ 解压字幕文件,如果无法解压,则直接返回 compressed_file。 exts 参数用于过滤掉非字幕文件,只有文件的扩展名在 exts 中,才解压该文件。 """ if not CompressedFile.is_compressed_file(compressed_file): return [compressed_file] # depends on [control=['if'], data=[]] root = os.path.dirn...
def spit_config(self, conf_file, firstwordonly=False): """conf_file a file opened for writing.""" cfg = ConfigParser.RawConfigParser() for sec in _CONFIG_SECS: cfg.add_section(sec) sec = 'channels' for i in sorted(self.pack.D): cfg.set(sec, str(i), ...
def function[spit_config, parameter[self, conf_file, firstwordonly]]: constant[conf_file a file opened for writing.] variable[cfg] assign[=] call[name[ConfigParser].RawConfigParser, parameter[]] for taget[name[sec]] in starred[name[_CONFIG_SECS]] begin[:] call[name[cfg].add_secti...
keyword[def] identifier[spit_config] ( identifier[self] , identifier[conf_file] , identifier[firstwordonly] = keyword[False] ): literal[string] identifier[cfg] = identifier[ConfigParser] . identifier[RawConfigParser] () keyword[for] identifier[sec] keyword[in] identifier[_CONFIG_SECS] ...
def spit_config(self, conf_file, firstwordonly=False): """conf_file a file opened for writing.""" cfg = ConfigParser.RawConfigParser() for sec in _CONFIG_SECS: cfg.add_section(sec) # depends on [control=['for'], data=['sec']] sec = 'channels' for i in sorted(self.pack.D): cfg.set(se...
def sync_model(self, comment='', compact_central=False, release_borrowed=True, release_workset=True, save_local=False): """Append a sync model entry to the journal. This instructs Revit to sync the currently open workshared model. Args: comment...
def function[sync_model, parameter[self, comment, compact_central, release_borrowed, release_workset, save_local]]: constant[Append a sync model entry to the journal. This instructs Revit to sync the currently open workshared model. Args: comment (str): comment to be provided for t...
keyword[def] identifier[sync_model] ( identifier[self] , identifier[comment] = literal[string] , identifier[compact_central] = keyword[False] , identifier[release_borrowed] = keyword[True] , identifier[release_workset] = keyword[True] , identifier[save_local] = keyword[False] ): literal[string] i...
def sync_model(self, comment='', compact_central=False, release_borrowed=True, release_workset=True, save_local=False): """Append a sync model entry to the journal. This instructs Revit to sync the currently open workshared model. Args: comment (str): comment to be provided for the syn...
def is_descendant_of_vault(self, id_, vault_id): """Tests if an ``Id`` is a descendant of a vault. arg: id (osid.id.Id): an ``Id`` arg: vault_id (osid.id.Id): the ``Id`` of a vault return: (boolean) - ``true`` if the ``id`` is a descendant of the ``vault_id,`` ``f...
def function[is_descendant_of_vault, parameter[self, id_, vault_id]]: constant[Tests if an ``Id`` is a descendant of a vault. arg: id (osid.id.Id): an ``Id`` arg: vault_id (osid.id.Id): the ``Id`` of a vault return: (boolean) - ``true`` if the ``id`` is a descendant of ...
keyword[def] identifier[is_descendant_of_vault] ( identifier[self] , identifier[id_] , identifier[vault_id] ): literal[string] keyword[if] identifier[self] . identifier[_catalog_session] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . ...
def is_descendant_of_vault(self, id_, vault_id): """Tests if an ``Id`` is a descendant of a vault. arg: id (osid.id.Id): an ``Id`` arg: vault_id (osid.id.Id): the ``Id`` of a vault return: (boolean) - ``true`` if the ``id`` is a descendant of the ``vault_id,`` ``false...
def threadpooled( # noqa: F811 func: typing.Optional[typing.Callable[..., typing.Union["typing.Awaitable[typing.Any]", typing.Any]]] = None, *, loop_getter: typing.Union[None, typing.Callable[..., asyncio.AbstractEventLoop], asyncio.AbstractEventLoop] = None, loop_getter_need_context: bool = False, ) -...
def function[threadpooled, parameter[func]]: constant[Post function to ThreadPoolExecutor. :param func: function to wrap :type func: typing.Optional[typing.Callable[..., typing.Union[typing.Awaitable, typing.Any]]] :param loop_getter: Method to get event loop, if wrap in asyncio task :type loop...
keyword[def] identifier[threadpooled] ( identifier[func] : identifier[typing] . identifier[Optional] [ identifier[typing] . identifier[Callable] [..., identifier[typing] . identifier[Union] [ literal[string] , identifier[typing] . identifier[Any] ]]]= keyword[None] , *, identifier[loop_getter] : identifier[typing] ...
def threadpooled(func: typing.Optional[typing.Callable[..., typing.Union['typing.Awaitable[typing.Any]', typing.Any]]]=None, *, loop_getter: typing.Union[None, typing.Callable[..., asyncio.AbstractEventLoop], asyncio.AbstractEventLoop]=None, loop_getter_need_context: bool=False) -> typing.Union[ThreadPooled, typing.Cal...
def get_service_uid_from(self, analysis): """Return the service from the analysis """ analysis = api.get_object(analysis) return api.get_uid(analysis.getAnalysisService())
def function[get_service_uid_from, parameter[self, analysis]]: constant[Return the service from the analysis ] variable[analysis] assign[=] call[name[api].get_object, parameter[name[analysis]]] return[call[name[api].get_uid, parameter[call[name[analysis].getAnalysisService, parameter[]]]]]
keyword[def] identifier[get_service_uid_from] ( identifier[self] , identifier[analysis] ): literal[string] identifier[analysis] = identifier[api] . identifier[get_object] ( identifier[analysis] ) keyword[return] identifier[api] . identifier[get_uid] ( identifier[analysis] . identifier[get...
def get_service_uid_from(self, analysis): """Return the service from the analysis """ analysis = api.get_object(analysis) return api.get_uid(analysis.getAnalysisService())
def view(self, *args, **kwargs): """Decorator to automatically apply as_view decorator and register it. """ def decorator(f): kwargs.setdefault("view_class", self.view_class) return self.add_view(as_view(*args, **kwargs)(f)) return decorator
def function[view, parameter[self]]: constant[Decorator to automatically apply as_view decorator and register it. ] def function[decorator, parameter[f]]: call[name[kwargs].setdefault, parameter[constant[view_class], name[self].view_class]] return[call[name[self].add_view...
keyword[def] identifier[view] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[decorator] ( identifier[f] ): identifier[kwargs] . identifier[setdefault] ( literal[string] , identifier[self] . identifier[view_class] ) ...
def view(self, *args, **kwargs): """Decorator to automatically apply as_view decorator and register it. """ def decorator(f): kwargs.setdefault('view_class', self.view_class) return self.add_view(as_view(*args, **kwargs)(f)) return decorator
def _parse_array(self, tensor_proto): """Grab data in TensorProto and convert to numpy array.""" try: from onnx.numpy_helper import to_array except ImportError: raise ImportError("Onnx and protobuf need to be installed. " + "Instructions to i...
def function[_parse_array, parameter[self, tensor_proto]]: constant[Grab data in TensorProto and convert to numpy array.] <ast.Try object at 0x7da1b1ef2470> if compare[call[name[len], parameter[call[name[tuple], parameter[name[tensor_proto].dims]]]] greater[>] constant[0]] begin[:] v...
keyword[def] identifier[_parse_array] ( identifier[self] , identifier[tensor_proto] ): literal[string] keyword[try] : keyword[from] identifier[onnx] . identifier[numpy_helper] keyword[import] identifier[to_array] keyword[except] identifier[ImportError] : keyw...
def _parse_array(self, tensor_proto): """Grab data in TensorProto and convert to numpy array.""" try: from onnx.numpy_helper import to_array # depends on [control=['try'], data=[]] except ImportError: raise ImportError('Onnx and protobuf need to be installed. ' + 'Instructions to install - ...
def reset_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission'): """ Resets an attribute of a snapshot to its default value. :type snapshot_id: string :param snapshot_id: ID of the snapshot :type attribute: string :pa...
def function[reset_snapshot_attribute, parameter[self, snapshot_id, attribute]]: constant[ Resets an attribute of a snapshot to its default value. :type snapshot_id: string :param snapshot_id: ID of the snapshot :type attribute: string :param attribute: The attribute to...
keyword[def] identifier[reset_snapshot_attribute] ( identifier[self] , identifier[snapshot_id] , identifier[attribute] = literal[string] ): literal[string] identifier[params] ={ literal[string] : identifier[snapshot_id] , literal[string] : identifier[attribute] } keyword[return] ...
def reset_snapshot_attribute(self, snapshot_id, attribute='createVolumePermission'): """ Resets an attribute of a snapshot to its default value. :type snapshot_id: string :param snapshot_id: ID of the snapshot :type attribute: string :param attribute: The attribute to reset...
def get_all_integration_statuses(self, **kwargs): # noqa: E501 """Gets the status of all Wavefront integrations # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = ap...
def function[get_all_integration_statuses, parameter[self]]: constant[Gets the status of all Wavefront integrations # noqa: E501 # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread =...
keyword[def] identifier[get_all_integration_statuses] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier[get] ( literal[string] ): keyword[return] identifier[self] . ...
def get_all_integration_statuses(self, **kwargs): # noqa: E501 'Gets the status of all Wavefront integrations # noqa: E501\n\n # noqa: E501\n This method makes a synchronous HTTP request by default. To make an\n asynchronous HTTP request, please pass async_req=True\n >>> thread = api...
def intersect(self, other): """Calculate the intersection of this rectangle and another rectangle. Args: other (Rect): The other rectangle. Returns: Rect: The intersection of this rectangle and the given other rectangle, or None if there is no such inter...
def function[intersect, parameter[self, other]]: constant[Calculate the intersection of this rectangle and another rectangle. Args: other (Rect): The other rectangle. Returns: Rect: The intersection of this rectangle and the given other rectangle, or None if there is no...
keyword[def] identifier[intersect] ( identifier[self] , identifier[other] ): literal[string] identifier[intersection] = identifier[Rect] () keyword[if] identifier[lib] . identifier[SDL_IntersectRect] ( identifier[self] . identifier[_ptr] , identifier[self] . identifier[_ptr] , identifier[...
def intersect(self, other): """Calculate the intersection of this rectangle and another rectangle. Args: other (Rect): The other rectangle. Returns: Rect: The intersection of this rectangle and the given other rectangle, or None if there is no such intersect...
def sort_by_modified(files_or_folders: list) -> list: """ Sort files or folders by modified time Args: files_or_folders: list of files or folders Returns: list """ return sorted(files_or_folders, key=os.path.getmtime, reverse=True)
def function[sort_by_modified, parameter[files_or_folders]]: constant[ Sort files or folders by modified time Args: files_or_folders: list of files or folders Returns: list ] return[call[name[sorted], parameter[name[files_or_folders]]]]
keyword[def] identifier[sort_by_modified] ( identifier[files_or_folders] : identifier[list] )-> identifier[list] : literal[string] keyword[return] identifier[sorted] ( identifier[files_or_folders] , identifier[key] = identifier[os] . identifier[path] . identifier[getmtime] , identifier[reverse] = keyword[...
def sort_by_modified(files_or_folders: list) -> list: """ Sort files or folders by modified time Args: files_or_folders: list of files or folders Returns: list """ return sorted(files_or_folders, key=os.path.getmtime, reverse=True)
def add(self, value): """Add a value, and return current average.""" self._data.append(value) if len(self._data) > self._max_count: self._data.popleft() return sum(self._data)/len(self._data)
def function[add, parameter[self, value]]: constant[Add a value, and return current average.] call[name[self]._data.append, parameter[name[value]]] if compare[call[name[len], parameter[name[self]._data]] greater[>] name[self]._max_count] begin[:] call[name[self]._data.popleft, pa...
keyword[def] identifier[add] ( identifier[self] , identifier[value] ): literal[string] identifier[self] . identifier[_data] . identifier[append] ( identifier[value] ) keyword[if] identifier[len] ( identifier[self] . identifier[_data] )> identifier[self] . identifier[_max_count] : ...
def add(self, value): """Add a value, and return current average.""" self._data.append(value) if len(self._data) > self._max_count: self._data.popleft() # depends on [control=['if'], data=[]] return sum(self._data) / len(self._data)
def _get_options_dic(self, options: List[str]) -> Dict[str, str]: """ Convert the option list to a dictionary where the key is the option and the value is the related option. Is called in the init. :param options: options given to the plugin. :type options: List[str] :re...
def function[_get_options_dic, parameter[self, options]]: constant[ Convert the option list to a dictionary where the key is the option and the value is the related option. Is called in the init. :param options: options given to the plugin. :type options: List[str] :retu...
keyword[def] identifier[_get_options_dic] ( identifier[self] , identifier[options] : identifier[List] [ identifier[str] ])-> identifier[Dict] [ identifier[str] , identifier[str] ]: literal[string] identifier[options_dic] ={} keyword[for] identifier[option] keyword[in] identifier[options...
def _get_options_dic(self, options: List[str]) -> Dict[str, str]: """ Convert the option list to a dictionary where the key is the option and the value is the related option. Is called in the init. :param options: options given to the plugin. :type options: List[str] :return...
def nnz_obs_names(self): """ wrapper around pyemu.Pst.nnz_obs_names for listing non-zero observation names Returns ------- nnz_obs_names : list pyemu.Pst.nnz_obs_names """ if self.__pst is not None: return self.pst.nnz_obs_names ...
def function[nnz_obs_names, parameter[self]]: constant[ wrapper around pyemu.Pst.nnz_obs_names for listing non-zero observation names Returns ------- nnz_obs_names : list pyemu.Pst.nnz_obs_names ] if compare[name[self].__pst is_not constant[N...
keyword[def] identifier[nnz_obs_names] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[__pst] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . identifier[pst] . identifier[nnz_obs_names] keyword[else] : ...
def nnz_obs_names(self): """ wrapper around pyemu.Pst.nnz_obs_names for listing non-zero observation names Returns ------- nnz_obs_names : list pyemu.Pst.nnz_obs_names """ if self.__pst is not None: return self.pst.nnz_obs_names # depends on...
def register(self, request, **kwargs): """ Create and immediately log in a new user. Only require a email to register, username is generated automatically and a password is random generated and emailed to the user. Activation is still required for accou...
def function[register, parameter[self, request]]: constant[ Create and immediately log in a new user. Only require a email to register, username is generated automatically and a password is random generated and emailed to the user. Activation is still r...
keyword[def] identifier[register] ( identifier[self] , identifier[request] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[Site] . identifier[_meta] . identifier[installed] : identifier[site] = identifier[Site] . identifier[objects] . identifier[get_current] () ...
def register(self, request, **kwargs): """ Create and immediately log in a new user. Only require a email to register, username is generated automatically and a password is random generated and emailed to the user. Activation is still required for account u...
def is_valid_for(self, entry_point, protocol): """Check if the current function can be executed from a request to the given entry point and with the given protocol""" return self.available_for_entry_point(entry_point) and self.available_for_protocol(protocol)
def function[is_valid_for, parameter[self, entry_point, protocol]]: constant[Check if the current function can be executed from a request to the given entry point and with the given protocol] return[<ast.BoolOp object at 0x7da1b04f5cf0>]
keyword[def] identifier[is_valid_for] ( identifier[self] , identifier[entry_point] , identifier[protocol] ): literal[string] keyword[return] identifier[self] . identifier[available_for_entry_point] ( identifier[entry_point] ) keyword[and] identifier[self] . identifier[available_for_protocol] ( id...
def is_valid_for(self, entry_point, protocol): """Check if the current function can be executed from a request to the given entry point and with the given protocol""" return self.available_for_entry_point(entry_point) and self.available_for_protocol(protocol)
def parse_xml(self, node): """ Parse an Object from ElementTree xml node :param node: ElementTree xml node :return: self """ def read_points(text): """parse a text string of float tuples and return [(x,...),...] """ return tuple(tuple(map(flo...
def function[parse_xml, parameter[self, node]]: constant[ Parse an Object from ElementTree xml node :param node: ElementTree xml node :return: self ] def function[read_points, parameter[text]]: constant[parse a text string of float tuples and return [(x,...),...]...
keyword[def] identifier[parse_xml] ( identifier[self] , identifier[node] ): literal[string] keyword[def] identifier[read_points] ( identifier[text] ): literal[string] keyword[return] identifier[tuple] ( identifier[tuple] ( identifier[map] ( identifier[float] , identifi...
def parse_xml(self, node): """ Parse an Object from ElementTree xml node :param node: ElementTree xml node :return: self """ def read_points(text): """parse a text string of float tuples and return [(x,...),...] """ return tuple((tuple(map(float, i.split(','...
def from_variant_sequence_and_reference_context( cls, variant_sequence, reference_context, min_transcript_prefix_length, max_transcript_mismatches, include_mismatches_after_variant, protein_sequence_length=None): """ Att...
def function[from_variant_sequence_and_reference_context, parameter[cls, variant_sequence, reference_context, min_transcript_prefix_length, max_transcript_mismatches, include_mismatches_after_variant, protein_sequence_length]]: constant[ Attempt to translate a single VariantSequence using the reading fr...
keyword[def] identifier[from_variant_sequence_and_reference_context] ( identifier[cls] , identifier[variant_sequence] , identifier[reference_context] , identifier[min_transcript_prefix_length] , identifier[max_transcript_mismatches] , identifier[include_mismatches_after_variant] , identifier[protein_sequence_l...
def from_variant_sequence_and_reference_context(cls, variant_sequence, reference_context, min_transcript_prefix_length, max_transcript_mismatches, include_mismatches_after_variant, protein_sequence_length=None): """ Attempt to translate a single VariantSequence using the reading frame from a single ...
def _iq_handler(iq_type, payload_class, payload_key, usage_restriction): """Method decorator generator for decorating <iq type='get'/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: payload class expected - `payload_key`: payload class specific fi...
def function[_iq_handler, parameter[iq_type, payload_class, payload_key, usage_restriction]]: constant[Method decorator generator for decorating <iq type='get'/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: payload class expected - `payload_...
keyword[def] identifier[_iq_handler] ( identifier[iq_type] , identifier[payload_class] , identifier[payload_key] , identifier[usage_restriction] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): literal[string] identifier[func] . identifier[_pyxmpp_stanza_handl...
def _iq_handler(iq_type, payload_class, payload_key, usage_restriction): """Method decorator generator for decorating <iq type='get'/> stanza handler methods in `XMPPFeatureHandler` subclasses. :Parameters: - `payload_class`: payload class expected - `payload_key`: payload class specific fi...
def lookup(self, h): '''Get stream IDs for a single hash. This yields strings that can be retrieved using :func:`streamcorpus_pipeline._kvlayer.get_kvlayer_stream_item`, or fed back into :mod:`coordinate` or other job queue systems. Note that for common terms this can return a ...
def function[lookup, parameter[self, h]]: constant[Get stream IDs for a single hash. This yields strings that can be retrieved using :func:`streamcorpus_pipeline._kvlayer.get_kvlayer_stream_item`, or fed back into :mod:`coordinate` or other job queue systems. Note that for comm...
keyword[def] identifier[lookup] ( identifier[self] , identifier[h] ): literal[string] keyword[for] ( identifier[_] , identifier[k1] , identifier[k2] ) keyword[in] identifier[self] . identifier[client] . identifier[scan_keys] ( identifier[HASH_TF_INDEX_TABLE] , (( identifier[h] ,),( identif...
def lookup(self, h): """Get stream IDs for a single hash. This yields strings that can be retrieved using :func:`streamcorpus_pipeline._kvlayer.get_kvlayer_stream_item`, or fed back into :mod:`coordinate` or other job queue systems. Note that for common terms this can return a larg...
def generate_signature(payload, secret): '''use an endpoint specific payload and client secret to generate a signature for the request''' payload = _encode(payload) secret = _encode(secret) return hmac.new(secret, digestmod=hashlib.sha256, msg=payload).hexdigest()
def function[generate_signature, parameter[payload, secret]]: constant[use an endpoint specific payload and client secret to generate a signature for the request] variable[payload] assign[=] call[name[_encode], parameter[name[payload]]] variable[secret] assign[=] call[name[_encode], paramete...
keyword[def] identifier[generate_signature] ( identifier[payload] , identifier[secret] ): literal[string] identifier[payload] = identifier[_encode] ( identifier[payload] ) identifier[secret] = identifier[_encode] ( identifier[secret] ) keyword[return] identifier[hmac] . identifier[new] ( identif...
def generate_signature(payload, secret): """use an endpoint specific payload and client secret to generate a signature for the request""" payload = _encode(payload) secret = _encode(secret) return hmac.new(secret, digestmod=hashlib.sha256, msg=payload).hexdigest()
def var_set(self, session, **kwargs): """ Sets the given variables or prints the current ones. "set answer=42" """ if not kwargs: session.write_line( self._utils.make_table( ("Name", "Value"), session.variables.items() ) ...
def function[var_set, parameter[self, session]]: constant[ Sets the given variables or prints the current ones. "set answer=42" ] if <ast.UnaryOp object at 0x7da18f09cbe0> begin[:] call[name[session].write_line, parameter[call[name[self]._utils.make_table, parameter[tuple...
keyword[def] identifier[var_set] ( identifier[self] , identifier[session] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[kwargs] : identifier[session] . identifier[write_line] ( identifier[self] . identifier[_utils] . identifier[make_table]...
def var_set(self, session, **kwargs): """ Sets the given variables or prints the current ones. "set answer=42" """ if not kwargs: session.write_line(self._utils.make_table(('Name', 'Value'), session.variables.items())) # depends on [control=['if'], data=[]] else: for (name, ...
def login(self, user, passwd, bank): """ Login """ logger.info("login...") if bank not in self.BANKS: logger.error("Can't find that bank.") return False self.useragent = self.BANKS[bank]["u-a"] self.bankid = self.BANKS[bank]["id"] login = json.dump...
def function[login, parameter[self, user, passwd, bank]]: constant[ Login ] call[name[logger].info, parameter[constant[login...]]] if compare[name[bank] <ast.NotIn object at 0x7da2590d7190> name[self].BANKS] begin[:] call[name[logger].error, parameter[constant[Can't find that ban...
keyword[def] identifier[login] ( identifier[self] , identifier[user] , identifier[passwd] , identifier[bank] ): literal[string] identifier[logger] . identifier[info] ( literal[string] ) keyword[if] identifier[bank] keyword[not] keyword[in] identifier[self] . identifier[BANKS] : ...
def login(self, user, passwd, bank): """ Login """ logger.info('login...') if bank not in self.BANKS: logger.error("Can't find that bank.") return False # depends on [control=['if'], data=[]] self.useragent = self.BANKS[bank]['u-a'] self.bankid = self.BANKS[bank]['id'] login = j...
def get_tasks_changed_since(self, since): """ Returns a list of tasks that were changed recently.""" changed_tasks = [] for task in self.client.filter_tasks({'status': 'pending'}): if task.get( 'modified', task.get( 'entry', ...
def function[get_tasks_changed_since, parameter[self, since]]: constant[ Returns a list of tasks that were changed recently.] variable[changed_tasks] assign[=] list[[]] for taget[name[task]] in starred[call[name[self].client.filter_tasks, parameter[dictionary[[<ast.Constant object at 0x7da1b0b0e...
keyword[def] identifier[get_tasks_changed_since] ( identifier[self] , identifier[since] ): literal[string] identifier[changed_tasks] =[] keyword[for] identifier[task] keyword[in] identifier[self] . identifier[client] . identifier[filter_tasks] ({ literal[string] : literal[string] }): ...
def get_tasks_changed_since(self, since): """ Returns a list of tasks that were changed recently.""" changed_tasks = [] for task in self.client.filter_tasks({'status': 'pending'}): if task.get('modified', task.get('entry', datetime.datetime(2000, 1, 1).replace(tzinfo=pytz.utc))) >= since: ...