code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def plot_phens_blits(phen_grid, patches, **kwargs): """ A version of plot_phens designed to be used in animations. Takes a 2D array of phenotypes and a list of matplotlib patch objects that have already been added to the current axes and recolors the patches based on the array. """ denom, palet...
def function[plot_phens_blits, parameter[phen_grid, patches]]: constant[ A version of plot_phens designed to be used in animations. Takes a 2D array of phenotypes and a list of matplotlib patch objects that have already been added to the current axes and recolors the patches based on the array. ...
keyword[def] identifier[plot_phens_blits] ( identifier[phen_grid] , identifier[patches] ,** identifier[kwargs] ): literal[string] identifier[denom] , identifier[palette] = identifier[get_kwargs] ( identifier[phen_grid] , identifier[kwargs] ) identifier[grid] = identifier[color_grid] ( identifier[phen...
def plot_phens_blits(phen_grid, patches, **kwargs): """ A version of plot_phens designed to be used in animations. Takes a 2D array of phenotypes and a list of matplotlib patch objects that have already been added to the current axes and recolors the patches based on the array. """ (denom, palet...
def log_response(_, _request, response, *_args, **kwargs): # type: (Any, ClientRequest, ClientResponse, str, Any) -> Optional[ClientResponse] """Log a server response. :param _: Unused in current version (will be None) :param requests.Request request: The request object. :param requests.Response re...
def function[log_response, parameter[_, _request, response]]: constant[Log a server response. :param _: Unused in current version (will be None) :param requests.Request request: The request object. :param requests.Response response: The response object. ] if <ast.UnaryOp object at 0x7da...
keyword[def] identifier[log_response] ( identifier[_] , identifier[_request] , identifier[response] ,* identifier[_args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[_LOGGER] . identifier[isEnabledFor] ( identifier[logging] . identifier[DEBUG] ): keyword[return]...
def log_response(_, _request, response, *_args, **kwargs): # type: (Any, ClientRequest, ClientResponse, str, Any) -> Optional[ClientResponse] 'Log a server response.\n\n :param _: Unused in current version (will be None)\n :param requests.Request request: The request object.\n :param requests.Response ...
def calculate_crop_output_shapes(operator): ''' Allowed input/output patterns are 1. [N, C, H, W] ---> [N, C, H', W'] 2. [N, C, H, W], shape-ref [N', C', H', W'] ---> [N, C, H', W'] ''' check_input_and_output_numbers(operator, input_count_range=[1, 2], output_count_range=1) check_in...
def function[calculate_crop_output_shapes, parameter[operator]]: constant[ Allowed input/output patterns are 1. [N, C, H, W] ---> [N, C, H', W'] 2. [N, C, H, W], shape-ref [N', C', H', W'] ---> [N, C, H', W'] ] call[name[check_input_and_output_numbers], parameter[name[operator]]...
keyword[def] identifier[calculate_crop_output_shapes] ( identifier[operator] ): literal[string] identifier[check_input_and_output_numbers] ( identifier[operator] , identifier[input_count_range] =[ literal[int] , literal[int] ], identifier[output_count_range] = literal[int] ) identifier[check_input_and...
def calculate_crop_output_shapes(operator): """ Allowed input/output patterns are 1. [N, C, H, W] ---> [N, C, H', W'] 2. [N, C, H, W], shape-ref [N', C', H', W'] ---> [N, C, H', W'] """ check_input_and_output_numbers(operator, input_count_range=[1, 2], output_count_range=1) check_in...
def to_xdr_object(self): """Creates an XDR Memo object for a transaction with MEMO_HASH.""" return Xdr.types.Memo(type=Xdr.const.MEMO_HASH, hash=self.memo_hash)
def function[to_xdr_object, parameter[self]]: constant[Creates an XDR Memo object for a transaction with MEMO_HASH.] return[call[name[Xdr].types.Memo, parameter[]]]
keyword[def] identifier[to_xdr_object] ( identifier[self] ): literal[string] keyword[return] identifier[Xdr] . identifier[types] . identifier[Memo] ( identifier[type] = identifier[Xdr] . identifier[const] . identifier[MEMO_HASH] , identifier[hash] = identifier[self] . identifier[memo_hash] )
def to_xdr_object(self): """Creates an XDR Memo object for a transaction with MEMO_HASH.""" return Xdr.types.Memo(type=Xdr.const.MEMO_HASH, hash=self.memo_hash)
def add_real_directory(self, source_path, read_only=True, lazy_read=True, target_path=None): """Create a fake directory corresponding to the real directory at the specified path. Add entries in the fake directory corresponding to the entries in the real directory. ...
def function[add_real_directory, parameter[self, source_path, read_only, lazy_read, target_path]]: constant[Create a fake directory corresponding to the real directory at the specified path. Add entries in the fake directory corresponding to the entries in the real directory. Args: ...
keyword[def] identifier[add_real_directory] ( identifier[self] , identifier[source_path] , identifier[read_only] = keyword[True] , identifier[lazy_read] = keyword[True] , identifier[target_path] = keyword[None] ): literal[string] identifier[source_path] = identifier[self] . identifier[_path_withou...
def add_real_directory(self, source_path, read_only=True, lazy_read=True, target_path=None): """Create a fake directory corresponding to the real directory at the specified path. Add entries in the fake directory corresponding to the entries in the real directory. Args: source_...
def prepare_components(self): """Prepare components that are going to be generated based on user options. :return: Updated list of components. :rtype: dict """ # Register the components based on user option # First, tabular report generated_components = d...
def function[prepare_components, parameter[self]]: constant[Prepare components that are going to be generated based on user options. :return: Updated list of components. :rtype: dict ] variable[generated_components] assign[=] call[name[deepcopy], parameter[name[all_defau...
keyword[def] identifier[prepare_components] ( identifier[self] ): literal[string] identifier[generated_components] = identifier[deepcopy] ( identifier[all_default_report_components] ) identifier[component_definitions] ={ identifier[impact_report...
def prepare_components(self): """Prepare components that are going to be generated based on user options. :return: Updated list of components. :rtype: dict """ # Register the components based on user option # First, tabular report generated_components = deepcopy(all_defa...
def sorted_t(key=None, reverse=False): """ Transformation for Sequence.sorted :param key: key to sort by :param reverse: reverse or not :return: transformation """ return Transformation( 'sorted', lambda sequence: sorted(sequence, key=key, reverse=reverse), None )
def function[sorted_t, parameter[key, reverse]]: constant[ Transformation for Sequence.sorted :param key: key to sort by :param reverse: reverse or not :return: transformation ] return[call[name[Transformation], parameter[constant[sorted], <ast.Lambda object at 0x7da204960cd0>, constant[...
keyword[def] identifier[sorted_t] ( identifier[key] = keyword[None] , identifier[reverse] = keyword[False] ): literal[string] keyword[return] identifier[Transformation] ( literal[string] , keyword[lambda] identifier[sequence] : identifier[sorted] ( identifier[sequence] , identifier[key] = ident...
def sorted_t(key=None, reverse=False): """ Transformation for Sequence.sorted :param key: key to sort by :param reverse: reverse or not :return: transformation """ return Transformation('sorted', lambda sequence: sorted(sequence, key=key, reverse=reverse), None)
def flush(self): """Flushes this instance's cache. The driver of this instance should call this method every `flush_interval`. Returns: list['ServicecontrolServicesAllocateQuotaRequest']: corresponding to AllocateQuotaRequests that were pending """ ...
def function[flush, parameter[self]]: constant[Flushes this instance's cache. The driver of this instance should call this method every `flush_interval`. Returns: list['ServicecontrolServicesAllocateQuotaRequest']: corresponding to AllocateQuotaRequests that were pe...
keyword[def] identifier[flush] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_cache] keyword[is] keyword[None] : keyword[return] [] keyword[with] identifier[self] . identifier[_cache] keyword[as] identifier[c] , identifier[self] . identi...
def flush(self): """Flushes this instance's cache. The driver of this instance should call this method every `flush_interval`. Returns: list['ServicecontrolServicesAllocateQuotaRequest']: corresponding to AllocateQuotaRequests that were pending """ if self....
def differences(scansion: str, candidate: str) -> List[int]: """ Given two strings, return a list of index positions where the contents differ. :param scansion: :param candidate: :return: >>> differences("abc", "abz") [2] """ before = scansion.replace(" ", "") after = candidate...
def function[differences, parameter[scansion, candidate]]: constant[ Given two strings, return a list of index positions where the contents differ. :param scansion: :param candidate: :return: >>> differences("abc", "abz") [2] ] variable[before] assign[=] call[name[scansion]...
keyword[def] identifier[differences] ( identifier[scansion] : identifier[str] , identifier[candidate] : identifier[str] )-> identifier[List] [ identifier[int] ]: literal[string] identifier[before] = identifier[scansion] . identifier[replace] ( literal[string] , literal[string] ) identifier[after] = id...
def differences(scansion: str, candidate: str) -> List[int]: """ Given two strings, return a list of index positions where the contents differ. :param scansion: :param candidate: :return: >>> differences("abc", "abz") [2] """ before = scansion.replace(' ', '') after = candidate...
def make_2d(array, verbose=True): """ tiny tool to expand 1D arrays the way i want Parameters ---------- array : array-like verbose : bool, default: True whether to print warnings Returns ------- np.array of with ndim = 2 """ array = np.asarray(array) if array....
def function[make_2d, parameter[array, verbose]]: constant[ tiny tool to expand 1D arrays the way i want Parameters ---------- array : array-like verbose : bool, default: True whether to print warnings Returns ------- np.array of with ndim = 2 ] variable[ar...
keyword[def] identifier[make_2d] ( identifier[array] , identifier[verbose] = keyword[True] ): literal[string] identifier[array] = identifier[np] . identifier[asarray] ( identifier[array] ) keyword[if] identifier[array] . identifier[ndim] < literal[int] : identifier[msg] = literal[string] li...
def make_2d(array, verbose=True): """ tiny tool to expand 1D arrays the way i want Parameters ---------- array : array-like verbose : bool, default: True whether to print warnings Returns ------- np.array of with ndim = 2 """ array = np.asarray(array) if array....
def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, description=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet): """ :calls: `PATCH /orgs/:org <ht...
def function[edit, parameter[self, billing_email, blog, company, description, email, location, name]]: constant[ :calls: `PATCH /orgs/:org <http://developer.github.com/v3/orgs>`_ :param billing_email: string :param blog: string :param company: string :param description: s...
keyword[def] identifier[edit] ( identifier[self] , identifier[billing_email] = identifier[github] . identifier[GithubObject] . identifier[NotSet] , identifier[blog] = identifier[github] . identifier[GithubObject] . identifier[NotSet] , identifier[company] = identifier[github] . identifier[GithubObject] . identifier[N...
def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, description=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet): """ :calls: `PATCH /orgs/:org <http:/...
def extractall(self, path=None, members=None, pwd=None): """Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). """ ...
def function[extractall, parameter[self, path, members, pwd]]: constant[Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). ...
keyword[def] identifier[extractall] ( identifier[self] , identifier[path] = keyword[None] , identifier[members] = keyword[None] , identifier[pwd] = keyword[None] ): literal[string] keyword[if] identifier[members] keyword[is] keyword[None] : identifier[members] = identifier[self] . i...
def extractall(self, path=None, members=None, pwd=None): """Extract all members from the archive to the current working directory. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by namelist(). """ if ...
def facts_refresh(): ''' Reload the facts dictionary from the device. Usually only needed if, the device configuration is changed by some other actor. This function will also refresh the facts stored in the salt grains. CLI Example: .. code-block:: bash salt 'device_name' junos.facts_...
def function[facts_refresh, parameter[]]: constant[ Reload the facts dictionary from the device. Usually only needed if, the device configuration is changed by some other actor. This function will also refresh the facts stored in the salt grains. CLI Example: .. code-block:: bash ...
keyword[def] identifier[facts_refresh] (): literal[string] identifier[conn] = identifier[__proxy__] [ literal[string] ]() identifier[ret] ={} identifier[ret] [ literal[string] ]= keyword[True] keyword[try] : identifier[conn] . identifier[facts_refresh] () keyword[except] iden...
def facts_refresh(): """ Reload the facts dictionary from the device. Usually only needed if, the device configuration is changed by some other actor. This function will also refresh the facts stored in the salt grains. CLI Example: .. code-block:: bash salt 'device_name' junos.facts_...
def MERGE(*args): """ Wipe repeated dependencies from a list of (Analysis, id, filename) tuples, supplied as argument. Replace id with the correct filename. """ # Get the longest common path common_prefix = os.path.dirname(os.path.commonprefix([os.path.abspath(a.scripts[-1][1]) for a, _, _ in a...
def function[MERGE, parameter[]]: constant[ Wipe repeated dependencies from a list of (Analysis, id, filename) tuples, supplied as argument. Replace id with the correct filename. ] variable[common_prefix] assign[=] call[name[os].path.dirname, parameter[call[name[os].path.commonprefix, parame...
keyword[def] identifier[MERGE] (* identifier[args] ): literal[string] identifier[common_prefix] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[os] . identifier[path] . identifier[commonprefix] ([ identifier[os] . identifier[path] . identifier[abspath] ( identifier[a] . identif...
def MERGE(*args): """ Wipe repeated dependencies from a list of (Analysis, id, filename) tuples, supplied as argument. Replace id with the correct filename. """ # Get the longest common path common_prefix = os.path.dirname(os.path.commonprefix([os.path.abspath(a.scripts[-1][1]) for (a, _, _) in ...
def _make_pretty_deprecated(deprecated): """ Makes the deprecated description pretty and returns a formatted string if `deprecated` is not an empty string. Otherwise, returns None. Expected input: ... Expected output: **Deprecated:** ... """ if deprecated != "": ...
def function[_make_pretty_deprecated, parameter[deprecated]]: constant[ Makes the deprecated description pretty and returns a formatted string if `deprecated` is not an empty string. Otherwise, returns None. Expected input: ... Expected output: **Deprecated:** ... ] ...
keyword[def] identifier[_make_pretty_deprecated] ( identifier[deprecated] ): literal[string] keyword[if] identifier[deprecated] != literal[string] : identifier[deprecated] = literal[string] . identifier[join] ( identifier[map] ( keyword[lambda] identifier[n] : identifier[n] [ literal[int] :], i...
def _make_pretty_deprecated(deprecated): """ Makes the deprecated description pretty and returns a formatted string if `deprecated` is not an empty string. Otherwise, returns None. Expected input: ... Expected output: **Deprecated:** ... """ if deprecated != '': ...
def add_menu(self, menu): '''add to the default popup menu''' from MAVProxy.modules.mavproxy_map import mp_slipmap self.default_popup.add(menu) self.map.add_object(mp_slipmap.SlipDefaultPopup(self.default_popup, combine=True))
def function[add_menu, parameter[self, menu]]: constant[add to the default popup menu] from relative_module[MAVProxy.modules.mavproxy_map] import module[mp_slipmap] call[name[self].default_popup.add, parameter[name[menu]]] call[name[self].map.add_object, parameter[call[name[mp_slipmap].SlipD...
keyword[def] identifier[add_menu] ( identifier[self] , identifier[menu] ): literal[string] keyword[from] identifier[MAVProxy] . identifier[modules] . identifier[mavproxy_map] keyword[import] identifier[mp_slipmap] identifier[self] . identifier[default_popup] . identifier[add] ( identif...
def add_menu(self, menu): """add to the default popup menu""" from MAVProxy.modules.mavproxy_map import mp_slipmap self.default_popup.add(menu) self.map.add_object(mp_slipmap.SlipDefaultPopup(self.default_popup, combine=True))
def run(hostname=None, port=None, path=None, loop=None): """ The arguments are not all optional. Either a path or hostname+port should be specified; you have to specify one. """ if path: log.debug("Starting Opentrons server application on {}".format( path)) hostname, port...
def function[run, parameter[hostname, port, path, loop]]: constant[ The arguments are not all optional. Either a path or hostname+port should be specified; you have to specify one. ] if name[path] begin[:] call[name[log].debug, parameter[call[constant[Starting Opentrons serve...
keyword[def] identifier[run] ( identifier[hostname] = keyword[None] , identifier[port] = keyword[None] , identifier[path] = keyword[None] , identifier[loop] = keyword[None] ): literal[string] keyword[if] identifier[path] : identifier[log] . identifier[debug] ( literal[string] . identifier[format]...
def run(hostname=None, port=None, path=None, loop=None): """ The arguments are not all optional. Either a path or hostname+port should be specified; you have to specify one. """ if path: log.debug('Starting Opentrons server application on {}'.format(path)) (hostname, port) = (None, N...
def levenshtein(left, right): """Computes the Levenshtein distance of the two given strings. >>> df0 = spark.createDataFrame([('kitten', 'sitting',)], ['l', 'r']) >>> df0.select(levenshtein('l', 'r').alias('d')).collect() [Row(d=3)] """ sc = SparkContext._active_spark_context jc = sc._jvm.f...
def function[levenshtein, parameter[left, right]]: constant[Computes the Levenshtein distance of the two given strings. >>> df0 = spark.createDataFrame([('kitten', 'sitting',)], ['l', 'r']) >>> df0.select(levenshtein('l', 'r').alias('d')).collect() [Row(d=3)] ] variable[sc] assign[=] na...
keyword[def] identifier[levenshtein] ( identifier[left] , identifier[right] ): literal[string] identifier[sc] = identifier[SparkContext] . identifier[_active_spark_context] identifier[jc] = identifier[sc] . identifier[_jvm] . identifier[functions] . identifier[levenshtein] ( identifier[_to_java_colum...
def levenshtein(left, right): """Computes the Levenshtein distance of the two given strings. >>> df0 = spark.createDataFrame([('kitten', 'sitting',)], ['l', 'r']) >>> df0.select(levenshtein('l', 'r').alias('d')).collect() [Row(d=3)] """ sc = SparkContext._active_spark_context jc = sc._jvm.f...
def responseInColor(request, status, headers, prefix='Response', opts=None): "Prints the response info in color" code, message = status.split(None, 1) message = '%s [%s] => Request %s %s %s on pid %d' % ( prefix, code, str(request.host), request.method, request.path, ...
def function[responseInColor, parameter[request, status, headers, prefix, opts]]: constant[Prints the response info in color] <ast.Tuple object at 0x7da207f99210> assign[=] call[name[status].split, parameter[constant[None], constant[1]]] variable[message] assign[=] binary_operation[constant[%s [...
keyword[def] identifier[responseInColor] ( identifier[request] , identifier[status] , identifier[headers] , identifier[prefix] = literal[string] , identifier[opts] = keyword[None] ): literal[string] identifier[code] , identifier[message] = identifier[status] . identifier[split] ( keyword[None] , literal[in...
def responseInColor(request, status, headers, prefix='Response', opts=None): """Prints the response info in color""" (code, message) = status.split(None, 1) message = '%s [%s] => Request %s %s %s on pid %d' % (prefix, code, str(request.host), request.method, request.path, os.getpid()) signal = int(code)...
def parameters(self): """ Get the dictionary of parameters (either ra,dec or l,b) :return: dictionary of parameters """ if self._coord_type == 'galactic': return collections.OrderedDict((('l', self.l), ('b', self.b))) else: return collections....
def function[parameters, parameter[self]]: constant[ Get the dictionary of parameters (either ra,dec or l,b) :return: dictionary of parameters ] if compare[name[self]._coord_type equal[==] constant[galactic]] begin[:] return[call[name[collections].OrderedDict, parameter[...
keyword[def] identifier[parameters] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_coord_type] == literal[string] : keyword[return] identifier[collections] . identifier[OrderedDict] ((( literal[string] , identifier[self] . identifier[l] ),( literal...
def parameters(self): """ Get the dictionary of parameters (either ra,dec or l,b) :return: dictionary of parameters """ if self._coord_type == 'galactic': return collections.OrderedDict((('l', self.l), ('b', self.b))) # depends on [control=['if'], data=[]] else: ret...
def do_install(ctx, verbose, fake): """Installs legit git aliases.""" click.echo('The following git aliases will be installed:\n') aliases = cli.list_commands(ctx) output_aliases(aliases) if click.confirm('\n{}Install aliases above?'.format('FAKE ' if fake else ''), default=fake): for alias...
def function[do_install, parameter[ctx, verbose, fake]]: constant[Installs legit git aliases.] call[name[click].echo, parameter[constant[The following git aliases will be installed: ]]] variable[aliases] assign[=] call[name[cli].list_commands, parameter[name[ctx]]] call[name[output_alias...
keyword[def] identifier[do_install] ( identifier[ctx] , identifier[verbose] , identifier[fake] ): literal[string] identifier[click] . identifier[echo] ( literal[string] ) identifier[aliases] = identifier[cli] . identifier[list_commands] ( identifier[ctx] ) identifier[output_aliases] ( identifier[...
def do_install(ctx, verbose, fake): """Installs legit git aliases.""" click.echo('The following git aliases will be installed:\n') aliases = cli.list_commands(ctx) output_aliases(aliases) if click.confirm('\n{}Install aliases above?'.format('FAKE ' if fake else ''), default=fake): for alias ...
def _format_exitcodes(exitcodes): """Format a list of exit code with names of the signals if possible""" str_exitcodes = ["{}({})".format(_get_exitcode_name(e), e) for e in exitcodes if e is not None] return "{" + ", ".join(str_exitcodes) + "}"
def function[_format_exitcodes, parameter[exitcodes]]: constant[Format a list of exit code with names of the signals if possible] variable[str_exitcodes] assign[=] <ast.ListComp object at 0x7da1b05bf400> return[binary_operation[binary_operation[constant[{] + call[constant[, ].join, parameter[name[st...
keyword[def] identifier[_format_exitcodes] ( identifier[exitcodes] ): literal[string] identifier[str_exitcodes] =[ literal[string] . identifier[format] ( identifier[_get_exitcode_name] ( identifier[e] ), identifier[e] ) keyword[for] identifier[e] keyword[in] identifier[exitcodes] keyword[if] iden...
def _format_exitcodes(exitcodes): """Format a list of exit code with names of the signals if possible""" str_exitcodes = ['{}({})'.format(_get_exitcode_name(e), e) for e in exitcodes if e is not None] return '{' + ', '.join(str_exitcodes) + '}'
def email_url_config(cls, url, backend=None): """Parses an email URL.""" config = {} url = urlparse(url) if not isinstance(url, cls.URL_CLASS) else url # Remove query strings path = url.path[1:] path = unquote_plus(path.split('?', 2)[0]) # Update with environm...
def function[email_url_config, parameter[cls, url, backend]]: constant[Parses an email URL.] variable[config] assign[=] dictionary[[], []] variable[url] assign[=] <ast.IfExp object at 0x7da1b22bbbb0> variable[path] assign[=] call[name[url].path][<ast.Slice object at 0x7da1b22b95a0>] ...
keyword[def] identifier[email_url_config] ( identifier[cls] , identifier[url] , identifier[backend] = keyword[None] ): literal[string] identifier[config] ={} identifier[url] = identifier[urlparse] ( identifier[url] ) keyword[if] keyword[not] identifier[isinstance] ( identifier[url] , i...
def email_url_config(cls, url, backend=None): """Parses an email URL.""" config = {} url = urlparse(url) if not isinstance(url, cls.URL_CLASS) else url # Remove query strings path = url.path[1:] path = unquote_plus(path.split('?', 2)[0]) # Update with environment configuration config.upd...
def get_my_hostname(self, split_hostname_on_first_period=False): """ Returns a best guess for the hostname registered with OpenStack for this host """ hostname = self.init_config.get("os_host") or self.hostname if split_hostname_on_first_period: hostname = hostname.s...
def function[get_my_hostname, parameter[self, split_hostname_on_first_period]]: constant[ Returns a best guess for the hostname registered with OpenStack for this host ] variable[hostname] assign[=] <ast.BoolOp object at 0x7da18f00ce80> if name[split_hostname_on_first_period] beg...
keyword[def] identifier[get_my_hostname] ( identifier[self] , identifier[split_hostname_on_first_period] = keyword[False] ): literal[string] identifier[hostname] = identifier[self] . identifier[init_config] . identifier[get] ( literal[string] ) keyword[or] identifier[self] . identifier[hostname] ...
def get_my_hostname(self, split_hostname_on_first_period=False): """ Returns a best guess for the hostname registered with OpenStack for this host """ hostname = self.init_config.get('os_host') or self.hostname if split_hostname_on_first_period: hostname = hostname.split('.')[0] # d...
def trim(s, prefix=None, suffix=None, strict=False): """Trim a string, removing given prefix or suffix. :param s: String to trim :param prefix: Prefix to remove from ``s`` :param suffix: Suffix to remove from ``s`` :param strict: Whether the prefix or suffix must be present in ``s``. ...
def function[trim, parameter[s, prefix, suffix, strict]]: constant[Trim a string, removing given prefix or suffix. :param s: String to trim :param prefix: Prefix to remove from ``s`` :param suffix: Suffix to remove from ``s`` :param strict: Whether the prefix or suffix must be present in ``s``....
keyword[def] identifier[trim] ( identifier[s] , identifier[prefix] = keyword[None] , identifier[suffix] = keyword[None] , identifier[strict] = keyword[False] ): literal[string] identifier[ensure_string] ( identifier[s] ) identifier[has_prefix] = identifier[prefix] keyword[is] keyword[not] keyword[...
def trim(s, prefix=None, suffix=None, strict=False): """Trim a string, removing given prefix or suffix. :param s: String to trim :param prefix: Prefix to remove from ``s`` :param suffix: Suffix to remove from ``s`` :param strict: Whether the prefix or suffix must be present in ``s``. ...
def _get_resolved_alias_name(self, property_name, original_alias_value, intrinsics_resolver): """ Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a complex intrinsic function wa...
def function[_get_resolved_alias_name, parameter[self, property_name, original_alias_value, intrinsics_resolver]]: constant[ Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a co...
keyword[def] identifier[_get_resolved_alias_name] ( identifier[self] , identifier[property_name] , identifier[original_alias_value] , identifier[intrinsics_resolver] ): literal[string] identifier[resolved_alias_name] = identifier[intrinsics_resolver] . identifier[resolve_parameter_refs] (...
def _get_resolved_alias_name(self, property_name, original_alias_value, intrinsics_resolver): """ Alias names can be supplied as an intrinsic function. This method tries to extract alias name from a reference to a parameter. If it cannot completely resolve (ie. if a complex intrinsic function was us...
def _get_params(self): """ Generate SOAP parameters. """ params = {'accountNumber': self._service.accountNumber} # Include object variables that are in field_order for key, val in self.__dict__.iteritems(): if key in self.field_order: ...
def function[_get_params, parameter[self]]: constant[ Generate SOAP parameters. ] variable[params] assign[=] dictionary[[<ast.Constant object at 0x7da1b18740a0>], [<ast.Attribute object at 0x7da1b1877b80>]] for taget[tuple[[<ast.Name object at 0x7da1b1876140>, <ast.Name object at...
keyword[def] identifier[_get_params] ( identifier[self] ): literal[string] identifier[params] ={ literal[string] : identifier[self] . identifier[_service] . identifier[accountNumber] } keyword[for] identifier[key] , identifier[val] keyword[in] identifier[self] . identifier[__...
def _get_params(self): """ Generate SOAP parameters. """ params = {'accountNumber': self._service.accountNumber} # Include object variables that are in field_order for (key, val) in self.__dict__.iteritems(): if key in self.field_order: # Turn into Unicode ...
def cmp_mat(a, b): """ Sorts two matrices returning a positive or zero value """ c = 0 for x, y in zip(a.flat, b.flat): c = cmp(abs(x), abs(y)) if c != 0: return c return c
def function[cmp_mat, parameter[a, b]]: constant[ Sorts two matrices returning a positive or zero value ] variable[c] assign[=] constant[0] for taget[tuple[[<ast.Name object at 0x7da20e955510>, <ast.Name object at 0x7da20e955180>]]] in starred[call[name[zip], parameter[name[a].flat, name...
keyword[def] identifier[cmp_mat] ( identifier[a] , identifier[b] ): literal[string] identifier[c] = literal[int] keyword[for] identifier[x] , identifier[y] keyword[in] identifier[zip] ( identifier[a] . identifier[flat] , identifier[b] . identifier[flat] ): identifier[c] = identifier[cmp] ...
def cmp_mat(a, b): """ Sorts two matrices returning a positive or zero value """ c = 0 for (x, y) in zip(a.flat, b.flat): c = cmp(abs(x), abs(y)) if c != 0: return c # depends on [control=['if'], data=['c']] # depends on [control=['for'], data=[]] return c
def main(argv=None): """ pyrpo.main: parse commandline options with optparse and run specified reports """ import logging if argv is None: argv = sys.argv prs = get_option_parser() (opts, args) = prs.parse_args(args=argv) if not opts.quiet: _format = None ...
def function[main, parameter[argv]]: constant[ pyrpo.main: parse commandline options with optparse and run specified reports ] import module[logging] if compare[name[argv] is constant[None]] begin[:] variable[argv] assign[=] name[sys].argv variable[prs] assign[=] ...
keyword[def] identifier[main] ( identifier[argv] = keyword[None] ): literal[string] keyword[import] identifier[logging] keyword[if] identifier[argv] keyword[is] keyword[None] : identifier[argv] = identifier[sys] . identifier[argv] identifier[prs] = identifier[get_option_parser] ...
def main(argv=None): """ pyrpo.main: parse commandline options with optparse and run specified reports """ import logging if argv is None: argv = sys.argv # depends on [control=['if'], data=['argv']] prs = get_option_parser() (opts, args) = prs.parse_args(args=argv) if not o...
def check_dependee_exists(self, depender, dependee, dependee_id): """Checks whether a depended-on module is available. """ shutit_global.shutit_global_object.yield_to_draw() # If the module id isn't there, there's a problem. if dependee is None: return 'module: \n\n' + dependee_id + '\n\nnot found in paths...
def function[check_dependee_exists, parameter[self, depender, dependee, dependee_id]]: constant[Checks whether a depended-on module is available. ] call[name[shutit_global].shutit_global_object.yield_to_draw, parameter[]] if compare[name[dependee] is constant[None]] begin[:] return[bin...
keyword[def] identifier[check_dependee_exists] ( identifier[self] , identifier[depender] , identifier[dependee] , identifier[dependee_id] ): literal[string] identifier[shutit_global] . identifier[shutit_global_object] . identifier[yield_to_draw] () keyword[if] identifier[dependee] keyword[is] keyword[...
def check_dependee_exists(self, depender, dependee, dependee_id): """Checks whether a depended-on module is available. """ shutit_global.shutit_global_object.yield_to_draw() # If the module id isn't there, there's a problem. if dependee is None: return 'module: \n\n' + dependee_id + '\n\nnot foun...
def _build_arguments(self): """ build arguments for command. """ self._parser.add_argument( '--attach', type=bool, required=False, default=False, help="Attach to containers output?" ) self._parser.add_argument( ...
def function[_build_arguments, parameter[self]]: constant[ build arguments for command. ] call[name[self]._parser.add_argument, parameter[constant[--attach]]] call[name[self]._parser.add_argument, parameter[constant[--clean]]] call[name[self]._parser.add_argument, paramet...
keyword[def] identifier[_build_arguments] ( identifier[self] ): literal[string] identifier[self] . identifier[_parser] . identifier[add_argument] ( literal[string] , identifier[type] = identifier[bool] , identifier[required] = keyword[False] , identifier[default]...
def _build_arguments(self): """ build arguments for command. """ self._parser.add_argument('--attach', type=bool, required=False, default=False, help='Attach to containers output?') self._parser.add_argument('--clean', type=bool, required=False, default=False, help='clean up everything that ...
def command_callback(result=None): """ :type result: opendnp3.ICommandTaskResult """ print("Received command result with summary: {}".format(opendnp3.TaskCompletionToString(result.summary))) result.ForeachItem(collection_callback)
def function[command_callback, parameter[result]]: constant[ :type result: opendnp3.ICommandTaskResult ] call[name[print], parameter[call[constant[Received command result with summary: {}].format, parameter[call[name[opendnp3].TaskCompletionToString, parameter[name[result].summary]]]]]] ...
keyword[def] identifier[command_callback] ( identifier[result] = keyword[None] ): literal[string] identifier[print] ( literal[string] . identifier[format] ( identifier[opendnp3] . identifier[TaskCompletionToString] ( identifier[result] . identifier[summary] ))) identifier[result] . identifier[ForeachI...
def command_callback(result=None): """ :type result: opendnp3.ICommandTaskResult """ print('Received command result with summary: {}'.format(opendnp3.TaskCompletionToString(result.summary))) result.ForeachItem(collection_callback)
def _set_all_tables(self, schema, **kwargs): """ You can run into a problem when you are trying to set a table and it has a foreign key to a table that doesn't exist, so this method will go through all fk refs and make sure the tables exist """ with self.transaction(**k...
def function[_set_all_tables, parameter[self, schema]]: constant[ You can run into a problem when you are trying to set a table and it has a foreign key to a table that doesn't exist, so this method will go through all fk refs and make sure the tables exist ] with call[...
keyword[def] identifier[_set_all_tables] ( identifier[self] , identifier[schema] ,** identifier[kwargs] ): literal[string] keyword[with] identifier[self] . identifier[transaction] (** identifier[kwargs] ) keyword[as] identifier[connection] : identifier[kwargs] [ literal[string] ]= id...
def _set_all_tables(self, schema, **kwargs): """ You can run into a problem when you are trying to set a table and it has a foreign key to a table that doesn't exist, so this method will go through all fk refs and make sure the tables exist """ with self.transaction(**kwargs) a...
def set_cookie(name, value): """Sets a cookie and redirects to cookie list. --- tags: - Cookies parameters: - in: path name: name type: string - in: path name: value type: string produces: - text/plain responses: 200: descript...
def function[set_cookie, parameter[name, value]]: constant[Sets a cookie and redirects to cookie list. --- tags: - Cookies parameters: - in: path name: name type: string - in: path name: value type: string produces: - text/plain respons...
keyword[def] identifier[set_cookie] ( identifier[name] , identifier[value] ): literal[string] identifier[r] = identifier[app] . identifier[make_response] ( identifier[redirect] ( identifier[url_for] ( literal[string] ))) identifier[r] . identifier[set_cookie] ( identifier[key] = identifier[name] , id...
def set_cookie(name, value): """Sets a cookie and redirects to cookie list. --- tags: - Cookies parameters: - in: path name: name type: string - in: path name: value type: string produces: - text/plain responses: 200: descript...
def get_by_code(self, code): """ Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object """ if any(x in code for x in ('_', '-')): cc = CultureCode.objects.get(code=code.replace('_', '-')) ...
def function[get_by_code, parameter[self, code]]: constant[ Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object ] if call[name[any], parameter[<ast.GeneratorExp object at 0x7da1b253e380>]] begin[:] ...
keyword[def] identifier[get_by_code] ( identifier[self] , identifier[code] ): literal[string] keyword[if] identifier[any] ( identifier[x] keyword[in] identifier[code] keyword[for] identifier[x] keyword[in] ( literal[string] , literal[string] )): identifier[cc] = identifier[Cultur...
def get_by_code(self, code): """ Retrieve a language by a code. :param code: iso code (any of the three) or its culture code :return: a Language object """ if any((x in code for x in ('_', '-'))): cc = CultureCode.objects.get(code=code.replace('_', '-')) return c...
def set_position(cls, resource_id, to_position, db_session=None, *args, **kwargs): """ Sets node position for new node in the tree :param resource_id: resource to move :param to_position: new position :param db_session: :return:def count_children(cls, resource_id, db_ses...
def function[set_position, parameter[cls, resource_id, to_position, db_session]]: constant[ Sets node position for new node in the tree :param resource_id: resource to move :param to_position: new position :param db_session: :return:def count_children(cls, resource_id, d...
keyword[def] identifier[set_position] ( identifier[cls] , identifier[resource_id] , identifier[to_position] , identifier[db_session] = keyword[None] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[db_session] = identifier[get_db_session] ( identifier[db_session] ) ...
def set_position(cls, resource_id, to_position, db_session=None, *args, **kwargs): """ Sets node position for new node in the tree :param resource_id: resource to move :param to_position: new position :param db_session: :return:def count_children(cls, resource_id, db_session...
def delete_row_range(self, format_str, start_game, end_game): """Delete rows related to the given game range. Args: format_str: a string to `.format()` by the game numbers in order to create the row prefixes. start_game: the starting game number of the deletion. ...
def function[delete_row_range, parameter[self, format_str, start_game, end_game]]: constant[Delete rows related to the given game range. Args: format_str: a string to `.format()` by the game numbers in order to create the row prefixes. start_game: the starting game num...
keyword[def] identifier[delete_row_range] ( identifier[self] , identifier[format_str] , identifier[start_game] , identifier[end_game] ): literal[string] identifier[row_keys] = identifier[make_single_array] ( identifier[self] . identifier[tf_table] . identifier[keys_by_range_dataset] ( ...
def delete_row_range(self, format_str, start_game, end_game): """Delete rows related to the given game range. Args: format_str: a string to `.format()` by the game numbers in order to create the row prefixes. start_game: the starting game number of the deletion. ...
def relation_to_intermediary(fk): """Transform an SQLAlchemy ForeignKey object to it's intermediary representation. """ return Relation( right_col=format_name(fk.parent.table.fullname), left_col=format_name(fk._column_tokens[1]), right_cardinality='?', left_cardinality='*', )
def function[relation_to_intermediary, parameter[fk]]: constant[Transform an SQLAlchemy ForeignKey object to it's intermediary representation. ] return[call[name[Relation], parameter[]]]
keyword[def] identifier[relation_to_intermediary] ( identifier[fk] ): literal[string] keyword[return] identifier[Relation] ( identifier[right_col] = identifier[format_name] ( identifier[fk] . identifier[parent] . identifier[table] . identifier[fullname] ), identifier[left_col] = identifier[forma...
def relation_to_intermediary(fk): """Transform an SQLAlchemy ForeignKey object to it's intermediary representation. """ return Relation(right_col=format_name(fk.parent.table.fullname), left_col=format_name(fk._column_tokens[1]), right_cardinality='?', left_cardinality='*')
def dict_to_ddb(item): # type: (Dict[str, Any]) -> Dict[str, Any] # TODO: narrow these types down """Converts a native Python dictionary to a raw DynamoDB item. :param dict item: Native item :returns: DynamoDB item :rtype: dict """ serializer = TypeSerializer() return {key: serializ...
def function[dict_to_ddb, parameter[item]]: constant[Converts a native Python dictionary to a raw DynamoDB item. :param dict item: Native item :returns: DynamoDB item :rtype: dict ] variable[serializer] assign[=] call[name[TypeSerializer], parameter[]] return[<ast.DictComp object at...
keyword[def] identifier[dict_to_ddb] ( identifier[item] ): literal[string] identifier[serializer] = identifier[TypeSerializer] () keyword[return] { identifier[key] : identifier[serializer] . identifier[serialize] ( identifier[value] ) keyword[for] identifier[key] , identifier[value] keyword[in] i...
def dict_to_ddb(item): # type: (Dict[str, Any]) -> Dict[str, Any] # TODO: narrow these types down 'Converts a native Python dictionary to a raw DynamoDB item.\n\n :param dict item: Native item\n :returns: DynamoDB item\n :rtype: dict\n ' serializer = TypeSerializer() return {key: seriali...
def getpad(self): """Get pad value of DataBatch.""" if self.last_batch_handle == 'pad' and \ self.cursor + self.batch_size > self.num_data: return self.cursor + self.batch_size - self.num_data # check the first batch elif self.last_batch_handle == 'roll_over' and \...
def function[getpad, parameter[self]]: constant[Get pad value of DataBatch.] if <ast.BoolOp object at 0x7da1b200bfa0> begin[:] return[binary_operation[binary_operation[name[self].cursor + name[self].batch_size] - name[self].num_data]]
keyword[def] identifier[getpad] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[last_batch_handle] == literal[string] keyword[and] identifier[self] . identifier[cursor] + identifier[self] . identifier[batch_size] > identifier[self] . identifier[num_data] : ...
def getpad(self): """Get pad value of DataBatch.""" if self.last_batch_handle == 'pad' and self.cursor + self.batch_size > self.num_data: return self.cursor + self.batch_size - self.num_data # depends on [control=['if'], data=[]] # check the first batch elif self.last_batch_handle == 'roll_over...
def set_connection_ip_list(addresses=None, grant_by_default=False, server=_DEFAULT_SERVER): ''' Set the IPGrant list for the SMTP virtual server. :param str addresses: A dictionary of IP + subnet pairs. :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist. :param s...
def function[set_connection_ip_list, parameter[addresses, grant_by_default, server]]: constant[ Set the IPGrant list for the SMTP virtual server. :param str addresses: A dictionary of IP + subnet pairs. :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist. :par...
keyword[def] identifier[set_connection_ip_list] ( identifier[addresses] = keyword[None] , identifier[grant_by_default] = keyword[False] , identifier[server] = identifier[_DEFAULT_SERVER] ): literal[string] identifier[setting] = literal[string] identifier[formatted_addresses] = identifier[list] () ...
def set_connection_ip_list(addresses=None, grant_by_default=False, server=_DEFAULT_SERVER): """ Set the IPGrant list for the SMTP virtual server. :param str addresses: A dictionary of IP + subnet pairs. :param bool grant_by_default: Whether the addresses should be a blacklist or whitelist. :param s...
def pop_smallest(self): """Return the item with the lowest priority and remove it. Raises IndexError if the object is empty. """ heap = self._heap v, k = heappop(heap) while k not in self or self[k] != v: v, k = heappop(heap) del self[k] retu...
def function[pop_smallest, parameter[self]]: constant[Return the item with the lowest priority and remove it. Raises IndexError if the object is empty. ] variable[heap] assign[=] name[self]._heap <ast.Tuple object at 0x7da1b1b0cca0> assign[=] call[name[heappop], parameter[name[h...
keyword[def] identifier[pop_smallest] ( identifier[self] ): literal[string] identifier[heap] = identifier[self] . identifier[_heap] identifier[v] , identifier[k] = identifier[heappop] ( identifier[heap] ) keyword[while] identifier[k] keyword[not] keyword[in] identifier[self]...
def pop_smallest(self): """Return the item with the lowest priority and remove it. Raises IndexError if the object is empty. """ heap = self._heap (v, k) = heappop(heap) while k not in self or self[k] != v: (v, k) = heappop(heap) # depends on [control=['while'], data=[]] de...
def surf_keep_cortex(surf, cortex): """ Remove medial wall from cortical surface to ensure that shortest paths are only calculated through the cortex. Inputs ------- surf : Tuple containing two numpy arrays of shape (n_nodes,3). Each node of the first array specifies the x, y, z coordina...
def function[surf_keep_cortex, parameter[surf, cortex]]: constant[ Remove medial wall from cortical surface to ensure that shortest paths are only calculated through the cortex. Inputs ------- surf : Tuple containing two numpy arrays of shape (n_nodes,3). Each node of the first array specifies ...
keyword[def] identifier[surf_keep_cortex] ( identifier[surf] , identifier[cortex] ): literal[string] identifier[vertices] , identifier[triangles] = identifier[surf] identifier[cortex_vertices] = identifier[np] . identifier[array] ( identifier[vertices] [ identifier[cortex] ], identifier[d...
def surf_keep_cortex(surf, cortex): """ Remove medial wall from cortical surface to ensure that shortest paths are only calculated through the cortex. Inputs ------- surf : Tuple containing two numpy arrays of shape (n_nodes,3). Each node of the first array specifies the x, y, z coordina...
def _updateTargetFromNode(self): """ Applies the configuration to its target axis """ self.viewBox.setAspectLocked(lock=self.configValue, ratio=self.aspectRatioCti.configValue)
def function[_updateTargetFromNode, parameter[self]]: constant[ Applies the configuration to its target axis ] call[name[self].viewBox.setAspectLocked, parameter[]]
keyword[def] identifier[_updateTargetFromNode] ( identifier[self] ): literal[string] identifier[self] . identifier[viewBox] . identifier[setAspectLocked] ( identifier[lock] = identifier[self] . identifier[configValue] , identifier[ratio] = identifier[self] . identifier[aspectRatioCti] . identifier[...
def _updateTargetFromNode(self): """ Applies the configuration to its target axis """ self.viewBox.setAspectLocked(lock=self.configValue, ratio=self.aspectRatioCti.configValue)
def _validate_config(self): """Ensure at least one switch is configured""" if len(cfg.CONF.ml2_arista.get('switch_info')) < 1: msg = _('Required option - when "sec_group_support" is enabled, ' 'at least one switch must be specified ') LOG.exception(msg) ...
def function[_validate_config, parameter[self]]: constant[Ensure at least one switch is configured] if compare[call[name[len], parameter[call[name[cfg].CONF.ml2_arista.get, parameter[constant[switch_info]]]]] less[<] constant[1]] begin[:] variable[msg] assign[=] call[name[_], parameter[c...
keyword[def] identifier[_validate_config] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[cfg] . identifier[CONF] . identifier[ml2_arista] . identifier[get] ( literal[string] ))< literal[int] : identifier[msg] = identifier[_] ( literal[string] ...
def _validate_config(self): """Ensure at least one switch is configured""" if len(cfg.CONF.ml2_arista.get('switch_info')) < 1: msg = _('Required option - when "sec_group_support" is enabled, at least one switch must be specified ') LOG.exception(msg) raise arista_exc.AristaConfigError(ms...
def weibull(target, seeds, shape, scale, loc): r""" Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- target : OpenPNM Object The object which this model is associated with. This controls the length of the calculated array, and also pro...
def function[weibull, parameter[target, seeds, shape, scale, loc]]: constant[ Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- target : OpenPNM Object The object which this model is associated with. This controls the length of the ...
keyword[def] identifier[weibull] ( identifier[target] , identifier[seeds] , identifier[shape] , identifier[scale] , identifier[loc] ): literal[string] identifier[seeds] = identifier[target] [ identifier[seeds] ] identifier[value] = identifier[spts] . identifier[weibull_min] . identifier[ppf] ( identif...
def weibull(target, seeds, shape, scale, loc): """ Produces values from a Weibull distribution given a set of random numbers. Parameters ---------- target : OpenPNM Object The object which this model is associated with. This controls the length of the calculated array, and also prov...
def _insert_lcl_level(pressure, temperature, lcl_pressure): """Insert the LCL pressure into the profile.""" interp_temp = interpolate_1d(lcl_pressure, pressure, temperature) # Pressure needs to be increasing for searchsorted, so flip it and then convert # the index back to the original array loc = ...
def function[_insert_lcl_level, parameter[pressure, temperature, lcl_pressure]]: constant[Insert the LCL pressure into the profile.] variable[interp_temp] assign[=] call[name[interpolate_1d], parameter[name[lcl_pressure], name[pressure], name[temperature]]] variable[loc] assign[=] binary_operati...
keyword[def] identifier[_insert_lcl_level] ( identifier[pressure] , identifier[temperature] , identifier[lcl_pressure] ): literal[string] identifier[interp_temp] = identifier[interpolate_1d] ( identifier[lcl_pressure] , identifier[pressure] , identifier[temperature] ) identifier[loc] = iden...
def _insert_lcl_level(pressure, temperature, lcl_pressure): """Insert the LCL pressure into the profile.""" interp_temp = interpolate_1d(lcl_pressure, pressure, temperature) # Pressure needs to be increasing for searchsorted, so flip it and then convert # the index back to the original array loc = p...
def prepare(data): """Restructure/prepare data about commits for output.""" message = data.get("message") sha = data.get("sha") tree = data.get("tree") tree_sha = tree.get("sha") return {"message": message, "sha": sha, "tree": {"sha": tree_sha}}
def function[prepare, parameter[data]]: constant[Restructure/prepare data about commits for output.] variable[message] assign[=] call[name[data].get, parameter[constant[message]]] variable[sha] assign[=] call[name[data].get, parameter[constant[sha]]] variable[tree] assign[=] call[name[da...
keyword[def] identifier[prepare] ( identifier[data] ): literal[string] identifier[message] = identifier[data] . identifier[get] ( literal[string] ) identifier[sha] = identifier[data] . identifier[get] ( literal[string] ) identifier[tree] = identifier[data] . identifier[get] ( literal[string] ) ...
def prepare(data): """Restructure/prepare data about commits for output.""" message = data.get('message') sha = data.get('sha') tree = data.get('tree') tree_sha = tree.get('sha') return {'message': message, 'sha': sha, 'tree': {'sha': tree_sha}}
def _http_request(self, method, url_path, headers=None, query_params=None, body_params=None, files=None, **kwargs): """ Method to do http requests. :param method: :param url_path: :param headers: :param body_params: :param query_params: :param files: (opt...
def function[_http_request, parameter[self, method, url_path, headers, query_params, body_params, files]]: constant[ Method to do http requests. :param method: :param url_path: :param headers: :param body_params: :param query_params: :param files: (option...
keyword[def] identifier[_http_request] ( identifier[self] , identifier[method] , identifier[url_path] , identifier[headers] = keyword[None] , identifier[query_params] = keyword[None] , identifier[body_params] = keyword[None] , identifier[files] = keyword[None] ,** identifier[kwargs] ): literal[string] ...
def _http_request(self, method, url_path, headers=None, query_params=None, body_params=None, files=None, **kwargs): """ Method to do http requests. :param method: :param url_path: :param headers: :param body_params: :param query_params: :param files: (optiona...
def page_for(self, member, page_size=DEFAULT_PAGE_SIZE): ''' Determine the page where a member falls in the leaderboard. @param member [String] Member name. @param page_size [int] Page size to be used in determining page location. @return the page where a member falls in the lea...
def function[page_for, parameter[self, member, page_size]]: constant[ Determine the page where a member falls in the leaderboard. @param member [String] Member name. @param page_size [int] Page size to be used in determining page location. @return the page where a member falls i...
keyword[def] identifier[page_for] ( identifier[self] , identifier[member] , identifier[page_size] = identifier[DEFAULT_PAGE_SIZE] ): literal[string] keyword[return] identifier[self] . identifier[page_for_in] ( identifier[self] . identifier[leaderboard_name] , identifier[member] , identifier[page_s...
def page_for(self, member, page_size=DEFAULT_PAGE_SIZE): """ Determine the page where a member falls in the leaderboard. @param member [String] Member name. @param page_size [int] Page size to be used in determining page location. @return the page where a member falls in the leaderb...
def copy(self, target=None, name=None): """ Asynchronously creates a copy of this DriveItem and all it's child elements. :param target: target location to move to. If it's a drive the item will be moved to the root folder. :type target: drive.Folder or Drive :param name...
def function[copy, parameter[self, target, name]]: constant[ Asynchronously creates a copy of this DriveItem and all it's child elements. :param target: target location to move to. If it's a drive the item will be moved to the root folder. :type target: drive.Folder or Drive ...
keyword[def] identifier[copy] ( identifier[self] , identifier[target] = keyword[None] , identifier[name] = keyword[None] ): literal[string] keyword[if] identifier[target] keyword[is] keyword[None] keyword[and] identifier[name] keyword[is] keyword[None] : keyword[raise] identifi...
def copy(self, target=None, name=None): """ Asynchronously creates a copy of this DriveItem and all it's child elements. :param target: target location to move to. If it's a drive the item will be moved to the root folder. :type target: drive.Folder or Drive :param name: a ...
def unpack_char16(self, data): """ Unpack a CIM-XML string value of CIM type 'char16' and return it as a unicode string object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned). """ if data is None: ret...
def function[unpack_char16, parameter[self, data]]: constant[ Unpack a CIM-XML string value of CIM type 'char16' and return it as a unicode string object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned). ] if compa...
keyword[def] identifier[unpack_char16] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[data] keyword[is] keyword[None] : keyword[return] keyword[None] identifier[len_data] = identifier[len] ( identifier[data] ) keyword[if] iden...
def unpack_char16(self, data): """ Unpack a CIM-XML string value of CIM type 'char16' and return it as a unicode string object, or None. data (unicode string): CIM-XML string value, or None (in which case None is returned). """ if data is None: return None # d...
def _install_kraken_db(datadir, args): """Install kraken minimal DB in genome folder. """ import requests kraken = os.path.join(datadir, "genomes/kraken") url = "https://ccb.jhu.edu/software/kraken/dl/minikraken.tgz" compress = os.path.join(kraken, os.path.basename(url)) base, ext = utils.sp...
def function[_install_kraken_db, parameter[datadir, args]]: constant[Install kraken minimal DB in genome folder. ] import module[requests] variable[kraken] assign[=] call[name[os].path.join, parameter[name[datadir], constant[genomes/kraken]]] variable[url] assign[=] constant[https://ccb....
keyword[def] identifier[_install_kraken_db] ( identifier[datadir] , identifier[args] ): literal[string] keyword[import] identifier[requests] identifier[kraken] = identifier[os] . identifier[path] . identifier[join] ( identifier[datadir] , literal[string] ) identifier[url] = literal[string] ...
def _install_kraken_db(datadir, args): """Install kraken minimal DB in genome folder. """ import requests kraken = os.path.join(datadir, 'genomes/kraken') url = 'https://ccb.jhu.edu/software/kraken/dl/minikraken.tgz' compress = os.path.join(kraken, os.path.basename(url)) (base, ext) = utils....
def explore_batch(traj, batch): """Chooses exploration according to `batch`""" explore_dict = {} explore_dict['sigma'] = np.arange(10.0 * batch, 10.0*(batch+1), 1.0).tolist() # for batch = 0 explores sigma in [0.0, 1.0, 2.0, ..., 9.0], # for batch = 1 explores sigma in [10.0, 11.0, 12.0, ..., 19.0] ...
def function[explore_batch, parameter[traj, batch]]: constant[Chooses exploration according to `batch`] variable[explore_dict] assign[=] dictionary[[], []] call[name[explore_dict]][constant[sigma]] assign[=] call[call[name[np].arange, parameter[binary_operation[constant[10.0] * name[batch]], bin...
keyword[def] identifier[explore_batch] ( identifier[traj] , identifier[batch] ): literal[string] identifier[explore_dict] ={} identifier[explore_dict] [ literal[string] ]= identifier[np] . identifier[arange] ( literal[int] * identifier[batch] , literal[int] *( identifier[batch] + literal[int] ), liter...
def explore_batch(traj, batch): """Chooses exploration according to `batch`""" explore_dict = {} explore_dict['sigma'] = np.arange(10.0 * batch, 10.0 * (batch + 1), 1.0).tolist() # for batch = 0 explores sigma in [0.0, 1.0, 2.0, ..., 9.0], # for batch = 1 explores sigma in [10.0, 11.0, 12.0, ..., 19...
def changepassword(self, event): """An enrolled user wants to change their password""" old = event.data['old'] new = event.data['new'] uuid = event.user.uuid # TODO: Write email to notify user of password change user = objectmodels['user'].find_one({'uuid': uuid}) ...
def function[changepassword, parameter[self, event]]: constant[An enrolled user wants to change their password] variable[old] assign[=] call[name[event].data][constant[old]] variable[new] assign[=] call[name[event].data][constant[new]] variable[uuid] assign[=] name[event].user.uuid ...
keyword[def] identifier[changepassword] ( identifier[self] , identifier[event] ): literal[string] identifier[old] = identifier[event] . identifier[data] [ literal[string] ] identifier[new] = identifier[event] . identifier[data] [ literal[string] ] identifier[uuid] = identifier[ev...
def changepassword(self, event): """An enrolled user wants to change their password""" old = event.data['old'] new = event.data['new'] uuid = event.user.uuid # TODO: Write email to notify user of password change user = objectmodels['user'].find_one({'uuid': uuid}) if std_hash(old, self.salt)...
def check(self, radl): """Check the features in this network.""" SIMPLE_FEATURES = { "host": (str, None), "credentials.username": (str, None), "credentials.password": (str, None), "credentials.private_key": (str, None) } self.check_simple(...
def function[check, parameter[self, radl]]: constant[Check the features in this network.] variable[SIMPLE_FEATURES] assign[=] dictionary[[<ast.Constant object at 0x7da1b0ae07c0>, <ast.Constant object at 0x7da1b0ae1ea0>, <ast.Constant object at 0x7da1b0ae2290>, <ast.Constant object at 0x7da1b0ae2650>], [...
keyword[def] identifier[check] ( identifier[self] , identifier[radl] ): literal[string] identifier[SIMPLE_FEATURES] ={ literal[string] :( identifier[str] , keyword[None] ), literal[string] :( identifier[str] , keyword[None] ), literal[string] :( identifier[str] , keyword...
def check(self, radl): """Check the features in this network.""" SIMPLE_FEATURES = {'host': (str, None), 'credentials.username': (str, None), 'credentials.password': (str, None), 'credentials.private_key': (str, None)} self.check_simple(SIMPLE_FEATURES, radl) if not self.getHost(): raise RADLPar...
def setProfile(self, profile): """ Sets the profile linked with this action. :param profile | <projexui.widgets.xviewwidget.XViewProfile> """ self._profile = profile # update the interface self.setIcon(profile.icon()) self....
def function[setProfile, parameter[self, profile]]: constant[ Sets the profile linked with this action. :param profile | <projexui.widgets.xviewwidget.XViewProfile> ] name[self]._profile assign[=] name[profile] call[name[self].setIcon, parameter[call[name[pr...
keyword[def] identifier[setProfile] ( identifier[self] , identifier[profile] ): literal[string] identifier[self] . identifier[_profile] = identifier[profile] identifier[self] . identifier[setIcon] ( identifier[profile] . identifier[icon] ()) identifier[self] . ide...
def setProfile(self, profile): """ Sets the profile linked with this action. :param profile | <projexui.widgets.xviewwidget.XViewProfile> """ self._profile = profile # update the interface self.setIcon(profile.icon()) self.setText(profile.name()) self.setToolTi...
def thread_raise(thread, exctype): ''' Raises or queues the exception `exctype` for the thread `thread`. See the documentation on the function `thread_exception_gate()` for more information. Adapted from http://tomerfiliba.com/recipes/Thread2/ which explains: "The exception will be raised only...
def function[thread_raise, parameter[thread, exctype]]: constant[ Raises or queues the exception `exctype` for the thread `thread`. See the documentation on the function `thread_exception_gate()` for more information. Adapted from http://tomerfiliba.com/recipes/Thread2/ which explains: "Th...
keyword[def] identifier[thread_raise] ( identifier[thread] , identifier[exctype] ): literal[string] keyword[import] identifier[ctypes] , identifier[inspect] , identifier[threading] , identifier[logging] keyword[if] keyword[not] identifier[inspect] . identifier[isclass] ( identifier[exctype] ): ...
def thread_raise(thread, exctype): """ Raises or queues the exception `exctype` for the thread `thread`. See the documentation on the function `thread_exception_gate()` for more information. Adapted from http://tomerfiliba.com/recipes/Thread2/ which explains: "The exception will be raised only...
def handle_chld(self, sig, frame): """ SIGCHLD handling :param sig: :param frame: :return: """ try: while True: wpid, status = waitpid(-1, WNOHANG) if not wpid: break # self.stdout...
def function[handle_chld, parameter[self, sig, frame]]: constant[ SIGCHLD handling :param sig: :param frame: :return: ] <ast.Try object at 0x7da18ede78b0>
keyword[def] identifier[handle_chld] ( identifier[self] , identifier[sig] , identifier[frame] ): literal[string] keyword[try] : keyword[while] keyword[True] : identifier[wpid] , identifier[status] = identifier[waitpid] (- literal[int] , identifier[WNOHANG] ) ...
def handle_chld(self, sig, frame): """ SIGCHLD handling :param sig: :param frame: :return: """ try: while True: (wpid, status) = waitpid(-1, WNOHANG) if not wpid: break # depends on [control=['if'], data=[]] # depends on [...
def find_loops( record, index, stop_types = STOP_TYPES, open=None, seen = None ): """Find all loops within the index and replace with loop records""" if open is None: open = [] if seen is None: seen = set() for child in children( record, index, stop_types = stop_types ): if child...
def function[find_loops, parameter[record, index, stop_types, open, seen]]: constant[Find all loops within the index and replace with loop records] if compare[name[open] is constant[None]] begin[:] variable[open] assign[=] list[[]] if compare[name[seen] is constant[None]] begin[:...
keyword[def] identifier[find_loops] ( identifier[record] , identifier[index] , identifier[stop_types] = identifier[STOP_TYPES] , identifier[open] = keyword[None] , identifier[seen] = keyword[None] ): literal[string] keyword[if] identifier[open] keyword[is] keyword[None] : identifier[open] =[] ...
def find_loops(record, index, stop_types=STOP_TYPES, open=None, seen=None): """Find all loops within the index and replace with loop records""" if open is None: open = [] # depends on [control=['if'], data=['open']] if seen is None: seen = set() # depends on [control=['if'], data=['seen']]...
def invoke(self, request): # type: (ApiClientRequest) -> ApiClientResponse """Dispatches a request to an API endpoint described in the request. Resolves the method from input request object, converts the list of header tuples to the required format (dict) for the `reques...
def function[invoke, parameter[self, request]]: constant[Dispatches a request to an API endpoint described in the request. Resolves the method from input request object, converts the list of header tuples to the required format (dict) for the `requests` lib call and invokes the ...
keyword[def] identifier[invoke] ( identifier[self] , identifier[request] ): literal[string] keyword[try] : identifier[http_method] = identifier[self] . identifier[_resolve_method] ( identifier[request] ) identifier[http_headers] = identifier[self] . identifier[_convert_li...
def invoke(self, request): # type: (ApiClientRequest) -> ApiClientResponse 'Dispatches a request to an API endpoint described in the\n request.\n\n Resolves the method from input request object, converts the\n list of header tuples to the required format (dict) for the\n `requests` l...
def get_by_identifier(self, identifier): """Gets blocks by identifier Args: identifier (str): Should be any of: username, phone_number, email. See: https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks """ params = {'identifier': identifier} ...
def function[get_by_identifier, parameter[self, identifier]]: constant[Gets blocks by identifier Args: identifier (str): Should be any of: username, phone_number, email. See: https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks ] variable[params] as...
keyword[def] identifier[get_by_identifier] ( identifier[self] , identifier[identifier] ): literal[string] identifier[params] ={ literal[string] : identifier[identifier] } keyword[return] identifier[self] . identifier[client] . identifier[get] ( identifier[self] . identifier[_url] (), id...
def get_by_identifier(self, identifier): """Gets blocks by identifier Args: identifier (str): Should be any of: username, phone_number, email. See: https://auth0.com/docs/api/management/v2#!/User_Blocks/get_user_blocks """ params = {'identifier': identifier} return self....
def getIndent(indentNum): """ Cached indent getter function """ try: return _indentCache[indentNum] except KeyError: i = "".join([_indent for _ in range(indentNum)]) _indentCache[indentNum] = i return i
def function[getIndent, parameter[indentNum]]: constant[ Cached indent getter function ] <ast.Try object at 0x7da1b03fafb0>
keyword[def] identifier[getIndent] ( identifier[indentNum] ): literal[string] keyword[try] : keyword[return] identifier[_indentCache] [ identifier[indentNum] ] keyword[except] identifier[KeyError] : identifier[i] = literal[string] . identifier[join] ([ identifier[_indent] keyword[...
def getIndent(indentNum): """ Cached indent getter function """ try: return _indentCache[indentNum] # depends on [control=['try'], data=[]] except KeyError: i = ''.join([_indent for _ in range(indentNum)]) _indentCache[indentNum] = i return i # depends on [control=[...
def render(self, name, value, attrs=None, **kwargs): """Widget render method.""" if self.confirm_with: self.attrs['data-confirm-with'] = 'id_%s' % self.confirm_with confirmation_markup = """ <div style="margin-top: 10px;" class="hidden password_strength_info"> <p...
def function[render, parameter[self, name, value, attrs]]: constant[Widget render method.] if name[self].confirm_with begin[:] call[name[self].attrs][constant[data-confirm-with]] assign[=] binary_operation[constant[id_%s] <ast.Mod object at 0x7da2590d6920> name[self].confirm_with] ...
keyword[def] identifier[render] ( identifier[self] , identifier[name] , identifier[value] , identifier[attrs] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[self] . identifier[confirm_with] : identifier[self] . identifier[attrs] [ literal[string] ]= l...
def render(self, name, value, attrs=None, **kwargs): """Widget render method.""" if self.confirm_with: self.attrs['data-confirm-with'] = 'id_%s' % self.confirm_with # depends on [control=['if'], data=[]] confirmation_markup = '\n <div style="margin-top: 10px;" class="hidden password_strength...
def myRank(grade, badFormat, year, length): '''rank of candidateNumber in year Arguments: grade {int} -- a weighted average for a specific candidate number and year badFormat {dict} -- candNumber : [results for candidate] year {int} -- year you are in length {int} -- length of e...
def function[myRank, parameter[grade, badFormat, year, length]]: constant[rank of candidateNumber in year Arguments: grade {int} -- a weighted average for a specific candidate number and year badFormat {dict} -- candNumber : [results for candidate] year {int} -- year you are in ...
keyword[def] identifier[myRank] ( identifier[grade] , identifier[badFormat] , identifier[year] , identifier[length] ): literal[string] keyword[return] identifier[int] ( identifier[sorted] ( identifier[everyonesAverage] ( identifier[year] , identifier[badFormat] , identifier[length] ), identifier[reverse] ...
def myRank(grade, badFormat, year, length): """rank of candidateNumber in year Arguments: grade {int} -- a weighted average for a specific candidate number and year badFormat {dict} -- candNumber : [results for candidate] year {int} -- year you are in length {int} -- length of e...
def alphabetical_formula(self): """ Returns a reduced formula string with appended charge """ alph_formula = super().alphabetical_formula chg_str = "" if self.charge > 0: chg_str = " +" + formula_double_format(self.charge, False) elif self.charge < 0: ...
def function[alphabetical_formula, parameter[self]]: constant[ Returns a reduced formula string with appended charge ] variable[alph_formula] assign[=] call[name[super], parameter[]].alphabetical_formula variable[chg_str] assign[=] constant[] if compare[name[self].charge ...
keyword[def] identifier[alphabetical_formula] ( identifier[self] ): literal[string] identifier[alph_formula] = identifier[super] (). identifier[alphabetical_formula] identifier[chg_str] = literal[string] keyword[if] identifier[self] . identifier[charge] > literal[int] : ...
def alphabetical_formula(self): """ Returns a reduced formula string with appended charge """ alph_formula = super().alphabetical_formula chg_str = '' if self.charge > 0: chg_str = ' +' + formula_double_format(self.charge, False) # depends on [control=['if'], data=[]] elif s...
def perplexity(eval_data, predictions, scores, learner='ignored'): ''' Return the perplexity `exp(-score)` computed from each score in `scores`. The log scores in `scores` should be base e (`exp`, `log`). The correct average to use for this metric is the geometric mean. It is recommended to work in...
def function[perplexity, parameter[eval_data, predictions, scores, learner]]: constant[ Return the perplexity `exp(-score)` computed from each score in `scores`. The log scores in `scores` should be base e (`exp`, `log`). The correct average to use for this metric is the geometric mean. It is r...
keyword[def] identifier[perplexity] ( identifier[eval_data] , identifier[predictions] , identifier[scores] , identifier[learner] = literal[string] ): literal[string] keyword[return] identifier[np] . identifier[exp] (- identifier[np] . identifier[array] ( identifier[scores] )). identifier[tolist] ()
def perplexity(eval_data, predictions, scores, learner='ignored'): """ Return the perplexity `exp(-score)` computed from each score in `scores`. The log scores in `scores` should be base e (`exp`, `log`). The correct average to use for this metric is the geometric mean. It is recommended to work in...
def write(self): """ attempt to get a chunk of data to write to our child process's stdin, then write it. the return value answers the questions "are we done writing forever?" """ # get_chunk may sometimes return bytes, and sometimes return strings # because of the nature of th...
def function[write, parameter[self]]: constant[ attempt to get a chunk of data to write to our child process's stdin, then write it. the return value answers the questions "are we done writing forever?" ] <ast.Try object at 0x7da18ede5c90> if <ast.BoolOp object at 0x7da18ede6470> be...
keyword[def] identifier[write] ( identifier[self] ): literal[string] keyword[try] : identifier[chunk] = identifier[self] . identifier[get_chunk] () keyword[if] identifier[chunk] keyword[is] keyword[None] : keyword[raise] ide...
def write(self): """ attempt to get a chunk of data to write to our child process's stdin, then write it. the return value answers the questions "are we done writing forever?" """ # get_chunk may sometimes return bytes, and sometimes return strings # because of the nature of the different t...
def delete(self, resource, force=False, export_only=None, suppress_device_updates=None, timeout=-1): """ Deletes a managed volume. Args: resource (dict): Object to delete. force: If set to true, the operation completes despite any problem...
def function[delete, parameter[self, resource, force, export_only, suppress_device_updates, timeout]]: constant[ Deletes a managed volume. Args: resource (dict): Object to delete. force: If set to true, the operation completes despite any...
keyword[def] identifier[delete] ( identifier[self] , identifier[resource] , identifier[force] = keyword[False] , identifier[export_only] = keyword[None] , identifier[suppress_device_updates] = keyword[None] , identifier[timeout] =- literal[int] ): literal[string] identifier[custom_headers] ={ liter...
def delete(self, resource, force=False, export_only=None, suppress_device_updates=None, timeout=-1): """ Deletes a managed volume. Args: resource (dict): Object to delete. force: If set to true, the operation completes despite any problems wi...
def translate_points(self, points): """ Translate coordinates and return screen coordinates Will be returned in order passed as tuples. :return: list """ retval = list() append = retval.append sx, sy = self.get_center_offset() if self._zoom_level == 1.0:...
def function[translate_points, parameter[self, points]]: constant[ Translate coordinates and return screen coordinates Will be returned in order passed as tuples. :return: list ] variable[retval] assign[=] call[name[list], parameter[]] variable[append] assign[=] name[re...
keyword[def] identifier[translate_points] ( identifier[self] , identifier[points] ): literal[string] identifier[retval] = identifier[list] () identifier[append] = identifier[retval] . identifier[append] identifier[sx] , identifier[sy] = identifier[self] . identifier[get_center_of...
def translate_points(self, points): """ Translate coordinates and return screen coordinates Will be returned in order passed as tuples. :return: list """ retval = list() append = retval.append (sx, sy) = self.get_center_offset() if self._zoom_level == 1.0: for c in ...
def from_file(cls, path, directory=None, modules=None, active=None): """ Instantiate a REPP from a `.rpp` file. The *path* parameter points to the top-level module. Submodules are loaded from *directory*. If *directory* is not given, it is the directory part of *path*. ...
def function[from_file, parameter[cls, path, directory, modules, active]]: constant[ Instantiate a REPP from a `.rpp` file. The *path* parameter points to the top-level module. Submodules are loaded from *directory*. If *directory* is not given, it is the directory part of *path...
keyword[def] identifier[from_file] ( identifier[cls] , identifier[path] , identifier[directory] = keyword[None] , identifier[modules] = keyword[None] , identifier[active] = keyword[None] ): literal[string] identifier[name] = identifier[basename] ( identifier[path] ) keyword[if] identifier...
def from_file(cls, path, directory=None, modules=None, active=None): """ Instantiate a REPP from a `.rpp` file. The *path* parameter points to the top-level module. Submodules are loaded from *directory*. If *directory* is not given, it is the directory part of *path*. A RE...
def get_request_id(self, renew=False): """ :Brief: This method is used in every place to get the already generated request ID or generate new request ID and sent off """ if not AppRequest.__request_id or renew: self.set_request_id(uuid.uuid1()) return AppReque...
def function[get_request_id, parameter[self, renew]]: constant[ :Brief: This method is used in every place to get the already generated request ID or generate new request ID and sent off ] if <ast.BoolOp object at 0x7da1b26aca30> begin[:] call[name[self].set_reque...
keyword[def] identifier[get_request_id] ( identifier[self] , identifier[renew] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[AppRequest] . identifier[__request_id] keyword[or] identifier[renew] : identifier[self] . identifier[set_request_id] ( identifier[u...
def get_request_id(self, renew=False): """ :Brief: This method is used in every place to get the already generated request ID or generate new request ID and sent off """ if not AppRequest.__request_id or renew: self.set_request_id(uuid.uuid1()) # depends on [control=['if'], data...
def _EntriesGenerator(self): """Retrieves directory entries. Since a directory can contain a vast number of entries using a generator is more memory efficient. Yields: VShadowPathSpec: a path specification. """ location = getattr(self.path_spec, 'location', None) store_index = getatt...
def function[_EntriesGenerator, parameter[self]]: constant[Retrieves directory entries. Since a directory can contain a vast number of entries using a generator is more memory efficient. Yields: VShadowPathSpec: a path specification. ] variable[location] assign[=] call[name[getat...
keyword[def] identifier[_EntriesGenerator] ( identifier[self] ): literal[string] identifier[location] = identifier[getattr] ( identifier[self] . identifier[path_spec] , literal[string] , keyword[None] ) identifier[store_index] = identifier[getattr] ( identifier[self] . identifier[path_spec] , literal[...
def _EntriesGenerator(self): """Retrieves directory entries. Since a directory can contain a vast number of entries using a generator is more memory efficient. Yields: VShadowPathSpec: a path specification. """ location = getattr(self.path_spec, 'location', None) store_index = getatt...
def get_replies(self, new=True): """ Return all reply notifications for this user. :param new: False for all notifications, True for only non-viewed notifications. """ url = (self._imgur._base_url + "/3/account/{0}/" "notifications/replies".format(self...
def function[get_replies, parameter[self, new]]: constant[ Return all reply notifications for this user. :param new: False for all notifications, True for only non-viewed notifications. ] variable[url] assign[=] binary_operation[name[self]._imgur._base_url + call[con...
keyword[def] identifier[get_replies] ( identifier[self] , identifier[new] = keyword[True] ): literal[string] identifier[url] =( identifier[self] . identifier[_imgur] . identifier[_base_url] + literal[string] literal[string] . identifier[format] ( identifier[self] . identifier[name] )) ...
def get_replies(self, new=True): """ Return all reply notifications for this user. :param new: False for all notifications, True for only non-viewed notifications. """ url = self._imgur._base_url + '/3/account/{0}/notifications/replies'.format(self.name) return self._img...
def run(expnum, ccd, version, dry_run=False, prefix="", force=False): """Run the OSSOS jmpmakepsf script. """ message = storage.SUCCESS if storage.get_status(task, prefix, expnum, version=version, ccd=ccd) and not force: logging.info("{} completed successfully for {} {} {} {}".format(task, pre...
def function[run, parameter[expnum, ccd, version, dry_run, prefix, force]]: constant[Run the OSSOS jmpmakepsf script. ] variable[message] assign[=] name[storage].SUCCESS if <ast.BoolOp object at 0x7da1b1a4bd90> begin[:] call[name[logging].info, parameter[call[constant[{} com...
keyword[def] identifier[run] ( identifier[expnum] , identifier[ccd] , identifier[version] , identifier[dry_run] = keyword[False] , identifier[prefix] = literal[string] , identifier[force] = keyword[False] ): literal[string] identifier[message] = identifier[storage] . identifier[SUCCESS] keyword[if] ...
def run(expnum, ccd, version, dry_run=False, prefix='', force=False): """Run the OSSOS jmpmakepsf script. """ message = storage.SUCCESS if storage.get_status(task, prefix, expnum, version=version, ccd=ccd) and (not force): logging.info('{} completed successfully for {} {} {} {}'.format(task, pr...
def __fix_context(context): """Return a new context dict based on original context. The new context will be a copy of the original, and some mutable members (such as script and css files) will also be copied to prevent polluting shared context. """ COPY_LISTS = ('script_files', 'css_files',) ...
def function[__fix_context, parameter[context]]: constant[Return a new context dict based on original context. The new context will be a copy of the original, and some mutable members (such as script and css files) will also be copied to prevent polluting shared context. ] variable[COPY...
keyword[def] identifier[__fix_context] ( identifier[context] ): literal[string] identifier[COPY_LISTS] =( literal[string] , literal[string] ,) keyword[for] identifier[attr] keyword[in] identifier[COPY_LISTS] : keyword[if] identifier[attr] keyword[in] identifier[context] : ...
def __fix_context(context): """Return a new context dict based on original context. The new context will be a copy of the original, and some mutable members (such as script and css files) will also be copied to prevent polluting shared context. """ COPY_LISTS = ('script_files', 'css_files') ...
def _any_pandas_objects(terms): """Check a sequence of terms for instances of PandasObject.""" return any(isinstance(term.value, pd.core.generic.PandasObject) for term in terms)
def function[_any_pandas_objects, parameter[terms]]: constant[Check a sequence of terms for instances of PandasObject.] return[call[name[any], parameter[<ast.GeneratorExp object at 0x7da18c4cfe80>]]]
keyword[def] identifier[_any_pandas_objects] ( identifier[terms] ): literal[string] keyword[return] identifier[any] ( identifier[isinstance] ( identifier[term] . identifier[value] , identifier[pd] . identifier[core] . identifier[generic] . identifier[PandasObject] ) keyword[for] identifier[term] ke...
def _any_pandas_objects(terms): """Check a sequence of terms for instances of PandasObject.""" return any((isinstance(term.value, pd.core.generic.PandasObject) for term in terms))
def display(self): """Display the visualization inline in the IPython notebook. This is deprecated, use the following instead:: from IPython.display import display display(viz) """ from IPython.core.display import display, HTML display(HTML(self._repr_ht...
def function[display, parameter[self]]: constant[Display the visualization inline in the IPython notebook. This is deprecated, use the following instead:: from IPython.display import display display(viz) ] from relative_module[IPython.core.display] import module[dis...
keyword[def] identifier[display] ( identifier[self] ): literal[string] keyword[from] identifier[IPython] . identifier[core] . identifier[display] keyword[import] identifier[display] , identifier[HTML] identifier[display] ( identifier[HTML] ( identifier[self] . identifier[_repr_html_] (...
def display(self): """Display the visualization inline in the IPython notebook. This is deprecated, use the following instead:: from IPython.display import display display(viz) """ from IPython.core.display import display, HTML display(HTML(self._repr_html_()))
def _run_svn(cmd, cwd, user, username, password, opts, **kwargs): ''' Execute svn return the output of the command cmd The command to run. cwd The path to the Subversion repository user Run svn as a user other than what the minion runs as username Connect ...
def function[_run_svn, parameter[cmd, cwd, user, username, password, opts]]: constant[ Execute svn return the output of the command cmd The command to run. cwd The path to the Subversion repository user Run svn as a user other than what the minion runs as user...
keyword[def] identifier[_run_svn] ( identifier[cmd] , identifier[cwd] , identifier[user] , identifier[username] , identifier[password] , identifier[opts] ,** identifier[kwargs] ): literal[string] identifier[cmd] =[ literal[string] , literal[string] , identifier[cmd] ] identifier[options] = identifier...
def _run_svn(cmd, cwd, user, username, password, opts, **kwargs): """ Execute svn return the output of the command cmd The command to run. cwd The path to the Subversion repository user Run svn as a user other than what the minion runs as username Connect ...
def search_profiles( self, parent, request_metadata, profile_query=None, page_size=None, offset=None, disable_spell_check=None, order_by=None, case_sensitive_sort=None, histogram_queries=None, retry=google.api_core.gapic_v1.method.D...
def function[search_profiles, parameter[self, parent, request_metadata, profile_query, page_size, offset, disable_spell_check, order_by, case_sensitive_sort, histogram_queries, retry, timeout, metadata]]: constant[ Searches for profiles within a tenant. For example, search by raw queries "softw...
keyword[def] identifier[search_profiles] ( identifier[self] , identifier[parent] , identifier[request_metadata] , identifier[profile_query] = keyword[None] , identifier[page_size] = keyword[None] , identifier[offset] = keyword[None] , identifier[disable_spell_check] = keyword[None] , identifier[order_by] = ke...
def search_profiles(self, parent, request_metadata, profile_query=None, page_size=None, offset=None, disable_spell_check=None, order_by=None, case_sensitive_sort=None, histogram_queries=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ ...
def Get(self): """Fetches user's data and returns it wrapped in a Grruser object.""" args = user_management_pb2.ApiGetGrrUserArgs(username=self.username) data = self._context.SendRequest("GetGrrUser", args) return GrrUser(data=data, context=self._context)
def function[Get, parameter[self]]: constant[Fetches user's data and returns it wrapped in a Grruser object.] variable[args] assign[=] call[name[user_management_pb2].ApiGetGrrUserArgs, parameter[]] variable[data] assign[=] call[name[self]._context.SendRequest, parameter[constant[GetGrrUser], nam...
keyword[def] identifier[Get] ( identifier[self] ): literal[string] identifier[args] = identifier[user_management_pb2] . identifier[ApiGetGrrUserArgs] ( identifier[username] = identifier[self] . identifier[username] ) identifier[data] = identifier[self] . identifier[_context] . identifier[SendRequest]...
def Get(self): """Fetches user's data and returns it wrapped in a Grruser object.""" args = user_management_pb2.ApiGetGrrUserArgs(username=self.username) data = self._context.SendRequest('GetGrrUser', args) return GrrUser(data=data, context=self._context)
def pivot_query_as_matrix(facet=None, facet_pivot_fields=None, **kwargs): """ Pivot query """ if facet_pivot_fields is None: facet_pivot_fields = [] logging.info("Additional args: {}".format(kwargs)) fp = search_associations(rows=0, facet_fields=[facet], ...
def function[pivot_query_as_matrix, parameter[facet, facet_pivot_fields]]: constant[ Pivot query ] if compare[name[facet_pivot_fields] is constant[None]] begin[:] variable[facet_pivot_fields] assign[=] list[[]] call[name[logging].info, parameter[call[constant[Additional a...
keyword[def] identifier[pivot_query_as_matrix] ( identifier[facet] = keyword[None] , identifier[facet_pivot_fields] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[facet_pivot_fields] keyword[is] keyword[None] : identifier[facet_pivot_fields] =[] identifier...
def pivot_query_as_matrix(facet=None, facet_pivot_fields=None, **kwargs): """ Pivot query """ if facet_pivot_fields is None: facet_pivot_fields = [] # depends on [control=['if'], data=['facet_pivot_fields']] logging.info('Additional args: {}'.format(kwargs)) fp = search_associations(row...
def item_deelgemeente_adapter(obj, request): """ Adapter for rendering a object of :class:`crabpy.gateway.crab.Deelgemeente` to json. """ return { 'id': obj.id, 'naam': obj.naam, 'gemeente': { 'id': obj.gemeente.id, 'naam': obj.gemeente.naam } ...
def function[item_deelgemeente_adapter, parameter[obj, request]]: constant[ Adapter for rendering a object of :class:`crabpy.gateway.crab.Deelgemeente` to json. ] return[dictionary[[<ast.Constant object at 0x7da1b0a9cd90>, <ast.Constant object at 0x7da1b0a9e5c0>, <ast.Constant object at 0x7da1b0...
keyword[def] identifier[item_deelgemeente_adapter] ( identifier[obj] , identifier[request] ): literal[string] keyword[return] { literal[string] : identifier[obj] . identifier[id] , literal[string] : identifier[obj] . identifier[naam] , literal[string] :{ literal[string] : identifier[obj...
def item_deelgemeente_adapter(obj, request): """ Adapter for rendering a object of :class:`crabpy.gateway.crab.Deelgemeente` to json. """ return {'id': obj.id, 'naam': obj.naam, 'gemeente': {'id': obj.gemeente.id, 'naam': obj.gemeente.naam}}
def to_file(self, f): """Write vocab to a file. :param (file) f: a file object, e.g. as returned by calling `open` File format: word0<TAB>count0 word1<TAB>count1 ... word with index 0 is on the 0th line and so on... """ for word in s...
def function[to_file, parameter[self, f]]: constant[Write vocab to a file. :param (file) f: a file object, e.g. as returned by calling `open` File format: word0<TAB>count0 word1<TAB>count1 ... word with index 0 is on the 0th line and so on... ...
keyword[def] identifier[to_file] ( identifier[self] , identifier[f] ): literal[string] keyword[for] identifier[word] keyword[in] identifier[self] . identifier[_index2word] : identifier[count] = identifier[self] . identifier[_counts] [ identifier[word] ] identifier[f] . ...
def to_file(self, f): """Write vocab to a file. :param (file) f: a file object, e.g. as returned by calling `open` File format: word0<TAB>count0 word1<TAB>count1 ... word with index 0 is on the 0th line and so on... """ for word in self._ind...
def rdrecord(record_name, sampfrom=0, sampto=None, channels=None, physical=True, pb_dir=None, m2s=True, smooth_frames=True, ignore_skew=False, return_res=64, force_channels=True, channel_names=None, warn_empty=False): """ Read a WFDB record and return the signal and record...
def function[rdrecord, parameter[record_name, sampfrom, sampto, channels, physical, pb_dir, m2s, smooth_frames, ignore_skew, return_res, force_channels, channel_names, warn_empty]]: constant[ Read a WFDB record and return the signal and record descriptors as attributes in a Record or MultiRecord object....
keyword[def] identifier[rdrecord] ( identifier[record_name] , identifier[sampfrom] = literal[int] , identifier[sampto] = keyword[None] , identifier[channels] = keyword[None] , identifier[physical] = keyword[True] , identifier[pb_dir] = keyword[None] , identifier[m2s] = keyword[True] , identifier[smooth_frames] = key...
def rdrecord(record_name, sampfrom=0, sampto=None, channels=None, physical=True, pb_dir=None, m2s=True, smooth_frames=True, ignore_skew=False, return_res=64, force_channels=True, channel_names=None, warn_empty=False): """ Read a WFDB record and return the signal and record descriptors as attributes in a Rec...
def select_best_paths(examples): """ Process `examples`, select only paths that works for every example. Select best paths with highest priority. Args: examples (dict): Output from :func:`.read_config`. Returns: list: List of :class:`.PathCall` and :class:`.Chained` objects. ""...
def function[select_best_paths, parameter[examples]]: constant[ Process `examples`, select only paths that works for every example. Select best paths with highest priority. Args: examples (dict): Output from :func:`.read_config`. Returns: list: List of :class:`.PathCall` and :c...
keyword[def] identifier[select_best_paths] ( identifier[examples] ): literal[string] identifier[possible_paths] ={} keyword[for] identifier[example] keyword[in] identifier[examples] : identifier[dom] = identifier[_create_dom] ( identifier[example] [ literal[string] ]) identi...
def select_best_paths(examples): """ Process `examples`, select only paths that works for every example. Select best paths with highest priority. Args: examples (dict): Output from :func:`.read_config`. Returns: list: List of :class:`.PathCall` and :class:`.Chained` objects. ""...
def get_sources(self, cuts=None, distance=None, skydir=None, minmax_ts=None, minmax_npred=None, exclude=None, square=False): """Retrieve list of sources in the ROI satisfying the given selections. Returns ------- srcs : list A ...
def function[get_sources, parameter[self, cuts, distance, skydir, minmax_ts, minmax_npred, exclude, square]]: constant[Retrieve list of sources in the ROI satisfying the given selections. Returns ------- srcs : list A list of `~fermipy.roi_model.Model` objects. ...
keyword[def] identifier[get_sources] ( identifier[self] , identifier[cuts] = keyword[None] , identifier[distance] = keyword[None] , identifier[skydir] = keyword[None] , identifier[minmax_ts] = keyword[None] , identifier[minmax_npred] = keyword[None] , identifier[exclude] = keyword[None] , identifier[square] = keywo...
def get_sources(self, cuts=None, distance=None, skydir=None, minmax_ts=None, minmax_npred=None, exclude=None, square=False): """Retrieve list of sources in the ROI satisfying the given selections. Returns ------- srcs : list A list of `~fermipy.roi_model.Model` objects. ...
def to_dict(self): """Dict representation of the database as credentials plus tables dict representation.""" db_dict = self.credentials db_dict.update(self.tables.to_dict()) return db_dict
def function[to_dict, parameter[self]]: constant[Dict representation of the database as credentials plus tables dict representation.] variable[db_dict] assign[=] name[self].credentials call[name[db_dict].update, parameter[call[name[self].tables.to_dict, parameter[]]]] return[name[db_dict]]
keyword[def] identifier[to_dict] ( identifier[self] ): literal[string] identifier[db_dict] = identifier[self] . identifier[credentials] identifier[db_dict] . identifier[update] ( identifier[self] . identifier[tables] . identifier[to_dict] ()) keyword[return] identifier[db_dict]
def to_dict(self): """Dict representation of the database as credentials plus tables dict representation.""" db_dict = self.credentials db_dict.update(self.tables.to_dict()) return db_dict
async def arun_process(path: Union[Path, str], target: Callable, *, args: Tuple[Any]=(), kwargs: Dict[str, Any]=None, callback: Callable[[Set[Tuple[Change, str]]], Awaitable]=None, watcher_cls: Type[AllWatcher]=PythonWatcher, ...
<ast.AsyncFunctionDef object at 0x7da20e963880>
keyword[async] keyword[def] identifier[arun_process] ( identifier[path] : identifier[Union] [ identifier[Path] , identifier[str] ], identifier[target] : identifier[Callable] ,*, identifier[args] : identifier[Tuple] [ identifier[Any] ]=(), identifier[kwargs] : identifier[Dict] [ identifier[str] , identifier[Any] ]=...
async def arun_process(path: Union[Path, str], target: Callable, *, args: Tuple[Any]=(), kwargs: Dict[str, Any]=None, callback: Callable[[Set[Tuple[Change, str]]], Awaitable]=None, watcher_cls: Type[AllWatcher]=PythonWatcher, debounce=400, min_sleep=100): """ Run a function in a subprocess using multiprocessing...
def update(self, *args, **kwargs): """d.update([E, ]**F) -> None. Update D from mapping/iterable E and F. Overwrite the values in `d` with the keys from `E` and `F`. If any key in `value` is invalid in `d`, ``KeyError`` is raised. This method is atomic - either all values in `value` a...
def function[update, parameter[self]]: constant[d.update([E, ]**F) -> None. Update D from mapping/iterable E and F. Overwrite the values in `d` with the keys from `E` and `F`. If any key in `value` is invalid in `d`, ``KeyError`` is raised. This method is atomic - either all values in...
keyword[def] identifier[update] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[len] ( identifier[args] )> literal[int] : identifier[msg] = literal[string] keyword[raise] identifier[TypeError] ( identifier[msg] . ...
def update(self, *args, **kwargs): """d.update([E, ]**F) -> None. Update D from mapping/iterable E and F. Overwrite the values in `d` with the keys from `E` and `F`. If any key in `value` is invalid in `d`, ``KeyError`` is raised. This method is atomic - either all values in `value` are s...
def check_keystore_json(jsondata: Dict) -> bool: """ Check if ``jsondata`` has the structure of a keystore file version 3. Note that this test is not complete, e.g. it doesn't check key derivation or cipher parameters. Copied from https://github.com/vbuterin/pybitcointools Args: jsondata: Dict...
def function[check_keystore_json, parameter[jsondata]]: constant[ Check if ``jsondata`` has the structure of a keystore file version 3. Note that this test is not complete, e.g. it doesn't check key derivation or cipher parameters. Copied from https://github.com/vbuterin/pybitcointools Args: ...
keyword[def] identifier[check_keystore_json] ( identifier[jsondata] : identifier[Dict] )-> identifier[bool] : literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[jsondata] keyword[and] literal[string] keyword[not] keyword[in] identifier[jsondata] : keyword[retu...
def check_keystore_json(jsondata: Dict) -> bool: """ Check if ``jsondata`` has the structure of a keystore file version 3. Note that this test is not complete, e.g. it doesn't check key derivation or cipher parameters. Copied from https://github.com/vbuterin/pybitcointools Args: jsondata: Dict...
def read_extended_header(self, groupby='field', force_type=''): """Read the extended header according to `extended_header_type`. Currently, only the FEI extended header format is supported. See `print_fei_ext_header_spec` or `this homepage`_ for the format specification. The ex...
def function[read_extended_header, parameter[self, groupby, force_type]]: constant[Read the extended header according to `extended_header_type`. Currently, only the FEI extended header format is supported. See `print_fei_ext_header_spec` or `this homepage`_ for the format specification....
keyword[def] identifier[read_extended_header] ( identifier[self] , identifier[groupby] = literal[string] , identifier[force_type] = literal[string] ): literal[string] identifier[ext_header_type] = identifier[str] ( identifier[force_type] ). identifier[upper] () keyword[or] identifier[self] . ident...
def read_extended_header(self, groupby='field', force_type=''): """Read the extended header according to `extended_header_type`. Currently, only the FEI extended header format is supported. See `print_fei_ext_header_spec` or `this homepage`_ for the format specification. The extend...
def add_codedValue(self, name, code): """ adds a value to the coded value list """ if self._codedValues is None: self._codedValues = [] self._codedValues.append( {"name": name, "code": code} )
def function[add_codedValue, parameter[self, name, code]]: constant[ adds a value to the coded value list ] if compare[name[self]._codedValues is constant[None]] begin[:] name[self]._codedValues assign[=] list[[]] call[name[self]._codedValues.append, parameter[dictionary[[<ast.Co...
keyword[def] identifier[add_codedValue] ( identifier[self] , identifier[name] , identifier[code] ): literal[string] keyword[if] identifier[self] . identifier[_codedValues] keyword[is] keyword[None] : identifier[self] . identifier[_codedValues] =[] identifier[self] . identif...
def add_codedValue(self, name, code): """ adds a value to the coded value list """ if self._codedValues is None: self._codedValues = [] # depends on [control=['if'], data=[]] self._codedValues.append({'name': name, 'code': code})
def rollback(self): """Rollback target system to consistent state. The strategy is to find the latest timestamp in the target system and the largest timestamp in the oplog less than the latest target system timestamp. This defines the rollback window and we just roll these back ...
def function[rollback, parameter[self]]: constant[Rollback target system to consistent state. The strategy is to find the latest timestamp in the target system and the largest timestamp in the oplog less than the latest target system timestamp. This defines the rollback window and we ju...
keyword[def] identifier[rollback] ( identifier[self] ): literal[string] identifier[LOG] . identifier[debug] ( literal[string] literal[string] ) identifier[last_docs] =[] keyword[for] identifier[dm] keyword[in] identifier[self] . identifier[d...
def rollback(self): """Rollback target system to consistent state. The strategy is to find the latest timestamp in the target system and the largest timestamp in the oplog less than the latest target system timestamp. This defines the rollback window and we just roll these back unti...
def execute_get(self, resource, **kwargs): """ Execute an HTTP GET request against the API endpoints. This method is meant for internal use. :param resource: The last part of the URI :param kwargs: Additional query parameters (and optionally headers) :return: The HTTP re...
def function[execute_get, parameter[self, resource]]: constant[ Execute an HTTP GET request against the API endpoints. This method is meant for internal use. :param resource: The last part of the URI :param kwargs: Additional query parameters (and optionally headers) :re...
keyword[def] identifier[execute_get] ( identifier[self] , identifier[resource] ,** identifier[kwargs] ): literal[string] identifier[url] = literal[string] %( identifier[self] . identifier[base_url] , identifier[resource] ) identifier[headers] = identifier[kwargs] . identifier[pop] ( lite...
def execute_get(self, resource, **kwargs): """ Execute an HTTP GET request against the API endpoints. This method is meant for internal use. :param resource: The last part of the URI :param kwargs: Additional query parameters (and optionally headers) :return: The HTTP respon...
def metastability(alpha, T, right_eigenvectors, square_map, pi): """Return the metastability PCCA+ objective function. Parameters ---------- alpha : ndarray Parameters of objective function (e.g. flattened A) T : csr sparse matrix Transition matrix right_eigenvectors : ndarray ...
def function[metastability, parameter[alpha, T, right_eigenvectors, square_map, pi]]: constant[Return the metastability PCCA+ objective function. Parameters ---------- alpha : ndarray Parameters of objective function (e.g. flattened A) T : csr sparse matrix Transition matrix ...
keyword[def] identifier[metastability] ( identifier[alpha] , identifier[T] , identifier[right_eigenvectors] , identifier[square_map] , identifier[pi] ): literal[string] identifier[num_micro] , identifier[num_eigen] = identifier[right_eigenvectors] . identifier[shape] identifier[A] , identifier[chi]...
def metastability(alpha, T, right_eigenvectors, square_map, pi): """Return the metastability PCCA+ objective function. Parameters ---------- alpha : ndarray Parameters of objective function (e.g. flattened A) T : csr sparse matrix Transition matrix right_eigenvectors : ndarray ...
def get_capabilities_by_type(self, strict_type_matching: bool = False) -> Dict[Type, Dict[str, Dict[str, Parser]]]: """ For all types that are supported, lists all extensions that can be parsed into such a type. For each extension, provides the list of parsers supported. The order is "mo...
def function[get_capabilities_by_type, parameter[self, strict_type_matching]]: constant[ For all types that are supported, lists all extensions that can be parsed into such a type. For each extension, provides the list of parsers supported. The order is "most pertinent first" Th...
keyword[def] identifier[get_capabilities_by_type] ( identifier[self] , identifier[strict_type_matching] : identifier[bool] = keyword[False] )-> identifier[Dict] [ identifier[Type] , identifier[Dict] [ identifier[str] , identifier[Dict] [ identifier[str] , identifier[Parser] ]]]: literal[string] id...
def get_capabilities_by_type(self, strict_type_matching: bool=False) -> Dict[Type, Dict[str, Dict[str, Parser]]]: """ For all types that are supported, lists all extensions that can be parsed into such a type. For each extension, provides the list of parsers supported. The order is "most per...
def timeseries(self): """Simulated time series""" if self._timeseries is None: self.compute() if isinstance(self.system, NetworkModel): return self.system._reshape_timeseries(self._timeseries) else: return self._timeseries
def function[timeseries, parameter[self]]: constant[Simulated time series] if compare[name[self]._timeseries is constant[None]] begin[:] call[name[self].compute, parameter[]] if call[name[isinstance], parameter[name[self].system, name[NetworkModel]]] begin[:] return[call[...
keyword[def] identifier[timeseries] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_timeseries] keyword[is] keyword[None] : identifier[self] . identifier[compute] () keyword[if] identifier[isinstance] ( identifier[self] . identifier[system]...
def timeseries(self): """Simulated time series""" if self._timeseries is None: self.compute() # depends on [control=['if'], data=[]] if isinstance(self.system, NetworkModel): return self.system._reshape_timeseries(self._timeseries) # depends on [control=['if'], data=[]] else: r...
def _handle_page_args(self, rison_args): """ Helper function to handle rison page arguments, sets defaults and impose FAB_API_MAX_PAGE_SIZE :param rison_args: :return: (tuple) page, page_size """ page = rison_args.get(API_PAGE_INDEX_RIS_KEY, 0...
def function[_handle_page_args, parameter[self, rison_args]]: constant[ Helper function to handle rison page arguments, sets defaults and impose FAB_API_MAX_PAGE_SIZE :param rison_args: :return: (tuple) page, page_size ] variable[page] assign[...
keyword[def] identifier[_handle_page_args] ( identifier[self] , identifier[rison_args] ): literal[string] identifier[page] = identifier[rison_args] . identifier[get] ( identifier[API_PAGE_INDEX_RIS_KEY] , literal[int] ) identifier[page_size] = identifier[rison_args] . identifier[get] ( ide...
def _handle_page_args(self, rison_args): """ Helper function to handle rison page arguments, sets defaults and impose FAB_API_MAX_PAGE_SIZE :param rison_args: :return: (tuple) page, page_size """ page = rison_args.get(API_PAGE_INDEX_RIS_KEY, 0) pa...
def update_model(self, idx=None): """Updates the value of property at given index. If idx is None, all controlled indices will be updated. This method should be called directly by the user in very unusual conditions.""" if idx is None: for w in self._widgets: ...
def function[update_model, parameter[self, idx]]: constant[Updates the value of property at given index. If idx is None, all controlled indices will be updated. This method should be called directly by the user in very unusual conditions.] if compare[name[idx] is constant[None]] ...
keyword[def] identifier[update_model] ( identifier[self] , identifier[idx] = keyword[None] ): literal[string] keyword[if] identifier[idx] keyword[is] keyword[None] : keyword[for] identifier[w] keyword[in] identifier[self] . identifier[_widgets] : identifier[idx] ...
def update_model(self, idx=None): """Updates the value of property at given index. If idx is None, all controlled indices will be updated. This method should be called directly by the user in very unusual conditions.""" if idx is None: for w in self._widgets: idx = se...