code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def read_data(self, device_property): """ read values from the device """ if self.inst is None: logger.error("Visa-MDO3014-read data-Self.inst : None") return None if device_property == 'present_value': return self.parse_value(self.inst.query('...
def function[read_data, parameter[self, device_property]]: constant[ read values from the device ] if compare[name[self].inst is constant[None]] begin[:] call[name[logger].error, parameter[constant[Visa-MDO3014-read data-Self.inst : None]]] return[constant[None]] ...
keyword[def] identifier[read_data] ( identifier[self] , identifier[device_property] ): literal[string] keyword[if] identifier[self] . identifier[inst] keyword[is] keyword[None] : identifier[logger] . identifier[error] ( literal[string] ) keyword[return] keyword[None] ...
def read_data(self, device_property): """ read values from the device """ if self.inst is None: logger.error('Visa-MDO3014-read data-Self.inst : None') return None # depends on [control=['if'], data=[]] if device_property == 'present_value': return self.parse_value(s...
def getDescendantsUIDs(self, all_descendants=False): """Returns the UIDs of the descendant Analysis Requests This method is used as metadata """ descendants = self.getDescendants(all_descendants=all_descendants) return map(api.get_uid, descendants)
def function[getDescendantsUIDs, parameter[self, all_descendants]]: constant[Returns the UIDs of the descendant Analysis Requests This method is used as metadata ] variable[descendants] assign[=] call[name[self].getDescendants, parameter[]] return[call[name[map], parameter[name[api]...
keyword[def] identifier[getDescendantsUIDs] ( identifier[self] , identifier[all_descendants] = keyword[False] ): literal[string] identifier[descendants] = identifier[self] . identifier[getDescendants] ( identifier[all_descendants] = identifier[all_descendants] ) keyword[return] identifier...
def getDescendantsUIDs(self, all_descendants=False): """Returns the UIDs of the descendant Analysis Requests This method is used as metadata """ descendants = self.getDescendants(all_descendants=all_descendants) return map(api.get_uid, descendants)
def get(self, slide_id, default=None): """ Return the slide identified by integer *slide_id* in this presentation, or *default* if not found. """ slide = self.part.get_slide(slide_id) if slide is None: return default return slide
def function[get, parameter[self, slide_id, default]]: constant[ Return the slide identified by integer *slide_id* in this presentation, or *default* if not found. ] variable[slide] assign[=] call[name[self].part.get_slide, parameter[name[slide_id]]] if compare[name[slide...
keyword[def] identifier[get] ( identifier[self] , identifier[slide_id] , identifier[default] = keyword[None] ): literal[string] identifier[slide] = identifier[self] . identifier[part] . identifier[get_slide] ( identifier[slide_id] ) keyword[if] identifier[slide] keyword[is] keyword[None...
def get(self, slide_id, default=None): """ Return the slide identified by integer *slide_id* in this presentation, or *default* if not found. """ slide = self.part.get_slide(slide_id) if slide is None: return default # depends on [control=['if'], data=[]] return slide
def load_freesurfer_geometry(filename, to='mesh', warn=False): ''' load_freesurfer_geometry(filename) yields the data stored at the freesurfer geometry file given by filename. The optional argument 'to' may be used to change the kind of data that is returned. The following are valid settings fo...
def function[load_freesurfer_geometry, parameter[filename, to, warn]]: constant[ load_freesurfer_geometry(filename) yields the data stored at the freesurfer geometry file given by filename. The optional argument 'to' may be used to change the kind of data that is returned. The following are...
keyword[def] identifier[load_freesurfer_geometry] ( identifier[filename] , identifier[to] = literal[string] , identifier[warn] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[warn] : keyword[with] identifier[warnings] . identifier[catch_warnings] (): identif...
def load_freesurfer_geometry(filename, to='mesh', warn=False): """ load_freesurfer_geometry(filename) yields the data stored at the freesurfer geometry file given by filename. The optional argument 'to' may be used to change the kind of data that is returned. The following are valid settings fo...
def _authenticate(self): """Authenticate user and generate token.""" self.cleanup_headers() url = LOGIN_ENDPOINT data = self.query( url, method='POST', extra_params={ 'email': self.__username, 'password': self.__password...
def function[_authenticate, parameter[self]]: constant[Authenticate user and generate token.] call[name[self].cleanup_headers, parameter[]] variable[url] assign[=] name[LOGIN_ENDPOINT] variable[data] assign[=] call[name[self].query, parameter[name[url]]] if <ast.BoolOp object at ...
keyword[def] identifier[_authenticate] ( identifier[self] ): literal[string] identifier[self] . identifier[cleanup_headers] () identifier[url] = identifier[LOGIN_ENDPOINT] identifier[data] = identifier[self] . identifier[query] ( identifier[url] , identifier[met...
def _authenticate(self): """Authenticate user and generate token.""" self.cleanup_headers() url = LOGIN_ENDPOINT data = self.query(url, method='POST', extra_params={'email': self.__username, 'password': self.__password}) if isinstance(data, dict) and data.get('success'): data = data.get('dat...
def get_log_path(config_file_name): '''generate stdout and stderr log path''' stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout') stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr') return stdout_full_path, stderr_full_path
def function[get_log_path, parameter[config_file_name]]: constant[generate stdout and stderr log path] variable[stdout_full_path] assign[=] call[name[os].path.join, parameter[name[NNICTL_HOME_DIR], name[config_file_name], constant[stdout]]] variable[stderr_full_path] assign[=] call[name[os].path...
keyword[def] identifier[get_log_path] ( identifier[config_file_name] ): literal[string] identifier[stdout_full_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[NNICTL_HOME_DIR] , identifier[config_file_name] , literal[string] ) identifier[stderr_full_path] = identifier[os] . i...
def get_log_path(config_file_name): """generate stdout and stderr log path""" stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout') stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr') return (stdout_full_path, stderr_full_path)
def is_public(self): """Return True iff this function should be considered public.""" if self.dunder_all is not None: return self.name in self.dunder_all else: return not self.name.startswith('_')
def function[is_public, parameter[self]]: constant[Return True iff this function should be considered public.] if compare[name[self].dunder_all is_not constant[None]] begin[:] return[compare[name[self].name in name[self].dunder_all]]
keyword[def] identifier[is_public] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[dunder_all] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[self] . identifier[name] keyword[in] identifier[self] . identifier[dunder_all] ...
def is_public(self): """Return True iff this function should be considered public.""" if self.dunder_all is not None: return self.name in self.dunder_all # depends on [control=['if'], data=[]] else: return not self.name.startswith('_')
async def get_target(config, url): """ Given a URL, get the webmention endpoint """ previous = config.cache.get( 'target', url, schema_version=SCHEMA_VERSION) if config.cache else None headers = previous.caching if previous else None request = await utils.retry_get(config, url, headers=header...
<ast.AsyncFunctionDef object at 0x7da18f00eec0>
keyword[async] keyword[def] identifier[get_target] ( identifier[config] , identifier[url] ): literal[string] identifier[previous] = identifier[config] . identifier[cache] . identifier[get] ( literal[string] , identifier[url] , identifier[schema_version] = identifier[SCHEMA_VERSION] ) keyword[if] id...
async def get_target(config, url): """ Given a URL, get the webmention endpoint """ previous = config.cache.get('target', url, schema_version=SCHEMA_VERSION) if config.cache else None headers = previous.caching if previous else None request = await utils.retry_get(config, url, headers=headers) if no...
def _se_all(self): """Standard errors (SE) for all parameters, including the intercept.""" err = np.expand_dims(self._ms_err, axis=1) t1 = np.diagonal( np.linalg.inv(np.matmul(self.xwins.swapaxes(1, 2), self.xwins)), axis1=1, axis2=2, ) ...
def function[_se_all, parameter[self]]: constant[Standard errors (SE) for all parameters, including the intercept.] variable[err] assign[=] call[name[np].expand_dims, parameter[name[self]._ms_err]] variable[t1] assign[=] call[name[np].diagonal, parameter[call[name[np].linalg.inv, parameter[call[...
keyword[def] identifier[_se_all] ( identifier[self] ): literal[string] identifier[err] = identifier[np] . identifier[expand_dims] ( identifier[self] . identifier[_ms_err] , identifier[axis] = literal[int] ) identifier[t1] = identifier[np] . identifier[diagonal] ( identifier[np...
def _se_all(self): """Standard errors (SE) for all parameters, including the intercept.""" err = np.expand_dims(self._ms_err, axis=1) t1 = np.diagonal(np.linalg.inv(np.matmul(self.xwins.swapaxes(1, 2), self.xwins)), axis1=1, axis2=2) return np.squeeze(np.sqrt(t1 * err))
def get_earliest_start_date_from_program(program): """ Get the earliest date that one of the courses in the program was available. For the sake of emails to new learners, we treat this as the program start date. Arguemnts: program (dict): Program data from Course Catalog API returns: ...
def function[get_earliest_start_date_from_program, parameter[program]]: constant[ Get the earliest date that one of the courses in the program was available. For the sake of emails to new learners, we treat this as the program start date. Arguemnts: program (dict): Program data from Course ...
keyword[def] identifier[get_earliest_start_date_from_program] ( identifier[program] ): literal[string] identifier[start_dates] =[] keyword[for] identifier[course] keyword[in] identifier[program] . identifier[get] ( literal[string] ,[]): keyword[for] identifier[run] keyword[in] identifie...
def get_earliest_start_date_from_program(program): """ Get the earliest date that one of the courses in the program was available. For the sake of emails to new learners, we treat this as the program start date. Arguemnts: program (dict): Program data from Course Catalog API returns: ...
def _notify_report(self, device_uuid, event_name, report): """Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug("Dropping report f...
def function[_notify_report, parameter[self, device_uuid, event_name, report]]: constant[Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager ] if compare[name[device_uuid] <ast.NotIn object at 0x7da2590d7190> ...
keyword[def] identifier[_notify_report] ( identifier[self] , identifier[device_uuid] , identifier[event_name] , identifier[report] ): literal[string] keyword[if] identifier[device_uuid] keyword[not] keyword[in] identifier[self] . identifier[_connections] : identifier[self] . ident...
def _notify_report(self, device_uuid, event_name, report): """Notify that a report has been received from a device. This routine is called synchronously in the event loop by the DeviceManager """ if device_uuid not in self._connections: self._logger.debug('Dropping report for device wit...
def register(self, request_class: Request, handler_factory: Callable[[], Handler]) -> None: """ Register the handler for the command :param request_class: The command or event to dispatch. It must implement getKey() :param handler_factory: A factory method to create the handler to dispat...
def function[register, parameter[self, request_class, handler_factory]]: constant[ Register the handler for the command :param request_class: The command or event to dispatch. It must implement getKey() :param handler_factory: A factory method to create the handler to dispatch to ...
keyword[def] identifier[register] ( identifier[self] , identifier[request_class] : identifier[Request] , identifier[handler_factory] : identifier[Callable] [[], identifier[Handler] ])-> keyword[None] : literal[string] identifier[key] = identifier[request_class] . identifier[__name__] iden...
def register(self, request_class: Request, handler_factory: Callable[[], Handler]) -> None: """ Register the handler for the command :param request_class: The command or event to dispatch. It must implement getKey() :param handler_factory: A factory method to create the handler to dispatch t...
def pid_exists(pid): """Check whether pid exists in the current process table.""" if pid < 0: return False try: os.kill(pid, 0) except OSError as e: return e.errno == errno.EPERM else: return True
def function[pid_exists, parameter[pid]]: constant[Check whether pid exists in the current process table.] if compare[name[pid] less[<] constant[0]] begin[:] return[constant[False]] <ast.Try object at 0x7da20c6ab760>
keyword[def] identifier[pid_exists] ( identifier[pid] ): literal[string] keyword[if] identifier[pid] < literal[int] : keyword[return] keyword[False] keyword[try] : identifier[os] . identifier[kill] ( identifier[pid] , literal[int] ) keyword[except] identifier[OSError] keywo...
def pid_exists(pid): """Check whether pid exists in the current process table.""" if pid < 0: return False # depends on [control=['if'], data=[]] try: os.kill(pid, 0) # depends on [control=['try'], data=[]] except OSError as e: return e.errno == errno.EPERM # depends on [contr...
def Upload(self, fd, sign_fn=None): """Uploads data from a given stream and signs them with a given key.""" if not sign_fn: raise ValueError("sign_fn can't be empty. " "See DefaultUploadSigner as a possible option.") args = binary_management_pb2.ApiUploadGrrBinaryArgs( ...
def function[Upload, parameter[self, fd, sign_fn]]: constant[Uploads data from a given stream and signs them with a given key.] if <ast.UnaryOp object at 0x7da1b1b98970> begin[:] <ast.Raise object at 0x7da1b1b98b50> variable[args] assign[=] call[name[binary_management_pb2].ApiUploadGrrBi...
keyword[def] identifier[Upload] ( identifier[self] , identifier[fd] , identifier[sign_fn] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[sign_fn] : keyword[raise] identifier[ValueError] ( literal[string] literal[string] ) identifier[args] = identifier[binary...
def Upload(self, fd, sign_fn=None): """Uploads data from a given stream and signs them with a given key.""" if not sign_fn: raise ValueError("sign_fn can't be empty. See DefaultUploadSigner as a possible option.") # depends on [control=['if'], data=[]] args = binary_management_pb2.ApiUploadGrrBinar...
def save_statement(self, statement): """ Save xAPI statement. Arguments: statement (EnterpriseStatement): xAPI Statement to send to the LRS. Raises: ClientError: If xAPI statement fails to save. """ response = self.lrs.save_statement(statement) ...
def function[save_statement, parameter[self, statement]]: constant[ Save xAPI statement. Arguments: statement (EnterpriseStatement): xAPI Statement to send to the LRS. Raises: ClientError: If xAPI statement fails to save. ] variable[response] ass...
keyword[def] identifier[save_statement] ( identifier[self] , identifier[statement] ): literal[string] identifier[response] = identifier[self] . identifier[lrs] . identifier[save_statement] ( identifier[statement] ) keyword[if] keyword[not] identifier[response] : keyword[rai...
def save_statement(self, statement): """ Save xAPI statement. Arguments: statement (EnterpriseStatement): xAPI Statement to send to the LRS. Raises: ClientError: If xAPI statement fails to save. """ response = self.lrs.save_statement(statement) if no...
def top_stories(self, limit=5, first=None, last=None, json=False): """ Get the top story objects list params : limit = (default | 5) number of story objects needed json = (default | False) The method uses asynchronous grequest form gevent """ ...
def function[top_stories, parameter[self, limit, first, last, json]]: constant[ Get the top story objects list params : limit = (default | 5) number of story objects needed json = (default | False) The method uses asynchronous grequest form gevent ] ...
keyword[def] identifier[top_stories] ( identifier[self] , identifier[limit] = literal[int] , identifier[first] = keyword[None] , identifier[last] = keyword[None] , identifier[json] = keyword[False] ): literal[string] identifier[story_ids] = identifier[requests] . identifier[get] ( identifier[TOP_S...
def top_stories(self, limit=5, first=None, last=None, json=False): """ Get the top story objects list params : limit = (default | 5) number of story objects needed json = (default | False) The method uses asynchronous grequest form gevent """ story_id...
def _compute_term2(self, C, mag, r): """ This computes the term f2 equation 8 Drouet & Cotton (2015) """ return (C['c4'] + C['c5'] * mag) * \ np.log(np.sqrt(r**2 + C['c6']**2)) + C['c7'] * r
def function[_compute_term2, parameter[self, C, mag, r]]: constant[ This computes the term f2 equation 8 Drouet & Cotton (2015) ] return[binary_operation[binary_operation[binary_operation[call[name[C]][constant[c4]] + binary_operation[call[name[C]][constant[c5]] * name[mag]]] * call[name[np]...
keyword[def] identifier[_compute_term2] ( identifier[self] , identifier[C] , identifier[mag] , identifier[r] ): literal[string] keyword[return] ( identifier[C] [ literal[string] ]+ identifier[C] [ literal[string] ]* identifier[mag] )* identifier[np] . identifier[log] ( identifier[np] . identifier[s...
def _compute_term2(self, C, mag, r): """ This computes the term f2 equation 8 Drouet & Cotton (2015) """ return (C['c4'] + C['c5'] * mag) * np.log(np.sqrt(r ** 2 + C['c6'] ** 2)) + C['c7'] * r
def _simplify(self): """ RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements """ r = self.region r = self._simplify_gotos(r) r = self._simplify_ifs(r) self.result = r
def function[_simplify, parameter[self]]: constant[ RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements ] variable[r] assign[=] name[self].region variable[r] assign[=] call[name[self]._simplify...
keyword[def] identifier[_simplify] ( identifier[self] ): literal[string] identifier[r] = identifier[self] . identifier[region] identifier[r] = identifier[self] . identifier[_simplify_gotos] ( identifier[r] ) identifier[r] = identifier[self] . identifier[_simplify_ifs] ( identifi...
def _simplify(self): """ RegionSimplifier performs the following simplifications: - Remove redundant Gotos - Remove redundant If/If-else statements """ r = self.region r = self._simplify_gotos(r) r = self._simplify_ifs(r) self.result = r
def merge_data(path_data, request_data): """ Merge data from the URI path and the request. Path data wins. """ merged = request_data.copy() if request_data else {} merged.update(path_data or {}) return merged
def function[merge_data, parameter[path_data, request_data]]: constant[ Merge data from the URI path and the request. Path data wins. ] variable[merged] assign[=] <ast.IfExp object at 0x7da1b0c40820> call[name[merged].update, parameter[<ast.BoolOp object at 0x7da1b0c3f5b0>]] re...
keyword[def] identifier[merge_data] ( identifier[path_data] , identifier[request_data] ): literal[string] identifier[merged] = identifier[request_data] . identifier[copy] () keyword[if] identifier[request_data] keyword[else] {} identifier[merged] . identifier[update] ( identifier[path_data] keyword...
def merge_data(path_data, request_data): """ Merge data from the URI path and the request. Path data wins. """ merged = request_data.copy() if request_data else {} merged.update(path_data or {}) return merged
def dumps(obj, **kwargs) -> str: """ Serialize a BioC ``obj`` to a JSON formatted ``str``. """ return json.dumps(obj, cls=BioCJSONEncoder, **kwargs)
def function[dumps, parameter[obj]]: constant[ Serialize a BioC ``obj`` to a JSON formatted ``str``. ] return[call[name[json].dumps, parameter[name[obj]]]]
keyword[def] identifier[dumps] ( identifier[obj] ,** identifier[kwargs] )-> identifier[str] : literal[string] keyword[return] identifier[json] . identifier[dumps] ( identifier[obj] , identifier[cls] = identifier[BioCJSONEncoder] ,** identifier[kwargs] )
def dumps(obj, **kwargs) -> str: """ Serialize a BioC ``obj`` to a JSON formatted ``str``. """ return json.dumps(obj, cls=BioCJSONEncoder, **kwargs)
def pasa(args): """ %prog ${pasadb}.assemblies.fasta ${pasadb}.pasa_assemblies.gff3 Wraps `pasa_asmbls_to_training_set.dbi`. """ from jcvi.formats.base import SetFile from jcvi.formats.gff import Gff p = OptionParser(pasa.__doc__) p.set_home("pasa") opts, args = p.parse_args(args) ...
def function[pasa, parameter[args]]: constant[ %prog ${pasadb}.assemblies.fasta ${pasadb}.pasa_assemblies.gff3 Wraps `pasa_asmbls_to_training_set.dbi`. ] from relative_module[jcvi.formats.base] import module[SetFile] from relative_module[jcvi.formats.gff] import module[Gff] variable...
keyword[def] identifier[pasa] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[formats] . identifier[base] keyword[import] identifier[SetFile] keyword[from] identifier[jcvi] . identifier[formats] . identifier[gff] keyword[import] identifier[Gff] identifie...
def pasa(args): """ %prog ${pasadb}.assemblies.fasta ${pasadb}.pasa_assemblies.gff3 Wraps `pasa_asmbls_to_training_set.dbi`. """ from jcvi.formats.base import SetFile from jcvi.formats.gff import Gff p = OptionParser(pasa.__doc__) p.set_home('pasa') (opts, args) = p.parse_args(args)...
def _translate_sext(self, oprnd1, oprnd2, oprnd3): """Return a formula representation of a SEXT instruction. """ assert oprnd1.size and oprnd3.size op1_var = self._translate_src_oprnd(oprnd1) op3_var, op3_var_constrs = self._translate_dst_oprnd(oprnd3) if oprnd3.size > ...
def function[_translate_sext, parameter[self, oprnd1, oprnd2, oprnd3]]: constant[Return a formula representation of a SEXT instruction. ] assert[<ast.BoolOp object at 0x7da1b0980220>] variable[op1_var] assign[=] call[name[self]._translate_src_oprnd, parameter[name[oprnd1]]] <ast.Tupl...
keyword[def] identifier[_translate_sext] ( identifier[self] , identifier[oprnd1] , identifier[oprnd2] , identifier[oprnd3] ): literal[string] keyword[assert] identifier[oprnd1] . identifier[size] keyword[and] identifier[oprnd3] . identifier[size] identifier[op1_var] = identifier[self]...
def _translate_sext(self, oprnd1, oprnd2, oprnd3): """Return a formula representation of a SEXT instruction. """ assert oprnd1.size and oprnd3.size op1_var = self._translate_src_oprnd(oprnd1) (op3_var, op3_var_constrs) = self._translate_dst_oprnd(oprnd3) if oprnd3.size > oprnd1.size: ...
def run_step(context): """Print debug info to console. context is a dictionary or dictionary-like. If you use pypyr.steps.debug as a simple step (i.e you do NOT specify the debug input context), it will just dump the entire context to stdout. Configure the debug step with the following optional c...
def function[run_step, parameter[context]]: constant[Print debug info to console. context is a dictionary or dictionary-like. If you use pypyr.steps.debug as a simple step (i.e you do NOT specify the debug input context), it will just dump the entire context to stdout. Configure the debug ste...
keyword[def] identifier[run_step] ( identifier[context] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) identifier[debug] = identifier[context] . identifier[get] ( literal[string] , keyword[None] ) keyword[if] identifier[debug] : identifier[keys] = identi...
def run_step(context): """Print debug info to console. context is a dictionary or dictionary-like. If you use pypyr.steps.debug as a simple step (i.e you do NOT specify the debug input context), it will just dump the entire context to stdout. Configure the debug step with the following optional c...
def _predict_forest(model, X, joint_contribution=False): """ For a given RandomForestRegressor, RandomForestClassifier, ExtraTreesRegressor, or ExtraTreesClassifier returns a triple of [prediction, bias and feature_contributions], such that prediction ≈ bias + feature_contributions. """ bias...
def function[_predict_forest, parameter[model, X, joint_contribution]]: constant[ For a given RandomForestRegressor, RandomForestClassifier, ExtraTreesRegressor, or ExtraTreesClassifier returns a triple of [prediction, bias and feature_contributions], such that prediction ≈ bias + feature_contri...
keyword[def] identifier[_predict_forest] ( identifier[model] , identifier[X] , identifier[joint_contribution] = keyword[False] ): literal[string] identifier[biases] =[] identifier[contributions] =[] identifier[predictions] =[] keyword[if] identifier[joint_contribution] : keyword...
def _predict_forest(model, X, joint_contribution=False): """ For a given RandomForestRegressor, RandomForestClassifier, ExtraTreesRegressor, or ExtraTreesClassifier returns a triple of [prediction, bias and feature_contributions], such that prediction ≈ bias + feature_contributions. """ bias...
def dist(self, src, tar): """Return the normalized indel distance between two strings. This is equivalent to normalized Levenshtein distance, when only inserts and deletes are possible. Parameters ---------- src : str Source string for comparison tar...
def function[dist, parameter[self, src, tar]]: constant[Return the normalized indel distance between two strings. This is equivalent to normalized Levenshtein distance, when only inserts and deletes are possible. Parameters ---------- src : str Source string...
keyword[def] identifier[dist] ( identifier[self] , identifier[src] , identifier[tar] ): literal[string] keyword[if] identifier[src] == identifier[tar] : keyword[return] literal[int] keyword[return] identifier[self] . identifier[dist_abs] ( identifier[src] , identifier[tar]...
def dist(self, src, tar): """Return the normalized indel distance between two strings. This is equivalent to normalized Levenshtein distance, when only inserts and deletes are possible. Parameters ---------- src : str Source string for comparison tar : s...
def mementoweb_api_tags(url): """ Parse list of :class:`TimeResource` objects based on the mementoweb.org. Args: url (str): Any url. Returns: list: :class:`TimeResource` objects. """ memento_url = "http://labs.mementoweb.org/timemap/json/" r = requests.get(memento_url + ur...
def function[mementoweb_api_tags, parameter[url]]: constant[ Parse list of :class:`TimeResource` objects based on the mementoweb.org. Args: url (str): Any url. Returns: list: :class:`TimeResource` objects. ] variable[memento_url] assign[=] constant[http://labs.mementowe...
keyword[def] identifier[mementoweb_api_tags] ( identifier[url] ): literal[string] identifier[memento_url] = literal[string] identifier[r] = identifier[requests] . identifier[get] ( identifier[memento_url] + identifier[url] ) keyword[if] identifier[r] . identifier[status_code] != literal[int] ...
def mementoweb_api_tags(url): """ Parse list of :class:`TimeResource` objects based on the mementoweb.org. Args: url (str): Any url. Returns: list: :class:`TimeResource` objects. """ memento_url = 'http://labs.mementoweb.org/timemap/json/' r = requests.get(memento_url + url...
def delete(self): """ Destructor. """ if self.maplesat: pysolvers.maplesat_del(self.maplesat) self.maplesat = None if self.prfile: self.prfile.close()
def function[delete, parameter[self]]: constant[ Destructor. ] if name[self].maplesat begin[:] call[name[pysolvers].maplesat_del, parameter[name[self].maplesat]] name[self].maplesat assign[=] constant[None] if name[self].prfile begin[:]...
keyword[def] identifier[delete] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[maplesat] : identifier[pysolvers] . identifier[maplesat_del] ( identifier[self] . identifier[maplesat] ) identifier[self] . identifier[maplesat] = keyword[None...
def delete(self): """ Destructor. """ if self.maplesat: pysolvers.maplesat_del(self.maplesat) self.maplesat = None if self.prfile: self.prfile.close() # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]]
def from_pairs(cls, doc, pairs): """ Construct an enumeration from an iterable of pairs. :param doc: See `Enum.__init__`. :type pairs: ``Iterable[Tuple[unicode, unicode]]`` :param pairs: Iterable to construct the enumeration from. :rtype: Enum """ values ...
def function[from_pairs, parameter[cls, doc, pairs]]: constant[ Construct an enumeration from an iterable of pairs. :param doc: See `Enum.__init__`. :type pairs: ``Iterable[Tuple[unicode, unicode]]`` :param pairs: Iterable to construct the enumeration from. :rtype: Enum ...
keyword[def] identifier[from_pairs] ( identifier[cls] , identifier[doc] , identifier[pairs] ): literal[string] identifier[values] =( identifier[EnumItem] ( identifier[value] , identifier[desc] ) keyword[for] identifier[value] , identifier[desc] keyword[in] identifier[pairs] ) keyword[re...
def from_pairs(cls, doc, pairs): """ Construct an enumeration from an iterable of pairs. :param doc: See `Enum.__init__`. :type pairs: ``Iterable[Tuple[unicode, unicode]]`` :param pairs: Iterable to construct the enumeration from. :rtype: Enum """ values = (EnumI...
def database_describe(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /database-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Databases#API-method%3A-%2Fdatabase-xxxx%2Fdescribe """ return DXHTTPRequest('/%s/describe' % ob...
def function[database_describe, parameter[object_id, input_params, always_retry]]: constant[ Invokes the /database-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Databases#API-method%3A-%2Fdatabase-xxxx%2Fdescribe ] return[call[name[DXHTTPReques...
keyword[def] identifier[database_describe] ( identifier[object_id] , identifier[input_params] ={}, identifier[always_retry] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[DXHTTPRequest] ( literal[string] % identifier[object_id] , identifier[input_params] , identifier[...
def database_describe(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /database-xxxx/describe API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Databases#API-method%3A-%2Fdatabase-xxxx%2Fdescribe """ return DXHTTPRequest('/%s/describe' % ob...
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() ...
def function[_adjust_scrollbars, parameter[self]]: constant[ Expands the vertical scrollbar beyond the range set by Qt. ] variable[document] assign[=] call[name[self]._control.document, parameter[]] variable[scrollbar] assign[=] call[name[self]._control.verticalScrollBar, parameter[]] ...
keyword[def] identifier[_adjust_scrollbars] ( identifier[self] ): literal[string] identifier[document] = identifier[self] . identifier[_control] . identifier[document] () identifier[scrollbar] = identifier[self] . identifier[_control] . identifier[verticalScrollBar] () ...
def _adjust_scrollbars(self): """ Expands the vertical scrollbar beyond the range set by Qt. """ # This code is adapted from _q_adjustScrollbars in qplaintextedit.cpp # and qtextedit.cpp. document = self._control.document() scrollbar = self._control.verticalScrollBar() viewport_height = ...
def feed(self, data): """ Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes`` """ self._lock.acquire() try: if self._event is no...
def function[feed, parameter[self, data]]: constant[ Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes`` ] call[name[self]._lock.acquire, parameter[...
keyword[def] identifier[feed] ( identifier[self] , identifier[data] ): literal[string] identifier[self] . identifier[_lock] . identifier[acquire] () keyword[try] : keyword[if] identifier[self] . identifier[_event] keyword[is] keyword[not] keyword[None] : i...
def feed(self, data): """ Feed new data into this pipe. This method is assumed to be called from a separate thread, so synchronization is done. :param data: the data to add, as a ``str`` or ``bytes`` """ self._lock.acquire() try: if self._event is not None: ...
def fermi_fourier_trans_inverse_conjugate_4(qubits): """We will need to map the momentum states in the reversed order for spin-down states to the position picture. This transformation can be simply implemented the complex conjugate of the former one. We only need to change the S gate to S* = S ** 3. ...
def function[fermi_fourier_trans_inverse_conjugate_4, parameter[qubits]]: constant[We will need to map the momentum states in the reversed order for spin-down states to the position picture. This transformation can be simply implemented the complex conjugate of the former one. We only need to change...
keyword[def] identifier[fermi_fourier_trans_inverse_conjugate_4] ( identifier[qubits] ): literal[string] keyword[yield] identifier[fswap] ( identifier[qubits] [ literal[int] ], identifier[qubits] [ literal[int] ]), keyword[yield] identifier[fermi_fourier_trans_2] ( identifier[qubits] [ literal[int]...
def fermi_fourier_trans_inverse_conjugate_4(qubits): """We will need to map the momentum states in the reversed order for spin-down states to the position picture. This transformation can be simply implemented the complex conjugate of the former one. We only need to change the S gate to S* = S ** 3. ...
def get_file(self, filename, dir='static'): """ get_file will search from apps directory """ if os.path.exists(filename): return filename dirs = self.apps if dir: fname = os.path.join(dir, filename) else: fname = filename ...
def function[get_file, parameter[self, filename, dir]]: constant[ get_file will search from apps directory ] if call[name[os].path.exists, parameter[name[filename]]] begin[:] return[name[filename]] variable[dirs] assign[=] name[self].apps if name[dir] begin[:] ...
keyword[def] identifier[get_file] ( identifier[self] , identifier[filename] , identifier[dir] = literal[string] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[filename] ): keyword[return] identifier[filename] identifier[di...
def get_file(self, filename, dir='static'): """ get_file will search from apps directory """ if os.path.exists(filename): return filename # depends on [control=['if'], data=[]] dirs = self.apps if dir: fname = os.path.join(dir, filename) # depends on [control=['if'], da...
def patched_function(self, *args, **kwargs): """ Step 3. Wrapped function calling. """ result = self.function(*args, **kwargs) self.validate(result) return result
def function[patched_function, parameter[self]]: constant[ Step 3. Wrapped function calling. ] variable[result] assign[=] call[name[self].function, parameter[<ast.Starred object at 0x7da1b0578bb0>]] call[name[self].validate, parameter[name[result]]] return[name[result]]
keyword[def] identifier[patched_function] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[result] = identifier[self] . identifier[function] (* identifier[args] ,** identifier[kwargs] ) identifier[self] . identifier[validate] ( identifier[result] ...
def patched_function(self, *args, **kwargs): """ Step 3. Wrapped function calling. """ result = self.function(*args, **kwargs) self.validate(result) return result
def _add_resourcegroupitem(group_item, scenario_id): """ Add a single resource group item (no DB flush, as it's an internal function) """ if group_item.id and group_item.id > 0: try: group_item_i = db.DBSession.query(ResourceGroupItem).filter(ResourceGroupItem.id == group_item.id...
def function[_add_resourcegroupitem, parameter[group_item, scenario_id]]: constant[ Add a single resource group item (no DB flush, as it's an internal function) ] if <ast.BoolOp object at 0x7da20cabdf00> begin[:] <ast.Try object at 0x7da20cabdd80> variable[ref_key] assign[=] ...
keyword[def] identifier[_add_resourcegroupitem] ( identifier[group_item] , identifier[scenario_id] ): literal[string] keyword[if] identifier[group_item] . identifier[id] keyword[and] identifier[group_item] . identifier[id] > literal[int] : keyword[try] : identifier[group_item_i] = ...
def _add_resourcegroupitem(group_item, scenario_id): """ Add a single resource group item (no DB flush, as it's an internal function) """ if group_item.id and group_item.id > 0: try: group_item_i = db.DBSession.query(ResourceGroupItem).filter(ResourceGroupItem.id == group_item.id...
def fidx(right, left, left_fk=None): """ Re-indexes a series or data frame (right) to align with another (left) series or data frame via foreign key relationship. The index of the right must be unique. This is similar to misc.reindex, but allows for data frame re-indexes and supports re-indexin...
def function[fidx, parameter[right, left, left_fk]]: constant[ Re-indexes a series or data frame (right) to align with another (left) series or data frame via foreign key relationship. The index of the right must be unique. This is similar to misc.reindex, but allows for data frame re-index...
keyword[def] identifier[fidx] ( identifier[right] , identifier[left] , identifier[left_fk] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[right] . identifier[index] . identifier[is_unique] : keyword[raise] identifier[ValueError] ( literal[string] ) ...
def fidx(right, left, left_fk=None): """ Re-indexes a series or data frame (right) to align with another (left) series or data frame via foreign key relationship. The index of the right must be unique. This is similar to misc.reindex, but allows for data frame re-indexes and supports re-indexin...
def delete(args): """ cdstarcat delete OID Delete an object specified by OID from CDSTAR. """ with _catalog(args) as cat: n = len(cat) cat.delete(args.args[0]) args.log.info('{0} objects deleted'.format(n - len(cat))) return n - len(cat)
def function[delete, parameter[args]]: constant[ cdstarcat delete OID Delete an object specified by OID from CDSTAR. ] with call[name[_catalog], parameter[name[args]]] begin[:] variable[n] assign[=] call[name[len], parameter[name[cat]]] call[name[cat].delete,...
keyword[def] identifier[delete] ( identifier[args] ): literal[string] keyword[with] identifier[_catalog] ( identifier[args] ) keyword[as] identifier[cat] : identifier[n] = identifier[len] ( identifier[cat] ) identifier[cat] . identifier[delete] ( identifier[args] . identifier[args] [ li...
def delete(args): """ cdstarcat delete OID Delete an object specified by OID from CDSTAR. """ with _catalog(args) as cat: n = len(cat) cat.delete(args.args[0]) args.log.info('{0} objects deleted'.format(n - len(cat))) return n - len(cat) # depends on [control=['with...
def describe(name, tags=None, region=None, key=None, keyid=None, profile=None): ''' Return RDS instance details. CLI example:: salt myminion boto_rds.describe myrds ''' res = __salt__['boto_rds.exists'](name, tags, region, key, keyid, pro...
def function[describe, parameter[name, tags, region, key, keyid, profile]]: constant[ Return RDS instance details. CLI example:: salt myminion boto_rds.describe myrds ] variable[res] assign[=] call[call[name[__salt__]][constant[boto_rds.exists]], parameter[name[name], name[tags], ...
keyword[def] identifier[describe] ( identifier[name] , identifier[tags] = keyword[None] , identifier[region] = keyword[None] , identifier[key] = keyword[None] , identifier[keyid] = keyword[None] , identifier[profile] = keyword[None] ): literal[string] identifier[res] = identifier[__salt__] [ literal[strin...
def describe(name, tags=None, region=None, key=None, keyid=None, profile=None): """ Return RDS instance details. CLI example:: salt myminion boto_rds.describe myrds """ res = __salt__['boto_rds.exists'](name, tags, region, key, keyid, profile) if not res.get('exists'): return ...
def calibrate_white(self): """ The RGB raw values are on a scale of 0-1020 but you never see a value anywhere close to 1020. This function is designed to be called when the sensor is placed over a white object in order to figure out what are the maximum RGB values the robot can ...
def function[calibrate_white, parameter[self]]: constant[ The RGB raw values are on a scale of 0-1020 but you never see a value anywhere close to 1020. This function is designed to be called when the sensor is placed over a white object in order to figure out what are the maximu...
keyword[def] identifier[calibrate_white] ( identifier[self] ): literal[string] ( identifier[self] . identifier[red_max] , identifier[self] . identifier[green_max] , identifier[self] . identifier[blue_max] )= identifier[self] . identifier[raw]
def calibrate_white(self): """ The RGB raw values are on a scale of 0-1020 but you never see a value anywhere close to 1020. This function is designed to be called when the sensor is placed over a white object in order to figure out what are the maximum RGB values the robot can expe...
def V_super_stock(self, V_stock, C_super_stock): """Return the volume of super (more concentrated) stock that must be diluted for the desired stock volume and stock concentration. :param V_stock: Volume of the stock of material :type V_stock: float :param C_super_stock: Concentr...
def function[V_super_stock, parameter[self, V_stock, C_super_stock]]: constant[Return the volume of super (more concentrated) stock that must be diluted for the desired stock volume and stock concentration. :param V_stock: Volume of the stock of material :type V_stock: float :pa...
keyword[def] identifier[V_super_stock] ( identifier[self] , identifier[V_stock] , identifier[C_super_stock] ): literal[string] keyword[return] identifier[Stock] . identifier[V_super_stock] ( identifier[self] , identifier[V_stock] , identifier[self] . identifier[_C_stock] , identifier[C_super_stock...
def V_super_stock(self, V_stock, C_super_stock): """Return the volume of super (more concentrated) stock that must be diluted for the desired stock volume and stock concentration. :param V_stock: Volume of the stock of material :type V_stock: float :param C_super_stock: Concentratio...
def get_max_tail_check(y_Arai, y_tail, t_Arai, tail_temps, n_tail): """ input: y_Arai, y_tail, t_Arai, tail_temps, n_tail output: max_check, diffs """ if not n_tail: return float('nan'), [] tail_compare = [] y_Arai_compare = [] for temp in tail_temps[:n_tail]: tail_index ...
def function[get_max_tail_check, parameter[y_Arai, y_tail, t_Arai, tail_temps, n_tail]]: constant[ input: y_Arai, y_tail, t_Arai, tail_temps, n_tail output: max_check, diffs ] if <ast.UnaryOp object at 0x7da20e955180> begin[:] return[tuple[[<ast.Call object at 0x7da20e957520>, <ast.L...
keyword[def] identifier[get_max_tail_check] ( identifier[y_Arai] , identifier[y_tail] , identifier[t_Arai] , identifier[tail_temps] , identifier[n_tail] ): literal[string] keyword[if] keyword[not] identifier[n_tail] : keyword[return] identifier[float] ( literal[string] ),[] identifier[tail...
def get_max_tail_check(y_Arai, y_tail, t_Arai, tail_temps, n_tail): """ input: y_Arai, y_tail, t_Arai, tail_temps, n_tail output: max_check, diffs """ if not n_tail: return (float('nan'), []) # depends on [control=['if'], data=[]] tail_compare = [] y_Arai_compare = [] for temp i...
def clean_features(df): """Fixes up columns of the passed DataFrame, such as casting T/F columns to boolean and filling in NaNs for team and opp. :param df: DataFrame of play-by-play data. :returns: Dataframe with cleaned columns. """ df = pd.DataFrame(df) bool_vals = set([True, False, Non...
def function[clean_features, parameter[df]]: constant[Fixes up columns of the passed DataFrame, such as casting T/F columns to boolean and filling in NaNs for team and opp. :param df: DataFrame of play-by-play data. :returns: Dataframe with cleaned columns. ] variable[df] assign[=] call...
keyword[def] identifier[clean_features] ( identifier[df] ): literal[string] identifier[df] = identifier[pd] . identifier[DataFrame] ( identifier[df] ) identifier[bool_vals] = identifier[set] ([ keyword[True] , keyword[False] , keyword[None] , identifier[np] . identifier[nan] ]) identifier[sparse...
def clean_features(df): """Fixes up columns of the passed DataFrame, such as casting T/F columns to boolean and filling in NaNs for team and opp. :param df: DataFrame of play-by-play data. :returns: Dataframe with cleaned columns. """ df = pd.DataFrame(df) bool_vals = set([True, False, None...
def url(self): """ Constructs and returns the View URL. :returns: View URL """ if self._partition_key: base_url = self.design_doc.document_partition_url( self._partition_key) else: base_url = self.design_doc.document_url r...
def function[url, parameter[self]]: constant[ Constructs and returns the View URL. :returns: View URL ] if name[self]._partition_key begin[:] variable[base_url] assign[=] call[name[self].design_doc.document_partition_url, parameter[name[self]._partition_key]] ...
keyword[def] identifier[url] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_partition_key] : identifier[base_url] = identifier[self] . identifier[design_doc] . identifier[document_partition_url] ( identifier[self] . identifier[_partition_...
def url(self): """ Constructs and returns the View URL. :returns: View URL """ if self._partition_key: base_url = self.design_doc.document_partition_url(self._partition_key) # depends on [control=['if'], data=[]] else: base_url = self.design_doc.document_url ret...
def _get_environment_updates(self, display_all_distributions=False): """ Check all pacakges installed in the environment to see if there are any updates availalble. Args: display_all_distributions (bool): Return distribution even if it is up-to-date. Defaults...
def function[_get_environment_updates, parameter[self, display_all_distributions]]: constant[ Check all pacakges installed in the environment to see if there are any updates availalble. Args: display_all_distributions (bool): Return distribution even if it is ...
keyword[def] identifier[_get_environment_updates] ( identifier[self] , identifier[display_all_distributions] = keyword[False] ): literal[string] identifier[updates] =[] keyword[for] identifier[distribution] keyword[in] identifier[self] . identifier[pip] . identifier[get_installed_distri...
def _get_environment_updates(self, display_all_distributions=False): """ Check all pacakges installed in the environment to see if there are any updates availalble. Args: display_all_distributions (bool): Return distribution even if it is up-to-date. Defaults to ...
def spectrum(clm, normalization='4pi', degrees=None, lmax=None, convention='power', unit='per_l', base=10.): """ Return the spectrum of the spherical harmonic coefficients as a function of spherical harmonic degree. Usage ----- array = spectrum(clm, [normalization, degrees, lmax, c...
def function[spectrum, parameter[clm, normalization, degrees, lmax, convention, unit, base]]: constant[ Return the spectrum of the spherical harmonic coefficients as a function of spherical harmonic degree. Usage ----- array = spectrum(clm, [normalization, degrees, lmax, convention, ...
keyword[def] identifier[spectrum] ( identifier[clm] , identifier[normalization] = literal[string] , identifier[degrees] = keyword[None] , identifier[lmax] = keyword[None] , identifier[convention] = literal[string] , identifier[unit] = literal[string] , identifier[base] = literal[int] ): literal[string] ke...
def spectrum(clm, normalization='4pi', degrees=None, lmax=None, convention='power', unit='per_l', base=10.0): """ Return the spectrum of the spherical harmonic coefficients as a function of spherical harmonic degree. Usage ----- array = spectrum(clm, [normalization, degrees, lmax, convention, ...
def _parse_abstract(self): """Parse the abstract from the TeX source. Sets the ``_abstract`` attribute. """ command = LatexCommand( 'setDocAbstract', {'name': 'abstract', 'required': True, 'bracket': '{'}) try: parsed = next(command.parse(self...
def function[_parse_abstract, parameter[self]]: constant[Parse the abstract from the TeX source. Sets the ``_abstract`` attribute. ] variable[command] assign[=] call[name[LatexCommand], parameter[constant[setDocAbstract], dictionary[[<ast.Constant object at 0x7da1b00371c0>, <ast.Constan...
keyword[def] identifier[_parse_abstract] ( identifier[self] ): literal[string] identifier[command] = identifier[LatexCommand] ( literal[string] , { literal[string] : literal[string] , literal[string] : keyword[True] , literal[string] : literal[string] }) keyword[try] : ...
def _parse_abstract(self): """Parse the abstract from the TeX source. Sets the ``_abstract`` attribute. """ command = LatexCommand('setDocAbstract', {'name': 'abstract', 'required': True, 'bracket': '{'}) try: parsed = next(command.parse(self._tex)) # depends on [control=['try'], d...
def displayable_path(path, separator=u'; '): """Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`. """ if isinstance(path, (list, tuple)): return separat...
def function[displayable_path, parameter[path, separator]]: constant[Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`. ] if call[name[isinstance], param...
keyword[def] identifier[displayable_path] ( identifier[path] , identifier[separator] = literal[string] ): literal[string] keyword[if] identifier[isinstance] ( identifier[path] ,( identifier[list] , identifier[tuple] )): keyword[return] identifier[separator] . identifier[join] ( identifier[displa...
def displayable_path(path, separator=u'; '): """Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`. """ if isinstance(path, (list, tuple)): return separat...
def overlay(self, block_start_string=missing, block_end_string=missing, variable_start_string=missing, variable_end_string=missing, comment_start_string=missing, comment_end_string=missing, line_statement_prefix=missing, line_comment_prefix=missing, trim_b...
def function[overlay, parameter[self, block_start_string, block_end_string, variable_start_string, variable_end_string, comment_start_string, comment_end_string, line_statement_prefix, line_comment_prefix, trim_blocks, lstrip_blocks, extensions, optimized, undefined, finalize, autoescape, loader, cache_size, auto_reloa...
keyword[def] identifier[overlay] ( identifier[self] , identifier[block_start_string] = identifier[missing] , identifier[block_end_string] = identifier[missing] , identifier[variable_start_string] = identifier[missing] , identifier[variable_end_string] = identifier[missing] , identifier[comment_start_string] = ident...
def overlay(self, block_start_string=missing, block_end_string=missing, variable_start_string=missing, variable_end_string=missing, comment_start_string=missing, comment_end_string=missing, line_statement_prefix=missing, line_comment_prefix=missing, trim_blocks=missing, lstrip_blocks=missing, extensions=missing, optimi...
def load_basic_system_bindings(): """ Basic system bindings (For both Emacs and Vi mode.) """ registry = Registry() suspend_supported = Condition( lambda cli: suspend_to_background_supported()) @registry.add_binding(Keys.ControlZ, filter=suspend_supported) def _(event): """...
def function[load_basic_system_bindings, parameter[]]: constant[ Basic system bindings (For both Emacs and Vi mode.) ] variable[registry] assign[=] call[name[Registry], parameter[]] variable[suspend_supported] assign[=] call[name[Condition], parameter[<ast.Lambda object at 0x7da1b07f4700...
keyword[def] identifier[load_basic_system_bindings] (): literal[string] identifier[registry] = identifier[Registry] () identifier[suspend_supported] = identifier[Condition] ( keyword[lambda] identifier[cli] : identifier[suspend_to_background_supported] ()) @ identifier[registry] . identifi...
def load_basic_system_bindings(): """ Basic system bindings (For both Emacs and Vi mode.) """ registry = Registry() suspend_supported = Condition(lambda cli: suspend_to_background_supported()) @registry.add_binding(Keys.ControlZ, filter=suspend_supported) def _(event): """ S...
def default(self, obj): '''Overrides the default serializer for `JSONEncoder`. This can serialize the following objects in addition to what `JSONEncoder` can already do. - `np.array` - `bytes` - `complex` - `np.float64` and other `np.dtype` objects Para...
def function[default, parameter[self, obj]]: constant[Overrides the default serializer for `JSONEncoder`. This can serialize the following objects in addition to what `JSONEncoder` can already do. - `np.array` - `bytes` - `complex` - `np.float64` and other `np.d...
keyword[def] identifier[default] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[np] . identifier[ndarray] ): keyword[return] identifier[obj] . identifier[tolist] () keyword[elif] identifier[isinstan...
def default(self, obj): """Overrides the default serializer for `JSONEncoder`. This can serialize the following objects in addition to what `JSONEncoder` can already do. - `np.array` - `bytes` - `complex` - `np.float64` and other `np.dtype` objects Paramete...
def fit(self, y): """Estimate survival distribution from training data. Parameters ---------- y : structured array, shape = (n_samples,) A structured array containing the binary event indicator as first field, and time of event or time of censoring as ...
def function[fit, parameter[self, y]]: constant[Estimate survival distribution from training data. Parameters ---------- y : structured array, shape = (n_samples,) A structured array containing the binary event indicator as first field, and time of event or time ...
keyword[def] identifier[fit] ( identifier[self] , identifier[y] ): literal[string] identifier[event] , identifier[time] = identifier[check_y_survival] ( identifier[y] , identifier[allow_all_censored] = keyword[True] ) identifier[unique_time] , identifier[prob] = identifier[kaplan_meier_es...
def fit(self, y): """Estimate survival distribution from training data. Parameters ---------- y : structured array, shape = (n_samples,) A structured array containing the binary event indicator as first field, and time of event or time of censoring as sec...
def add_section(self, section_name): """Add an empty section. """ if section_name == "DEFAULT": raise Exception("'DEFAULT' is reserved section name.") if section_name in self._sections: raise Exception( "Error! %s is already one of the sections" %...
def function[add_section, parameter[self, section_name]]: constant[Add an empty section. ] if compare[name[section_name] equal[==] constant[DEFAULT]] begin[:] <ast.Raise object at 0x7da204566260> if compare[name[section_name] in name[self]._sections] begin[:] <ast.Raise o...
keyword[def] identifier[add_section] ( identifier[self] , identifier[section_name] ): literal[string] keyword[if] identifier[section_name] == literal[string] : keyword[raise] identifier[Exception] ( literal[string] ) keyword[if] identifier[section_name] keyword[in] ident...
def add_section(self, section_name): """Add an empty section. """ if section_name == 'DEFAULT': raise Exception("'DEFAULT' is reserved section name.") # depends on [control=['if'], data=[]] if section_name in self._sections: raise Exception('Error! %s is already one of the sections'...
def filter_google_songs(songs, include_filters=None, exclude_filters=None, all_includes=False, all_excludes=False): """Match a Google Music song dict against a set of metadata filters. Parameters: songs (list): Google Music song dicts to filter. include_filters (list): A list of ``(field, pattern)`` tuples. ...
def function[filter_google_songs, parameter[songs, include_filters, exclude_filters, all_includes, all_excludes]]: constant[Match a Google Music song dict against a set of metadata filters. Parameters: songs (list): Google Music song dicts to filter. include_filters (list): A list of ``(field, pattern)``...
keyword[def] identifier[filter_google_songs] ( identifier[songs] , identifier[include_filters] = keyword[None] , identifier[exclude_filters] = keyword[None] , identifier[all_includes] = keyword[False] , identifier[all_excludes] = keyword[False] ): literal[string] identifier[matched_songs] =[] identifier[filte...
def filter_google_songs(songs, include_filters=None, exclude_filters=None, all_includes=False, all_excludes=False): """Match a Google Music song dict against a set of metadata filters. Parameters: songs (list): Google Music song dicts to filter. include_filters (list): A list of ``(field, pattern)`` tuples. ...
def check_unused_args(self, used_args, args, kwargs): """Implement the check_unused_args in superclass.""" for k, v in kwargs.items(): if k in used_args: self._used_kwargs.update({k: v}) else: self._unused_kwargs.update({k: v})
def function[check_unused_args, parameter[self, used_args, args, kwargs]]: constant[Implement the check_unused_args in superclass.] for taget[tuple[[<ast.Name object at 0x7da1afe189d0>, <ast.Name object at 0x7da1afe1a260>]]] in starred[call[name[kwargs].items, parameter[]]] begin[:] if c...
keyword[def] identifier[check_unused_args] ( identifier[self] , identifier[used_args] , identifier[args] , identifier[kwargs] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[kwargs] . identifier[items] (): keyword[if] identifier[k] keyword[in] ...
def check_unused_args(self, used_args, args, kwargs): """Implement the check_unused_args in superclass.""" for (k, v) in kwargs.items(): if k in used_args: self._used_kwargs.update({k: v}) # depends on [control=['if'], data=['k']] else: self._unused_kwargs.update({k: v})...
def get_template_by_name(name,**kwargs): """ Get a specific resource template, by name. """ try: tmpl_i = db.DBSession.query(Template).filter(Template.name == name).options(joinedload_all('templatetypes.typeattrs.default_dataset.metadata')).one() return tmpl_i except NoResultFoun...
def function[get_template_by_name, parameter[name]]: constant[ Get a specific resource template, by name. ] <ast.Try object at 0x7da18bcc8670>
keyword[def] identifier[get_template_by_name] ( identifier[name] ,** identifier[kwargs] ): literal[string] keyword[try] : identifier[tmpl_i] = identifier[db] . identifier[DBSession] . identifier[query] ( identifier[Template] ). identifier[filter] ( identifier[Template] . identifier[name] == identi...
def get_template_by_name(name, **kwargs): """ Get a specific resource template, by name. """ try: tmpl_i = db.DBSession.query(Template).filter(Template.name == name).options(joinedload_all('templatetypes.typeattrs.default_dataset.metadata')).one() return tmpl_i # depends on [control...
def set(conf): """Applies a configuration to the global config object""" for name, value in conf.items(): if value is not None: setattr(Conf, name.upper(), value)
def function[set, parameter[conf]]: constant[Applies a configuration to the global config object] for taget[tuple[[<ast.Name object at 0x7da1b1b1a470>, <ast.Name object at 0x7da1b1b1ba30>]]] in starred[call[name[conf].items, parameter[]]] begin[:] if compare[name[value] is_not constant[N...
keyword[def] identifier[set] ( identifier[conf] ): literal[string] keyword[for] identifier[name] , identifier[value] keyword[in] identifier[conf] . identifier[items] (): keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : identifier[setattr] (...
def set(conf): """Applies a configuration to the global config object""" for (name, value) in conf.items(): if value is not None: setattr(Conf, name.upper(), value) # depends on [control=['if'], data=['value']] # depends on [control=['for'], data=[]]
def make_motif34lib(): ''' This function generates the motif34lib.mat library required for all other motif computations. Not to be called externally. ''' from scipy import io import os def motif3generate(): n = 0 M = np.zeros((54, 6), dtype=bool) # isomorphs # canon...
def function[make_motif34lib, parameter[]]: constant[ This function generates the motif34lib.mat library required for all other motif computations. Not to be called externally. ] from relative_module[scipy] import module[io] import module[os] def function[motif3generate, parameter[]]...
keyword[def] identifier[make_motif34lib] (): literal[string] keyword[from] identifier[scipy] keyword[import] identifier[io] keyword[import] identifier[os] keyword[def] identifier[motif3generate] (): identifier[n] = literal[int] identifier[M] = identifier[np] . identifie...
def make_motif34lib(): """ This function generates the motif34lib.mat library required for all other motif computations. Not to be called externally. """ from scipy import io import os def motif3generate(): n = 0 M = np.zeros((54, 6), dtype=bool) # isomorphs # canon...
def login(self): """Logs into MAL and sets cookies appropriately. :rtype: :class:`.Session` :return: The current session. """ # POSTS a login to mal. mal_headers = { 'Host': 'myanimelist.net', } mal_payload = { 'username': self.username, 'password': self.password, ...
def function[login, parameter[self]]: constant[Logs into MAL and sets cookies appropriately. :rtype: :class:`.Session` :return: The current session. ] variable[mal_headers] assign[=] dictionary[[<ast.Constant object at 0x7da20e955b70>], [<ast.Constant object at 0x7da20e954340>]] va...
keyword[def] identifier[login] ( identifier[self] ): literal[string] identifier[mal_headers] ={ literal[string] : literal[string] , } identifier[mal_payload] ={ literal[string] : identifier[self] . identifier[username] , literal[string] : identifier[self] . identifier[password]...
def login(self): """Logs into MAL and sets cookies appropriately. :rtype: :class:`.Session` :return: The current session. """ # POSTS a login to mal. mal_headers = {'Host': 'myanimelist.net'} mal_payload = {'username': self.username, 'password': self.password, 'cookie': 1, 'sublogin': 'Log...
def ip_to_geojson(ipaddress, name="Point"): """Generate GeoJSON for given IP address""" geo = ip_to_geo(ipaddress) point = { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "name": name ...
def function[ip_to_geojson, parameter[ipaddress, name]]: constant[Generate GeoJSON for given IP address] variable[geo] assign[=] call[name[ip_to_geo], parameter[name[ipaddress]]] variable[point] assign[=] dictionary[[<ast.Constant object at 0x7da1b28ad900>, <ast.Constant object at 0x7da1b28ae230...
keyword[def] identifier[ip_to_geojson] ( identifier[ipaddress] , identifier[name] = literal[string] ): literal[string] identifier[geo] = identifier[ip_to_geo] ( identifier[ipaddress] ) identifier[point] ={ literal[string] : literal[string] , literal[string] :[ { literal[string] : ...
def ip_to_geojson(ipaddress, name='Point'): """Generate GeoJSON for given IP address""" geo = ip_to_geo(ipaddress) point = {'type': 'FeatureCollection', 'features': [{'type': 'Feature', 'properties': {'name': name}, 'geometry': {'type': 'Point', 'coordinates': [geo['longitude'], geo['latitude']]}}]} ret...
def process_request_body(fn): ''' A decorator to skip a processor function if process_request_body is False ''' @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) return wrappe...
def function[process_request_body, parameter[fn]]: constant[ A decorator to skip a processor function if process_request_body is False ] def function[wrapped, parameter[]]: if compare[name[cherrypy].request.process_request_body is_not constant[False]] begin[:] ...
keyword[def] identifier[process_request_body] ( identifier[fn] ): literal[string] @ identifier[functools] . identifier[wraps] ( identifier[fn] ) keyword[def] identifier[wrapped] (* identifier[args] ,** identifier[kwargs] ): keyword[if] identifier[cherrypy] . identifier[request] . identifier[...
def process_request_body(fn): """ A decorator to skip a processor function if process_request_body is False """ @functools.wraps(fn) def wrapped(*args, **kwargs): # pylint: disable=C0111 if cherrypy.request.process_request_body is not False: fn(*args, **kwargs) # depends on [c...
async def info(self, ctx, *, member : discord.Member = None): """Shows info about a member. This cannot be used in private messages. If you don't specify a member then the info returned will be yours. """ channel = ctx.message.channel if member is None: membe...
<ast.AsyncFunctionDef object at 0x7da1b260b820>
keyword[async] keyword[def] identifier[info] ( identifier[self] , identifier[ctx] ,*, identifier[member] : identifier[discord] . identifier[Member] = keyword[None] ): literal[string] identifier[channel] = identifier[ctx] . identifier[message] . identifier[channel] keyword[if] identifier...
async def info(self, ctx, *, member: discord.Member=None): """Shows info about a member. This cannot be used in private messages. If you don't specify a member then the info returned will be yours. """ channel = ctx.message.channel if member is None: member = ctx.message.aut...
def bootstrap_styled(cls=None, add_meta=True, form_group=True, input_class='form-control'): """ Wrap a widget to conform with Bootstrap's html control design. Args: input_class: Class to give to the rendered <input> control. add_meta: bool: """ def real_decorator(cls...
def function[bootstrap_styled, parameter[cls, add_meta, form_group, input_class]]: constant[ Wrap a widget to conform with Bootstrap's html control design. Args: input_class: Class to give to the rendered <input> control. add_meta: bool: ] def function[real_decorat...
keyword[def] identifier[bootstrap_styled] ( identifier[cls] = keyword[None] , identifier[add_meta] = keyword[True] , identifier[form_group] = keyword[True] , identifier[input_class] = literal[string] ): literal[string] keyword[def] identifier[real_decorator] ( identifier[cls] ): keyword[class] ...
def bootstrap_styled(cls=None, add_meta=True, form_group=True, input_class='form-control'): """ Wrap a widget to conform with Bootstrap's html control design. Args: input_class: Class to give to the rendered <input> control. add_meta: bool: """ def real_decorator(cls): ...
def delete_user_jobs(session, job_ids): """ Remove a list of jobs from the currently authenticated user """ jobs_data = { 'jobs[]': job_ids } response = make_delete_request(session, 'self/jobs', json_data=jobs_data) json_data = response.json() if response.status_code == 200: ...
def function[delete_user_jobs, parameter[session, job_ids]]: constant[ Remove a list of jobs from the currently authenticated user ] variable[jobs_data] assign[=] dictionary[[<ast.Constant object at 0x7da1b26acac0>], [<ast.Name object at 0x7da1b26ac4f0>]] variable[response] assign[=] cal...
keyword[def] identifier[delete_user_jobs] ( identifier[session] , identifier[job_ids] ): literal[string] identifier[jobs_data] ={ literal[string] : identifier[job_ids] } identifier[response] = identifier[make_delete_request] ( identifier[session] , literal[string] , identifier[json_data] = i...
def delete_user_jobs(session, job_ids): """ Remove a list of jobs from the currently authenticated user """ jobs_data = {'jobs[]': job_ids} response = make_delete_request(session, 'self/jobs', json_data=jobs_data) json_data = response.json() if response.status_code == 200: return jso...
def get_instrument_title(self): """Return the current instrument title """ instrument = self.context.getInstrument() if not instrument: return "" return api.get_title(instrument)
def function[get_instrument_title, parameter[self]]: constant[Return the current instrument title ] variable[instrument] assign[=] call[name[self].context.getInstrument, parameter[]] if <ast.UnaryOp object at 0x7da1b2344e50> begin[:] return[constant[]] return[call[name[api].g...
keyword[def] identifier[get_instrument_title] ( identifier[self] ): literal[string] identifier[instrument] = identifier[self] . identifier[context] . identifier[getInstrument] () keyword[if] keyword[not] identifier[instrument] : keyword[return] literal[string] key...
def get_instrument_title(self): """Return the current instrument title """ instrument = self.context.getInstrument() if not instrument: return '' # depends on [control=['if'], data=[]] return api.get_title(instrument)
def download_user_playlists_by_search(self, user_name): """Download user's playlists by his/her name. :params user_name: user name. """ try: user = self.crawler.search_user(user_name, self.quiet) except RequestException as exception: click.echo(exception...
def function[download_user_playlists_by_search, parameter[self, user_name]]: constant[Download user's playlists by his/her name. :params user_name: user name. ] <ast.Try object at 0x7da1b085a620>
keyword[def] identifier[download_user_playlists_by_search] ( identifier[self] , identifier[user_name] ): literal[string] keyword[try] : identifier[user] = identifier[self] . identifier[crawler] . identifier[search_user] ( identifier[user_name] , identifier[self] . identifier[quiet] ) ...
def download_user_playlists_by_search(self, user_name): """Download user's playlists by his/her name. :params user_name: user name. """ try: user = self.crawler.search_user(user_name, self.quiet) # depends on [control=['try'], data=[]] except RequestException as exception: ...
def to_items(self, func=str): """ Contruct a list of dictionary items. The items are normalized using: - A sort function by key (for consistent results) - A transformation function for values The transformation function will default to `str`, which is a good choic...
def function[to_items, parameter[self, func]]: constant[ Contruct a list of dictionary items. The items are normalized using: - A sort function by key (for consistent results) - A transformation function for values The transformation function will default to `str`...
keyword[def] identifier[to_items] ( identifier[self] , identifier[func] = identifier[str] ): literal[string] keyword[return] [ ( identifier[key] , identifier[func] ( identifier[self] . identifier[kwargs] [ identifier[key] ])) keyword[for] identifier[key] keyword[in] identifier[s...
def to_items(self, func=str): """ Contruct a list of dictionary items. The items are normalized using: - A sort function by key (for consistent results) - A transformation function for values The transformation function will default to `str`, which is a good choice wh...
def addfield(table, field, value=None, index=None, missing=None): """ Add a field with a fixed or calculated value. E.g.:: >>> import petl as etl >>> table1 = [['foo', 'bar'], ... ['M', 12], ... ['F', 34], ... ['-', 56]] >>> # using ...
def function[addfield, parameter[table, field, value, index, missing]]: constant[ Add a field with a fixed or calculated value. E.g.:: >>> import petl as etl >>> table1 = [['foo', 'bar'], ... ['M', 12], ... ['F', 34], ... ['-', 56]] ...
keyword[def] identifier[addfield] ( identifier[table] , identifier[field] , identifier[value] = keyword[None] , identifier[index] = keyword[None] , identifier[missing] = keyword[None] ): literal[string] keyword[return] identifier[AddFieldView] ( identifier[table] , identifier[field] , identifier[value] =...
def addfield(table, field, value=None, index=None, missing=None): """ Add a field with a fixed or calculated value. E.g.:: >>> import petl as etl >>> table1 = [['foo', 'bar'], ... ['M', 12], ... ['F', 34], ... ['-', 56]] >>> # using ...
def setup(self, config_file): """ Setup settings from a JSON config file """ def get_config_and_warn(key, default, abort=False): value = config.get(key, None) if not value: print(f"Cannot find {key} in settings, using default value: {default}") va...
def function[setup, parameter[self, config_file]]: constant[ Setup settings from a JSON config file ] def function[get_config_and_warn, parameter[key, default, abort]]: variable[value] assign[=] call[name[config].get, parameter[name[key], constant[None]]] if <ast.UnaryOp ...
keyword[def] identifier[setup] ( identifier[self] , identifier[config_file] ): literal[string] keyword[def] identifier[get_config_and_warn] ( identifier[key] , identifier[default] , identifier[abort] = keyword[False] ): identifier[value] = identifier[config] . identifier[get] ( ident...
def setup(self, config_file): """ Setup settings from a JSON config file """ def get_config_and_warn(key, default, abort=False): value = config.get(key, None) if not value: print(f'Cannot find {key} in settings, using default value: {default}') value = default ...
def eliot_friendly_generator_function(original): """ Decorate a generator function so that the Eliot action context is preserved across ``yield`` expressions. """ @wraps(original) def wrapper(*a, **kw): # Keep track of whether the next value to deliver to the generator is # a non...
def function[eliot_friendly_generator_function, parameter[original]]: constant[ Decorate a generator function so that the Eliot action context is preserved across ``yield`` expressions. ] def function[wrapper, parameter[]]: variable[ok] assign[=] constant[True] ...
keyword[def] identifier[eliot_friendly_generator_function] ( identifier[original] ): literal[string] @ identifier[wraps] ( identifier[original] ) keyword[def] identifier[wrapper] (* identifier[a] ,** identifier[kw] ): identifier[ok] = keyword[True] identifier[val...
def eliot_friendly_generator_function(original): """ Decorate a generator function so that the Eliot action context is preserved across ``yield`` expressions. """ @wraps(original) def wrapper(*a, **kw): # Keep track of whether the next value to deliver to the generator is # a no...
def _read_callback(self, data=None): """Callback called when some data are read on the socket. The buffer is given to the hiredis parser. If a reply is complete, we put the decoded reply to on the reply queue. Args: data (str): string (buffer) read on the socket. ""...
def function[_read_callback, parameter[self, data]]: constant[Callback called when some data are read on the socket. The buffer is given to the hiredis parser. If a reply is complete, we put the decoded reply to on the reply queue. Args: data (str): string (buffer) read on ...
keyword[def] identifier[_read_callback] ( identifier[self] , identifier[data] = keyword[None] ): literal[string] keyword[try] : keyword[if] identifier[data] keyword[is] keyword[not] keyword[None] : identifier[self] . identifier[__reader] . identifier[feed] ( identi...
def _read_callback(self, data=None): """Callback called when some data are read on the socket. The buffer is given to the hiredis parser. If a reply is complete, we put the decoded reply to on the reply queue. Args: data (str): string (buffer) read on the socket. """ ...
def register(linter): """Required method to auto register this checker.""" linter.register_checker(NewDbFieldWithDefaultChecker(linter)) if not compat.LOAD_CONFIGURATION_SUPPORTED: load_configuration(linter)
def function[register, parameter[linter]]: constant[Required method to auto register this checker.] call[name[linter].register_checker, parameter[call[name[NewDbFieldWithDefaultChecker], parameter[name[linter]]]]] if <ast.UnaryOp object at 0x7da20c6a84c0> begin[:] call[name[load_...
keyword[def] identifier[register] ( identifier[linter] ): literal[string] identifier[linter] . identifier[register_checker] ( identifier[NewDbFieldWithDefaultChecker] ( identifier[linter] )) keyword[if] keyword[not] identifier[compat] . identifier[LOAD_CONFIGURATION_SUPPORTED] : identifier[...
def register(linter): """Required method to auto register this checker.""" linter.register_checker(NewDbFieldWithDefaultChecker(linter)) if not compat.LOAD_CONFIGURATION_SUPPORTED: load_configuration(linter) # depends on [control=['if'], data=[]]
def tee(data, n=2): """ Tee or "T" copy to help working with Stream instances as well as with numbers. Parameters ---------- data : Input to be copied. Can be anything. n : Size of returned tuple. Defaults to 2. Returns ------- Tuple of n independent Stream instances, if the input is a Str...
def function[tee, parameter[data, n]]: constant[ Tee or "T" copy to help working with Stream instances as well as with numbers. Parameters ---------- data : Input to be copied. Can be anything. n : Size of returned tuple. Defaults to 2. Returns ------- Tuple of n independent Stream i...
keyword[def] identifier[tee] ( identifier[data] , identifier[n] = literal[int] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] ,( identifier[Stream] , identifier[Iterator] )): keyword[return] identifier[tuple] ( identifier[Stream] ( identifier[cp] ) keyword[for] identifier[cp] ...
def tee(data, n=2): """ Tee or "T" copy to help working with Stream instances as well as with numbers. Parameters ---------- data : Input to be copied. Can be anything. n : Size of returned tuple. Defaults to 2. Returns ------- Tuple of n independent Stream instances, if the input is a S...
def get_resource_attribute(resource_attr_id, **kwargs): """ Get a specific resource attribte, by ID If type_id is Gspecified, only return the resource attributes within the type. """ resource_attr_qry = db.DBSession.query(ResourceAttr).filter( ResourceAttr.id == resource_att...
def function[get_resource_attribute, parameter[resource_attr_id]]: constant[ Get a specific resource attribte, by ID If type_id is Gspecified, only return the resource attributes within the type. ] variable[resource_attr_qry] assign[=] call[call[name[db].DBSession.query, para...
keyword[def] identifier[get_resource_attribute] ( identifier[resource_attr_id] ,** identifier[kwargs] ): literal[string] identifier[resource_attr_qry] = identifier[db] . identifier[DBSession] . identifier[query] ( identifier[ResourceAttr] ). identifier[filter] ( identifier[ResourceAttr] . identifier[...
def get_resource_attribute(resource_attr_id, **kwargs): """ Get a specific resource attribte, by ID If type_id is Gspecified, only return the resource attributes within the type. """ resource_attr_qry = db.DBSession.query(ResourceAttr).filter(ResourceAttr.id == resource_attr_id) ...
def get_time_remaining_estimate(self): """ Looks through all power sources and returns total time remaining estimate or TIME_REMAINING_UNLIMITED if ac power supply is online. """ all_energy_now = [] all_energy_not_discharging = [] all_power_now = [] for su...
def function[get_time_remaining_estimate, parameter[self]]: constant[ Looks through all power sources and returns total time remaining estimate or TIME_REMAINING_UNLIMITED if ac power supply is online. ] variable[all_energy_now] assign[=] list[[]] variable[all_energy_not_...
keyword[def] identifier[get_time_remaining_estimate] ( identifier[self] ): literal[string] identifier[all_energy_now] =[] identifier[all_energy_not_discharging] =[] identifier[all_power_now] =[] keyword[for] identifier[supply] keyword[in] identifier[os] . identifier[li...
def get_time_remaining_estimate(self): """ Looks through all power sources and returns total time remaining estimate or TIME_REMAINING_UNLIMITED if ac power supply is online. """ all_energy_now = [] all_energy_not_discharging = [] all_power_now = [] for supply in os.listdir(P...
def reload_config(self, dockercfg_path=None): """ Force a reload of the auth configuration Args: dockercfg_path (str): Use a custom path for the Docker config file (default ``$HOME/.docker/config.json`` if present, otherwise``$HOME/.dockercfg``) ...
def function[reload_config, parameter[self, dockercfg_path]]: constant[ Force a reload of the auth configuration Args: dockercfg_path (str): Use a custom path for the Docker config file (default ``$HOME/.docker/config.json`` if present, otherwise``$HO...
keyword[def] identifier[reload_config] ( identifier[self] , identifier[dockercfg_path] = keyword[None] ): literal[string] identifier[self] . identifier[_auth_configs] = identifier[auth] . identifier[load_config] ( identifier[dockercfg_path] , identifier[credstore_env] = identifier[self] . ...
def reload_config(self, dockercfg_path=None): """ Force a reload of the auth configuration Args: dockercfg_path (str): Use a custom path for the Docker config file (default ``$HOME/.docker/config.json`` if present, otherwise``$HOME/.dockercfg``) ...
def _ScanEncryptedVolume(self, scan_context, scan_node): """Scans an encrypted volume scan node for volume and file systems. Args: scan_context (SourceScannerContext): source scanner context. scan_node (SourceScanNode): volume scan node. Raises: ScannerError: if the format of or within t...
def function[_ScanEncryptedVolume, parameter[self, scan_context, scan_node]]: constant[Scans an encrypted volume scan node for volume and file systems. Args: scan_context (SourceScannerContext): source scanner context. scan_node (SourceScanNode): volume scan node. Raises: ScannerErro...
keyword[def] identifier[_ScanEncryptedVolume] ( identifier[self] , identifier[scan_context] , identifier[scan_node] ): literal[string] keyword[if] keyword[not] identifier[scan_node] keyword[or] keyword[not] identifier[scan_node] . identifier[path_spec] : keyword[raise] identifier[errors] . ide...
def _ScanEncryptedVolume(self, scan_context, scan_node): """Scans an encrypted volume scan node for volume and file systems. Args: scan_context (SourceScannerContext): source scanner context. scan_node (SourceScanNode): volume scan node. Raises: ScannerError: if the format of or within t...
def getMetadata(self, objectId=None, **filters): """ Request metadata about a text or a collection :param objectId: Object Identifier to filter on :type objectId: str :param filters: Kwargs parameters. :type filters: dict :return: Collection """ if object...
def function[getMetadata, parameter[self, objectId]]: constant[ Request metadata about a text or a collection :param objectId: Object Identifier to filter on :type objectId: str :param filters: Kwargs parameters. :type filters: dict :return: Collection ] ...
keyword[def] identifier[getMetadata] ( identifier[self] , identifier[objectId] = keyword[None] ,** identifier[filters] ): literal[string] keyword[if] identifier[objectId] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[inventory] keyword[elif] i...
def getMetadata(self, objectId=None, **filters): """ Request metadata about a text or a collection :param objectId: Object Identifier to filter on :type objectId: str :param filters: Kwargs parameters. :type filters: dict :return: Collection """ if objectId is No...
def finalize_media(app): """Point media files at our media server.""" if (app.builder.name == 'readthedocssinglehtmllocalmedia' or app.builder.format != 'html' or not hasattr(app.builder, 'script_files')): return # Use local media for downloadable files # Pull project data ...
def function[finalize_media, parameter[app]]: constant[Point media files at our media server.] if <ast.BoolOp object at 0x7da18c4cd510> begin[:] return[None] variable[context] assign[=] name[app].builder.config.html_context variable[STATIC_URL] assign[=] call[name[context].get, p...
keyword[def] identifier[finalize_media] ( identifier[app] ): literal[string] keyword[if] ( identifier[app] . identifier[builder] . identifier[name] == literal[string] keyword[or] identifier[app] . identifier[builder] . identifier[format] != literal[string] keyword[or] keyword[not] identifie...
def finalize_media(app): """Point media files at our media server.""" if app.builder.name == 'readthedocssinglehtmllocalmedia' or app.builder.format != 'html' or (not hasattr(app.builder, 'script_files')): return # Use local media for downloadable files # depends on [control=['if'], data=[]] # Pul...
def insert_completions(self, e): # (M-*) u"""Insert all completions of the text before point that would have been generated by possible-completions.""" completions = self._get_completions() b = self.begidx e = self.endidx for comp in completions: rep = ...
def function[insert_completions, parameter[self, e]]: constant[Insert all completions of the text before point that would have been generated by possible-completions.] variable[completions] assign[=] call[name[self]._get_completions, parameter[]] variable[b] assign[=] name[self].begidx ...
keyword[def] identifier[insert_completions] ( identifier[self] , identifier[e] ): literal[string] identifier[completions] = identifier[self] . identifier[_get_completions] () identifier[b] = identifier[self] . identifier[begidx] identifier[e] = identifier[self] . identifier[e...
def insert_completions(self, e): # (M-*) u'Insert all completions of the text before point that would have\n been generated by possible-completions.' completions = self._get_completions() b = self.begidx e = self.endidx for comp in completions: rep = [c for c in comp] rep.app...
def enterstring(self, window_name, object_name='', data=''): """ Type string sequence. @param window_name: Window name to focus on, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to focus on, ei...
def function[enterstring, parameter[self, window_name, object_name, data]]: constant[ Type string sequence. @param window_name: Window name to focus on, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object...
keyword[def] identifier[enterstring] ( identifier[self] , identifier[window_name] , identifier[object_name] = literal[string] , identifier[data] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[object_name] keyword[and] keyword[not] identifier[data] : keywo...
def enterstring(self, window_name, object_name='', data=''): """ Type string sequence. @param window_name: Window name to focus on, either full name, LDTP's name convention, or a Unix glob. @type window_name: string @param object_name: Object name to focus on, either...
def write_tables(target, tables, append=False, overwrite=False, **kwargs): """Write an LIGO_LW table to file Parameters ---------- target : `str`, `file`, :class:`~ligo.lw.ligolw.Document` the file or document to write into tables : `list`, `tuple` of :class:`~ligo.lw.table.Table` ...
def function[write_tables, parameter[target, tables, append, overwrite]]: constant[Write an LIGO_LW table to file Parameters ---------- target : `str`, `file`, :class:`~ligo.lw.ligolw.Document` the file or document to write into tables : `list`, `tuple` of :class:`~ligo.lw.table.Table`...
keyword[def] identifier[write_tables] ( identifier[target] , identifier[tables] , identifier[append] = keyword[False] , identifier[overwrite] = keyword[False] ,** identifier[kwargs] ): literal[string] keyword[from] identifier[ligo] . identifier[lw] . identifier[ligolw] keyword[import] ( identifier[Docume...
def write_tables(target, tables, append=False, overwrite=False, **kwargs): """Write an LIGO_LW table to file Parameters ---------- target : `str`, `file`, :class:`~ligo.lw.ligolw.Document` the file or document to write into tables : `list`, `tuple` of :class:`~ligo.lw.table.Table` ...
def event_from_item(self, sequenced_item): """ Reconstructs domain event from stored event topic and event attrs. Used in the event store when getting domain events. """ assert isinstance(sequenced_item, self.sequenced_item_class), ( self.sequenced_item_class, type(se...
def function[event_from_item, parameter[self, sequenced_item]]: constant[ Reconstructs domain event from stored event topic and event attrs. Used in the event store when getting domain events. ] assert[call[name[isinstance], parameter[name[sequenced_item], name[self].sequenced_item_c...
keyword[def] identifier[event_from_item] ( identifier[self] , identifier[sequenced_item] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[sequenced_item] , identifier[self] . identifier[sequenced_item_class] ),( identifier[self] . identifier[sequenced_item_class] , i...
def event_from_item(self, sequenced_item): """ Reconstructs domain event from stored event topic and event attrs. Used in the event store when getting domain events. """ assert isinstance(sequenced_item, self.sequenced_item_class), (self.sequenced_item_class, type(sequenced_item)) # ...
def connect_mturk(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.mturk.connecti...
def function[connect_mturk, parameter[aws_access_key_id, aws_secret_access_key]]: constant[ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.mtu...
keyword[def] identifier[connect_mturk] ( identifier[aws_access_key_id] = keyword[None] , identifier[aws_secret_access_key] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[from] identifier[boto] . identifier[mturk] . identifier[connection] keyword[import] identifier[MTurkConnection] ...
def connect_mturk(aws_access_key_id=None, aws_secret_access_key=None, **kwargs): """ :type aws_access_key_id: string :param aws_access_key_id: Your AWS Access Key ID :type aws_secret_access_key: string :param aws_secret_access_key: Your AWS Secret Access Key :rtype: :class:`boto.mturk.connecti...
def measureSize(self, diff, chunkSize): """ Spend some time to get an accurate size. """ (toUUID, fromUUID) = self.toArg.diff(diff) isInteractive = sys.stderr.isatty() return self.toObj.diff(self._client.measureSize( toUUID, fromUUID, diff.size, ...
def function[measureSize, parameter[self, diff, chunkSize]]: constant[ Spend some time to get an accurate size. ] <ast.Tuple object at 0x7da1b2725270> assign[=] call[name[self].toArg.diff, parameter[name[diff]]] variable[isInteractive] assign[=] call[name[sys].stderr.isatty, parameter[]] ret...
keyword[def] identifier[measureSize] ( identifier[self] , identifier[diff] , identifier[chunkSize] ): literal[string] ( identifier[toUUID] , identifier[fromUUID] )= identifier[self] . identifier[toArg] . identifier[diff] ( identifier[diff] ) identifier[isInteractive] = identifier[sys] . ide...
def measureSize(self, diff, chunkSize): """ Spend some time to get an accurate size. """ (toUUID, fromUUID) = self.toArg.diff(diff) isInteractive = sys.stderr.isatty() return self.toObj.diff(self._client.measureSize(toUUID, fromUUID, diff.size, chunkSize, isInteractive))
def create(self, path, data, ephemeral=False, sequence=False): """ Creates a ZooKeeper node :param path: Z-Path :param data: Node Content :param ephemeral: Ephemeral flag :param sequence: Sequential flag """ return self._zk.create( self.__path...
def function[create, parameter[self, path, data, ephemeral, sequence]]: constant[ Creates a ZooKeeper node :param path: Z-Path :param data: Node Content :param ephemeral: Ephemeral flag :param sequence: Sequential flag ] return[call[name[self]._zk.create, par...
keyword[def] identifier[create] ( identifier[self] , identifier[path] , identifier[data] , identifier[ephemeral] = keyword[False] , identifier[sequence] = keyword[False] ): literal[string] keyword[return] identifier[self] . identifier[_zk] . identifier[create] ( identifier[self] . identif...
def create(self, path, data, ephemeral=False, sequence=False): """ Creates a ZooKeeper node :param path: Z-Path :param data: Node Content :param ephemeral: Ephemeral flag :param sequence: Sequential flag """ return self._zk.create(self.__path(path), data, ephemer...
def tilt(self,R,z,nsigma=None,mc=False,nmc=10000, gl=True,ngl=_DEFAULTNGL,**kwargs): """ NAME: tilt PURPOSE: calculate the tilt of the velocity ellipsoid by marginalizing over velocity INPUT: R - radius at which to calculate this (can be...
def function[tilt, parameter[self, R, z, nsigma, mc, nmc, gl, ngl]]: constant[ NAME: tilt PURPOSE: calculate the tilt of the velocity ellipsoid by marginalizing over velocity INPUT: R - radius at which to calculate this (can be Quantity) ...
keyword[def] identifier[tilt] ( identifier[self] , identifier[R] , identifier[z] , identifier[nsigma] = keyword[None] , identifier[mc] = keyword[False] , identifier[nmc] = literal[int] , identifier[gl] = keyword[True] , identifier[ngl] = identifier[_DEFAULTNGL] ,** identifier[kwargs] ): literal[string] ...
def tilt(self, R, z, nsigma=None, mc=False, nmc=10000, gl=True, ngl=_DEFAULTNGL, **kwargs): """ NAME: tilt PURPOSE: calculate the tilt of the velocity ellipsoid by marginalizing over velocity INPUT: R - radius at which to calculate this (can be Quantity)...
def _image_xobjects(container): """Search for all XObject-based images in the container Usually the container is a page, but it could also be a Form XObject that contains images. Filter out the Form XObjects which are dealt with elsewhere. Generate a sequence of tuples (image, xobj container), whe...
def function[_image_xobjects, parameter[container]]: constant[Search for all XObject-based images in the container Usually the container is a page, but it could also be a Form XObject that contains images. Filter out the Form XObjects which are dealt with elsewhere. Generate a sequence of tupl...
keyword[def] identifier[_image_xobjects] ( identifier[container] ): literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[container] : keyword[return] identifier[resources] = identifier[container] [ literal[string] ] keyword[if] literal[string] keyword[n...
def _image_xobjects(container): """Search for all XObject-based images in the container Usually the container is a page, but it could also be a Form XObject that contains images. Filter out the Form XObjects which are dealt with elsewhere. Generate a sequence of tuples (image, xobj container), whe...
def power_tick(val, pos, times_sign=r'\times'): """Custom power ticker function. """ if val == 0: return r'$\mathregular{0}$' elif val < 0: exponent = int(np.log10(-val)) else: exponent = int(np.log10(val)) coeff = val / 10**exponent return r'$\mathregular{{{:.1f} {} 10^...
def function[power_tick, parameter[val, pos, times_sign]]: constant[Custom power ticker function. ] if compare[name[val] equal[==] constant[0]] begin[:] return[constant[$\mathregular{0}$]] variable[coeff] assign[=] binary_operation[name[val] / binary_operation[constant[10] ** name[expone...
keyword[def] identifier[power_tick] ( identifier[val] , identifier[pos] , identifier[times_sign] = literal[string] ): literal[string] keyword[if] identifier[val] == literal[int] : keyword[return] literal[string] keyword[elif] identifier[val] < literal[int] : identifier[exponent] ...
def power_tick(val, pos, times_sign='\\times'): """Custom power ticker function. """ if val == 0: return '$\\mathregular{0}$' # depends on [control=['if'], data=[]] elif val < 0: exponent = int(np.log10(-val)) # depends on [control=['if'], data=['val']] else: exponent = int(np....
def from_localhost(self) -> bool: """True if :attr:`.peername` is a connection from a ``localhost`` address. """ sock_family = self.socket.family if sock_family == _socket.AF_UNIX: return True elif sock_family not in (_socket.AF_INET, _socket.AF_INET6): ...
def function[from_localhost, parameter[self]]: constant[True if :attr:`.peername` is a connection from a ``localhost`` address. ] variable[sock_family] assign[=] name[self].socket.family if compare[name[sock_family] equal[==] name[_socket].AF_UNIX] begin[:] return[consta...
keyword[def] identifier[from_localhost] ( identifier[self] )-> identifier[bool] : literal[string] identifier[sock_family] = identifier[self] . identifier[socket] . identifier[family] keyword[if] identifier[sock_family] == identifier[_socket] . identifier[AF_UNIX] : keyword[r...
def from_localhost(self) -> bool: """True if :attr:`.peername` is a connection from a ``localhost`` address. """ sock_family = self.socket.family if sock_family == _socket.AF_UNIX: return True # depends on [control=['if'], data=[]] elif sock_family not in (_socket.AF_INET, _soc...
def _find_descendents(self, url): """Return properties document for url and all children.""" # Ad-hoc query for URL starting with a prefix map_fun = """function(doc) { var url = doc.url + "/"; if(doc.type === 'properties' && url.indexOf('%s') === 0) { ...
def function[_find_descendents, parameter[self, url]]: constant[Return properties document for url and all children.] variable[map_fun] assign[=] binary_operation[constant[function(doc) { var url = doc.url + "/"; if(doc.type === 'properties' && url.indexOf('%s') === 0) { ...
keyword[def] identifier[_find_descendents] ( identifier[self] , identifier[url] ): literal[string] identifier[map_fun] = literal[string] %( identifier[url] + literal[string] ) identifier[vr] = identifier[self] . identifier[db] . identifier[query] ( identifier[map...
def _find_descendents(self, url): """Return properties document for url and all children.""" # Ad-hoc query for URL starting with a prefix map_fun = 'function(doc) {\n var url = doc.url + "/";\n if(doc.type === \'properties\' && url.indexOf(\'%s\') === 0) {\n ...
def random_color(_min=MIN_COLOR, _max=MAX_COLOR): """Returns a random color between min and max.""" return color(random.randint(_min, _max))
def function[random_color, parameter[_min, _max]]: constant[Returns a random color between min and max.] return[call[name[color], parameter[call[name[random].randint, parameter[name[_min], name[_max]]]]]]
keyword[def] identifier[random_color] ( identifier[_min] = identifier[MIN_COLOR] , identifier[_max] = identifier[MAX_COLOR] ): literal[string] keyword[return] identifier[color] ( identifier[random] . identifier[randint] ( identifier[_min] , identifier[_max] ))
def random_color(_min=MIN_COLOR, _max=MAX_COLOR): """Returns a random color between min and max.""" return color(random.randint(_min, _max))
def _parse_proto(prototxt_fname): """Parse Caffe prototxt into symbol string """ proto = caffe_parser.read_prototxt(prototxt_fname) # process data layer input_name, input_dim, layers = _get_input(proto) # only support single input, so always use `data` as the input data mapping = {input_nam...
def function[_parse_proto, parameter[prototxt_fname]]: constant[Parse Caffe prototxt into symbol string ] variable[proto] assign[=] call[name[caffe_parser].read_prototxt, parameter[name[prototxt_fname]]] <ast.Tuple object at 0x7da1b1fb41c0> assign[=] call[name[_get_input], parameter[name[pro...
keyword[def] identifier[_parse_proto] ( identifier[prototxt_fname] ): literal[string] identifier[proto] = identifier[caffe_parser] . identifier[read_prototxt] ( identifier[prototxt_fname] ) identifier[input_name] , identifier[input_dim] , identifier[layers] = identifier[_get_input] ( identifier[...
def _parse_proto(prototxt_fname): """Parse Caffe prototxt into symbol string """ proto = caffe_parser.read_prototxt(prototxt_fname) # process data layer (input_name, input_dim, layers) = _get_input(proto) # only support single input, so always use `data` as the input data mapping = {input_na...
def start_all_linking(self, link_type, group_id): """Begin all linking""" self.logger.info("start_all_linking for type %s group %s", link_type, group_id) self.direct_command_hub('0264' + link_type + group_id)
def function[start_all_linking, parameter[self, link_type, group_id]]: constant[Begin all linking] call[name[self].logger.info, parameter[constant[start_all_linking for type %s group %s], name[link_type], name[group_id]]] call[name[self].direct_command_hub, parameter[binary_operation[binary_oper...
keyword[def] identifier[start_all_linking] ( identifier[self] , identifier[link_type] , identifier[group_id] ): literal[string] identifier[self] . identifier[logger] . identifier[info] ( literal[string] , identifier[link_type] , identifier[group_id] ) identifier[self] . identifier...
def start_all_linking(self, link_type, group_id): """Begin all linking""" self.logger.info('start_all_linking for type %s group %s', link_type, group_id) self.direct_command_hub('0264' + link_type + group_id)
def set_all_ylims(self, ylim, dy, yscale, fontsize=None): """Set limits and ticks for y axis for whole figure. This will set y axis limits and tick marks for the entire figure. It can be overridden in the SinglePlot class. Args: ylim (len-2 list of floats): The limits for t...
def function[set_all_ylims, parameter[self, ylim, dy, yscale, fontsize]]: constant[Set limits and ticks for y axis for whole figure. This will set y axis limits and tick marks for the entire figure. It can be overridden in the SinglePlot class. Args: ylim (len-2 list of flo...
keyword[def] identifier[set_all_ylims] ( identifier[self] , identifier[ylim] , identifier[dy] , identifier[yscale] , identifier[fontsize] = keyword[None] ): literal[string] identifier[self] . identifier[_set_all_lims] ( literal[string] , identifier[ylim] , identifier[dy] , identifier[yscale] , iden...
def set_all_ylims(self, ylim, dy, yscale, fontsize=None): """Set limits and ticks for y axis for whole figure. This will set y axis limits and tick marks for the entire figure. It can be overridden in the SinglePlot class. Args: ylim (len-2 list of floats): The limits for the a...
def _thresholds_init(self): """ Initiate and check any thresholds set """ thresholds = getattr(self._py3status_module, "thresholds", []) self._thresholds = {} if isinstance(thresholds, list): try: thresholds.sort() except TypeError:...
def function[_thresholds_init, parameter[self]]: constant[ Initiate and check any thresholds set ] variable[thresholds] assign[=] call[name[getattr], parameter[name[self]._py3status_module, constant[thresholds], list[[]]]] name[self]._thresholds assign[=] dictionary[[], []] ...
keyword[def] identifier[_thresholds_init] ( identifier[self] ): literal[string] identifier[thresholds] = identifier[getattr] ( identifier[self] . identifier[_py3status_module] , literal[string] ,[]) identifier[self] . identifier[_thresholds] ={} keyword[if] identifier[isinstance]...
def _thresholds_init(self): """ Initiate and check any thresholds set """ thresholds = getattr(self._py3status_module, 'thresholds', []) self._thresholds = {} if isinstance(thresholds, list): try: thresholds.sort() # depends on [control=['try'], data=[]] exce...
def get_directory_relative_to_git_root(directory: str): """ Gets the path to the given directory relative to the git repository root in which it is a subdirectory. :param directory: the directory within a git repository :return: the path to the directory relative to the git repository root """ r...
def function[get_directory_relative_to_git_root, parameter[directory]]: constant[ Gets the path to the given directory relative to the git repository root in which it is a subdirectory. :param directory: the directory within a git repository :return: the path to the directory relative to the git rep...
keyword[def] identifier[get_directory_relative_to_git_root] ( identifier[directory] : identifier[str] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[relpath] ( identifier[os] . identifier[path] . identifier[realpath] ( identifier[directory] ), identifier[get_git_root_dir...
def get_directory_relative_to_git_root(directory: str): """ Gets the path to the given directory relative to the git repository root in which it is a subdirectory. :param directory: the directory within a git repository :return: the path to the directory relative to the git repository root """ r...
def get_open_state_machine_of_file_system_path(self, file_system_path): """Return a reference to the state machine with respective path if open """ for sm in self.state_machines.values(): if sm.file_system_path == file_system_path: return sm
def function[get_open_state_machine_of_file_system_path, parameter[self, file_system_path]]: constant[Return a reference to the state machine with respective path if open ] for taget[name[sm]] in starred[call[name[self].state_machines.values, parameter[]]] begin[:] if compare[nam...
keyword[def] identifier[get_open_state_machine_of_file_system_path] ( identifier[self] , identifier[file_system_path] ): literal[string] keyword[for] identifier[sm] keyword[in] identifier[self] . identifier[state_machines] . identifier[values] (): keyword[if] identifier[sm] . ident...
def get_open_state_machine_of_file_system_path(self, file_system_path): """Return a reference to the state machine with respective path if open """ for sm in self.state_machines.values(): if sm.file_system_path == file_system_path: return sm # depends on [control=['if'], data=[]] #...
def _get_report_string(time='hour', threshold='significant', online=False): """ Like :func:`get_report` except returns the raw data instead. :param str time: A string indicating the time range of earthquakes to report. Must be either "hour" (only earthquakes in the past hour), "day" (only earthquakes t...
def function[_get_report_string, parameter[time, threshold, online]]: constant[ Like :func:`get_report` except returns the raw data instead. :param str time: A string indicating the time range of earthquakes to report. Must be either "hour" (only earthquakes in the past hour), "day" (only earthquak...
keyword[def] identifier[_get_report_string] ( identifier[time] = literal[string] , identifier[threshold] = literal[string] , identifier[online] = keyword[False] ): literal[string] identifier[key] = identifier[_get_report_request] ( identifier[time] , identifier[threshold] ) identifier[result] = identi...
def _get_report_string(time='hour', threshold='significant', online=False): """ Like :func:`get_report` except returns the raw data instead. :param str time: A string indicating the time range of earthquakes to report. Must be either "hour" (only earthquakes in the past hour), "day" (only earthquakes t...
def teardown(self): ''' cleanup the monitor data and ''' self.monitor_thread.stop() self.monitor_thread = None super(BaseMonitor, self).teardown()
def function[teardown, parameter[self]]: constant[ cleanup the monitor data and ] call[name[self].monitor_thread.stop, parameter[]] name[self].monitor_thread assign[=] constant[None] call[call[name[super], parameter[name[BaseMonitor], name[self]]].teardown, parameter[]]
keyword[def] identifier[teardown] ( identifier[self] ): literal[string] identifier[self] . identifier[monitor_thread] . identifier[stop] () identifier[self] . identifier[monitor_thread] = keyword[None] identifier[super] ( identifier[BaseMonitor] , identifier[self] ). identifier[t...
def teardown(self): """ cleanup the monitor data and """ self.monitor_thread.stop() self.monitor_thread = None super(BaseMonitor, self).teardown()
def get_distributions(self): """ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDis...
def function[get_distributions, parameter[self]]: constant[ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and ...
keyword[def] identifier[get_distributions] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_cache_enabled] : keyword[for] identifier[dist] keyword[in] identifier[self] . identifier[_yield_distributions] (): keyword[yiel...
def get_distributions(self): """ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistrib...