code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def absolute_values(df, *, column: str, new_column: str = None): """ Get the absolute numeric value of each element of a column --- ### Parameters *mandatory :* - `column` (*str*): name of the column *optional :* - `new_column` (*str*): name of the column containing the result. ...
def function[absolute_values, parameter[df]]: constant[ Get the absolute numeric value of each element of a column --- ### Parameters *mandatory :* - `column` (*str*): name of the column *optional :* - `new_column` (*str*): name of the column containing the result. By defau...
keyword[def] identifier[absolute_values] ( identifier[df] ,*, identifier[column] : identifier[str] , identifier[new_column] : identifier[str] = keyword[None] ): literal[string] identifier[new_column] = identifier[new_column] keyword[or] identifier[column] identifier[df] [ identifier[new_column] ]= ...
def absolute_values(df, *, column: str, new_column: str=None): """ Get the absolute numeric value of each element of a column --- ### Parameters *mandatory :* - `column` (*str*): name of the column *optional :* - `new_column` (*str*): name of the column containing the result. B...
def openssh_tunnel(self, lport, rport, server, remoteip='127.0.0.1', keyfile=None, password=None, timeout=0.4): """ We decided to replace pyzmq's openssh_tunnel method to work around issue https://github.com/zeromq/pyzmq/issues/589 which was solved in pyzmq https://github.com/zeromq/p...
def function[openssh_tunnel, parameter[self, lport, rport, server, remoteip, keyfile, password, timeout]]: constant[ We decided to replace pyzmq's openssh_tunnel method to work around issue https://github.com/zeromq/pyzmq/issues/589 which was solved in pyzmq https://github.com/zeromq/pyzmq/pull/615 ...
keyword[def] identifier[openssh_tunnel] ( identifier[self] , identifier[lport] , identifier[rport] , identifier[server] , identifier[remoteip] = literal[string] , identifier[keyfile] = keyword[None] , identifier[password] = keyword[None] , identifier[timeout] = literal[int] ): literal[string] identifier[s...
def openssh_tunnel(self, lport, rport, server, remoteip='127.0.0.1', keyfile=None, password=None, timeout=0.4): """ We decided to replace pyzmq's openssh_tunnel method to work around issue https://github.com/zeromq/pyzmq/issues/589 which was solved in pyzmq https://github.com/zeromq/pyzmq/pull/615 "...
def list_workspaces(self, page_limit=None, include_count=None, sort=None, cursor=None, include_audit=None, **kwargs): """ List workspaces. List the wor...
def function[list_workspaces, parameter[self, page_limit, include_count, sort, cursor, include_audit]]: constant[ List workspaces. List the workspaces associated with a Watson Assistant service instance. This operation is limited to 500 requests per 30 minutes. For more information, ...
keyword[def] identifier[list_workspaces] ( identifier[self] , identifier[page_limit] = keyword[None] , identifier[include_count] = keyword[None] , identifier[sort] = keyword[None] , identifier[cursor] = keyword[None] , identifier[include_audit] = keyword[None] , ** identifier[kwargs] ): literal[string] ...
def list_workspaces(self, page_limit=None, include_count=None, sort=None, cursor=None, include_audit=None, **kwargs): """ List workspaces. List the workspaces associated with a Watson Assistant service instance. This operation is limited to 500 requests per 30 minutes. For more information,...
def comply(self, path): """Issues a chown and chmod to the file paths specified.""" utils.ensure_permissions(path, self.user.pw_name, self.group.gr_name, self.mode)
def function[comply, parameter[self, path]]: constant[Issues a chown and chmod to the file paths specified.] call[name[utils].ensure_permissions, parameter[name[path], name[self].user.pw_name, name[self].group.gr_name, name[self].mode]]
keyword[def] identifier[comply] ( identifier[self] , identifier[path] ): literal[string] identifier[utils] . identifier[ensure_permissions] ( identifier[path] , identifier[self] . identifier[user] . identifier[pw_name] , identifier[self] . identifier[group] . identifier[gr_name] , identifi...
def comply(self, path): """Issues a chown and chmod to the file paths specified.""" utils.ensure_permissions(path, self.user.pw_name, self.group.gr_name, self.mode)
def interrupt_kernel(self): """ Attempts to interrupt the running kernel. Also unsets _reading flag, to avoid runtime errors if raw_input is called again. """ if self.custom_interrupt: self._reading = False self.custom_interrupt_requested.emit() ...
def function[interrupt_kernel, parameter[self]]: constant[ Attempts to interrupt the running kernel. Also unsets _reading flag, to avoid runtime errors if raw_input is called again. ] if name[self].custom_interrupt begin[:] name[self]._reading assign[=] c...
keyword[def] identifier[interrupt_kernel] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[custom_interrupt] : identifier[self] . identifier[_reading] = keyword[False] identifier[self] . identifier[custom_interrupt_requested] . identifier[e...
def interrupt_kernel(self): """ Attempts to interrupt the running kernel. Also unsets _reading flag, to avoid runtime errors if raw_input is called again. """ if self.custom_interrupt: self._reading = False self.custom_interrupt_requested.emit() # depends on [co...
def construct(cls, project, *, run=None, name=None, data=None, **desc): """ Construct an animation, set the runner, and add in the two "reserved fields" `name` and `data`. """ from . failed import Failed exception = desc.pop('_exception', None) if exception: ...
def function[construct, parameter[cls, project]]: constant[ Construct an animation, set the runner, and add in the two "reserved fields" `name` and `data`. ] from relative_module[failed] import module[Failed] variable[exception] assign[=] call[name[desc].pop, parameter[consta...
keyword[def] identifier[construct] ( identifier[cls] , identifier[project] ,*, identifier[run] = keyword[None] , identifier[name] = keyword[None] , identifier[data] = keyword[None] ,** identifier[desc] ): literal[string] keyword[from] . identifier[failed] keyword[import] identifier[Failed] ...
def construct(cls, project, *, run=None, name=None, data=None, **desc): """ Construct an animation, set the runner, and add in the two "reserved fields" `name` and `data`. """ from .failed import Failed exception = desc.pop('_exception', None) if exception: a = Failed(pro...
def fitNull(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False, seed=None, n_times=10, factr=1e3, init_method=None): """ Fit null model """ if seed is not None: sp.random.seed(seed) read_from_file = False if cache: assert fname ...
def function[fitNull, parameter[self, verbose, cache, out_dir, fname, rewrite, seed, n_times, factr, init_method]]: constant[ Fit null model ] if compare[name[seed] is_not constant[None]] begin[:] call[name[sp].random.seed, parameter[name[seed]]] variable[read_fro...
keyword[def] identifier[fitNull] ( identifier[self] , identifier[verbose] = keyword[False] , identifier[cache] = keyword[False] , identifier[out_dir] = literal[string] , identifier[fname] = keyword[None] , identifier[rewrite] = keyword[False] , identifier[seed] = keyword[None] , identifier[n_times] = literal[int] , i...
def fitNull(self, verbose=False, cache=False, out_dir='./cache', fname=None, rewrite=False, seed=None, n_times=10, factr=1000.0, init_method=None): """ Fit null model """ if seed is not None: sp.random.seed(seed) # depends on [control=['if'], data=['seed']] read_from_file = False ...
def fnmatchcase(name, pat): """Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments. """ try: re_pat = _cache[pat] except KeyError: res = translate(pat) if len(_cache) >= _MAXCACHE: ...
def function[fnmatchcase, parameter[name, pat]]: constant[Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments. ] <ast.Try object at 0x7da1b2345d80> return[compare[call[name[re_pat].match, parameter[name[name]]] is_...
keyword[def] identifier[fnmatchcase] ( identifier[name] , identifier[pat] ): literal[string] keyword[try] : identifier[re_pat] = identifier[_cache] [ identifier[pat] ] keyword[except] identifier[KeyError] : identifier[res] = identifier[translate] ( identifier[pat] ) keywor...
def fnmatchcase(name, pat): """Test whether FILENAME matches PATTERN, including case. This is a version of fnmatch() which doesn't case-normalize its arguments. """ try: re_pat = _cache[pat] # depends on [control=['try'], data=[]] except KeyError: res = translate(pat) i...
def _get_raw_specs(self, config): """ This method extract only the "Validate.spec" from modules that were collected by ConfigReader._get_modules(). And, this method append "Validate.spec" to raw_specs. This method creates a dictionary like the following: raw_specs = { ...
def function[_get_raw_specs, parameter[self, config]]: constant[ This method extract only the "Validate.spec" from modules that were collected by ConfigReader._get_modules(). And, this method append "Validate.spec" to raw_specs. This method creates a dictionary like the following...
keyword[def] identifier[_get_raw_specs] ( identifier[self] , identifier[config] ): literal[string] identifier[raw_specs] ={} identifier[spec_name] = literal[string] identifier[modules] = identifier[self] . identifier[_get_modules] () keyword[for] identifier[s...
def _get_raw_specs(self, config): """ This method extract only the "Validate.spec" from modules that were collected by ConfigReader._get_modules(). And, this method append "Validate.spec" to raw_specs. This method creates a dictionary like the following: raw_specs = { ...
def _plot_variability(ts, variability, threshold=None, epochs=None): """Plot the timeseries and variability. Optionally plot epochs.""" import matplotlib.style import matplotlib as mpl mpl.style.use('classic') import matplotlib.pyplot as plt if variability.ndim is 1: variability = variab...
def function[_plot_variability, parameter[ts, variability, threshold, epochs]]: constant[Plot the timeseries and variability. Optionally plot epochs.] import module[matplotlib.style] import module[matplotlib] as alias[mpl] call[name[mpl].style.use, parameter[constant[classic]]] import module...
keyword[def] identifier[_plot_variability] ( identifier[ts] , identifier[variability] , identifier[threshold] = keyword[None] , identifier[epochs] = keyword[None] ): literal[string] keyword[import] identifier[matplotlib] . identifier[style] keyword[import] identifier[matplotlib] keyword[as] ident...
def _plot_variability(ts, variability, threshold=None, epochs=None): """Plot the timeseries and variability. Optionally plot epochs.""" import matplotlib.style import matplotlib as mpl mpl.style.use('classic') import matplotlib.pyplot as plt if variability.ndim is 1: variability = variab...
def init_celery(project_name): """ init celery app without the need of redundant code """ os.environ.setdefault('DJANGO_SETTINGS_MODULE', '%s.settings' % project_name) app = Celery(project_name) app.config_from_object('django.conf:settings') app.autodiscover_tasks(settings.INSTALLED_APPS, related_na...
def function[init_celery, parameter[project_name]]: constant[ init celery app without the need of redundant code ] call[name[os].environ.setdefault, parameter[constant[DJANGO_SETTINGS_MODULE], binary_operation[constant[%s.settings] <ast.Mod object at 0x7da2590d6920> name[project_name]]]] variabl...
keyword[def] identifier[init_celery] ( identifier[project_name] ): literal[string] identifier[os] . identifier[environ] . identifier[setdefault] ( literal[string] , literal[string] % identifier[project_name] ) identifier[app] = identifier[Celery] ( identifier[project_name] ) identifier[app] . ide...
def init_celery(project_name): """ init celery app without the need of redundant code """ os.environ.setdefault('DJANGO_SETTINGS_MODULE', '%s.settings' % project_name) app = Celery(project_name) app.config_from_object('django.conf:settings') app.autodiscover_tasks(settings.INSTALLED_APPS, related_na...
def __upload(self, resource, bytes): """Performs a single chunk upload.""" # note: string conversion required here due to open encoding bug in requests-oauthlib. headers = { 'x-ton-expires': http_time(self.options.get('x-ton-expires', self._DEFAULT_EXPIRE)), 'content-len...
def function[__upload, parameter[self, resource, bytes]]: constant[Performs a single chunk upload.] variable[headers] assign[=] dictionary[[<ast.Constant object at 0x7da1b0656b90>, <ast.Constant object at 0x7da1b0654100>, <ast.Constant object at 0x7da1b0657f10>], [<ast.Call object at 0x7da1b06573d0>, <a...
keyword[def] identifier[__upload] ( identifier[self] , identifier[resource] , identifier[bytes] ): literal[string] identifier[headers] ={ literal[string] : identifier[http_time] ( identifier[self] . identifier[options] . identifier[get] ( literal[string] , identifier[self] . iden...
def __upload(self, resource, bytes): """Performs a single chunk upload.""" # note: string conversion required here due to open encoding bug in requests-oauthlib. headers = {'x-ton-expires': http_time(self.options.get('x-ton-expires', self._DEFAULT_EXPIRE)), 'content-length': str(self._file_size), 'content-t...
def n_yearly_publications(self, refresh=True): """Number of journal publications in a given year.""" pub_years = [int(ab.coverDate.split('-')[0]) for ab in self.get_journal_abstracts(refresh=refresh)] return Counter(pub_years)
def function[n_yearly_publications, parameter[self, refresh]]: constant[Number of journal publications in a given year.] variable[pub_years] assign[=] <ast.ListComp object at 0x7da18f00cfd0> return[call[name[Counter], parameter[name[pub_years]]]]
keyword[def] identifier[n_yearly_publications] ( identifier[self] , identifier[refresh] = keyword[True] ): literal[string] identifier[pub_years] =[ identifier[int] ( identifier[ab] . identifier[coverDate] . identifier[split] ( literal[string] )[ literal[int] ]) keyword[for] identifier[ab]...
def n_yearly_publications(self, refresh=True): """Number of journal publications in a given year.""" pub_years = [int(ab.coverDate.split('-')[0]) for ab in self.get_journal_abstracts(refresh=refresh)] return Counter(pub_years)
def conf_budget(self, budget): """ Set limit on the number of conflicts. """ if self.minicard: pysolvers.minicard_cbudget(self.minicard, budget)
def function[conf_budget, parameter[self, budget]]: constant[ Set limit on the number of conflicts. ] if name[self].minicard begin[:] call[name[pysolvers].minicard_cbudget, parameter[name[self].minicard, name[budget]]]
keyword[def] identifier[conf_budget] ( identifier[self] , identifier[budget] ): literal[string] keyword[if] identifier[self] . identifier[minicard] : identifier[pysolvers] . identifier[minicard_cbudget] ( identifier[self] . identifier[minicard] , identifier[budget] )
def conf_budget(self, budget): """ Set limit on the number of conflicts. """ if self.minicard: pysolvers.minicard_cbudget(self.minicard, budget) # depends on [control=['if'], data=[]]
def _prepare_args(log_likelihood_fn, state, log_likelihood=None, description='log_likelihood'): """Processes input args to meet list-like assumptions.""" state_parts = list(state) if mcmc_util.is_list_like(state) else [state] state_parts = [tf.convert_to_tensor(s, name='current_state') ...
def function[_prepare_args, parameter[log_likelihood_fn, state, log_likelihood, description]]: constant[Processes input args to meet list-like assumptions.] variable[state_parts] assign[=] <ast.IfExp object at 0x7da1b03563e0> variable[state_parts] assign[=] <ast.ListComp object at 0x7da1b0356230...
keyword[def] identifier[_prepare_args] ( identifier[log_likelihood_fn] , identifier[state] , identifier[log_likelihood] = keyword[None] , identifier[description] = literal[string] ): literal[string] identifier[state_parts] = identifier[list] ( identifier[state] ) keyword[if] identifier[mcmc_util] . identifie...
def _prepare_args(log_likelihood_fn, state, log_likelihood=None, description='log_likelihood'): """Processes input args to meet list-like assumptions.""" state_parts = list(state) if mcmc_util.is_list_like(state) else [state] state_parts = [tf.convert_to_tensor(s, name='current_state') for s in state_parts]...
def resample_multipitch(times, frequencies, target_times): """Resamples multipitch time series to a new timescale. Values in ``target_times`` outside the range of ``times`` return no pitch estimate. Parameters ---------- times : np.ndarray Array of time stamps frequencies : list of np.n...
def function[resample_multipitch, parameter[times, frequencies, target_times]]: constant[Resamples multipitch time series to a new timescale. Values in ``target_times`` outside the range of ``times`` return no pitch estimate. Parameters ---------- times : np.ndarray Array of time stamps...
keyword[def] identifier[resample_multipitch] ( identifier[times] , identifier[frequencies] , identifier[target_times] ): literal[string] keyword[if] identifier[target_times] . identifier[size] == literal[int] : keyword[return] [] keyword[if] identifier[times] . identifier[size] == literal[...
def resample_multipitch(times, frequencies, target_times): """Resamples multipitch time series to a new timescale. Values in ``target_times`` outside the range of ``times`` return no pitch estimate. Parameters ---------- times : np.ndarray Array of time stamps frequencies : list of np.n...
def find_executable(name: str, flags=os.X_OK) -> List[str]: r"""Finds executable `name`. Similar to Unix ``which`` command. Returns list of zero or more full paths to `name`. """ result = [] extensions = [x for x in os.environ.get("PATHEXT", "").split(os.pathsep) if x] path = os.environ.ge...
def function[find_executable, parameter[name, flags]]: constant[Finds executable `name`. Similar to Unix ``which`` command. Returns list of zero or more full paths to `name`. ] variable[result] assign[=] list[[]] variable[extensions] assign[=] <ast.ListComp object at 0x7da20c6a92a0...
keyword[def] identifier[find_executable] ( identifier[name] : identifier[str] , identifier[flags] = identifier[os] . identifier[X_OK] )-> identifier[List] [ identifier[str] ]: literal[string] identifier[result] =[] identifier[extensions] =[ identifier[x] keyword[for] identifier[x] keyword[in] iden...
def find_executable(name: str, flags=os.X_OK) -> List[str]: """Finds executable `name`. Similar to Unix ``which`` command. Returns list of zero or more full paths to `name`. """ result = [] extensions = [x for x in os.environ.get('PATHEXT', '').split(os.pathsep) if x] path = os.environ.get...
def load_site_config(name): """Load and return site configuration as a dict.""" return _load_config_json( os.path.join( CONFIG_PATH, CONFIG_SITES_PATH, name + CONFIG_EXT ) )
def function[load_site_config, parameter[name]]: constant[Load and return site configuration as a dict.] return[call[name[_load_config_json], parameter[call[name[os].path.join, parameter[name[CONFIG_PATH], name[CONFIG_SITES_PATH], binary_operation[name[name] + name[CONFIG_EXT]]]]]]]
keyword[def] identifier[load_site_config] ( identifier[name] ): literal[string] keyword[return] identifier[_load_config_json] ( identifier[os] . identifier[path] . identifier[join] ( identifier[CONFIG_PATH] , identifier[CONFIG_SITES_PATH] , identifier[name] + identifier[CONFIG_EXT] ...
def load_site_config(name): """Load and return site configuration as a dict.""" return _load_config_json(os.path.join(CONFIG_PATH, CONFIG_SITES_PATH, name + CONFIG_EXT))
def read_from_file(self, filename): """Load a PSF file""" self.clear() with open(filename) as f: # A) check the first line line = next(f) if not line.startswith("PSF"): raise FileFormatError("Error while reading: A PSF file must start with a li...
def function[read_from_file, parameter[self, filename]]: constant[Load a PSF file] call[name[self].clear, parameter[]] with call[name[open], parameter[name[filename]]] begin[:] variable[line] assign[=] call[name[next], parameter[name[f]]] if <ast.UnaryOp object at...
keyword[def] identifier[read_from_file] ( identifier[self] , identifier[filename] ): literal[string] identifier[self] . identifier[clear] () keyword[with] identifier[open] ( identifier[filename] ) keyword[as] identifier[f] : identifier[line] = identifier[next] ( ide...
def read_from_file(self, filename): """Load a PSF file""" self.clear() with open(filename) as f: # A) check the first line line = next(f) if not line.startswith('PSF'): raise FileFormatError("Error while reading: A PSF file must start with a line 'PSF'.") # depends on [c...
def MakeDeployableBinary(self, template_path, output_path): """This will add the config to the client template.""" context = self.context + ["Client Context"] utils.EnsureDirExists(os.path.dirname(output_path)) client_config_data = self.GetClientConfig(context) shutil.copyfile(template_path, output...
def function[MakeDeployableBinary, parameter[self, template_path, output_path]]: constant[This will add the config to the client template.] variable[context] assign[=] binary_operation[name[self].context + list[[<ast.Constant object at 0x7da20cabd690>]]] call[name[utils].EnsureDirExists, paramet...
keyword[def] identifier[MakeDeployableBinary] ( identifier[self] , identifier[template_path] , identifier[output_path] ): literal[string] identifier[context] = identifier[self] . identifier[context] +[ literal[string] ] identifier[utils] . identifier[EnsureDirExists] ( identifier[os] . identifier[path...
def MakeDeployableBinary(self, template_path, output_path): """This will add the config to the client template.""" context = self.context + ['Client Context'] utils.EnsureDirExists(os.path.dirname(output_path)) client_config_data = self.GetClientConfig(context) shutil.copyfile(template_path, output_...
def scatter(self, *args, **kwargs): ''' Creates a scatter plot of the given x and y items. Args: x (str or seq[float]) : values or field names of center x coordinates y (str or seq[float]) : values or field names of center y coordinates size (str or list[float]) : ...
def function[scatter, parameter[self]]: constant[ Creates a scatter plot of the given x and y items. Args: x (str or seq[float]) : values or field names of center x coordinates y (str or seq[float]) : values or field names of center y coordinates size (str or list[...
keyword[def] identifier[scatter] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[marker_type] = identifier[kwargs] . identifier[pop] ( literal[string] , literal[string] ) keyword[if] identifier[isinstance] ( identifier[marker_type] , identifier...
def scatter(self, *args, **kwargs): """ Creates a scatter plot of the given x and y items. Args: x (str or seq[float]) : values or field names of center x coordinates y (str or seq[float]) : values or field names of center y coordinates size (str or list[float]) : valu...
def get_environment() -> Environment: """ Returns the jinja2 templating environment updated with the most recent cauldron environment configurations :return: """ env = JINJA_ENVIRONMENT loader = env.loader resource_path = environ.configs.make_path( 'resources', 'templates', ...
def function[get_environment, parameter[]]: constant[ Returns the jinja2 templating environment updated with the most recent cauldron environment configurations :return: ] variable[env] assign[=] name[JINJA_ENVIRONMENT] variable[loader] assign[=] name[env].loader variabl...
keyword[def] identifier[get_environment] ()-> identifier[Environment] : literal[string] identifier[env] = identifier[JINJA_ENVIRONMENT] identifier[loader] = identifier[env] . identifier[loader] identifier[resource_path] = identifier[environ] . identifier[configs] . identifier[make_path] ( ...
def get_environment() -> Environment: """ Returns the jinja2 templating environment updated with the most recent cauldron environment configurations :return: """ env = JINJA_ENVIRONMENT loader = env.loader resource_path = environ.configs.make_path('resources', 'templates', override_key=...
def reduce_log_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') sum_op = symbol.sum(inputs[0], axis=attrs.get('axes'), keepdims=keep_dims) log_sym = symbol.log(sum_op) ...
def function[reduce_log_sum, parameter[attrs, inputs, proto_obj]]: constant[Reduce the array along a given axis by log sum value] variable[keep_dims] assign[=] <ast.IfExp object at 0x7da1b204cac0> variable[sum_op] assign[=] call[name[symbol].sum, parameter[call[name[inputs]][constant[0]]]] ...
keyword[def] identifier[reduce_log_sum] ( identifier[attrs] , identifier[inputs] , identifier[proto_obj] ): literal[string] identifier[keep_dims] = keyword[True] keyword[if] literal[string] keyword[not] keyword[in] identifier[attrs] keyword[else] identifier[attrs] . identifier[get] ( literal[string]...
def reduce_log_sum(attrs, inputs, proto_obj): """Reduce the array along a given axis by log sum value""" keep_dims = True if 'keepdims' not in attrs else attrs.get('keepdims') sum_op = symbol.sum(inputs[0], axis=attrs.get('axes'), keepdims=keep_dims) log_sym = symbol.log(sum_op) return (log_sym, att...
def load_section(self, section): """ Loads the contents of a #Section. The `section.identifier` is the name of the object that we need to load. # Arguments section (Section): The section to load. Fill the `section.title` and `section.content` values. Optionally, `section.loader_context` c...
def function[load_section, parameter[self, section]]: constant[ Loads the contents of a #Section. The `section.identifier` is the name of the object that we need to load. # Arguments section (Section): The section to load. Fill the `section.title` and `section.content` values. Optiona...
keyword[def] identifier[load_section] ( identifier[self] , identifier[section] ): literal[string] keyword[assert] identifier[section] . identifier[identifier] keyword[is] keyword[not] keyword[None] identifier[obj] , identifier[scope] = identifier[import_object_with_scope] ( identifier[section] ....
def load_section(self, section): """ Loads the contents of a #Section. The `section.identifier` is the name of the object that we need to load. # Arguments section (Section): The section to load. Fill the `section.title` and `section.content` values. Optionally, `section.loader_context` c...
def _decode(hashid, salt, alphabet, separators, guards): """Helper method that restores the values encoded in a hashid without argument checks.""" parts = tuple(_split(hashid, guards)) hashid = parts[1] if 2 <= len(parts) <= 3 else parts[0] if not hashid: return lottery_char = hashid[0...
def function[_decode, parameter[hashid, salt, alphabet, separators, guards]]: constant[Helper method that restores the values encoded in a hashid without argument checks.] variable[parts] assign[=] call[name[tuple], parameter[call[name[_split], parameter[name[hashid], name[guards]]]]] variab...
keyword[def] identifier[_decode] ( identifier[hashid] , identifier[salt] , identifier[alphabet] , identifier[separators] , identifier[guards] ): literal[string] identifier[parts] = identifier[tuple] ( identifier[_split] ( identifier[hashid] , identifier[guards] )) identifier[hashid] = identifier[parts...
def _decode(hashid, salt, alphabet, separators, guards): """Helper method that restores the values encoded in a hashid without argument checks.""" parts = tuple(_split(hashid, guards)) hashid = parts[1] if 2 <= len(parts) <= 3 else parts[0] if not hashid: return # depends on [control=['if']...
def _check_for_degenerate_interesting_groups(items): """ Make sure interesting_groups specify existing metadata and that the interesting_group is not all of the same for all of the samples """ igkey = ("algorithm", "bcbiornaseq", "interesting_groups") interesting_groups = tz.get_in(igkey, items[0], ...
def function[_check_for_degenerate_interesting_groups, parameter[items]]: constant[ Make sure interesting_groups specify existing metadata and that the interesting_group is not all of the same for all of the samples ] variable[igkey] assign[=] tuple[[<ast.Constant object at 0x7da1b1846500>, <ast...
keyword[def] identifier[_check_for_degenerate_interesting_groups] ( identifier[items] ): literal[string] identifier[igkey] =( literal[string] , literal[string] , literal[string] ) identifier[interesting_groups] = identifier[tz] . identifier[get_in] ( identifier[igkey] , identifier[items] [ literal[int...
def _check_for_degenerate_interesting_groups(items): """ Make sure interesting_groups specify existing metadata and that the interesting_group is not all of the same for all of the samples """ igkey = ('algorithm', 'bcbiornaseq', 'interesting_groups') interesting_groups = tz.get_in(igkey, items[0], ...
def simulate(args): """ %prog simulate run_dir 1 300 Simulate BAMs with varying inserts with dwgsim. The above command will simulate between 1 to 300 CAGs in the HD region, in a directory called `run_dir`. """ p = OptionParser(simulate.__doc__) p.add_option("--method", choices=("wgsim",...
def function[simulate, parameter[args]]: constant[ %prog simulate run_dir 1 300 Simulate BAMs with varying inserts with dwgsim. The above command will simulate between 1 to 300 CAGs in the HD region, in a directory called `run_dir`. ] variable[p] assign[=] call[name[OptionParser], p...
keyword[def] identifier[simulate] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[simulate] . identifier[__doc__] ) identifier[p] . identifier[add_option] ( literal[string] , identifier[choices] =( literal[string] , literal[string] ), identifier[default] = l...
def simulate(args): """ %prog simulate run_dir 1 300 Simulate BAMs with varying inserts with dwgsim. The above command will simulate between 1 to 300 CAGs in the HD region, in a directory called `run_dir`. """ p = OptionParser(simulate.__doc__) p.add_option('--method', choices=('wgsim',...
def check_content(self, content_pattern_names, content, encoding): """Check which of the named patterns matches the given content. Returns a pair (matching, nonmatching), in which each element is a tuple of pattern names. :param iterable content_pattern_names: names of content patterns to check. :para...
def function[check_content, parameter[self, content_pattern_names, content, encoding]]: constant[Check which of the named patterns matches the given content. Returns a pair (matching, nonmatching), in which each element is a tuple of pattern names. :param iterable content_pattern_names: names of conte...
keyword[def] identifier[check_content] ( identifier[self] , identifier[content_pattern_names] , identifier[content] , identifier[encoding] ): literal[string] keyword[if] keyword[not] identifier[content_pattern_names] keyword[or] keyword[not] identifier[encoding] : keyword[return] (),() id...
def check_content(self, content_pattern_names, content, encoding): """Check which of the named patterns matches the given content. Returns a pair (matching, nonmatching), in which each element is a tuple of pattern names. :param iterable content_pattern_names: names of content patterns to check. :para...
def has_in_members(self, member): """ :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: bool """ assert isinstance(member, github.NamedUser.NamedUser), member status, head...
def function[has_in_members, parameter[self, member]]: constant[ :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: bool ] assert[call[name[isinstance], parameter[name[member], name[gi...
keyword[def] identifier[has_in_members] ( identifier[self] , identifier[member] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[member] , identifier[github] . identifier[NamedUser] . identifier[NamedUser] ), identifier[member] identifier[status] , identifier[header...
def has_in_members(self, member): """ :calls: `GET /teams/:id/members/:user <http://developer.github.com/v3/orgs/teams>`_ :param member: :class:`github.NamedUser.NamedUser` :rtype: bool """ assert isinstance(member, github.NamedUser.NamedUser), member (status, headers, data) ...
def _maybe_create_new_template(self): """Returns True if a new template is created as opposed to reusing the existing template. When there are multiple available formats, the formatter uses the first format where a formatting template could be created. """ ii = 0 while i...
def function[_maybe_create_new_template, parameter[self]]: constant[Returns True if a new template is created as opposed to reusing the existing template. When there are multiple available formats, the formatter uses the first format where a formatting template could be created. ] ...
keyword[def] identifier[_maybe_create_new_template] ( identifier[self] ): literal[string] identifier[ii] = literal[int] keyword[while] identifier[ii] < identifier[len] ( identifier[self] . identifier[_possible_formats] ): identifier[number_format] = identifier[self] . identi...
def _maybe_create_new_template(self): """Returns True if a new template is created as opposed to reusing the existing template. When there are multiple available formats, the formatter uses the first format where a formatting template could be created. """ ii = 0 while ii < len(self...
def replace(table, field, a, b, **kwargs): """ Convenience function to replace all occurrences of `a` with `b` under the given field. See also :func:`convert`. The ``where`` keyword argument can be given with a callable or expression which is evaluated on each row and which should return True if th...
def function[replace, parameter[table, field, a, b]]: constant[ Convenience function to replace all occurrences of `a` with `b` under the given field. See also :func:`convert`. The ``where`` keyword argument can be given with a callable or expression which is evaluated on each row and which sho...
keyword[def] identifier[replace] ( identifier[table] , identifier[field] , identifier[a] , identifier[b] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[convert] ( identifier[table] , identifier[field] ,{ identifier[a] : identifier[b] },** identifier[kwargs] )
def replace(table, field, a, b, **kwargs): """ Convenience function to replace all occurrences of `a` with `b` under the given field. See also :func:`convert`. The ``where`` keyword argument can be given with a callable or expression which is evaluated on each row and which should return True if th...
def section_tortuosity(section): '''Tortuosity of a section The tortuosity is defined as the ratio of the path length of a section and the euclidian distnce between its end points. The path length is the sum of distances between consecutive points. If the section contains less than 2 points, the ...
def function[section_tortuosity, parameter[section]]: constant[Tortuosity of a section The tortuosity is defined as the ratio of the path length of a section and the euclidian distnce between its end points. The path length is the sum of distances between consecutive points. If the section co...
keyword[def] identifier[section_tortuosity] ( identifier[section] ): literal[string] identifier[pts] = identifier[section] . identifier[points] keyword[return] literal[int] keyword[if] identifier[len] ( identifier[pts] )< literal[int] keyword[else] identifier[mm] . identifier[section_length] ( i...
def section_tortuosity(section): """Tortuosity of a section The tortuosity is defined as the ratio of the path length of a section and the euclidian distnce between its end points. The path length is the sum of distances between consecutive points. If the section contains less than 2 points, the ...
def laplacian_pyramid_image(shape, n_levels=4, sd=None): """Simple laplacian pyramid paramaterization of an image. For more flexibility, use a sum of lowres_tensor()s. Args: shape: shape of resulting image, [batch, width, height, channels]. n_levels: number of levels of laplacian pyarmid. ...
def function[laplacian_pyramid_image, parameter[shape, n_levels, sd]]: constant[Simple laplacian pyramid paramaterization of an image. For more flexibility, use a sum of lowres_tensor()s. Args: shape: shape of resulting image, [batch, width, height, channels]. n_levels: number of levels of...
keyword[def] identifier[laplacian_pyramid_image] ( identifier[shape] , identifier[n_levels] = literal[int] , identifier[sd] = keyword[None] ): literal[string] identifier[batch_dims] = identifier[shape] [:- literal[int] ] identifier[w] , identifier[h] , identifier[ch] = identifier[shape] [- literal[int...
def laplacian_pyramid_image(shape, n_levels=4, sd=None): """Simple laplacian pyramid paramaterization of an image. For more flexibility, use a sum of lowres_tensor()s. Args: shape: shape of resulting image, [batch, width, height, channels]. n_levels: number of levels of laplacian pyarmid. ...
async def remove_participant(self, p: Participant): """ remove a participant from the tournament |methcoro| Args: p: the participant to remove Raises: APIException """ await self.connection('DELETE', 'tournaments/{}/participants/{}'.format(self...
<ast.AsyncFunctionDef object at 0x7da18fe909d0>
keyword[async] keyword[def] identifier[remove_participant] ( identifier[self] , identifier[p] : identifier[Participant] ): literal[string] keyword[await] identifier[self] . identifier[connection] ( literal[string] , literal[string] . identifier[format] ( identifier[self] . identifier[_id] , ident...
async def remove_participant(self, p: Participant): """ remove a participant from the tournament |methcoro| Args: p: the participant to remove Raises: APIException """ await self.connection('DELETE', 'tournaments/{}/participants/{}'.format(self._id, p....
def is_alive(self): """Returns a boolean flag with the state of the connection.""" null = chr(0) if self.remote_conn is None: log.error("Connection is not initialised, is_alive returns False") return False if self.protocol == "telnet": try: ...
def function[is_alive, parameter[self]]: constant[Returns a boolean flag with the state of the connection.] variable[null] assign[=] call[name[chr], parameter[constant[0]]] if compare[name[self].remote_conn is constant[None]] begin[:] call[name[log].error, parameter[constant[Conn...
keyword[def] identifier[is_alive] ( identifier[self] ): literal[string] identifier[null] = identifier[chr] ( literal[int] ) keyword[if] identifier[self] . identifier[remote_conn] keyword[is] keyword[None] : identifier[log] . identifier[error] ( literal[string] ) ...
def is_alive(self): """Returns a boolean flag with the state of the connection.""" null = chr(0) if self.remote_conn is None: log.error('Connection is not initialised, is_alive returns False') return False # depends on [control=['if'], data=[]] if self.protocol == 'telnet': try:...
def is_letter(uni_char): """Determine whether the given Unicode character is a Unicode letter""" category = Category.get(uni_char) return (category == Category.UPPERCASE_LETTER or category == Category.LOWERCASE_LETTER or category == Category.TITLECASE_LETTER or category =...
def function[is_letter, parameter[uni_char]]: constant[Determine whether the given Unicode character is a Unicode letter] variable[category] assign[=] call[name[Category].get, parameter[name[uni_char]]] return[<ast.BoolOp object at 0x7da1b188cdf0>]
keyword[def] identifier[is_letter] ( identifier[uni_char] ): literal[string] identifier[category] = identifier[Category] . identifier[get] ( identifier[uni_char] ) keyword[return] ( identifier[category] == identifier[Category] . identifier[UPPERCASE_LETTER] keyword[or] identifier[category] == i...
def is_letter(uni_char): """Determine whether the given Unicode character is a Unicode letter""" category = Category.get(uni_char) return category == Category.UPPERCASE_LETTER or category == Category.LOWERCASE_LETTER or category == Category.TITLECASE_LETTER or (category == Category.MODIFIER_LETTER) or (cate...
def uavionix_adsb_out_cfg_encode(self, ICAO, callsign, emitterType, aircraftSize, gpsOffsetLat, gpsOffsetLon, stallSpeed, rfSelect): ''' Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) ICAO ...
def function[uavionix_adsb_out_cfg_encode, parameter[self, ICAO, callsign, emitterType, aircraftSize, gpsOffsetLat, gpsOffsetLon, stallSpeed, rfSelect]]: constant[ Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) ...
keyword[def] identifier[uavionix_adsb_out_cfg_encode] ( identifier[self] , identifier[ICAO] , identifier[callsign] , identifier[emitterType] , identifier[aircraftSize] , identifier[gpsOffsetLat] , identifier[gpsOffsetLon] , identifier[stallSpeed] , identifier[rfSelect] ): literal[string] ...
def uavionix_adsb_out_cfg_encode(self, ICAO, callsign, emitterType, aircraftSize, gpsOffsetLat, gpsOffsetLon, stallSpeed, rfSelect): """ Static data to configure the ADS-B transponder (send within 10 sec of a POR and every 10 sec thereafter) ICAO ...
def intersection(self, key, *others): """Return a new set with elements common to the set and all others.""" if not isinstance(key, str): raise ValueError("String expected.") self.db.sinterstore(key, [self.key] + [o.key for o in others]) return Set(key)
def function[intersection, parameter[self, key]]: constant[Return a new set with elements common to the set and all others.] if <ast.UnaryOp object at 0x7da2044c0670> begin[:] <ast.Raise object at 0x7da2044c29b0> call[name[self].db.sinterstore, parameter[name[key], binary_operation[list[...
keyword[def] identifier[intersection] ( identifier[self] , identifier[key] ,* identifier[others] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[key] , identifier[str] ): keyword[raise] identifier[ValueError] ( literal[string] ) identifier[se...
def intersection(self, key, *others): """Return a new set with elements common to the set and all others.""" if not isinstance(key, str): raise ValueError('String expected.') # depends on [control=['if'], data=[]] self.db.sinterstore(key, [self.key] + [o.key for o in others]) return Set(key)
def parametrized_function(decorator): '''Decorator used to create decorators with arguments. Should be used with function returning another function that will be called with the original function has the first parameter. No difference are made between method and function, so the wrapper function...
def function[parametrized_function, parameter[decorator]]: constant[Decorator used to create decorators with arguments. Should be used with function returning another function that will be called with the original function has the first parameter. No difference are made between method and functi...
keyword[def] identifier[parametrized_function] ( identifier[decorator] ): literal[string] keyword[def] identifier[meta_decorator] (* identifier[args] ,** identifier[kwargs] ): keyword[return] identifier[_NormalMetaDecorator] ( identifier[decorator] , identifier[args] , identifier[kwargs] ) ...
def parametrized_function(decorator): """Decorator used to create decorators with arguments. Should be used with function returning another function that will be called with the original function has the first parameter. No difference are made between method and function, so the wrapper function...
def start_server(self): """Start the RPC Server. :return: """ self._stopped.clear() if not self._connection or self._connection.is_closed: self._create_connection() while not self._stopped.is_set(): try: # Check our connection for ...
def function[start_server, parameter[self]]: constant[Start the RPC Server. :return: ] call[name[self]._stopped.clear, parameter[]] if <ast.BoolOp object at 0x7da2054a6b60> begin[:] call[name[self]._create_connection, parameter[]] while <ast.UnaryOp objec...
keyword[def] identifier[start_server] ( identifier[self] ): literal[string] identifier[self] . identifier[_stopped] . identifier[clear] () keyword[if] keyword[not] identifier[self] . identifier[_connection] keyword[or] identifier[self] . identifier[_connection] . identifier[is_closed] ...
def start_server(self): """Start the RPC Server. :return: """ self._stopped.clear() if not self._connection or self._connection.is_closed: self._create_connection() # depends on [control=['if'], data=[]] while not self._stopped.is_set(): try: # Check our con...
def conform(self, frame, axis='items'): """ Conform input DataFrame to align with chosen axis pair. Parameters ---------- frame : DataFrame axis : {'items', 'major', 'minor'} Axis the input corresponds to. E.g., if axis='major', then the frame's ...
def function[conform, parameter[self, frame, axis]]: constant[ Conform input DataFrame to align with chosen axis pair. Parameters ---------- frame : DataFrame axis : {'items', 'major', 'minor'} Axis the input corresponds to. E.g., if axis='major', then ...
keyword[def] identifier[conform] ( identifier[self] , identifier[frame] , identifier[axis] = literal[string] ): literal[string] identifier[axes] = identifier[self] . identifier[_get_plane_axes] ( identifier[axis] ) keyword[return] identifier[frame] . identifier[reindex] (** identifier[sel...
def conform(self, frame, axis='items'): """ Conform input DataFrame to align with chosen axis pair. Parameters ---------- frame : DataFrame axis : {'items', 'major', 'minor'} Axis the input corresponds to. E.g., if axis='major', then the frame's colu...
def sort_protein_sequences(protein_sequences): """ Sort protein sequences in decreasing order of priority """ return list( sorted( protein_sequences, key=ProteinSequence.ascending_sort_key, reverse=True))
def function[sort_protein_sequences, parameter[protein_sequences]]: constant[ Sort protein sequences in decreasing order of priority ] return[call[name[list], parameter[call[name[sorted], parameter[name[protein_sequences]]]]]]
keyword[def] identifier[sort_protein_sequences] ( identifier[protein_sequences] ): literal[string] keyword[return] identifier[list] ( identifier[sorted] ( identifier[protein_sequences] , identifier[key] = identifier[ProteinSequence] . identifier[ascending_sort_key] , identifier[reverse...
def sort_protein_sequences(protein_sequences): """ Sort protein sequences in decreasing order of priority """ return list(sorted(protein_sequences, key=ProteinSequence.ascending_sort_key, reverse=True))
def sendError(self, errorcode): """This method uses the socket passed, and uses the errorcode to compose and send an error packet.""" log.debug("In sendError, being asked to send error %d", errorcode) errpkt = TftpPacketERR() errpkt.errorcode = errorcode if self.context.t...
def function[sendError, parameter[self, errorcode]]: constant[This method uses the socket passed, and uses the errorcode to compose and send an error packet.] call[name[log].debug, parameter[constant[In sendError, being asked to send error %d], name[errorcode]]] variable[errpkt] assign[=...
keyword[def] identifier[sendError] ( identifier[self] , identifier[errorcode] ): literal[string] identifier[log] . identifier[debug] ( literal[string] , identifier[errorcode] ) identifier[errpkt] = identifier[TftpPacketERR] () identifier[errpkt] . identifier[errorcode] = identifie...
def sendError(self, errorcode): """This method uses the socket passed, and uses the errorcode to compose and send an error packet.""" log.debug('In sendError, being asked to send error %d', errorcode) errpkt = TftpPacketERR() errpkt.errorcode = errorcode if self.context.tidport == None: ...
def releaseNetToMs(): """RELEASE Section 9.3.18.1""" a = TpPd(pd=0x3) b = MessageType(mesType=0x2d) # 00101101 c = CauseHdr(ieiC=0x08, eightBitC=0x0) d = CauseHdr(ieiC=0x08, eightBitC=0x0) e = FacilityHdr(ieiF=0x1C, eightBitF=0x0) f = UserUserHdr(ieiUU=0x7E, eightBitUU=0x0) packet = a /...
def function[releaseNetToMs, parameter[]]: constant[RELEASE Section 9.3.18.1] variable[a] assign[=] call[name[TpPd], parameter[]] variable[b] assign[=] call[name[MessageType], parameter[]] variable[c] assign[=] call[name[CauseHdr], parameter[]] variable[d] assign[=] call[name[Cau...
keyword[def] identifier[releaseNetToMs] (): literal[string] identifier[a] = identifier[TpPd] ( identifier[pd] = literal[int] ) identifier[b] = identifier[MessageType] ( identifier[mesType] = literal[int] ) identifier[c] = identifier[CauseHdr] ( identifier[ieiC] = literal[int] , identifier[eightBi...
def releaseNetToMs(): """RELEASE Section 9.3.18.1""" a = TpPd(pd=3) b = MessageType(mesType=45) # 00101101 c = CauseHdr(ieiC=8, eightBitC=0) d = CauseHdr(ieiC=8, eightBitC=0) e = FacilityHdr(ieiF=28, eightBitF=0) f = UserUserHdr(ieiUU=126, eightBitUU=0) packet = a / b / c / d / e / f ...
def _correlate(self): """ Run correlation algorithm. """ a = self.algorithm(**self.algorithm_params) self.correlation_result = a.run()
def function[_correlate, parameter[self]]: constant[ Run correlation algorithm. ] variable[a] assign[=] call[name[self].algorithm, parameter[]] name[self].correlation_result assign[=] call[name[a].run, parameter[]]
keyword[def] identifier[_correlate] ( identifier[self] ): literal[string] identifier[a] = identifier[self] . identifier[algorithm] (** identifier[self] . identifier[algorithm_params] ) identifier[self] . identifier[correlation_result] = identifier[a] . identifier[run] ()
def _correlate(self): """ Run correlation algorithm. """ a = self.algorithm(**self.algorithm_params) self.correlation_result = a.run()
def rotate_left(self): """ Rotate the node to the left. """ right = self.right new = self._replace(right=self.right.left, red=True) top = right._replace(left=new, red=self.red) return top
def function[rotate_left, parameter[self]]: constant[ Rotate the node to the left. ] variable[right] assign[=] name[self].right variable[new] assign[=] call[name[self]._replace, parameter[]] variable[top] assign[=] call[name[right]._replace, parameter[]] return[name[t...
keyword[def] identifier[rotate_left] ( identifier[self] ): literal[string] identifier[right] = identifier[self] . identifier[right] identifier[new] = identifier[self] . identifier[_replace] ( identifier[right] = identifier[self] . identifier[right] . identifier[left] , identifier[red] = ...
def rotate_left(self): """ Rotate the node to the left. """ right = self.right new = self._replace(right=self.right.left, red=True) top = right._replace(left=new, red=self.red) return top
def _generate_async(self, generator): """ Return the previous generator object after having run the first element evaluation as a background task. Args: generator (iterable): A generator function. Returns: iterable: The generator function with first elem...
def function[_generate_async, parameter[self, generator]]: constant[ Return the previous generator object after having run the first element evaluation as a background task. Args: generator (iterable): A generator function. Returns: iterable: The generat...
keyword[def] identifier[_generate_async] ( identifier[self] , identifier[generator] ): literal[string] identifier[first_value_future] = identifier[self] . identifier[_workers] . identifier[submit] ( identifier[next] , identifier[generator] ) keyword[def] identifier[get_first_element] ( i...
def _generate_async(self, generator): """ Return the previous generator object after having run the first element evaluation as a background task. Args: generator (iterable): A generator function. Returns: iterable: The generator function with first element ...
def set_comparison(self): """Defines the comparison values for the ratio. This function is added for easier modularity. """ self.comp1 = self.zvals[0] self.comp2 = self.zvals[1] return
def function[set_comparison, parameter[self]]: constant[Defines the comparison values for the ratio. This function is added for easier modularity. ] name[self].comp1 assign[=] call[name[self].zvals][constant[0]] name[self].comp2 assign[=] call[name[self].zvals][constant[1]] ...
keyword[def] identifier[set_comparison] ( identifier[self] ): literal[string] identifier[self] . identifier[comp1] = identifier[self] . identifier[zvals] [ literal[int] ] identifier[self] . identifier[comp2] = identifier[self] . identifier[zvals] [ literal[int] ] keyword[return]
def set_comparison(self): """Defines the comparison values for the ratio. This function is added for easier modularity. """ self.comp1 = self.zvals[0] self.comp2 = self.zvals[1] return
async def send_traceback(destination: discord.abc.Messageable, verbosity: int, *exc_info): """ Sends a traceback of an exception to a destination. Used when REPL fails for any reason. :param destination: Where to send this information to :param verbosity: How far back this traceback should go. 0 sh...
<ast.AsyncFunctionDef object at 0x7da1b1e68310>
keyword[async] keyword[def] identifier[send_traceback] ( identifier[destination] : identifier[discord] . identifier[abc] . identifier[Messageable] , identifier[verbosity] : identifier[int] ,* identifier[exc_info] ): literal[string] identifier[etype] , identifier[value] , identifier[trace] = identifi...
async def send_traceback(destination: discord.abc.Messageable, verbosity: int, *exc_info): """ Sends a traceback of an exception to a destination. Used when REPL fails for any reason. :param destination: Where to send this information to :param verbosity: How far back this traceback should go. 0 sh...
def _verify_barycentric(lambda1, lambda2, lambda3): """Verifies that weights are barycentric and on the reference triangle. I.e., checks that they sum to one and are all non-negative. Args: lambda1 (float): Parameter along the reference triangle. lambda2 (float): Parame...
def function[_verify_barycentric, parameter[lambda1, lambda2, lambda3]]: constant[Verifies that weights are barycentric and on the reference triangle. I.e., checks that they sum to one and are all non-negative. Args: lambda1 (float): Parameter along the reference triangle. ...
keyword[def] identifier[_verify_barycentric] ( identifier[lambda1] , identifier[lambda2] , identifier[lambda3] ): literal[string] identifier[weights_total] = identifier[lambda1] + identifier[lambda2] + identifier[lambda3] keyword[if] keyword[not] identifier[np] . identifier[allclose] ( ...
def _verify_barycentric(lambda1, lambda2, lambda3): """Verifies that weights are barycentric and on the reference triangle. I.e., checks that they sum to one and are all non-negative. Args: lambda1 (float): Parameter along the reference triangle. lambda2 (float): Parameter ...
def connection_lost(self, exc: Optional[Exception]) -> None: """ 7.1.4. The WebSocket Connection is Closed. """ logger.debug("%s - event = connection_lost(%s)", self.side, exc) self.state = State.CLOSED logger.debug("%s - state = CLOSED", self.side) if not hasatt...
def function[connection_lost, parameter[self, exc]]: constant[ 7.1.4. The WebSocket Connection is Closed. ] call[name[logger].debug, parameter[constant[%s - event = connection_lost(%s)], name[self].side, name[exc]]] name[self].state assign[=] name[State].CLOSED call[name...
keyword[def] identifier[connection_lost] ( identifier[self] , identifier[exc] : identifier[Optional] [ identifier[Exception] ])-> keyword[None] : literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[self] . identifier[side] , identifier[exc] ) identifier[se...
def connection_lost(self, exc: Optional[Exception]) -> None: """ 7.1.4. The WebSocket Connection is Closed. """ logger.debug('%s - event = connection_lost(%s)', self.side, exc) self.state = State.CLOSED logger.debug('%s - state = CLOSED', self.side) if not hasattr(self, 'close_code'...
def add_link(self, targets, weight): """ Add link(s) pointing to ``targets``. If a link already exists pointing to a target, just add ``weight`` to that link's weight Args: targets (Node or list[Node]): node or nodes to link to weight (int or float): wei...
def function[add_link, parameter[self, targets, weight]]: constant[ Add link(s) pointing to ``targets``. If a link already exists pointing to a target, just add ``weight`` to that link's weight Args: targets (Node or list[Node]): node or nodes to link to ...
keyword[def] identifier[add_link] ( identifier[self] , identifier[targets] , identifier[weight] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[targets] , identifier[list] ): identifier[target_list] =[ identifier[targets] ] keyword[el...
def add_link(self, targets, weight): """ Add link(s) pointing to ``targets``. If a link already exists pointing to a target, just add ``weight`` to that link's weight Args: targets (Node or list[Node]): node or nodes to link to weight (int or float): weight ...
def import_wd_atmcof(self, plfile, atmfile, wdidx, Nabun=19, Nlogg=11, Npb=25, Nints=4): """ Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: ...
def function[import_wd_atmcof, parameter[self, plfile, atmfile, wdidx, Nabun, Nlogg, Npb, Nints]]: constant[ Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat ...
keyword[def] identifier[import_wd_atmcof] ( identifier[self] , identifier[plfile] , identifier[atmfile] , identifier[wdidx] , identifier[Nabun] = literal[int] , identifier[Nlogg] = literal[int] , identifier[Npb] = literal[int] , identifier[Nints] = literal[int] ): literal[string] ...
def import_wd_atmcof(self, plfile, atmfile, wdidx, Nabun=19, Nlogg=11, Npb=25, Nints=4): """ Parses WD's atmcof and reads in all Legendre polynomials for the given passband. @plfile: path and filename of atmcofplanck.dat @atmfile: path and filename of atmcof.dat @wdidx: WD i...
def refactor_module_to_package(self): """Convert the current module into a package.""" refactor = ModuleToPackage(self.project, self.resource) return self._get_changes(refactor)
def function[refactor_module_to_package, parameter[self]]: constant[Convert the current module into a package.] variable[refactor] assign[=] call[name[ModuleToPackage], parameter[name[self].project, name[self].resource]] return[call[name[self]._get_changes, parameter[name[refactor]]]]
keyword[def] identifier[refactor_module_to_package] ( identifier[self] ): literal[string] identifier[refactor] = identifier[ModuleToPackage] ( identifier[self] . identifier[project] , identifier[self] . identifier[resource] ) keyword[return] identifier[self] . identifier[_get_changes] ( i...
def refactor_module_to_package(self): """Convert the current module into a package.""" refactor = ModuleToPackage(self.project, self.resource) return self._get_changes(refactor)
def get_original(document, xslt): """Get the original chain given document path and xslt local path :param str document: local absolute path to document :param str xslt: local absolute path to xst file :return: new chain generated. :rtype: str """ dom = etree.par...
def function[get_original, parameter[document, xslt]]: constant[Get the original chain given document path and xslt local path :param str document: local absolute path to document :param str xslt: local absolute path to xst file :return: new chain generated. :rtype: str ...
keyword[def] identifier[get_original] ( identifier[document] , identifier[xslt] ): literal[string] identifier[dom] = identifier[etree] . identifier[parse] ( identifier[document] ) identifier[xslt] = identifier[etree] . identifier[parse] ( identifier[xslt] ) ident...
def get_original(document, xslt): """Get the original chain given document path and xslt local path :param str document: local absolute path to document :param str xslt: local absolute path to xst file :return: new chain generated. :rtype: str """ dom = etree.parse(docum...
def cleaned_up_slab(self): """ Returns a slab with the adsorbates removed """ ads_strs = list(self.ads_entries_dict.keys()) cleaned = self.structure.copy() cleaned.remove_species(ads_strs) return cleaned
def function[cleaned_up_slab, parameter[self]]: constant[ Returns a slab with the adsorbates removed ] variable[ads_strs] assign[=] call[name[list], parameter[call[name[self].ads_entries_dict.keys, parameter[]]]] variable[cleaned] assign[=] call[name[self].structure.copy, paramet...
keyword[def] identifier[cleaned_up_slab] ( identifier[self] ): literal[string] identifier[ads_strs] = identifier[list] ( identifier[self] . identifier[ads_entries_dict] . identifier[keys] ()) identifier[cleaned] = identifier[self] . identifier[structure] . identifier[copy] () iden...
def cleaned_up_slab(self): """ Returns a slab with the adsorbates removed """ ads_strs = list(self.ads_entries_dict.keys()) cleaned = self.structure.copy() cleaned.remove_species(ads_strs) return cleaned
def from_ranges(ranges, name, data_key, start_key='offset', length_key='length'): """ Creates a list of commands from a list of ranges. Each range is converted to two commands: a start_* and a stop_*. """ commands = [] for r in ranges: data = r[data_key] ...
def function[from_ranges, parameter[ranges, name, data_key, start_key, length_key]]: constant[ Creates a list of commands from a list of ranges. Each range is converted to two commands: a start_* and a stop_*. ] variable[commands] assign[=] list[[]] for taget[name[r]] in ...
keyword[def] identifier[from_ranges] ( identifier[ranges] , identifier[name] , identifier[data_key] , identifier[start_key] = literal[string] , identifier[length_key] = literal[string] ): literal[string] identifier[commands] =[] keyword[for] identifier[r] keyword[in] identifier[ranges] ...
def from_ranges(ranges, name, data_key, start_key='offset', length_key='length'): """ Creates a list of commands from a list of ranges. Each range is converted to two commands: a start_* and a stop_*. """ commands = [] for r in ranges: data = r[data_key] start = r[sta...
def destroyCommit(self, varBind, **context): """Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed Object ...
def function[destroyCommit, parameter[self, varBind]]: constant[Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed...
keyword[def] identifier[destroyCommit] ( identifier[self] , identifier[varBind] ,** identifier[context] ): literal[string] identifier[name] , identifier[val] = identifier[varBind] ( identifier[debug] . identifier[logger] & identifier[debug] . identifier[FLAG_INS] keyword[and] i...
def destroyCommit(self, varBind, **context): """Destroy Managed Object Instance. Implements the second of the multi-step workflow similar to the SNMP SET command processing (:RFC:`1905#section-4.2.5`). The goal of the second phase is to actually remove requested Managed Object Inst...
def update_model_dict(self): """Updates the model dictionary""" dct = {} models = self.chimera.openModels for md in models.list(): dct[md.name] = md.id self.model_dict = dct
def function[update_model_dict, parameter[self]]: constant[Updates the model dictionary] variable[dct] assign[=] dictionary[[], []] variable[models] assign[=] name[self].chimera.openModels for taget[name[md]] in starred[call[name[models].list, parameter[]]] begin[:] call[...
keyword[def] identifier[update_model_dict] ( identifier[self] ): literal[string] identifier[dct] ={} identifier[models] = identifier[self] . identifier[chimera] . identifier[openModels] keyword[for] identifier[md] keyword[in] identifier[models] . identifier[list] (): ...
def update_model_dict(self): """Updates the model dictionary""" dct = {} models = self.chimera.openModels for md in models.list(): dct[md.name] = md.id # depends on [control=['for'], data=['md']] self.model_dict = dct
def _random_ipv4_address_from_subnet(self, subnet, network=False): """ Produces a random IPv4 address or network with a valid CIDR from within a given subnet. :param subnet: IPv4Network to choose from within :param network: Return a network address, and not an IP address ...
def function[_random_ipv4_address_from_subnet, parameter[self, subnet, network]]: constant[ Produces a random IPv4 address or network with a valid CIDR from within a given subnet. :param subnet: IPv4Network to choose from within :param network: Return a network address, and not ...
keyword[def] identifier[_random_ipv4_address_from_subnet] ( identifier[self] , identifier[subnet] , identifier[network] = keyword[False] ): literal[string] identifier[address] = identifier[str] ( identifier[subnet] [ identifier[self] . identifier[generator] . identifier[random] . identifie...
def _random_ipv4_address_from_subnet(self, subnet, network=False): """ Produces a random IPv4 address or network with a valid CIDR from within a given subnet. :param subnet: IPv4Network to choose from within :param network: Return a network address, and not an IP address """...
def load_features(self): """ Loads all the known features from the feature service """ # Loading all loci that # are in self.loci variable defined # when the pyGFE object is created for loc in self.loci: if self.verbose: self.logger.inf...
def function[load_features, parameter[self]]: constant[ Loads all the known features from the feature service ] for taget[name[loc]] in starred[name[self].loci] begin[:] if name[self].verbose begin[:] call[name[self].logger.info, parameter[binary_o...
keyword[def] identifier[load_features] ( identifier[self] ): literal[string] keyword[for] identifier[loc] keyword[in] identifier[self] . identifier[loci] : keyword[if] identifier[self] . identifier[verbose] : identifier[self] . identifier...
def load_features(self): """ Loads all the known features from the feature service """ # Loading all loci that # are in self.loci variable defined # when the pyGFE object is created for loc in self.loci: if self.verbose: self.logger.info(self.logname + 'Loading fe...
def _db_upgrade(self, db_name): """ Upgrade nipap database schema """ current_db_version = self._get_db_version() self._execute(db_schema.functions) for i in range(current_db_version, nipap.__db_version__): self._logger.info("Upgrading DB schema:", i, "to", i+1) ...
def function[_db_upgrade, parameter[self, db_name]]: constant[ Upgrade nipap database schema ] variable[current_db_version] assign[=] call[name[self]._get_db_version, parameter[]] call[name[self]._execute, parameter[name[db_schema].functions]] for taget[name[i]] in starred[call[n...
keyword[def] identifier[_db_upgrade] ( identifier[self] , identifier[db_name] ): literal[string] identifier[current_db_version] = identifier[self] . identifier[_get_db_version] () identifier[self] . identifier[_execute] ( identifier[db_schema] . identifier[functions] ) keyword[for...
def _db_upgrade(self, db_name): """ Upgrade nipap database schema """ current_db_version = self._get_db_version() self._execute(db_schema.functions) for i in range(current_db_version, nipap.__db_version__): self._logger.info('Upgrading DB schema:', i, 'to', i + 1) upgrade_sql = d...
def SG(self): r'''Specific gravity of the mixture, [dimensionless]. For gas-phase conditions, this is calculated at 15.6 °C (60 °F) and 1 atm for the mixture and the reference fluid, air. For liquid and solid phase conditions, this is calculated based on a reference ...
def function[SG, parameter[self]]: constant[Specific gravity of the mixture, [dimensionless]. For gas-phase conditions, this is calculated at 15.6 °C (60 °F) and 1 atm for the mixture and the reference fluid, air. For liquid and solid phase conditions, this is calculated base...
keyword[def] identifier[SG] ( identifier[self] ): literal[string] keyword[return] identifier[phase_select_property] ( identifier[phase] = identifier[self] . identifier[phase] , identifier[s] = identifier[self] . identifier[SGs] , identifier[l] = identifier[self] . identifier[SGl] , identifier[g] =...
def SG(self): """Specific gravity of the mixture, [dimensionless]. For gas-phase conditions, this is calculated at 15.6 °C (60 °F) and 1 atm for the mixture and the reference fluid, air. For liquid and solid phase conditions, this is calculated based on a reference fluid...
def handle_extracted_license(self, extr_lic): """ Build and return an ExtractedLicense or None. Note that this function adds the license to the document. """ lic = self.parse_only_extr_license(extr_lic) if lic is not None: self.doc.add_extr_lic(lic) re...
def function[handle_extracted_license, parameter[self, extr_lic]]: constant[ Build and return an ExtractedLicense or None. Note that this function adds the license to the document. ] variable[lic] assign[=] call[name[self].parse_only_extr_license, parameter[name[extr_lic]]] ...
keyword[def] identifier[handle_extracted_license] ( identifier[self] , identifier[extr_lic] ): literal[string] identifier[lic] = identifier[self] . identifier[parse_only_extr_license] ( identifier[extr_lic] ) keyword[if] identifier[lic] keyword[is] keyword[not] keyword[None] : ...
def handle_extracted_license(self, extr_lic): """ Build and return an ExtractedLicense or None. Note that this function adds the license to the document. """ lic = self.parse_only_extr_license(extr_lic) if lic is not None: self.doc.add_extr_lic(lic) # depends on [control=['i...
def service_name(self): """ Service name inside the Docker Swarm service_suffix should be a numerical value unique for user {service_prefix}-{service_owner}-{service_suffix} """ if hasattr(self, "server_name") and self.server_name: server_name = self.server_n...
def function[service_name, parameter[self]]: constant[ Service name inside the Docker Swarm service_suffix should be a numerical value unique for user {service_prefix}-{service_owner}-{service_suffix} ] if <ast.BoolOp object at 0x7da1b0214be0> begin[:] va...
keyword[def] identifier[service_name] ( identifier[self] ): literal[string] keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[server_name] : identifier[server_name] = identifier[self] . identifier[server_name] ...
def service_name(self): """ Service name inside the Docker Swarm service_suffix should be a numerical value unique for user {service_prefix}-{service_owner}-{service_suffix} """ if hasattr(self, 'server_name') and self.server_name: server_name = self.server_name # depen...
def find_objects_wo_child(config=None, config_path=None, parent_regex=None, child_regex=None, ignore_ws=False, saltenv='base'): ''' Return a list of parent ``ciscoconfparse.IOSCfgLin...
def function[find_objects_wo_child, parameter[config, config_path, parent_regex, child_regex, ignore_ws, saltenv]]: constant[ Return a list of parent ``ciscoconfparse.IOSCfgLine`` objects, which matched the ``parent_regex`` and whose children did *not* match ``child_regex``. Only the parent ``ciscoc...
keyword[def] identifier[find_objects_wo_child] ( identifier[config] = keyword[None] , identifier[config_path] = keyword[None] , identifier[parent_regex] = keyword[None] , identifier[child_regex] = keyword[None] , identifier[ignore_ws] = keyword[False] , identifier[saltenv] = literal[string] ): literal[strin...
def find_objects_wo_child(config=None, config_path=None, parent_regex=None, child_regex=None, ignore_ws=False, saltenv='base'): """ Return a list of parent ``ciscoconfparse.IOSCfgLine`` objects, which matched the ``parent_regex`` and whose children did *not* match ``child_regex``. Only the parent ``cisc...
def __evaluation_error(self, result, condition, throw): """Helper-method for easy error-logging""" self.log.error("Result does not match condition, dropping item. " "Result %s; Condition: %s; Throw: %s", result, condition, throw) return False
def function[__evaluation_error, parameter[self, result, condition, throw]]: constant[Helper-method for easy error-logging] call[name[self].log.error, parameter[constant[Result does not match condition, dropping item. Result %s; Condition: %s; Throw: %s], name[result], name[condition], name[throw]]] ...
keyword[def] identifier[__evaluation_error] ( identifier[self] , identifier[result] , identifier[condition] , identifier[throw] ): literal[string] identifier[self] . identifier[log] . identifier[error] ( literal[string] literal[string] , identifier[result] , identifier[condition]...
def __evaluation_error(self, result, condition, throw): """Helper-method for easy error-logging""" self.log.error('Result does not match condition, dropping item. Result %s; Condition: %s; Throw: %s', result, condition, throw) return False
def ws004c(self, value=None): """Corresponds to IDD Field `ws004c` Args: value (float): value for IDD Field `ws004c` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a missing value Ra...
def function[ws004c, parameter[self, value]]: constant[Corresponds to IDD Field `ws004c` Args: value (float): value for IDD Field `ws004c` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a mis...
keyword[def] identifier[ws004c] ( identifier[self] , identifier[value] = keyword[None] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[try] : identifier[value] = identifier[float] ( identifier[value] ) ...
def ws004c(self, value=None): """Corresponds to IDD Field `ws004c` Args: value (float): value for IDD Field `ws004c` Unit: m/s if `value` is None it will not be checked against the specification and is assumed to be a missing value Raises...
def get_user( self, identified_with, identifier, req, resp, resource, uri_kwargs ): """Get user object for given identifier. Args: identified_with (object): authentication middleware used to identify the user. identifier: middleware specifix user iden...
def function[get_user, parameter[self, identified_with, identifier, req, resp, resource, uri_kwargs]]: constant[Get user object for given identifier. Args: identified_with (object): authentication middleware used to identify the user. identifier: middleware speci...
keyword[def] identifier[get_user] ( identifier[self] , identifier[identified_with] , identifier[identifier] , identifier[req] , identifier[resp] , identifier[resource] , identifier[uri_kwargs] ): literal[string] identifier[stored_value] = identifier[self] . identifier[kv_store] . identifier[get] ...
def get_user(self, identified_with, identifier, req, resp, resource, uri_kwargs): """Get user object for given identifier. Args: identified_with (object): authentication middleware used to identify the user. identifier: middleware specifix user identifier (string or ...
def scrape_links(html, engine): """ function to scrape file links from html response """ soup = BeautifulSoup(html, 'lxml') links = [] if engine == 'd': results = soup.findAll('a', {'class': 'result__a'}) for result in results: link = result.get('href')[15:] link = link.replace('/blob/', '/raw/') li...
def function[scrape_links, parameter[html, engine]]: constant[ function to scrape file links from html response ] variable[soup] assign[=] call[name[BeautifulSoup], parameter[name[html], constant[lxml]]] variable[links] assign[=] list[[]] if compare[name[engine] equal[==] constant[d]] ...
keyword[def] identifier[scrape_links] ( identifier[html] , identifier[engine] ): literal[string] identifier[soup] = identifier[BeautifulSoup] ( identifier[html] , literal[string] ) identifier[links] =[] keyword[if] identifier[engine] == literal[string] : identifier[results] = identifier[soup] . identifi...
def scrape_links(html, engine): """ function to scrape file links from html response """ soup = BeautifulSoup(html, 'lxml') links = [] if engine == 'd': results = soup.findAll('a', {'class': 'result__a'}) for result in results: link = result.get('href')[15:] lin...
def _growing_step_sequence(interval_growth, max_interval, init_interval, start_level=None): """ Returns an iterator that constructs a sequence of trigger levels with growing intervals. The interval is growing exponentially until it reaches the maximum value. Then the interval stays the s...
def function[_growing_step_sequence, parameter[interval_growth, max_interval, init_interval, start_level]]: constant[ Returns an iterator that constructs a sequence of trigger levels with growing intervals. The interval is growing exponentially until it reaches the maximum value. Then the interv...
keyword[def] identifier[_growing_step_sequence] ( identifier[interval_growth] , identifier[max_interval] , identifier[init_interval] , identifier[start_level] = keyword[None] ): literal[string] identifier[interval] = identifier[init_interval] identifier[next_level] = identifier[start_leve...
def _growing_step_sequence(interval_growth, max_interval, init_interval, start_level=None): """ Returns an iterator that constructs a sequence of trigger levels with growing intervals. The interval is growing exponentially until it reaches the maximum value. Then the interval stays the same ...
def minimize(self, *args, **kwargs): '''Optimize our loss exhaustively. This method is a thin wrapper over the :func:`iterate` method. It simply exhausts the iterative optimization process and returns the final monitor values. Returns ------- train_monitors : di...
def function[minimize, parameter[self]]: constant[Optimize our loss exhaustively. This method is a thin wrapper over the :func:`iterate` method. It simply exhausts the iterative optimization process and returns the final monitor values. Returns ------- train_mon...
keyword[def] identifier[minimize] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[monitors] = keyword[None] keyword[for] identifier[monitors] keyword[in] identifier[self] . identifier[iterate] (* identifier[args] ,** identifier[kwargs] ): ...
def minimize(self, *args, **kwargs): """Optimize our loss exhaustively. This method is a thin wrapper over the :func:`iterate` method. It simply exhausts the iterative optimization process and returns the final monitor values. Returns ------- train_monitors : dict ...
def hashleftjoin(left, right, key=None, lkey=None, rkey=None, missing=None, cache=True, lprefix=None, rprefix=None): """Alternative implementation of :func:`petl.transform.joins.leftjoin`, where the join is executed by constructing an in-memory lookup for the right hand table, then iteratin...
def function[hashleftjoin, parameter[left, right, key, lkey, rkey, missing, cache, lprefix, rprefix]]: constant[Alternative implementation of :func:`petl.transform.joins.leftjoin`, where the join is executed by constructing an in-memory lookup for the right hand table, then iterating over rows from the ...
keyword[def] identifier[hashleftjoin] ( identifier[left] , identifier[right] , identifier[key] = keyword[None] , identifier[lkey] = keyword[None] , identifier[rkey] = keyword[None] , identifier[missing] = keyword[None] , identifier[cache] = keyword[True] , identifier[lprefix] = keyword[None] , identifier[rprefix] = ...
def hashleftjoin(left, right, key=None, lkey=None, rkey=None, missing=None, cache=True, lprefix=None, rprefix=None): """Alternative implementation of :func:`petl.transform.joins.leftjoin`, where the join is executed by constructing an in-memory lookup for the right hand table, then iterating over rows from ...
def get_type(self, notification_type_id): """ Returns a CloudMonitorNotificationType object for the given ID. """ uri = "/notification_types/%s" % utils.get_id(notification_type_id) resp, resp_body = self.api.method_get(uri) return CloudMonitorNotificationType(self, resp_...
def function[get_type, parameter[self, notification_type_id]]: constant[ Returns a CloudMonitorNotificationType object for the given ID. ] variable[uri] assign[=] binary_operation[constant[/notification_types/%s] <ast.Mod object at 0x7da2590d6920> call[name[utils].get_id, parameter[name[...
keyword[def] identifier[get_type] ( identifier[self] , identifier[notification_type_id] ): literal[string] identifier[uri] = literal[string] % identifier[utils] . identifier[get_id] ( identifier[notification_type_id] ) identifier[resp] , identifier[resp_body] = identifier[self] . identifie...
def get_type(self, notification_type_id): """ Returns a CloudMonitorNotificationType object for the given ID. """ uri = '/notification_types/%s' % utils.get_id(notification_type_id) (resp, resp_body) = self.api.method_get(uri) return CloudMonitorNotificationType(self, resp_body)
def action(self, name, pk): """ Action method to handle actions from a show view """ pk = self._deserialize_pk_if_composite(pk) if self.appbuilder.sm.has_access(name, self.__class__.__name__): action = self.actions.get(name) return action.func(self.dat...
def function[action, parameter[self, name, pk]]: constant[ Action method to handle actions from a show view ] variable[pk] assign[=] call[name[self]._deserialize_pk_if_composite, parameter[name[pk]]] if call[name[self].appbuilder.sm.has_access, parameter[name[name], name[self...
keyword[def] identifier[action] ( identifier[self] , identifier[name] , identifier[pk] ): literal[string] identifier[pk] = identifier[self] . identifier[_deserialize_pk_if_composite] ( identifier[pk] ) keyword[if] identifier[self] . identifier[appbuilder] . identifier[sm] . identifier[has...
def action(self, name, pk): """ Action method to handle actions from a show view """ pk = self._deserialize_pk_if_composite(pk) if self.appbuilder.sm.has_access(name, self.__class__.__name__): action = self.actions.get(name) return action.func(self.datamodel.get(pk)) # d...
def is_root_state_of_library(self): """ If self is the attribute LibraryState.state_copy of a LibraryState its the library root state and its parent is a LibraryState :return True or False :rtype bool """ from rafcon.core.states.library_state import LibraryState r...
def function[is_root_state_of_library, parameter[self]]: constant[ If self is the attribute LibraryState.state_copy of a LibraryState its the library root state and its parent is a LibraryState :return True or False :rtype bool ] from relative_module[rafcon.core.states.librar...
keyword[def] identifier[is_root_state_of_library] ( identifier[self] ): literal[string] keyword[from] identifier[rafcon] . identifier[core] . identifier[states] . identifier[library_state] keyword[import] identifier[LibraryState] keyword[return] identifier[isinstance] ( identifier[sel...
def is_root_state_of_library(self): """ If self is the attribute LibraryState.state_copy of a LibraryState its the library root state and its parent is a LibraryState :return True or False :rtype bool """ from rafcon.core.states.library_state import LibraryState return isinst...
def validate(cls, grammar): # type: (_MetaRule, Grammar) -> None """ Perform rules validation of the class. :param grammar: Grammar on which to validate. :raise RuleSyntaxException: If invalid syntax is used. :raise UselessEpsilonException: If epsilon used in rules in use...
def function[validate, parameter[cls, grammar]]: constant[ Perform rules validation of the class. :param grammar: Grammar on which to validate. :raise RuleSyntaxException: If invalid syntax is used. :raise UselessEpsilonException: If epsilon used in rules in useless. :rai...
keyword[def] identifier[validate] ( identifier[cls] , identifier[grammar] ): literal[string] identifier[defined] = identifier[set] ( identifier[dir] ( identifier[cls] )) keyword[if] literal[string] keyword[in] identifier[defined] keyword[and] identifier[len] ( identifier[def...
def validate(cls, grammar): # type: (_MetaRule, Grammar) -> None '\n Perform rules validation of the class.\n :param grammar: Grammar on which to validate.\n :raise RuleSyntaxException: If invalid syntax is used.\n :raise UselessEpsilonException: If epsilon used in rules in useless.\...
def which(program): ''' look for "program" in PATH (respecting PATHEXT), and return the path to it, or None if it was not found ''' # current directory / absolute paths: if os.path.exists(program) and os.access(program, os.X_OK): return program # PATH: for path in os.environ['PAT...
def function[which, parameter[program]]: constant[ look for "program" in PATH (respecting PATHEXT), and return the path to it, or None if it was not found ] if <ast.BoolOp object at 0x7da1b00e1ab0> begin[:] return[name[program]] for taget[name[path]] in starred[call[call[name...
keyword[def] identifier[which] ( identifier[program] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[program] ) keyword[and] identifier[os] . identifier[access] ( identifier[program] , identifier[os] . identifier[X_OK] ): keyword[return] i...
def which(program): """ look for "program" in PATH (respecting PATHEXT), and return the path to it, or None if it was not found """ # current directory / absolute paths: if os.path.exists(program) and os.access(program, os.X_OK): return program # depends on [control=['if'], data=[]] ...
def get_session(self, token=None): ''' If provided, the `token` parameter is used to initialize an authenticated session, otherwise an unauthenticated session object is generated. Returns an instance of :attr:`session_obj`.. :param token: A token with which to initilize the sess...
def function[get_session, parameter[self, token]]: constant[ If provided, the `token` parameter is used to initialize an authenticated session, otherwise an unauthenticated session object is generated. Returns an instance of :attr:`session_obj`.. :param token: A token with which...
keyword[def] identifier[get_session] ( identifier[self] , identifier[token] = keyword[None] ): literal[string] keyword[if] identifier[token] keyword[is] keyword[not] keyword[None] : identifier[session] = identifier[self] . identifier[session_obj] ( identifier[self] . identifier[cli...
def get_session(self, token=None): """ If provided, the `token` parameter is used to initialize an authenticated session, otherwise an unauthenticated session object is generated. Returns an instance of :attr:`session_obj`.. :param token: A token with which to initilize the session....
def hpss(S, kernel_size=31, power=2.0, mask=False, margin=1.0): """Median-filtering harmonic percussive source separation (HPSS). If `margin = 1.0`, decomposes an input spectrogram `S = H + P` where `H` contains the harmonic components, and `P` contains the percussive components. If `margin > 1.0`...
def function[hpss, parameter[S, kernel_size, power, mask, margin]]: constant[Median-filtering harmonic percussive source separation (HPSS). If `margin = 1.0`, decomposes an input spectrogram `S = H + P` where `H` contains the harmonic components, and `P` contains the percussive components. If ...
keyword[def] identifier[hpss] ( identifier[S] , identifier[kernel_size] = literal[int] , identifier[power] = literal[int] , identifier[mask] = keyword[False] , identifier[margin] = literal[int] ): literal[string] keyword[if] identifier[np] . identifier[iscomplexobj] ( identifier[S] ): identifier...
def hpss(S, kernel_size=31, power=2.0, mask=False, margin=1.0): """Median-filtering harmonic percussive source separation (HPSS). If `margin = 1.0`, decomposes an input spectrogram `S = H + P` where `H` contains the harmonic components, and `P` contains the percussive components. If `margin > 1.0`...
def extract_feature_dependent_feature(self, extractor, force_extraction=False, verbose=0, add_args=None, custom_name=None): """ Extracts a feature which may be dependent on other features and stores it in the database Parameters ---------- ...
def function[extract_feature_dependent_feature, parameter[self, extractor, force_extraction, verbose, add_args, custom_name]]: constant[ Extracts a feature which may be dependent on other features and stores it in the database Parameters ---------- extractor : function, which ta...
keyword[def] identifier[extract_feature_dependent_feature] ( identifier[self] , identifier[extractor] , identifier[force_extraction] = keyword[False] , identifier[verbose] = literal[int] , identifier[add_args] = keyword[None] , identifier[custom_name] = keyword[None] ): literal[string] keyword[if]...
def extract_feature_dependent_feature(self, extractor, force_extraction=False, verbose=0, add_args=None, custom_name=None): """ Extracts a feature which may be dependent on other features and stores it in the database Parameters ---------- extractor : function, which takes the path ...
def _hash_scalar(val, encoding='utf8', hash_key=None): """ Hash scalar value Returns ------- 1d uint64 numpy array of hash value, of length 1 """ if isna(val): # this is to be consistent with the _hash_categorical implementation return np.array([np.iinfo(np.uint64).max], dt...
def function[_hash_scalar, parameter[val, encoding, hash_key]]: constant[ Hash scalar value Returns ------- 1d uint64 numpy array of hash value, of length 1 ] if call[name[isna], parameter[name[val]]] begin[:] return[call[name[np].array, parameter[list[[<ast.Attribute object...
keyword[def] identifier[_hash_scalar] ( identifier[val] , identifier[encoding] = literal[string] , identifier[hash_key] = keyword[None] ): literal[string] keyword[if] identifier[isna] ( identifier[val] ): keyword[return] identifier[np] . identifier[array] ([ identifier[np] . identifier[iin...
def _hash_scalar(val, encoding='utf8', hash_key=None): """ Hash scalar value Returns ------- 1d uint64 numpy array of hash value, of length 1 """ if isna(val): # this is to be consistent with the _hash_categorical implementation return np.array([np.iinfo(np.uint64).max], dty...
def close(self): """Closes all currently open file pointers""" if not self.active: return self.active = False if self._file: self._file.close() self._sincedb_update_position(force_update=True) if self._current_event: event = '\n'....
def function[close, parameter[self]]: constant[Closes all currently open file pointers] if <ast.UnaryOp object at 0x7da18f58e020> begin[:] return[None] name[self].active assign[=] constant[False] if name[self]._file begin[:] call[name[self]._file.close, parameter[...
keyword[def] identifier[close] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[active] : keyword[return] identifier[self] . identifier[active] = keyword[False] keyword[if] identifier[self] . identifier[_file] : ...
def close(self): """Closes all currently open file pointers""" if not self.active: return # depends on [control=['if'], data=[]] self.active = False if self._file: self._file.close() self._sincedb_update_position(force_update=True) # depends on [control=['if'], data=[]] if ...
def inflate_nd_checker(identifier, definition): """ Inflate a no-data checker from a basic definition. Args: identifier (str): the no-data checker identifier / name. definition (bool/dict): a boolean acting as "passes" or a full dict definition with "pass...
def function[inflate_nd_checker, parameter[identifier, definition]]: constant[ Inflate a no-data checker from a basic definition. Args: identifier (str): the no-data checker identifier / name. definition (bool/dict): a boolean acting as "passes" or a full ...
keyword[def] identifier[inflate_nd_checker] ( identifier[identifier] , identifier[definition] ): literal[string] keyword[if] identifier[isinstance] ( identifier[definition] , identifier[bool] ): keyword[return] identifier[Checker] ( identifier[name] = identifier[identifier] , identif...
def inflate_nd_checker(identifier, definition): """ Inflate a no-data checker from a basic definition. Args: identifier (str): the no-data checker identifier / name. definition (bool/dict): a boolean acting as "passes" or a full dict definition with "passes" ...
def verify_keys(app_req, required_keys, issuer=None): """ Verify all JWT object keys listed in required_keys. Each required key is specified as a dot-separated path. The key values are returned as a list ordered by how you specified them. Take this JWT for example:: { "iss...
def function[verify_keys, parameter[app_req, required_keys, issuer]]: constant[ Verify all JWT object keys listed in required_keys. Each required key is specified as a dot-separated path. The key values are returned as a list ordered by how you specified them. Take this JWT for example:: ...
keyword[def] identifier[verify_keys] ( identifier[app_req] , identifier[required_keys] , identifier[issuer] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[issuer] : identifier[issuer] = identifier[_get_issuer] ( identifier[app_req] = identifier[app_req] ) identifier[...
def verify_keys(app_req, required_keys, issuer=None): """ Verify all JWT object keys listed in required_keys. Each required key is specified as a dot-separated path. The key values are returned as a list ordered by how you specified them. Take this JWT for example:: { "iss...
def linearize(self, index=0): '''Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if the input is a linear...
def function[linearize, parameter[self, index]]: constant[Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError...
keyword[def] identifier[linearize] ( identifier[self] , identifier[index] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[circular] keyword[and] identifier[index] != literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) ...
def linearize(self, index=0): """Linearize the Sequence at an index. :param index: index at which to linearize. :type index: int :returns: A linearized version of the current sequence. :rtype: coral.sequence._sequence.Sequence :raises: ValueError if the input is a linear seq...
def input_file(self, filename, lines=None, expected=None, line_offset=0): """Run all checks on a Python source file.""" if self.options.verbose: print('checking %s' % filename) fchecker = self.checker_class( filename, lines=lines, options=self.options) return fche...
def function[input_file, parameter[self, filename, lines, expected, line_offset]]: constant[Run all checks on a Python source file.] if name[self].options.verbose begin[:] call[name[print], parameter[binary_operation[constant[checking %s] <ast.Mod object at 0x7da2590d6920> name[filename]...
keyword[def] identifier[input_file] ( identifier[self] , identifier[filename] , identifier[lines] = keyword[None] , identifier[expected] = keyword[None] , identifier[line_offset] = literal[int] ): literal[string] keyword[if] identifier[self] . identifier[options] . identifier[verbose] : ...
def input_file(self, filename, lines=None, expected=None, line_offset=0): """Run all checks on a Python source file.""" if self.options.verbose: print('checking %s' % filename) # depends on [control=['if'], data=[]] fchecker = self.checker_class(filename, lines=lines, options=self.options) retu...
def least_loaded_node(self): """Choose the node with fewest outstanding requests, with fallbacks. This method will prefer a node with an existing connection and no in-flight-requests. If no such node is found, a node will be chosen randomly from disconnected nodes that are not "blacked ...
def function[least_loaded_node, parameter[self]]: constant[Choose the node with fewest outstanding requests, with fallbacks. This method will prefer a node with an existing connection and no in-flight-requests. If no such node is found, a node will be chosen randomly from disconnected n...
keyword[def] identifier[least_loaded_node] ( identifier[self] ): literal[string] identifier[nodes] =[ identifier[broker] . identifier[nodeId] keyword[for] identifier[broker] keyword[in] identifier[self] . identifier[cluster] . identifier[brokers] ()] identifier[random] . identifier[shu...
def least_loaded_node(self): """Choose the node with fewest outstanding requests, with fallbacks. This method will prefer a node with an existing connection and no in-flight-requests. If no such node is found, a node will be chosen randomly from disconnected nodes that are not "blacked out"...
def _all_help_methods(self): """ Returns a list of all the Workbench commands""" methods = {name:method for name, method in inspect.getmembers(self, predicate=inspect.isroutine) if not name.startswith('_')} return methods
def function[_all_help_methods, parameter[self]]: constant[ Returns a list of all the Workbench commands] variable[methods] assign[=] <ast.DictComp object at 0x7da18dc07250> return[name[methods]]
keyword[def] identifier[_all_help_methods] ( identifier[self] ): literal[string] identifier[methods] ={ identifier[name] : identifier[method] keyword[for] identifier[name] , identifier[method] keyword[in] identifier[inspect] . identifier[getmembers] ( identifier[self] , identifier[predicate] = ...
def _all_help_methods(self): """ Returns a list of all the Workbench commands""" methods = {name: method for (name, method) in inspect.getmembers(self, predicate=inspect.isroutine) if not name.startswith('_')} return methods
def summary(self, variables=None, alpha=0.05, start=0, batches=100, chain=None, roundto=3): """ Generate a pretty-printed summary of the model's variables. :Parameters: alpha : float The alpha level for generating posterior intervals. Defaults to 0.05...
def function[summary, parameter[self, variables, alpha, start, batches, chain, roundto]]: constant[ Generate a pretty-printed summary of the model's variables. :Parameters: alpha : float The alpha level for generating posterior intervals. Defaults to 0.05. s...
keyword[def] identifier[summary] ( identifier[self] , identifier[variables] = keyword[None] , identifier[alpha] = literal[int] , identifier[start] = literal[int] , identifier[batches] = literal[int] , identifier[chain] = keyword[None] , identifier[roundto] = literal[int] ): literal[string] ...
def summary(self, variables=None, alpha=0.05, start=0, batches=100, chain=None, roundto=3): """ Generate a pretty-printed summary of the model's variables. :Parameters: alpha : float The alpha level for generating posterior intervals. Defaults to 0.05. start : i...
def get_selection_as_executable_code(self): """Return selected text as a processed text, to be executable in a Python/IPython interpreter""" ls = self.get_line_separator() _indent = lambda line: len(line)-len(line.lstrip()) line_from, line_to = self.get_selection_bounds(...
def function[get_selection_as_executable_code, parameter[self]]: constant[Return selected text as a processed text, to be executable in a Python/IPython interpreter] variable[ls] assign[=] call[name[self].get_line_separator, parameter[]] variable[_indent] assign[=] <ast.Lambda object at ...
keyword[def] identifier[get_selection_as_executable_code] ( identifier[self] ): literal[string] identifier[ls] = identifier[self] . identifier[get_line_separator] () identifier[_indent] = keyword[lambda] identifier[line] : identifier[len] ( identifier[line] )- identifier[len] ( ident...
def get_selection_as_executable_code(self): """Return selected text as a processed text, to be executable in a Python/IPython interpreter""" ls = self.get_line_separator() _indent = lambda line: len(line) - len(line.lstrip()) (line_from, line_to) = self.get_selection_bounds() text = self.get...
def update(self): ''' Updates LaserData. ''' if self.hasproxy(): laserD = LaserData() values = [] data = self.proxy.getLaserData() #laserD.values = laser.distanceData for i in range (data.numLaser): values.appen...
def function[update, parameter[self]]: constant[ Updates LaserData. ] if call[name[self].hasproxy, parameter[]] begin[:] variable[laserD] assign[=] call[name[LaserData], parameter[]] variable[values] assign[=] list[[]] variable[data] assign...
keyword[def] identifier[update] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[hasproxy] (): identifier[laserD] = identifier[LaserData] () identifier[values] =[] identifier[data] = identifier[self] . identifier[proxy] . identi...
def update(self): """ Updates LaserData. """ if self.hasproxy(): laserD = LaserData() values = [] data = self.proxy.getLaserData() #laserD.values = laser.distanceData for i in range(data.numLaser): values.append(data.distanceData[i] / 1000.0) ...
def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): """ partially update the specified HorizontalPodAutoscaler This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread =...
def function[patch_namespaced_horizontal_pod_autoscaler, parameter[self, name, namespace, body]]: constant[ partially update the specified HorizontalPodAutoscaler This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True ...
keyword[def] identifier[patch_namespaced_horizontal_pod_autoscaler] ( identifier[self] , identifier[name] , identifier[namespace] , identifier[body] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= keyword[True] keyword[if] identifier[kwargs] . identifier...
def patch_namespaced_horizontal_pod_autoscaler(self, name, namespace, body, **kwargs): """ partially update the specified HorizontalPodAutoscaler This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api...
def get_definition_revision(self, project, definition_id, revision, **kwargs): """GetDefinitionRevision. [Preview API] Get release definition for a given definitionId and revision :param str project: Project ID or project name :param int definition_id: Id of the definition. :para...
def function[get_definition_revision, parameter[self, project, definition_id, revision]]: constant[GetDefinitionRevision. [Preview API] Get release definition for a given definitionId and revision :param str project: Project ID or project name :param int definition_id: Id of the definiti...
keyword[def] identifier[get_definition_revision] ( identifier[self] , identifier[project] , identifier[definition_id] , identifier[revision] ,** identifier[kwargs] ): literal[string] identifier[route_values] ={} keyword[if] identifier[project] keyword[is] keyword[not] keyword[None] : ...
def get_definition_revision(self, project, definition_id, revision, **kwargs): """GetDefinitionRevision. [Preview API] Get release definition for a given definitionId and revision :param str project: Project ID or project name :param int definition_id: Id of the definition. :param in...
def crypto_sign_ed25519ph_update(edph, pmsg): """ Update the hash state wrapped in edph :param edph: the ed25519ph state being updated :type edph: crypto_sign_ed25519ph_state :param pmsg: the partial message :type pmsg: bytes :rtype: None """ ensure(isinstance(edph, crypto_sign_ed25...
def function[crypto_sign_ed25519ph_update, parameter[edph, pmsg]]: constant[ Update the hash state wrapped in edph :param edph: the ed25519ph state being updated :type edph: crypto_sign_ed25519ph_state :param pmsg: the partial message :type pmsg: bytes :rtype: None ] call[na...
keyword[def] identifier[crypto_sign_ed25519ph_update] ( identifier[edph] , identifier[pmsg] ): literal[string] identifier[ensure] ( identifier[isinstance] ( identifier[edph] , identifier[crypto_sign_ed25519ph_state] ), literal[string] , identifier[raising] = identifier[exc] . identifier[TypeError...
def crypto_sign_ed25519ph_update(edph, pmsg): """ Update the hash state wrapped in edph :param edph: the ed25519ph state being updated :type edph: crypto_sign_ed25519ph_state :param pmsg: the partial message :type pmsg: bytes :rtype: None """ ensure(isinstance(edph, crypto_sign_ed25...
def methodReturnReceived(self, mret): """ Called when a method return message is received """ d, timeout = self._pendingCalls.get(mret.reply_serial, (None, None)) if timeout: timeout.cancel() if d: del self._pendingCalls[mret.reply_serial] ...
def function[methodReturnReceived, parameter[self, mret]]: constant[ Called when a method return message is received ] <ast.Tuple object at 0x7da1b06df220> assign[=] call[name[self]._pendingCalls.get, parameter[name[mret].reply_serial, tuple[[<ast.Constant object at 0x7da1b06dc280>, <ast...
keyword[def] identifier[methodReturnReceived] ( identifier[self] , identifier[mret] ): literal[string] identifier[d] , identifier[timeout] = identifier[self] . identifier[_pendingCalls] . identifier[get] ( identifier[mret] . identifier[reply_serial] ,( keyword[None] , keyword[None] )) keyw...
def methodReturnReceived(self, mret): """ Called when a method return message is received """ (d, timeout) = self._pendingCalls.get(mret.reply_serial, (None, None)) if timeout: timeout.cancel() # depends on [control=['if'], data=[]] if d: del self._pendingCalls[mret.repl...
def _parse_ethtool_opts(opts, iface): ''' Filters given options and outputs valid settings for ETHTOOLS_OPTS If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting. ''' config = {} if 'autoneg' in opts: if opts...
def function[_parse_ethtool_opts, parameter[opts, iface]]: constant[ Filters given options and outputs valid settings for ETHTOOLS_OPTS If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting. ] variable[config] assi...
keyword[def] identifier[_parse_ethtool_opts] ( identifier[opts] , identifier[iface] ): literal[string] identifier[config] ={} keyword[if] literal[string] keyword[in] identifier[opts] : keyword[if] identifier[opts] [ literal[string] ] keyword[in] identifier[_CONFIG_TRUE] : i...
def _parse_ethtool_opts(opts, iface): """ Filters given options and outputs valid settings for ETHTOOLS_OPTS If an option has a value that is not expected, this function will log what the Interface, Setting and what it was expecting. """ config = {} if 'autoneg' in opts: if opts[...
def load_environment_vars(self): """ Looks for any MACH9_ prefixed environment variables and applies them to the configuration if present. """ for k, v in os.environ.items(): if k.startswith(MACH9_PREFIX): _, config_key = k.split(MACH9_PREFIX, 1) ...
def function[load_environment_vars, parameter[self]]: constant[ Looks for any MACH9_ prefixed environment variables and applies them to the configuration if present. ] for taget[tuple[[<ast.Name object at 0x7da1b27e3b50>, <ast.Name object at 0x7da1b27e0ca0>]]] in starred[call[nam...
keyword[def] identifier[load_environment_vars] ( identifier[self] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[os] . identifier[environ] . identifier[items] (): keyword[if] identifier[k] . identifier[startswith] ( identifier[MACH9_PREFIX] ): ...
def load_environment_vars(self): """ Looks for any MACH9_ prefixed environment variables and applies them to the configuration if present. """ for (k, v) in os.environ.items(): if k.startswith(MACH9_PREFIX): (_, config_key) = k.split(MACH9_PREFIX, 1) self[...
def enable_torque(self, ids): """ Enables torque of the motors with the specified ids. """ self._set_torque_enable(dict(zip(ids, itertools.repeat(True))))
def function[enable_torque, parameter[self, ids]]: constant[ Enables torque of the motors with the specified ids. ] call[name[self]._set_torque_enable, parameter[call[name[dict], parameter[call[name[zip], parameter[name[ids], call[name[itertools].repeat, parameter[constant[True]]]]]]]]]
keyword[def] identifier[enable_torque] ( identifier[self] , identifier[ids] ): literal[string] identifier[self] . identifier[_set_torque_enable] ( identifier[dict] ( identifier[zip] ( identifier[ids] , identifier[itertools] . identifier[repeat] ( keyword[True] ))))
def enable_torque(self, ids): """ Enables torque of the motors with the specified ids. """ self._set_torque_enable(dict(zip(ids, itertools.repeat(True))))
def run(self): """ Called by the process, it runs it. NEVER call this method directly. Instead call start() to start the separate process. If you don't want to use a second process, then call fetch() directly on this istance. To stop, call terminate() """ if not self._q...
def function[run, parameter[self]]: constant[ Called by the process, it runs it. NEVER call this method directly. Instead call start() to start the separate process. If you don't want to use a second process, then call fetch() directly on this istance. To stop, call terminate() ...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_queue] : keyword[raise] identifier[Exception] ( literal[string] ) identifier[factory] = identifier[LiveStreamFactory] ( identifier[self] ) id...
def run(self): """ Called by the process, it runs it. NEVER call this method directly. Instead call start() to start the separate process. If you don't want to use a second process, then call fetch() directly on this istance. To stop, call terminate() """ if not self._queue: ...