code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_cover_image(self, output_file_path=None, scope='profile/public'): """ Retrieve the Mxit user's cover image No user authentication required """ data = _get( token=self.oauth.get_user_token(scope), uri='/user/cover' ) if output_file_...
def function[get_cover_image, parameter[self, output_file_path, scope]]: constant[ Retrieve the Mxit user's cover image No user authentication required ] variable[data] assign[=] call[name[_get], parameter[]] if name[output_file_path] begin[:] with call[na...
keyword[def] identifier[get_cover_image] ( identifier[self] , identifier[output_file_path] = keyword[None] , identifier[scope] = literal[string] ): literal[string] identifier[data] = identifier[_get] ( identifier[token] = identifier[self] . identifier[oauth] . identifier[get_user_token] ( ...
def get_cover_image(self, output_file_path=None, scope='profile/public'): """ Retrieve the Mxit user's cover image No user authentication required """ data = _get(token=self.oauth.get_user_token(scope), uri='/user/cover') if output_file_path: with open(output_file_path, 'w') ...
def JSONList(*args, **kwargs): """Stores a list as JSON on database, with mutability support. If kwargs has a param `unique_sorted` (which evaluated to True), list values are made unique and sorted. """ type_ = JSON try: if kwargs.pop("unique_sorted"): type_ = JSONUniqueList...
def function[JSONList, parameter[]]: constant[Stores a list as JSON on database, with mutability support. If kwargs has a param `unique_sorted` (which evaluated to True), list values are made unique and sorted. ] variable[type_] assign[=] name[JSON] <ast.Try object at 0x7da20c6c44c0> ...
keyword[def] identifier[JSONList] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[type_] = identifier[JSON] keyword[try] : keyword[if] identifier[kwargs] . identifier[pop] ( literal[string] ): identifier[type_] = identifier[JSONUniqueListType] key...
def JSONList(*args, **kwargs): """Stores a list as JSON on database, with mutability support. If kwargs has a param `unique_sorted` (which evaluated to True), list values are made unique and sorted. """ type_ = JSON try: if kwargs.pop('unique_sorted'): type_ = JSONUniqueList...
def rtype_to_model(rtype): """ Return a model class object given a string resource type :param rtype: string resource type :return: model class object :raise: ValueError """ models = goldman.config.MODELS for model in models: if rtype.lower() == model.RTYPE....
def function[rtype_to_model, parameter[rtype]]: constant[ Return a model class object given a string resource type :param rtype: string resource type :return: model class object :raise: ValueError ] variable[models] assign[=] name[goldman].config.MODELS f...
keyword[def] identifier[rtype_to_model] ( identifier[rtype] ): literal[string] identifier[models] = identifier[goldman] . identifier[config] . identifier[MODELS] keyword[for] identifier[model] keyword[in] identifier[models] : keyword[if] identifier[rtype] . identifier[lower] ()== identi...
def rtype_to_model(rtype): """ Return a model class object given a string resource type :param rtype: string resource type :return: model class object :raise: ValueError """ models = goldman.config.MODELS for model in models: if rtype.lower() == model.RTYPE.l...
def request_port_forward(self, address, port, handler=None): """ Ask the server to forward TCP connections from a listening port on the server, across this SSH session. If a handler is given, that handler is called from a different thread whenever a forwarded connection arrives....
def function[request_port_forward, parameter[self, address, port, handler]]: constant[ Ask the server to forward TCP connections from a listening port on the server, across this SSH session. If a handler is given, that handler is called from a different thread whenever a forward...
keyword[def] identifier[request_port_forward] ( identifier[self] , identifier[address] , identifier[port] , identifier[handler] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[active] : keyword[raise] identifier[SSHException] ( literal[strin...
def request_port_forward(self, address, port, handler=None): """ Ask the server to forward TCP connections from a listening port on the server, across this SSH session. If a handler is given, that handler is called from a different thread whenever a forwarded connection arrives. Th...
def parse_mode(mode, default_bitdepth=None): """Parse PIL-style mode and return tuple (grayscale, alpha, bitdeph)""" # few special cases if mode == 'P': # Don't know what is pallette raise Error('Unknown colour mode:' + mode) elif mode == '1': # Logical return (True, Fals...
def function[parse_mode, parameter[mode, default_bitdepth]]: constant[Parse PIL-style mode and return tuple (grayscale, alpha, bitdeph)] if compare[name[mode] equal[==] constant[P]] begin[:] <ast.Raise object at 0x7da1b26ae290> if call[name[mode].startswith, parameter[constant[L]]] begin...
keyword[def] identifier[parse_mode] ( identifier[mode] , identifier[default_bitdepth] = keyword[None] ): literal[string] keyword[if] identifier[mode] == literal[string] : keyword[raise] identifier[Error] ( literal[string] + identifier[mode] ) keyword[elif] identifier[mode] == lit...
def parse_mode(mode, default_bitdepth=None): """Parse PIL-style mode and return tuple (grayscale, alpha, bitdeph)""" # few special cases if mode == 'P': # Don't know what is pallette raise Error('Unknown colour mode:' + mode) # depends on [control=['if'], data=['mode']] elif mode == '1'...
def _makeResult(self): """Return a Result that doesn't print dots. Nose's ResultProxy will wrap it, and other plugins can still print stuff---but without smashing into our progress bar, care of ProgressivePlugin's stderr/out wrapping. """ return ProgressiveResult(self._...
def function[_makeResult, parameter[self]]: constant[Return a Result that doesn't print dots. Nose's ResultProxy will wrap it, and other plugins can still print stuff---but without smashing into our progress bar, care of ProgressivePlugin's stderr/out wrapping. ] return[cal...
keyword[def] identifier[_makeResult] ( identifier[self] ): literal[string] keyword[return] identifier[ProgressiveResult] ( identifier[self] . identifier[_cwd] , identifier[self] . identifier[_totalTests] , identifier[self] . identifier[stream] , identifier[config] = iden...
def _makeResult(self): """Return a Result that doesn't print dots. Nose's ResultProxy will wrap it, and other plugins can still print stuff---but without smashing into our progress bar, care of ProgressivePlugin's stderr/out wrapping. """ return ProgressiveResult(self._cwd, sel...
def _defaultDepsVoc(self): """Vocabulary of all departments """ # Getting the assigned departments deps = self.getDepartments() items = [] for d in deps: items.append((api.get_uid(d), api.get_title(d))) return api.to_display_list(items, sort_by="value"...
def function[_defaultDepsVoc, parameter[self]]: constant[Vocabulary of all departments ] variable[deps] assign[=] call[name[self].getDepartments, parameter[]] variable[items] assign[=] list[[]] for taget[name[d]] in starred[name[deps]] begin[:] call[name[items].ap...
keyword[def] identifier[_defaultDepsVoc] ( identifier[self] ): literal[string] identifier[deps] = identifier[self] . identifier[getDepartments] () identifier[items] =[] keyword[for] identifier[d] keyword[in] identifier[deps] : identifier[items] . identifie...
def _defaultDepsVoc(self): """Vocabulary of all departments """ # Getting the assigned departments deps = self.getDepartments() items = [] for d in deps: items.append((api.get_uid(d), api.get_title(d))) # depends on [control=['for'], data=['d']] return api.to_display_list(items,...
def get_work_item_next_states_on_checkin_action(self, ids, action=None): """GetWorkItemNextStatesOnCheckinAction. [Preview API] Returns the next state on the given work item IDs. :param [int] ids: list of work item ids :param str action: possible actions. Currently only supports checkin ...
def function[get_work_item_next_states_on_checkin_action, parameter[self, ids, action]]: constant[GetWorkItemNextStatesOnCheckinAction. [Preview API] Returns the next state on the given work item IDs. :param [int] ids: list of work item ids :param str action: possible actions. Currently ...
keyword[def] identifier[get_work_item_next_states_on_checkin_action] ( identifier[self] , identifier[ids] , identifier[action] = keyword[None] ): literal[string] identifier[query_parameters] ={} keyword[if] identifier[ids] keyword[is] keyword[not] keyword[None] : identifie...
def get_work_item_next_states_on_checkin_action(self, ids, action=None): """GetWorkItemNextStatesOnCheckinAction. [Preview API] Returns the next state on the given work item IDs. :param [int] ids: list of work item ids :param str action: possible actions. Currently only supports checkin ...
def to_JSON(self): """Dumps object fields into a JSON formatted string :returns: the JSON string """ return json.dumps({"reception_time": self._reception_time, "Location": json.loads(self._location.to_JSON()), "Weather": json.loads...
def function[to_JSON, parameter[self]]: constant[Dumps object fields into a JSON formatted string :returns: the JSON string ] return[call[name[json].dumps, parameter[dictionary[[<ast.Constant object at 0x7da2044c3490>, <ast.Constant object at 0x7da2044c1ed0>, <ast.Constant object at 0x7da...
keyword[def] identifier[to_JSON] ( identifier[self] ): literal[string] keyword[return] identifier[json] . identifier[dumps] ({ literal[string] : identifier[self] . identifier[_reception_time] , literal[string] : identifier[json] . identifier[loads] ( identifier[self] . identifier[_locatio...
def to_JSON(self): """Dumps object fields into a JSON formatted string :returns: the JSON string """ return json.dumps({'reception_time': self._reception_time, 'Location': json.loads(self._location.to_JSON()), 'Weather': json.loads(self._weather.to_JSON())})
def _compute_magnitude_squared_term(self, P, M, Q, W, mag): """ Compute magnitude squared term, equation 5, p. 909. """ return P * (mag - M) + Q * (mag - M) ** 2 + W
def function[_compute_magnitude_squared_term, parameter[self, P, M, Q, W, mag]]: constant[ Compute magnitude squared term, equation 5, p. 909. ] return[binary_operation[binary_operation[binary_operation[name[P] * binary_operation[name[mag] - name[M]]] + binary_operation[name[Q] * binary_oper...
keyword[def] identifier[_compute_magnitude_squared_term] ( identifier[self] , identifier[P] , identifier[M] , identifier[Q] , identifier[W] , identifier[mag] ): literal[string] keyword[return] identifier[P] *( identifier[mag] - identifier[M] )+ identifier[Q] *( identifier[mag] - identifier[M] )** ...
def _compute_magnitude_squared_term(self, P, M, Q, W, mag): """ Compute magnitude squared term, equation 5, p. 909. """ return P * (mag - M) + Q * (mag - M) ** 2 + W
def mkres(self): """ Create a directory tree for the resized assets """ for d in DENSITY_TYPES: if d == 'ldpi' and not self.ldpi: continue # skip ldpi if d == 'xxxhdpi' and not self.xxxhdpi: continue # skip xxxhdpi tr...
def function[mkres, parameter[self]]: constant[ Create a directory tree for the resized assets ] for taget[name[d]] in starred[name[DENSITY_TYPES]] begin[:] if <ast.BoolOp object at 0x7da18dc05600> begin[:] continue if <ast.BoolOp object at 0x7...
keyword[def] identifier[mkres] ( identifier[self] ): literal[string] keyword[for] identifier[d] keyword[in] identifier[DENSITY_TYPES] : keyword[if] identifier[d] == literal[string] keyword[and] keyword[not] identifier[self] . identifier[ldpi] : keyword[continue]...
def mkres(self): """ Create a directory tree for the resized assets """ for d in DENSITY_TYPES: if d == 'ldpi' and (not self.ldpi): continue # skip ldpi # depends on [control=['if'], data=[]] if d == 'xxxhdpi' and (not self.xxxhdpi): continue # skip xxx...
def build_software_cache(sw_dir=None): """ Builds up the software cache directory at *sw_dir* by simply copying all required python modules. *sw_dir* is evaluated with :py:func:`get_sw_dir`. """ # ensure the cache is empty sw_dir = get_sw_dir(sw_dir) remove_software_cache(sw_dir) os.make...
def function[build_software_cache, parameter[sw_dir]]: constant[ Builds up the software cache directory at *sw_dir* by simply copying all required python modules. *sw_dir* is evaluated with :py:func:`get_sw_dir`. ] variable[sw_dir] assign[=] call[name[get_sw_dir], parameter[name[sw_dir]]] ...
keyword[def] identifier[build_software_cache] ( identifier[sw_dir] = keyword[None] ): literal[string] identifier[sw_dir] = identifier[get_sw_dir] ( identifier[sw_dir] ) identifier[remove_software_cache] ( identifier[sw_dir] ) identifier[os] . identifier[makedirs] ( identifier[sw_dir] ) ...
def build_software_cache(sw_dir=None): """ Builds up the software cache directory at *sw_dir* by simply copying all required python modules. *sw_dir* is evaluated with :py:func:`get_sw_dir`. """ # ensure the cache is empty sw_dir = get_sw_dir(sw_dir) remove_software_cache(sw_dir) os.make...
def create_vocabulary( vocabulary_path, data_path, max_vocabulary_size, tokenizer=None, normalize_digits=True, _DIGIT_RE=re.compile(br"\d"), _START_VOCAB=None ): r"""Create vocabulary file (if it does not exist yet) from data file. Data file is assumed to contain one sentence per line. Each sen...
def function[create_vocabulary, parameter[vocabulary_path, data_path, max_vocabulary_size, tokenizer, normalize_digits, _DIGIT_RE, _START_VOCAB]]: constant[Create vocabulary file (if it does not exist yet) from data file. Data file is assumed to contain one sentence per line. Each sentence is tokenized...
keyword[def] identifier[create_vocabulary] ( identifier[vocabulary_path] , identifier[data_path] , identifier[max_vocabulary_size] , identifier[tokenizer] = keyword[None] , identifier[normalize_digits] = keyword[True] , identifier[_DIGIT_RE] = identifier[re] . identifier[compile] ( literal[string] ), identifier[_ST...
def create_vocabulary(vocabulary_path, data_path, max_vocabulary_size, tokenizer=None, normalize_digits=True, _DIGIT_RE=re.compile(b'\\d'), _START_VOCAB=None): """Create vocabulary file (if it does not exist yet) from data file. Data file is assumed to contain one sentence per line. Each sentence is tokeni...
def _set_dscp_ttl_mode(self, v, load=False): """ Setter method for dscp_ttl_mode, mapped from YANG variable /interface/tunnel/dscp_ttl_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_ttl_mode is considered as a private method. Backends looking...
def function[_set_dscp_ttl_mode, parameter[self, v, load]]: constant[ Setter method for dscp_ttl_mode, mapped from YANG variable /interface/tunnel/dscp_ttl_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_ttl_mode is considered as a private ...
keyword[def] identifier[_set_dscp_ttl_mode] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ...
def _set_dscp_ttl_mode(self, v, load=False): """ Setter method for dscp_ttl_mode, mapped from YANG variable /interface/tunnel/dscp_ttl_mode (enumeration) If this variable is read-only (config: false) in the source YANG file, then _set_dscp_ttl_mode is considered as a private method. Backends looking...
def is_blocked(self, ip): """Determine if an IP address should be considered blocked.""" blocked = True if ip in self.allowed_admin_ips: blocked = False for allowed_range in self.allowed_admin_ip_ranges: if ipaddress.ip_address(ip) in ipaddress.ip_network(allowe...
def function[is_blocked, parameter[self, ip]]: constant[Determine if an IP address should be considered blocked.] variable[blocked] assign[=] constant[True] if compare[name[ip] in name[self].allowed_admin_ips] begin[:] variable[blocked] assign[=] constant[False] for taget...
keyword[def] identifier[is_blocked] ( identifier[self] , identifier[ip] ): literal[string] identifier[blocked] = keyword[True] keyword[if] identifier[ip] keyword[in] identifier[self] . identifier[allowed_admin_ips] : identifier[blocked] = keyword[False] keyword...
def is_blocked(self, ip): """Determine if an IP address should be considered blocked.""" blocked = True if ip in self.allowed_admin_ips: blocked = False # depends on [control=['if'], data=[]] for allowed_range in self.allowed_admin_ip_ranges: if ipaddress.ip_address(ip) in ipaddress.ip_...
def nodes(self): """Set of all currently connected servers. .. warning:: When connected to a replica set the value of :attr:`nodes` can change over time as :class:`MongoClient`'s view of the replica set changes. :attr:`nodes` can also be an empty set when :class:`MongoClie...
def function[nodes, parameter[self]]: constant[Set of all currently connected servers. .. warning:: When connected to a replica set the value of :attr:`nodes` can change over time as :class:`MongoClient`'s view of the replica set changes. :attr:`nodes` can also be an empty set when ...
keyword[def] identifier[nodes] ( identifier[self] ): literal[string] identifier[description] = identifier[self] . identifier[_topology] . identifier[description] keyword[return] identifier[frozenset] ( identifier[s] . identifier[address] keyword[for] identifier[s] keyword[in] identif...
def nodes(self): """Set of all currently connected servers. .. warning:: When connected to a replica set the value of :attr:`nodes` can change over time as :class:`MongoClient`'s view of the replica set changes. :attr:`nodes` can also be an empty set when :class:`MongoClient` ...
def geost_1d(*args,**kwargs) : #(lon,lat,nu): OR (dst,nu) """ ;+ ; ; GEOST_1D : Compute geostrophic speeds from a sea level dataset <br /> ; ; Reference : Powell, B. S., et R. R. Leben (2004), An Optimal Filter for <br /> ; Geostrophic Mesoscale Currents from Along-Track Satelli...
def function[geost_1d, parameter[]]: constant[ ;+ ; ; GEOST_1D : Compute geostrophic speeds from a sea level dataset <br /> ; ; Reference : Powell, B. S., et R. R. Leben (2004), An Optimal Filter for <br /> ; Geostrophic Mesoscale Currents from Along-Track Satellite Altimetry, <br ...
keyword[def] identifier[geost_1d] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[lon] = identifier[args] [ literal[int] ] identifier[lat] = identifier[args] [ literal[int] ] identifier[dst] = identifier[args] [ literal[int] ] keyword[if] identifier[len] ( identi...
def geost_1d(*args, **kwargs): #(lon,lat,nu): OR (dst,nu) '\n ;+\n ;\n ; GEOST_1D : Compute geostrophic speeds from a sea level dataset <br />\n ;\n ; Reference : Powell, B. S., et R. R. Leben (2004), An Optimal Filter for <br />\n ; Geostrophic Mesoscale Currents from Along-Track Satellite...
def sizefromlen(limit, *properties): ''' Factory to generate a function which get size from specified field with limits. Often used in nstruct "size" parameter. To retrieve size without limit, simply use lambda expression: lambda x: x.header.length :param limit: the maximum size limit, if ...
def function[sizefromlen, parameter[limit]]: constant[ Factory to generate a function which get size from specified field with limits. Often used in nstruct "size" parameter. To retrieve size without limit, simply use lambda expression: lambda x: x.header.length :param limit: the maxim...
keyword[def] identifier[sizefromlen] ( identifier[limit] ,* identifier[properties] ): literal[string] keyword[def] identifier[func] ( identifier[namedstruct] ): identifier[v] = identifier[namedstruct] . identifier[_target] keyword[for] identifier[p] keyword[in] identifier[properties]...
def sizefromlen(limit, *properties): """ Factory to generate a function which get size from specified field with limits. Often used in nstruct "size" parameter. To retrieve size without limit, simply use lambda expression: lambda x: x.header.length :param limit: the maximum size limit, if ...
def _run_task_internal(self, task): ''' run a particular module step in a playbook ''' hosts = self._list_available_hosts() self.inventory.restrict_to(hosts) runner = cirruscluster.ext.ansible.runner.Runner( pattern=task.play.hosts, inventory=self.inventory, module_name=tas...
def function[_run_task_internal, parameter[self, task]]: constant[ run a particular module step in a playbook ] variable[hosts] assign[=] call[name[self]._list_available_hosts, parameter[]] call[name[self].inventory.restrict_to, parameter[name[hosts]]] variable[runner] assign[=] call[nam...
keyword[def] identifier[_run_task_internal] ( identifier[self] , identifier[task] ): literal[string] identifier[hosts] = identifier[self] . identifier[_list_available_hosts] () identifier[self] . identifier[inventory] . identifier[restrict_to] ( identifier[hosts] ) identifier[ru...
def _run_task_internal(self, task): """ run a particular module step in a playbook """ hosts = self._list_available_hosts() self.inventory.restrict_to(hosts) runner = cirruscluster.ext.ansible.runner.Runner(pattern=task.play.hosts, inventory=self.inventory, module_name=task.module_name, module_args=task...
def _mod_defpriv_opts(object_type, defprivileges): ''' Format options ''' object_type = object_type.lower() defprivileges = '' if defprivileges is None else defprivileges _defprivs = re.split(r'\s?,\s?', defprivileges.upper()) return object_type, defprivileges, _defprivs
def function[_mod_defpriv_opts, parameter[object_type, defprivileges]]: constant[ Format options ] variable[object_type] assign[=] call[name[object_type].lower, parameter[]] variable[defprivileges] assign[=] <ast.IfExp object at 0x7da20c7c8bb0> variable[_defprivs] assign[=] call[...
keyword[def] identifier[_mod_defpriv_opts] ( identifier[object_type] , identifier[defprivileges] ): literal[string] identifier[object_type] = identifier[object_type] . identifier[lower] () identifier[defprivileges] = literal[string] keyword[if] identifier[defprivileges] keyword[is] keyword[None] ...
def _mod_defpriv_opts(object_type, defprivileges): """ Format options """ object_type = object_type.lower() defprivileges = '' if defprivileges is None else defprivileges _defprivs = re.split('\\s?,\\s?', defprivileges.upper()) return (object_type, defprivileges, _defprivs)
def read_datasource(jboss_config, name, profile=None): ''' Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: ...
def function[read_datasource, parameter[jboss_config, name, profile]]: constant[ Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode ...
keyword[def] identifier[read_datasource] ( identifier[jboss_config] , identifier[name] , identifier[profile] = keyword[None] ): literal[string] identifier[log] . identifier[debug] ( literal[string] , identifier[name] ) keyword[return] identifier[__read_datasource] ( identifier[jboss_config] , identif...
def read_datasource(jboss_config, name, profile=None): """ Read datasource properties in the running jboss instance. jboss_config Configuration dictionary with properties specified above. name Datasource name profile Profile name (JBoss domain mode only) CLI Example: ...
def fmt_iso(timestamp): """ Format a UNIX timestamp to an ISO datetime string. """ try: return fmt.iso_datetime(timestamp) except (ValueError, TypeError): return "N/A".rjust(len(fmt.iso_datetime(0)))
def function[fmt_iso, parameter[timestamp]]: constant[ Format a UNIX timestamp to an ISO datetime string. ] <ast.Try object at 0x7da2044c04c0>
keyword[def] identifier[fmt_iso] ( identifier[timestamp] ): literal[string] keyword[try] : keyword[return] identifier[fmt] . identifier[iso_datetime] ( identifier[timestamp] ) keyword[except] ( identifier[ValueError] , identifier[TypeError] ): keyword[return] literal[string] . iden...
def fmt_iso(timestamp): """ Format a UNIX timestamp to an ISO datetime string. """ try: return fmt.iso_datetime(timestamp) # depends on [control=['try'], data=[]] except (ValueError, TypeError): return 'N/A'.rjust(len(fmt.iso_datetime(0))) # depends on [control=['except'], data=[]]
def ionic_strength(mis, zis): r'''Calculate the ionic strength of a solution in one of two ways, depending on the inputs only. For Pitzer and Bromley models, `mis` should be molalities of each component. For eNRTL models, `mis` should be mole fractions of each electrolyte in the solution. This will ...
def function[ionic_strength, parameter[mis, zis]]: constant[Calculate the ionic strength of a solution in one of two ways, depending on the inputs only. For Pitzer and Bromley models, `mis` should be molalities of each component. For eNRTL models, `mis` should be mole fractions of each electrolyte i...
keyword[def] identifier[ionic_strength] ( identifier[mis] , identifier[zis] ): literal[string] keyword[return] literal[int] * identifier[sum] ([ identifier[mi] * identifier[zi] * identifier[zi] keyword[for] identifier[mi] , identifier[zi] keyword[in] identifier[zip] ( identifier[mis] , identifier[zis]...
def ionic_strength(mis, zis): """Calculate the ionic strength of a solution in one of two ways, depending on the inputs only. For Pitzer and Bromley models, `mis` should be molalities of each component. For eNRTL models, `mis` should be mole fractions of each electrolyte in the solution. This will s...
def sort_labeled_intervals(intervals, labels=None): '''Sort intervals, and optionally, their corresponding labels according to start time. Parameters ---------- intervals : np.ndarray, shape=(n, 2) The input intervals labels : list, optional Labels for each interval Return...
def function[sort_labeled_intervals, parameter[intervals, labels]]: constant[Sort intervals, and optionally, their corresponding labels according to start time. Parameters ---------- intervals : np.ndarray, shape=(n, 2) The input intervals labels : list, optional Labels for...
keyword[def] identifier[sort_labeled_intervals] ( identifier[intervals] , identifier[labels] = keyword[None] ): literal[string] identifier[idx] = identifier[np] . identifier[argsort] ( identifier[intervals] [:, literal[int] ]) identifier[intervals_sorted] = identifier[intervals] [ identifier[idx] ] ...
def sort_labeled_intervals(intervals, labels=None): """Sort intervals, and optionally, their corresponding labels according to start time. Parameters ---------- intervals : np.ndarray, shape=(n, 2) The input intervals labels : list, optional Labels for each interval Return...
def read(self, symbol, as_of=None, raw=False, **kwargs): # TODO: shall we block from_version from getting into super.read? """Read data for the named symbol. Returns a BitemporalItem object with a data and metdata element (as passed into write). Parameters ---------- sym...
def function[read, parameter[self, symbol, as_of, raw]]: constant[Read data for the named symbol. Returns a BitemporalItem object with a data and metdata element (as passed into write). Parameters ---------- symbol : `str` symbol name for the item as_of : `da...
keyword[def] identifier[read] ( identifier[self] , identifier[symbol] , identifier[as_of] = keyword[None] , identifier[raw] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[item] = identifier[self] . identifier[_store] . identifier[read] ( identifier[symbol] ,** identifier[kwa...
def read(self, symbol, as_of=None, raw=False, **kwargs): # TODO: shall we block from_version from getting into super.read? 'Read data for the named symbol. Returns a BitemporalItem object with\n a data and metdata element (as passed into write).\n\n Parameters\n ----------\n symbol :...
def remove_dirs(self, directory): """Delete a directory recursively. :param directory: $PATH to directory. :type directory: ``str`` """ LOG.info('Removing directory [ %s ]', directory) local_files = self._drectory_local_files(directory=directory) for file_name i...
def function[remove_dirs, parameter[self, directory]]: constant[Delete a directory recursively. :param directory: $PATH to directory. :type directory: ``str`` ] call[name[LOG].info, parameter[constant[Removing directory [ %s ]], name[directory]]] variable[local_files] as...
keyword[def] identifier[remove_dirs] ( identifier[self] , identifier[directory] ): literal[string] identifier[LOG] . identifier[info] ( literal[string] , identifier[directory] ) identifier[local_files] = identifier[self] . identifier[_drectory_local_files] ( identifier[directory] = identi...
def remove_dirs(self, directory): """Delete a directory recursively. :param directory: $PATH to directory. :type directory: ``str`` """ LOG.info('Removing directory [ %s ]', directory) local_files = self._drectory_local_files(directory=directory) for file_name in local_files: ...
def get_rules(): """Returns all enabled rules. :rtype: [Rule] """ paths = [rule_path for path in get_rules_import_paths() for rule_path in sorted(path.glob('*.py'))] return sorted(get_loaded_rules(paths), key=lambda rule: rule.priority)
def function[get_rules, parameter[]]: constant[Returns all enabled rules. :rtype: [Rule] ] variable[paths] assign[=] <ast.ListComp object at 0x7da20cabe590> return[call[name[sorted], parameter[call[name[get_loaded_rules], parameter[name[paths]]]]]]
keyword[def] identifier[get_rules] (): literal[string] identifier[paths] =[ identifier[rule_path] keyword[for] identifier[path] keyword[in] identifier[get_rules_import_paths] () keyword[for] identifier[rule_path] keyword[in] identifier[sorted] ( identifier[path] . identifier[glob] ( literal[str...
def get_rules(): """Returns all enabled rules. :rtype: [Rule] """ paths = [rule_path for path in get_rules_import_paths() for rule_path in sorted(path.glob('*.py'))] return sorted(get_loaded_rules(paths), key=lambda rule: rule.priority)
def read_flags_from_files(self, argv, force_gnu=True): """Processes command line args, but also allow args to be read from file. Args: argv: [str], a list of strings, usually sys.argv[1:], which may contain one or more flagfile directives of the form --flagfile="./filename". Note that...
def function[read_flags_from_files, parameter[self, argv, force_gnu]]: constant[Processes command line args, but also allow args to be read from file. Args: argv: [str], a list of strings, usually sys.argv[1:], which may contain one or more flagfile directives of the form --flagfile="./file...
keyword[def] identifier[read_flags_from_files] ( identifier[self] , identifier[argv] , identifier[force_gnu] = keyword[True] ): literal[string] identifier[rest_of_args] = identifier[argv] identifier[new_argv] =[] keyword[while] identifier[rest_of_args] : identifier[current_arg] = identif...
def read_flags_from_files(self, argv, force_gnu=True): """Processes command line args, but also allow args to be read from file. Args: argv: [str], a list of strings, usually sys.argv[1:], which may contain one or more flagfile directives of the form --flagfile="./filename". Note that...
def intersectingIntervalIterator(self, start, end): """ Get an iterator which will iterate over those objects in the tree which intersect the given interval - sorted in order of start index :param start: find intervals in the tree that intersect an interval with with this start index ...
def function[intersectingIntervalIterator, parameter[self, start, end]]: constant[ Get an iterator which will iterate over those objects in the tree which intersect the given interval - sorted in order of start index :param start: find intervals in the tree that intersect an interval with ...
keyword[def] identifier[intersectingIntervalIterator] ( identifier[self] , identifier[start] , identifier[end] ): literal[string] identifier[items] = identifier[self] . identifier[intersectingInterval] ( identifier[start] , identifier[end] ) identifier[items] . identifier[sort] ( identifier[key] = key...
def intersectingIntervalIterator(self, start, end): """ Get an iterator which will iterate over those objects in the tree which intersect the given interval - sorted in order of start index :param start: find intervals in the tree that intersect an interval with with this start index ...
def get_pay_giftcard(self, rule_id): """ 查询支付后投放卡券的规则 详情请参见 https://mp.weixin.qq.com/wiki?id=mp1466494654_K9rNz :param rule_id: 支付即会员的规则 ID :return: 支付后投放卡券的规则 :rtype: dict """ return self._post( 'card/paygiftcard/getbyid', ...
def function[get_pay_giftcard, parameter[self, rule_id]]: constant[ 查询支付后投放卡券的规则 详情请参见 https://mp.weixin.qq.com/wiki?id=mp1466494654_K9rNz :param rule_id: 支付即会员的规则 ID :return: 支付后投放卡券的规则 :rtype: dict ] return[call[name[self]._post, parameter[constant[...
keyword[def] identifier[get_pay_giftcard] ( identifier[self] , identifier[rule_id] ): literal[string] keyword[return] identifier[self] . identifier[_post] ( literal[string] , identifier[data] ={ literal[string] : identifier[rule_id] , }, identifier[resul...
def get_pay_giftcard(self, rule_id): """ 查询支付后投放卡券的规则 详情请参见 https://mp.weixin.qq.com/wiki?id=mp1466494654_K9rNz :param rule_id: 支付即会员的规则 ID :return: 支付后投放卡券的规则 :rtype: dict """ return self._post('card/paygiftcard/getbyid', data={'rule_id': rule_id}, resul...
def buffer_to_audio(buffer: bytes) -> np.ndarray: """Convert a raw mono audio byte string to numpy array of floats""" return np.fromstring(buffer, dtype='<i2').astype(np.float32, order='C') / 32768.0
def function[buffer_to_audio, parameter[buffer]]: constant[Convert a raw mono audio byte string to numpy array of floats] return[binary_operation[call[call[name[np].fromstring, parameter[name[buffer]]].astype, parameter[name[np].float32]] / constant[32768.0]]]
keyword[def] identifier[buffer_to_audio] ( identifier[buffer] : identifier[bytes] )-> identifier[np] . identifier[ndarray] : literal[string] keyword[return] identifier[np] . identifier[fromstring] ( identifier[buffer] , identifier[dtype] = literal[string] ). identifier[astype] ( identifier[np] . identifie...
def buffer_to_audio(buffer: bytes) -> np.ndarray: """Convert a raw mono audio byte string to numpy array of floats""" return np.fromstring(buffer, dtype='<i2').astype(np.float32, order='C') / 32768.0
def predict_cats_from_sigs(self, df_data_ini, df_sig_ini, dist_type='cosine', predict_level='Predict Category', truth_level=1, unknown_thresh=-1): ''' Predict category using signature ''' keep_rows = df_sig_ini.index.tolist() data_rows = df_data_ini.index.tolist() ...
def function[predict_cats_from_sigs, parameter[self, df_data_ini, df_sig_ini, dist_type, predict_level, truth_level, unknown_thresh]]: constant[ Predict category using signature ] variable[keep_rows] assign[=] call[name[df_sig_ini].index.tolist, parameter[]] variable[data_rows] assign[=] call[na...
keyword[def] identifier[predict_cats_from_sigs] ( identifier[self] , identifier[df_data_ini] , identifier[df_sig_ini] , identifier[dist_type] = literal[string] , identifier[predict_level] = literal[string] , identifier[truth_level] = literal[int] , identifier[unknown_thresh] =- literal[int] ): literal[string]...
def predict_cats_from_sigs(self, df_data_ini, df_sig_ini, dist_type='cosine', predict_level='Predict Category', truth_level=1, unknown_thresh=-1): """ Predict category using signature """ keep_rows = df_sig_ini.index.tolist() data_rows = df_data_ini.index.tolist() common_rows = list(set(data_rows).inter...
def rels(self): """Returns a LIST of all the metadata relations""" r = [] for i in self.metadata: r = r + i[REL] return []
def function[rels, parameter[self]]: constant[Returns a LIST of all the metadata relations] variable[r] assign[=] list[[]] for taget[name[i]] in starred[name[self].metadata] begin[:] variable[r] assign[=] binary_operation[name[r] + call[name[i]][name[REL]]] return[list[[]]]
keyword[def] identifier[rels] ( identifier[self] ): literal[string] identifier[r] =[] keyword[for] identifier[i] keyword[in] identifier[self] . identifier[metadata] : identifier[r] = identifier[r] + identifier[i] [ identifier[REL] ] keyword[return] []
def rels(self): """Returns a LIST of all the metadata relations""" r = [] for i in self.metadata: r = r + i[REL] # depends on [control=['for'], data=['i']] return []
def view_fullreport(token, dstore): """ Display an .rst report about the computation """ # avoid circular imports from openquake.calculators.reportwriter import ReportWriter return ReportWriter(dstore).make_report()
def function[view_fullreport, parameter[token, dstore]]: constant[ Display an .rst report about the computation ] from relative_module[openquake.calculators.reportwriter] import module[ReportWriter] return[call[call[name[ReportWriter], parameter[name[dstore]]].make_report, parameter[]]]
keyword[def] identifier[view_fullreport] ( identifier[token] , identifier[dstore] ): literal[string] keyword[from] identifier[openquake] . identifier[calculators] . identifier[reportwriter] keyword[import] identifier[ReportWriter] keyword[return] identifier[ReportWriter] ( identifier[dstore]...
def view_fullreport(token, dstore): """ Display an .rst report about the computation """ # avoid circular imports from openquake.calculators.reportwriter import ReportWriter return ReportWriter(dstore).make_report()
def delete(self, key_id=None): """ Delete one of the ssh keys associated with your account. Please use with caution as there is NO confimation and NO undo. """ url = self.bitbucket.url('DELETE_SSH_KEY', key_id=key_id) return self.bitbucket.dispatch('DELETE', url, auth=self.bi...
def function[delete, parameter[self, key_id]]: constant[ Delete one of the ssh keys associated with your account. Please use with caution as there is NO confimation and NO undo. ] variable[url] assign[=] call[name[self].bitbucket.url, parameter[constant[DELETE_SSH_KEY]]] return[c...
keyword[def] identifier[delete] ( identifier[self] , identifier[key_id] = keyword[None] ): literal[string] identifier[url] = identifier[self] . identifier[bitbucket] . identifier[url] ( literal[string] , identifier[key_id] = identifier[key_id] ) keyword[return] identifier[self] . identifi...
def delete(self, key_id=None): """ Delete one of the ssh keys associated with your account. Please use with caution as there is NO confimation and NO undo. """ url = self.bitbucket.url('DELETE_SSH_KEY', key_id=key_id) return self.bitbucket.dispatch('DELETE', url, auth=self.bitbucket.auth...
def parse_color(color): """Take any css color definition and give back a tuple containing the r, g, b, a values along with a type which can be: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb, rgba """ r = g = b = a = type = None if color.startswith('#'): color = color[1:] if len(color) == ...
def function[parse_color, parameter[color]]: constant[Take any css color definition and give back a tuple containing the r, g, b, a values along with a type which can be: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb, rgba ] variable[r] assign[=] constant[None] if call[name[color].startswith,...
keyword[def] identifier[parse_color] ( identifier[color] ): literal[string] identifier[r] = identifier[g] = identifier[b] = identifier[a] = identifier[type] = keyword[None] keyword[if] identifier[color] . identifier[startswith] ( literal[string] ): identifier[color] = identifier[color] [ li...
def parse_color(color): """Take any css color definition and give back a tuple containing the r, g, b, a values along with a type which can be: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb, rgba """ r = g = b = a = type = None if color.startswith('#'): color = color[1:] if len(color) == ...
def Dumper(obj, indent=0, increase=4, encoding='utf-8'): """appropriately view a given dict/list/tuple/object data structure""" ############################################################################## def p(given): """ensure proper decoding from unicode, if necessary""" if isinstance(g...
def function[Dumper, parameter[obj, indent, increase, encoding]]: constant[appropriately view a given dict/list/tuple/object data structure] def function[p, parameter[given]]: constant[ensure proper decoding from unicode, if necessary] if call[name[isinstance], parameter[...
keyword[def] identifier[Dumper] ( identifier[obj] , identifier[indent] = literal[int] , identifier[increase] = literal[int] , identifier[encoding] = literal[string] ): literal[string] keyword[def] identifier[p] ( identifier[given] ): literal[string] keyword[if] identifier[isinstan...
def Dumper(obj, indent=0, increase=4, encoding='utf-8'): """appropriately view a given dict/list/tuple/object data structure""" ############################################################################## def p(given): """ensure proper decoding from unicode, if necessary""" if isinstance(...
def contains_ignoring_case(self, *items): """Asserts that val is string and contains the given item or items.""" if len(items) == 0: raise ValueError('one or more args must be given') if isinstance(self.val, str_types): if len(items) == 1: if not isinstanc...
def function[contains_ignoring_case, parameter[self]]: constant[Asserts that val is string and contains the given item or items.] if compare[call[name[len], parameter[name[items]]] equal[==] constant[0]] begin[:] <ast.Raise object at 0x7da18f09f190> if call[name[isinstance], parameter[na...
keyword[def] identifier[contains_ignoring_case] ( identifier[self] ,* identifier[items] ): literal[string] keyword[if] identifier[len] ( identifier[items] )== literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[isinstance] ( ident...
def contains_ignoring_case(self, *items): """Asserts that val is string and contains the given item or items.""" if len(items) == 0: raise ValueError('one or more args must be given') # depends on [control=['if'], data=[]] if isinstance(self.val, str_types): if len(items) == 1: ...
def get_notebook_image_info(project: 'Project', job: Any) -> Tuple[str, str]: """Return the image name and image tag for a job""" image_name, _ = get_job_image_info(project, job) return image_name, LATEST_IMAGE_TAG
def function[get_notebook_image_info, parameter[project, job]]: constant[Return the image name and image tag for a job] <ast.Tuple object at 0x7da20c6c7520> assign[=] call[name[get_job_image_info], parameter[name[project], name[job]]] return[tuple[[<ast.Name object at 0x7da20c6c6680>, <ast.Name obje...
keyword[def] identifier[get_notebook_image_info] ( identifier[project] : literal[string] , identifier[job] : identifier[Any] )-> identifier[Tuple] [ identifier[str] , identifier[str] ]: literal[string] identifier[image_name] , identifier[_] = identifier[get_job_image_info] ( identifier[project] , identifie...
def get_notebook_image_info(project: 'Project', job: Any) -> Tuple[str, str]: """Return the image name and image tag for a job""" (image_name, _) = get_job_image_info(project, job) return (image_name, LATEST_IMAGE_TAG)
def check_digest_auth(user, passwd): """Check user authentication using HTTP Digest auth""" if request.headers.get('Authorization'): credentials = parse_authorization_header(request.headers.get('Authorization')) if not credentials: return request_uri = request.script_root + ...
def function[check_digest_auth, parameter[user, passwd]]: constant[Check user authentication using HTTP Digest auth] if call[name[request].headers.get, parameter[constant[Authorization]]] begin[:] variable[credentials] assign[=] call[name[parse_authorization_header], parameter[call[name[...
keyword[def] identifier[check_digest_auth] ( identifier[user] , identifier[passwd] ): literal[string] keyword[if] identifier[request] . identifier[headers] . identifier[get] ( literal[string] ): identifier[credentials] = identifier[parse_authorization_header] ( identifier[request] . identifier[h...
def check_digest_auth(user, passwd): """Check user authentication using HTTP Digest auth""" if request.headers.get('Authorization'): credentials = parse_authorization_header(request.headers.get('Authorization')) if not credentials: return # depends on [control=['if'], data=[]] ...
def activities(self): """获取用户的最近动态. :return: 最近动态,返回生成器,具体说明见 :class:`.Activity` :rtype: Activity.Iterable """ from .activity import Activity if self.url is None: return gotten_feed_num = 20 start = '0' api_url = self.url + 'activiti...
def function[activities, parameter[self]]: constant[获取用户的最近动态. :return: 最近动态,返回生成器,具体说明见 :class:`.Activity` :rtype: Activity.Iterable ] from relative_module[activity] import module[Activity] if compare[name[self].url is constant[None]] begin[:] return[None] v...
keyword[def] identifier[activities] ( identifier[self] ): literal[string] keyword[from] . identifier[activity] keyword[import] identifier[Activity] keyword[if] identifier[self] . identifier[url] keyword[is] keyword[None] : keyword[return] identifier[gotten_fe...
def activities(self): """获取用户的最近动态. :return: 最近动态,返回生成器,具体说明见 :class:`.Activity` :rtype: Activity.Iterable """ from .activity import Activity if self.url is None: return # depends on [control=['if'], data=[]] gotten_feed_num = 20 start = '0' api_url = self.url +...
def _mount_devicemapper(self, identifier): """ Devicemapper mount backend. """ info = self.client.info() # cid is the contaienr_id of the temp container cid = self._identifier_as_cid(identifier) cinfo = self.client.inspect_container(cid) dm_dev_name, d...
def function[_mount_devicemapper, parameter[self, identifier]]: constant[ Devicemapper mount backend. ] variable[info] assign[=] call[name[self].client.info, parameter[]] variable[cid] assign[=] call[name[self]._identifier_as_cid, parameter[name[identifier]]] variable[cin...
keyword[def] identifier[_mount_devicemapper] ( identifier[self] , identifier[identifier] ): literal[string] identifier[info] = identifier[self] . identifier[client] . identifier[info] () identifier[cid] = identifier[self] . identifier[_identifier_as_cid] ( identifier[identifier]...
def _mount_devicemapper(self, identifier): """ Devicemapper mount backend. """ info = self.client.info() # cid is the contaienr_id of the temp container cid = self._identifier_as_cid(identifier) cinfo = self.client.inspect_container(cid) (dm_dev_name, dm_dev_id, dm_dev_size) = ('...
def _read_dat(x): """read 24bit binary data and convert them to numpy. Parameters ---------- x : bytes bytes (length should be divisible by 3) Returns ------- numpy vector vector with the signed 24bit values Notes ----- It's pretty slow but it's pretty a PITA t...
def function[_read_dat, parameter[x]]: constant[read 24bit binary data and convert them to numpy. Parameters ---------- x : bytes bytes (length should be divisible by 3) Returns ------- numpy vector vector with the signed 24bit values Notes ----- It's prett...
keyword[def] identifier[_read_dat] ( identifier[x] ): literal[string] identifier[n_smp] = identifier[int] ( identifier[len] ( identifier[x] )/ identifier[DATA_PRECISION] ) identifier[dat] = identifier[zeros] ( identifier[n_smp] ) keyword[for] identifier[i] keyword[in] identifier[range] ( iden...
def _read_dat(x): """read 24bit binary data and convert them to numpy. Parameters ---------- x : bytes bytes (length should be divisible by 3) Returns ------- numpy vector vector with the signed 24bit values Notes ----- It's pretty slow but it's pretty a PITA t...
def _escape_char(c): "Single char escape. Return the char, escaped if not already legal" if isinstance(c, int): c = _unichr(c) return c if c in LEGAL_CHARS else ESCAPE_FMT % ord(c)
def function[_escape_char, parameter[c]]: constant[Single char escape. Return the char, escaped if not already legal] if call[name[isinstance], parameter[name[c], name[int]]] begin[:] variable[c] assign[=] call[name[_unichr], parameter[name[c]]] return[<ast.IfExp object at 0x7da1b10e...
keyword[def] identifier[_escape_char] ( identifier[c] ): literal[string] keyword[if] identifier[isinstance] ( identifier[c] , identifier[int] ): identifier[c] = identifier[_unichr] ( identifier[c] ) keyword[return] identifier[c] keyword[if] identifier[c] keyword[in] identifier[LEGAL_CHA...
def _escape_char(c): """Single char escape. Return the char, escaped if not already legal""" if isinstance(c, int): c = _unichr(c) # depends on [control=['if'], data=[]] return c if c in LEGAL_CHARS else ESCAPE_FMT % ord(c)
def sheetpack(fn, sheet=0, header=True, startcell=None, stopcell=None, usecols=None): """Return a ChannelPack instance loaded with data from the spread sheet file fn, (xls, xlsx). fn: str The file to read from. sheet: int or str If int, it is the index for the sheet 0-bas...
def function[sheetpack, parameter[fn, sheet, header, startcell, stopcell, usecols]]: constant[Return a ChannelPack instance loaded with data from the spread sheet file fn, (xls, xlsx). fn: str The file to read from. sheet: int or str If int, it is the index for the sheet 0-based. E...
keyword[def] identifier[sheetpack] ( identifier[fn] , identifier[sheet] = literal[int] , identifier[header] = keyword[True] , identifier[startcell] = keyword[None] , identifier[stopcell] = keyword[None] , identifier[usecols] = keyword[None] ): literal[string] identifier[cp] = identifier[ChannelPack] ( id...
def sheetpack(fn, sheet=0, header=True, startcell=None, stopcell=None, usecols=None): """Return a ChannelPack instance loaded with data from the spread sheet file fn, (xls, xlsx). fn: str The file to read from. sheet: int or str If int, it is the index for the sheet 0-based. Else the s...
def errata_applicability(self, synchronous=True, **kwargs): """Force regenerate errata applicability :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete if ``True``. Immediately return the server's respon...
def function[errata_applicability, parameter[self, synchronous]]: constant[Force regenerate errata applicability :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete if ``True``. Immediately return the ser...
keyword[def] identifier[errata_applicability] ( identifier[self] , identifier[synchronous] = keyword[True] ,** identifier[kwargs] ): literal[string] identifier[kwargs] = identifier[kwargs] . identifier[copy] () identifier[kwargs] . identifier[update] ( identifier[self] . identifier[_server...
def errata_applicability(self, synchronous=True, **kwargs): """Force regenerate errata applicability :param synchronous: What should happen if the server returns an HTTP 202 (accepted) status code? Wait for the task to complete if ``True``. Immediately return the server's response o...
def compute_etag(self) -> Optional[str]: """Computes the etag header to be used for this request. By default uses a hash of the content written so far. May be overridden to provide custom etag implementations, or may return None to disable tornado's default etag support. """ ...
def function[compute_etag, parameter[self]]: constant[Computes the etag header to be used for this request. By default uses a hash of the content written so far. May be overridden to provide custom etag implementations, or may return None to disable tornado's default etag support. ...
keyword[def] identifier[compute_etag] ( identifier[self] )-> identifier[Optional] [ identifier[str] ]: literal[string] identifier[hasher] = identifier[hashlib] . identifier[sha1] () keyword[for] identifier[part] keyword[in] identifier[self] . identifier[_write_buffer] : ide...
def compute_etag(self) -> Optional[str]: """Computes the etag header to be used for this request. By default uses a hash of the content written so far. May be overridden to provide custom etag implementations, or may return None to disable tornado's default etag support. """ ha...
def quit(self, daemononly = False): ''' Send quit event to quit the main loop ''' if not self.quitting: self.quitting = True self.queue.append(SystemControlEvent(SystemControlEvent.QUIT, daemononly = daemononly), True)
def function[quit, parameter[self, daemononly]]: constant[ Send quit event to quit the main loop ] if <ast.UnaryOp object at 0x7da207f008b0> begin[:] name[self].quitting assign[=] constant[True] call[name[self].queue.append, parameter[call[name[SystemContr...
keyword[def] identifier[quit] ( identifier[self] , identifier[daemononly] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[quitting] : identifier[self] . identifier[quitting] = keyword[True] identifier[self] . identifier[queue] ...
def quit(self, daemononly=False): """ Send quit event to quit the main loop """ if not self.quitting: self.quitting = True self.queue.append(SystemControlEvent(SystemControlEvent.QUIT, daemononly=daemononly), True) # depends on [control=['if'], data=[]]
def answer_options(self): """ :returns: A list of :class:`~.AnswerOption` instances representing the available answers to this question. """ return [ AnswerOption(element) for element in self._answer_option_xpb.apply_( self._quest...
def function[answer_options, parameter[self]]: constant[ :returns: A list of :class:`~.AnswerOption` instances representing the available answers to this question. ] return[<ast.ListComp object at 0x7da1b261f3a0>]
keyword[def] identifier[answer_options] ( identifier[self] ): literal[string] keyword[return] [ identifier[AnswerOption] ( identifier[element] ) keyword[for] identifier[element] keyword[in] identifier[self] . identifier[_answer_option_xpb] . identifier[apply_] ( identi...
def answer_options(self): """ :returns: A list of :class:`~.AnswerOption` instances representing the available answers to this question. """ return [AnswerOption(element) for element in self._answer_option_xpb.apply_(self._question_element)]
def _calculate(self): self.logpriors = np.zeros_like(self.rad) for i in range(self.N-1): o = np.arange(i+1, self.N) dist = ((self.zscale*(self.pos[i] - self.pos[o]))**2).sum(axis=-1) dist0 = (self.rad[i] + self.rad[o])**2 update = self.prior_func(dist -...
def function[_calculate, parameter[self]]: name[self].logpriors assign[=] call[name[np].zeros_like, parameter[name[self].rad]] for taget[name[i]] in starred[call[name[range], parameter[binary_operation[name[self].N - constant[1]]]]] begin[:] variable[o] assign[=] call[name[np].arange, pa...
keyword[def] identifier[_calculate] ( identifier[self] ): identifier[self] . identifier[logpriors] = identifier[np] . identifier[zeros_like] ( identifier[self] . identifier[rad] ) keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[self] . identifier[N] - literal[int] ): ...
def _calculate(self): self.logpriors = np.zeros_like(self.rad) for i in range(self.N - 1): o = np.arange(i + 1, self.N) dist = ((self.zscale * (self.pos[i] - self.pos[o])) ** 2).sum(axis=-1) dist0 = (self.rad[i] + self.rad[o]) ** 2 update = self.prior_func(dist - dist0) s...
def ffti(wave, npoints=None, indep_min=None, indep_max=None): r""" Return the imaginary part of the Fast Fourier Transform of a waveform. :param wave: Waveform :type wave: :py:class:`peng.eng.Waveform` :param npoints: Number of points to use in the transform. If **npoints** is...
def function[ffti, parameter[wave, npoints, indep_min, indep_max]]: constant[ Return the imaginary part of the Fast Fourier Transform of a waveform. :param wave: Waveform :type wave: :py:class:`peng.eng.Waveform` :param npoints: Number of points to use in the transform. If **npoints** ...
keyword[def] identifier[ffti] ( identifier[wave] , identifier[npoints] = keyword[None] , identifier[indep_min] = keyword[None] , identifier[indep_max] = keyword[None] ): literal[string] keyword[return] identifier[imag] ( identifier[fft] ( identifier[wave] , identifier[npoints] , identifier[indep_min] , id...
def ffti(wave, npoints=None, indep_min=None, indep_max=None): """ Return the imaginary part of the Fast Fourier Transform of a waveform. :param wave: Waveform :type wave: :py:class:`peng.eng.Waveform` :param npoints: Number of points to use in the transform. If **npoints** is ...
def predict(self, X): """ Predictions with the model for all the MCMC samples. Returns posterior means and standard deviations at X. Note that this is different in GPy where the variances are given. """ if X.ndim==1: X = X[None,:] ps = self.model.param_array.copy() means...
def function[predict, parameter[self, X]]: constant[ Predictions with the model for all the MCMC samples. Returns posterior means and standard deviations at X. Note that this is different in GPy where the variances are given. ] if compare[name[X].ndim equal[==] constant[1]] begin[:] ...
keyword[def] identifier[predict] ( identifier[self] , identifier[X] ): literal[string] keyword[if] identifier[X] . identifier[ndim] == literal[int] : identifier[X] = identifier[X] [ keyword[None] ,:] identifier[ps] = identifier[self] . identifier[model] . identifier[param_array] . identi...
def predict(self, X): """ Predictions with the model for all the MCMC samples. Returns posterior means and standard deviations at X. Note that this is different in GPy where the variances are given. """ if X.ndim == 1: X = X[None, :] # depends on [control=['if'], data=[]] ps = self....
def parse(self, file, outfile=None): """Parse a line-oriented entity file into a list of entity dict objects Note the returned list is of dict objects. TODO: These will later be specified using marshmallow and it should be possible to generate objects Arguments --------...
def function[parse, parameter[self, file, outfile]]: constant[Parse a line-oriented entity file into a list of entity dict objects Note the returned list is of dict objects. TODO: These will later be specified using marshmallow and it should be possible to generate objects Argu...
keyword[def] identifier[parse] ( identifier[self] , identifier[file] , identifier[outfile] = keyword[None] ): literal[string] identifier[file] = identifier[self] . identifier[_ensure_file] ( identifier[file] ) identifier[ents] =[] identifier[skipped] =[] identifier[n_line...
def parse(self, file, outfile=None): """Parse a line-oriented entity file into a list of entity dict objects Note the returned list is of dict objects. TODO: These will later be specified using marshmallow and it should be possible to generate objects Arguments --------- ...
def name_scope(name=None): """ This decorator wraps a function so that it runs inside a TensorFlow name scope. The name is given by the `name` option; if this is None, then the name of the function will be used. ``` >>> @name_scope() >>> def foo(...): >>> # now runs inside scope "foo...
def function[name_scope, parameter[name]]: constant[ This decorator wraps a function so that it runs inside a TensorFlow name scope. The name is given by the `name` option; if this is None, then the name of the function will be used. ``` >>> @name_scope() >>> def foo(...): >>> # ...
keyword[def] identifier[name_scope] ( identifier[name] = keyword[None] ): literal[string] keyword[def] identifier[name_scope_wrapper_decorator] ( identifier[method] ): @ identifier[functools] . identifier[wraps] ( identifier[method] ) keyword[def] identifier[name_scope_wrapper] (* identi...
def name_scope(name=None): """ This decorator wraps a function so that it runs inside a TensorFlow name scope. The name is given by the `name` option; if this is None, then the name of the function will be used. ``` >>> @name_scope() >>> def foo(...): >>> # now runs inside scope "foo...
def get_historical_standings(date): """Return the historical standings file for specified date.""" try: url = STANDINGS_HISTORICAL_URL.format(date.year, date.strftime('%Y/%m/%d')) return urlopen(url) except HTTPError: ValueError('Could no...
def function[get_historical_standings, parameter[date]]: constant[Return the historical standings file for specified date.] <ast.Try object at 0x7da1b1a66290>
keyword[def] identifier[get_historical_standings] ( identifier[date] ): literal[string] keyword[try] : identifier[url] = identifier[STANDINGS_HISTORICAL_URL] . identifier[format] ( identifier[date] . identifier[year] , identifier[date] . identifier[strftime] ( literal[string] )) ...
def get_historical_standings(date): """Return the historical standings file for specified date.""" try: url = STANDINGS_HISTORICAL_URL.format(date.year, date.strftime('%Y/%m/%d')) return urlopen(url) # depends on [control=['try'], data=[]] except HTTPError: ValueError('Could not fin...
def _unescape_token(token): r"""Replaces escaped characters in the token with their unescaped versions. Applies inverse transformations as _escape_token(): 1. Replace "\u" with "_", and "\\" with "\". 2. Replace "\###;" with the unicode character the ### refers to. Args: token: escaped string Ret...
def function[_unescape_token, parameter[token]]: constant[Replaces escaped characters in the token with their unescaped versions. Applies inverse transformations as _escape_token(): 1. Replace "\u" with "_", and "\\" with "\". 2. Replace "\###;" with the unicode character the ### refers to. Args: ...
keyword[def] identifier[_unescape_token] ( identifier[token] ): literal[string] keyword[def] identifier[match] ( identifier[m] ): literal[string] keyword[if] identifier[m] . identifier[group] ( literal[int] ) keyword[is] keyword[None] : keyword[return] literal[string] keyword[if] ...
def _unescape_token(token): """Replaces escaped characters in the token with their unescaped versions. Applies inverse transformations as _escape_token(): 1. Replace "\\u" with "_", and "\\\\" with "\\". 2. Replace "\\###;" with the unicode character the ### refers to. Args: token: escaped string ...
def blob_size(self, digest): """ Return the size of a blob in the registry given the hash of its content. :param digest: Hash of the blob's content (prefixed by ``sha256:``). :type digest: str :rtype: long :returns: Whether the blob exists. """ r = self....
def function[blob_size, parameter[self, digest]]: constant[ Return the size of a blob in the registry given the hash of its content. :param digest: Hash of the blob's content (prefixed by ``sha256:``). :type digest: str :rtype: long :returns: Whether the blob exists. ...
keyword[def] identifier[blob_size] ( identifier[self] , identifier[digest] ): literal[string] identifier[r] = identifier[self] . identifier[_request] ( literal[string] , literal[string] + identifier[digest] ) keyword[return] identifier[long] ( identifier[r] . identifier[headers] [ literal...
def blob_size(self, digest): """ Return the size of a blob in the registry given the hash of its content. :param digest: Hash of the blob's content (prefixed by ``sha256:``). :type digest: str :rtype: long :returns: Whether the blob exists. """ r = self._request...
def parse_plotProfile(self): """Find plotProfile output""" self.deeptools_plotProfile = dict() for f in self.find_log_files('deeptools/plotProfile', filehandles=False): parsed_data, bin_labels, converted_bin_labels = self.parsePlotProfileData(f) for k, v in parsed_data.it...
def function[parse_plotProfile, parameter[self]]: constant[Find plotProfile output] name[self].deeptools_plotProfile assign[=] call[name[dict], parameter[]] for taget[name[f]] in starred[call[name[self].find_log_files, parameter[constant[deeptools/plotProfile]]]] begin[:] <ast.Tu...
keyword[def] identifier[parse_plotProfile] ( identifier[self] ): literal[string] identifier[self] . identifier[deeptools_plotProfile] = identifier[dict] () keyword[for] identifier[f] keyword[in] identifier[self] . identifier[find_log_files] ( literal[string] , identifier[filehandles] = ...
def parse_plotProfile(self): """Find plotProfile output""" self.deeptools_plotProfile = dict() for f in self.find_log_files('deeptools/plotProfile', filehandles=False): (parsed_data, bin_labels, converted_bin_labels) = self.parsePlotProfileData(f) for (k, v) in parsed_data.items(): ...
def update_sandbox_product( self, product_id, surge_multiplier=None, drivers_available=None, ): """Update sandbox product availability. Params product_id (str) Unique identifier representing a specific product for a given l...
def function[update_sandbox_product, parameter[self, product_id, surge_multiplier, drivers_available]]: constant[Update sandbox product availability. Params product_id (str) Unique identifier representing a specific product for a given location. s...
keyword[def] identifier[update_sandbox_product] ( identifier[self] , identifier[product_id] , identifier[surge_multiplier] = keyword[None] , identifier[drivers_available] = keyword[None] , ): literal[string] identifier[args] ={ literal[string] : identifier[surge_multiplier] , ...
def update_sandbox_product(self, product_id, surge_multiplier=None, drivers_available=None): """Update sandbox product availability. Params product_id (str) Unique identifier representing a specific product for a given location. surge_multiplier (floa...
async def StorageAttachmentLife(self, ids): ''' ids : typing.Sequence[~StorageAttachmentId] Returns -> typing.Sequence[~LifeResult] ''' # map input types to rpc msg _params = dict() msg = dict(type='Uniter', request='StorageAttachmentLife', ...
<ast.AsyncFunctionDef object at 0x7da18dc05b70>
keyword[async] keyword[def] identifier[StorageAttachmentLife] ( identifier[self] , identifier[ids] ): literal[string] identifier[_params] = identifier[dict] () identifier[msg] = identifier[dict] ( identifier[type] = literal[string] , identifier[request] = literal[string]...
async def StorageAttachmentLife(self, ids): """ ids : typing.Sequence[~StorageAttachmentId] Returns -> typing.Sequence[~LifeResult] """ # map input types to rpc msg _params = dict() msg = dict(type='Uniter', request='StorageAttachmentLife', version=5, params=_params) _params[...
def sync(context, provider, **kwargs): # pylint: disable=too-many-locals """Sync static website to S3 bucket.""" session = get_session(provider.region) bucket_name = OutputLookup.handle(kwargs.get('bucket_output_lookup'), provider=provider, ...
def function[sync, parameter[context, provider]]: constant[Sync static website to S3 bucket.] variable[session] assign[=] call[name[get_session], parameter[name[provider].region]] variable[bucket_name] assign[=] call[name[OutputLookup].handle, parameter[call[name[kwargs].get, parameter[constant[...
keyword[def] identifier[sync] ( identifier[context] , identifier[provider] ,** identifier[kwargs] ): literal[string] identifier[session] = identifier[get_session] ( identifier[provider] . identifier[region] ) identifier[bucket_name] = identifier[OutputLookup] . identifier[handle] ( identifier[kwargs] ...
def sync(context, provider, **kwargs): # pylint: disable=too-many-locals 'Sync static website to S3 bucket.' session = get_session(provider.region) bucket_name = OutputLookup.handle(kwargs.get('bucket_output_lookup'), provider=provider, context=context) if context.hook_data['staticsite']['deploy_is_cur...
def get_all_firmwares(self, filter='', start=0, count=-1, query='', sort=''): """ Gets a list of firmware inventory across all servers. To filter the returned data, specify a filter expression to select a particular server model, component name, and/or component firmware version. Note: ...
def function[get_all_firmwares, parameter[self, filter, start, count, query, sort]]: constant[ Gets a list of firmware inventory across all servers. To filter the returned data, specify a filter expression to select a particular server model, component name, and/or component firmware version. ...
keyword[def] identifier[get_all_firmwares] ( identifier[self] , identifier[filter] = literal[string] , identifier[start] = literal[int] , identifier[count] =- literal[int] , identifier[query] = literal[string] , identifier[sort] = literal[string] ): literal[string] identifier[uri] = identifier[self...
def get_all_firmwares(self, filter='', start=0, count=-1, query='', sort=''): """ Gets a list of firmware inventory across all servers. To filter the returned data, specify a filter expression to select a particular server model, component name, and/or component firmware version. Note: ...
def _ftp_pwd(self): """Variant of `self.ftp.pwd()` that supports encoding-fallback. Returns: Current working directory as native string. """ try: return self.ftp.pwd() except UnicodeEncodeError: if compat.PY2 or self.ftp.encoding != "...
def function[_ftp_pwd, parameter[self]]: constant[Variant of `self.ftp.pwd()` that supports encoding-fallback. Returns: Current working directory as native string. ] <ast.Try object at 0x7da1b042d660>
keyword[def] identifier[_ftp_pwd] ( identifier[self] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[ftp] . identifier[pwd] () keyword[except] identifier[UnicodeEncodeError] : keyword[if] identifier[compat] . identifier[PY2]...
def _ftp_pwd(self): """Variant of `self.ftp.pwd()` that supports encoding-fallback. Returns: Current working directory as native string. """ try: return self.ftp.pwd() # depends on [control=['try'], data=[]] except UnicodeEncodeError: if compat.PY2 or self.ftp.e...
def dnld_goa(self, species, ext='gaf', item=None, fileout=None): """Download GOA source file name on EMBL-EBI ftp server.""" basename = self.get_basename(species, ext, item) src = os.path.join(self.ftp_src_goa, species.upper(), "{F}.gz".format(F=basename)) dst = os.path.join(os.getcwd(),...
def function[dnld_goa, parameter[self, species, ext, item, fileout]]: constant[Download GOA source file name on EMBL-EBI ftp server.] variable[basename] assign[=] call[name[self].get_basename, parameter[name[species], name[ext], name[item]]] variable[src] assign[=] call[name[os].path.join, param...
keyword[def] identifier[dnld_goa] ( identifier[self] , identifier[species] , identifier[ext] = literal[string] , identifier[item] = keyword[None] , identifier[fileout] = keyword[None] ): literal[string] identifier[basename] = identifier[self] . identifier[get_basename] ( identifier[species] , ident...
def dnld_goa(self, species, ext='gaf', item=None, fileout=None): """Download GOA source file name on EMBL-EBI ftp server.""" basename = self.get_basename(species, ext, item) src = os.path.join(self.ftp_src_goa, species.upper(), '{F}.gz'.format(F=basename)) dst = os.path.join(os.getcwd(), basename) if fi...
def _resolve_slices(data_columns, names): """ Convert any slices into column names Parameters ---------- data_columns : pandas.Index Dataframe columns names : tuple Names (including slices) of columns in the dataframe. Returns...
def function[_resolve_slices, parameter[data_columns, names]]: constant[ Convert any slices into column names Parameters ---------- data_columns : pandas.Index Dataframe columns names : tuple Names (including slices) of columns in the ...
keyword[def] identifier[_resolve_slices] ( identifier[data_columns] , identifier[names] ): literal[string] keyword[def] identifier[_get_slice_cols] ( identifier[sc] ): literal[string] identifier[idx_start] = identifier[data_columns] . identifier...
def _resolve_slices(data_columns, names): """ Convert any slices into column names Parameters ---------- data_columns : pandas.Index Dataframe columns names : tuple Names (including slices) of columns in the dataframe. Returns ...
def getStuckRelayCheckEnabled(self): """Returns True if enabled, False if disabled""" command = '$GE' settings = self.sendCommand(command) flags = int(settings[2], 16) return not (flags & 0x0010)
def function[getStuckRelayCheckEnabled, parameter[self]]: constant[Returns True if enabled, False if disabled] variable[command] assign[=] constant[$GE] variable[settings] assign[=] call[name[self].sendCommand, parameter[name[command]]] variable[flags] assign[=] call[name[int], parameter...
keyword[def] identifier[getStuckRelayCheckEnabled] ( identifier[self] ): literal[string] identifier[command] = literal[string] identifier[settings] = identifier[self] . identifier[sendCommand] ( identifier[command] ) identifier[flags] = identifier[int] ( identifier[settings] [ literal[int] ], li...
def getStuckRelayCheckEnabled(self): """Returns True if enabled, False if disabled""" command = '$GE' settings = self.sendCommand(command) flags = int(settings[2], 16) return not flags & 16
def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the RevokeRequestPayload object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read metho...
def function[read, parameter[self, istream, kmip_version]]: constant[ Read the data encoding the RevokeRequestPayload object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read metho...
keyword[def] identifier[read] ( identifier[self] , identifier[istream] , identifier[kmip_version] = identifier[enums] . identifier[KMIPVersion] . identifier[KMIP_1_0] ): literal[string] identifier[super] ( identifier[RevokeRequestPayload] , identifier[self] ). identifier[read] ( identifier...
def read(self, istream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the RevokeRequestPayload object and decode it into its constituent parts. Args: istream (Stream): A data stream containing encoded object data, supporting a read method; u...
def make_formatters(self): """ Create a list formatter functions for each column. They can then be stored in the render spec for faster justification processing. """ return [self.make_formatter(inner_w, spec['padding'], spec['align'], spec['overflow']) ...
def function[make_formatters, parameter[self]]: constant[ Create a list formatter functions for each column. They can then be stored in the render spec for faster justification processing. ] return[<ast.ListComp object at 0x7da204622560>]
keyword[def] identifier[make_formatters] ( identifier[self] ): literal[string] keyword[return] [ identifier[self] . identifier[make_formatter] ( identifier[inner_w] , identifier[spec] [ literal[string] ], identifier[spec] [ literal[string] ], identifier[spec] [ literal[string] ]) ...
def make_formatters(self): """ Create a list formatter functions for each column. They can then be stored in the render spec for faster justification processing. """ return [self.make_formatter(inner_w, spec['padding'], spec['align'], spec['overflow']) for (spec, inner_w) in zip(self.colspec, self.widt...
def _compute_distance_term(self, C, mag, rrup): """ Compute second and third terms in equation 1, p. 901. """ term1 = C['b'] * rrup term2 = - np.log(rrup + C['c'] * np.exp(C['d'] * mag)) return term1 + term2
def function[_compute_distance_term, parameter[self, C, mag, rrup]]: constant[ Compute second and third terms in equation 1, p. 901. ] variable[term1] assign[=] binary_operation[call[name[C]][constant[b]] * name[rrup]] variable[term2] assign[=] <ast.UnaryOp object at 0x7da2043479...
keyword[def] identifier[_compute_distance_term] ( identifier[self] , identifier[C] , identifier[mag] , identifier[rrup] ): literal[string] identifier[term1] = identifier[C] [ literal[string] ]* identifier[rrup] identifier[term2] =- identifier[np] . identifier[log] ( identifier[rrup] + ide...
def _compute_distance_term(self, C, mag, rrup): """ Compute second and third terms in equation 1, p. 901. """ term1 = C['b'] * rrup term2 = -np.log(rrup + C['c'] * np.exp(C['d'] * mag)) return term1 + term2
def pauli(qubo): """ Convert to pauli operators of universal gate model. Requires blueqat. """ from blueqat.pauli import qubo_bit h = 0.0 assert all(len(q) == len(qubo) for q in qubo) for i in range(len(qubo)): h += qubo_bit(i) * qubo[i][i] for j in range(i + 1, len(qubo)): h += qubo_bit(i)*qubo_bit(j) *...
def function[pauli, parameter[qubo]]: constant[ Convert to pauli operators of universal gate model. Requires blueqat. ] from relative_module[blueqat.pauli] import module[qubo_bit] variable[h] assign[=] constant[0.0] assert[call[name[all], parameter[<ast.GeneratorExp object at 0x7da18eb54df0>]...
keyword[def] identifier[pauli] ( identifier[qubo] ): literal[string] keyword[from] identifier[blueqat] . identifier[pauli] keyword[import] identifier[qubo_bit] identifier[h] = literal[int] keyword[assert] identifier[all] ( identifier[len] ( identifier[q] )== identifier[len] ( identifier[qubo] ) keyword...
def pauli(qubo): """ Convert to pauli operators of universal gate model. Requires blueqat. """ from blueqat.pauli import qubo_bit h = 0.0 assert all((len(q) == len(qubo) for q in qubo)) for i in range(len(qubo)): h += qubo_bit(i) * qubo[i][i] for j in range(i + 1, len(qubo)): ...
def get_dependencies(): """Returns list of dicts which indicate installed dependencies""" dependencies = [] # Numpy dep_attrs = { "name": "numpy", "min_version": "1.1.0", "description": "required", } try: import numpy dep_attrs["version"] = numpy.version...
def function[get_dependencies, parameter[]]: constant[Returns list of dicts which indicate installed dependencies] variable[dependencies] assign[=] list[[]] variable[dep_attrs] assign[=] dictionary[[<ast.Constant object at 0x7da1b151b0a0>, <ast.Constant object at 0x7da1b15180d0>, <ast.Constant o...
keyword[def] identifier[get_dependencies] (): literal[string] identifier[dependencies] =[] identifier[dep_attrs] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , } keyword[try] : keyword[import] iden...
def get_dependencies(): """Returns list of dicts which indicate installed dependencies""" dependencies = [] # Numpy dep_attrs = {'name': 'numpy', 'min_version': '1.1.0', 'description': 'required'} try: import numpy dep_attrs['version'] = numpy.version.version # depends on [control=[...
def notify(cls, user_or_email, instance): """Create, save, and return a watch which fires when something happens to ``instance``.""" return super(InstanceEvent, cls).notify(user_or_email, object_id=instance.pk)
def function[notify, parameter[cls, user_or_email, instance]]: constant[Create, save, and return a watch which fires when something happens to ``instance``.] return[call[call[name[super], parameter[name[InstanceEvent], name[cls]]].notify, parameter[name[user_or_email]]]]
keyword[def] identifier[notify] ( identifier[cls] , identifier[user_or_email] , identifier[instance] ): literal[string] keyword[return] identifier[super] ( identifier[InstanceEvent] , identifier[cls] ). identifier[notify] ( identifier[user_or_email] , identifier[object_id] = identifier[in...
def notify(cls, user_or_email, instance): """Create, save, and return a watch which fires when something happens to ``instance``.""" return super(InstanceEvent, cls).notify(user_or_email, object_id=instance.pk)
def version_calc(dist, attr, value): """ Handler for parameter to setup(use_vcs_version=value) attr should be 'use_vcs_version' (also allows use_hg_version for compatibility). bool(value) should be true to invoke this plugin. value may optionally be a dict and supply options to the plugin. """ expected_attrs =...
def function[version_calc, parameter[dist, attr, value]]: constant[ Handler for parameter to setup(use_vcs_version=value) attr should be 'use_vcs_version' (also allows use_hg_version for compatibility). bool(value) should be true to invoke this plugin. value may optionally be a dict and supply options to ...
keyword[def] identifier[version_calc] ( identifier[dist] , identifier[attr] , identifier[value] ): literal[string] identifier[expected_attrs] = literal[string] , literal[string] keyword[if] keyword[not] identifier[value] keyword[or] identifier[attr] keyword[not] keyword[in] identifier[expected_attrs] :...
def version_calc(dist, attr, value): """ Handler for parameter to setup(use_vcs_version=value) attr should be 'use_vcs_version' (also allows use_hg_version for compatibility). bool(value) should be true to invoke this plugin. value may optionally be a dict and supply options to the plugin. """ expected_a...
def get_queryset(self): """ Returns queryset limited to categories with live Entry instances. :rtype: django.db.models.query.QuerySet. """ queryset = super(LiveEntryCategoryManager, self).get_queryset() return queryset.filter(tag__in=[ entry_tag.tag ...
def function[get_queryset, parameter[self]]: constant[ Returns queryset limited to categories with live Entry instances. :rtype: django.db.models.query.QuerySet. ] variable[queryset] assign[=] call[call[name[super], parameter[name[LiveEntryCategoryManager], name[self]]].get_quer...
keyword[def] identifier[get_queryset] ( identifier[self] ): literal[string] identifier[queryset] = identifier[super] ( identifier[LiveEntryCategoryManager] , identifier[self] ). identifier[get_queryset] () keyword[return] identifier[queryset] . identifier[filter] ( identifier[tag__in] =[ ...
def get_queryset(self): """ Returns queryset limited to categories with live Entry instances. :rtype: django.db.models.query.QuerySet. """ queryset = super(LiveEntryCategoryManager, self).get_queryset() return queryset.filter(tag__in=[entry_tag.tag for entry_tag in EntryTag.objects....
def _parse_common(tag): """Returns a tuple of (name, modifiers, dtype, kind) for the specified tag. Any missing attributes will have values of None. """ if "modifiers" in tag.attrib: modifiers = re.split(",\s*", tag.attrib["modifiers"].strip()) if "" in modifiers: modifiers.r...
def function[_parse_common, parameter[tag]]: constant[Returns a tuple of (name, modifiers, dtype, kind) for the specified tag. Any missing attributes will have values of None. ] if compare[constant[modifiers] in name[tag].attrib] begin[:] variable[modifiers] assign[=] call[name[r...
keyword[def] identifier[_parse_common] ( identifier[tag] ): literal[string] keyword[if] literal[string] keyword[in] identifier[tag] . identifier[attrib] : identifier[modifiers] = identifier[re] . identifier[split] ( literal[string] , identifier[tag] . identifier[attrib] [ literal[string] ]. ide...
def _parse_common(tag): """Returns a tuple of (name, modifiers, dtype, kind) for the specified tag. Any missing attributes will have values of None. """ if 'modifiers' in tag.attrib: modifiers = re.split(',\\s*', tag.attrib['modifiers'].strip()) if '' in modifiers: modifiers....
def fetch(self): """ Fetch & return a new `DomainRecord` object representing the domain record's current state :rtype: DomainRecord :raises DOAPIError: if the API endpoint replies with an error (e.g., if the domain record no longer exists) """ return ...
def function[fetch, parameter[self]]: constant[ Fetch & return a new `DomainRecord` object representing the domain record's current state :rtype: DomainRecord :raises DOAPIError: if the API endpoint replies with an error (e.g., if the domain record no longer exists) ...
keyword[def] identifier[fetch] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[domain] . identifier[_record] ( identifier[self] . identifier[doapi_manager] . identifier[request] ( identifier[self] . identifier[url] )[ literal[string] ])
def fetch(self): """ Fetch & return a new `DomainRecord` object representing the domain record's current state :rtype: DomainRecord :raises DOAPIError: if the API endpoint replies with an error (e.g., if the domain record no longer exists) """ return self.dom...
def primary_spin(mass1, mass2, spin1, spin2): """Returns the dimensionless spin of the primary mass.""" mass1, mass2, spin1, spin2, input_is_array = ensurearray( mass1, mass2, spin1, spin2) sp = copy.copy(spin1) mask = mass1 < mass2 sp[mask] = spin2[mask] return formatreturn(sp, input_is...
def function[primary_spin, parameter[mass1, mass2, spin1, spin2]]: constant[Returns the dimensionless spin of the primary mass.] <ast.Tuple object at 0x7da18dc04460> assign[=] call[name[ensurearray], parameter[name[mass1], name[mass2], name[spin1], name[spin2]]] variable[sp] assign[=] call[name[...
keyword[def] identifier[primary_spin] ( identifier[mass1] , identifier[mass2] , identifier[spin1] , identifier[spin2] ): literal[string] identifier[mass1] , identifier[mass2] , identifier[spin1] , identifier[spin2] , identifier[input_is_array] = identifier[ensurearray] ( identifier[mass1] , identifier...
def primary_spin(mass1, mass2, spin1, spin2): """Returns the dimensionless spin of the primary mass.""" (mass1, mass2, spin1, spin2, input_is_array) = ensurearray(mass1, mass2, spin1, spin2) sp = copy.copy(spin1) mask = mass1 < mass2 sp[mask] = spin2[mask] return formatreturn(sp, input_is_array)
def get_trilegal(filename,ra,dec,folder='.', galactic=False, filterset='kepler_2mass',area=1,maglim=27,binaries=False, trilegal_version='1.6',sigma_AV=0.1,convert_h5=True): """Runs get_trilegal perl script; optionally saves output into .h5 file Depends on a perl script provide...
def function[get_trilegal, parameter[filename, ra, dec, folder, galactic, filterset, area, maglim, binaries, trilegal_version, sigma_AV, convert_h5]]: constant[Runs get_trilegal perl script; optionally saves output into .h5 file Depends on a perl script provided by L. Girardi; calls the web form simula...
keyword[def] identifier[get_trilegal] ( identifier[filename] , identifier[ra] , identifier[dec] , identifier[folder] = literal[string] , identifier[galactic] = keyword[False] , identifier[filterset] = literal[string] , identifier[area] = literal[int] , identifier[maglim] = literal[int] , identifier[binaries] = keywo...
def get_trilegal(filename, ra, dec, folder='.', galactic=False, filterset='kepler_2mass', area=1, maglim=27, binaries=False, trilegal_version='1.6', sigma_AV=0.1, convert_h5=True): """Runs get_trilegal perl script; optionally saves output into .h5 file Depends on a perl script provided by L. Girardi; calls the...
def get_all_events(self): """Make a list of all events in the TRIPS EKB. The events are stored in self.all_events. """ self.all_events = {} events = self.tree.findall('EVENT') events += self.tree.findall('CC') for e in events: event_id = e.attrib['id'...
def function[get_all_events, parameter[self]]: constant[Make a list of all events in the TRIPS EKB. The events are stored in self.all_events. ] name[self].all_events assign[=] dictionary[[], []] variable[events] assign[=] call[name[self].tree.findall, parameter[constant[EVENT]]]...
keyword[def] identifier[get_all_events] ( identifier[self] ): literal[string] identifier[self] . identifier[all_events] ={} identifier[events] = identifier[self] . identifier[tree] . identifier[findall] ( literal[string] ) identifier[events] += identifier[self] . identifier[tree] ...
def get_all_events(self): """Make a list of all events in the TRIPS EKB. The events are stored in self.all_events. """ self.all_events = {} events = self.tree.findall('EVENT') events += self.tree.findall('CC') for e in events: event_id = e.attrib['id'] if event_id in...
def order_by(self, **kwargs): """ Orders the query by the key passed in +kwargs+. Only pass one key, as it cannot sort by multiple columns at once. Raises QueryInvalid if this method is called when there is already a custom order (i.e. this method was already called on this query...
def function[order_by, parameter[self]]: constant[ Orders the query by the key passed in +kwargs+. Only pass one key, as it cannot sort by multiple columns at once. Raises QueryInvalid if this method is called when there is already a custom order (i.e. this method was already cal...
keyword[def] identifier[order_by] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[self] . identifier[_order_with] : keyword[raise] identifier[QueryInvalid] ( literal[string] ) identifier[self] . identifier[_order_with] = identifie...
def order_by(self, **kwargs): """ Orders the query by the key passed in +kwargs+. Only pass one key, as it cannot sort by multiple columns at once. Raises QueryInvalid if this method is called when there is already a custom order (i.e. this method was already called on this query). A...
def niceStringify(self, level): """Returns a string representation with new lines and shifts""" out = level * " " + \ "Function[" + str(self.keywordLine) + \ ":" + str(self.keywordPos) + \ ":" + self._getLPA() + \ ":" + str(self.colonLine) + \ ...
def function[niceStringify, parameter[self, level]]: constant[Returns a string representation with new lines and shifts] variable[out] assign[=] binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary...
keyword[def] identifier[niceStringify] ( identifier[self] , identifier[level] ): literal[string] identifier[out] = identifier[level] * literal[string] + literal[string] + identifier[str] ( identifier[self] . identifier[keywordLine] )+ literal[string] + identifier[str] ( identifier[self] . identifie...
def niceStringify(self, level): """Returns a string representation with new lines and shifts""" out = level * ' ' + 'Function[' + str(self.keywordLine) + ':' + str(self.keywordPos) + ':' + self._getLPA() + ':' + str(self.colonLine) + ':' + str(self.colonPos) + "]: '" + self.name + "'" if self.isAsync: ...
def make_empty_table(row_count, column_count): """ Make an empty table Parameters ---------- row_count : int The number of rows in the new table column_count : int The number of columns in the new table Returns ------- table : list of lists of str Each cell ...
def function[make_empty_table, parameter[row_count, column_count]]: constant[ Make an empty table Parameters ---------- row_count : int The number of rows in the new table column_count : int The number of columns in the new table Returns ------- table : list of ...
keyword[def] identifier[make_empty_table] ( identifier[row_count] , identifier[column_count] ): literal[string] identifier[table] =[] keyword[while] identifier[row_count] > literal[int] : identifier[row] =[] keyword[for] identifier[column] keyword[in] identifier[range] ( identifi...
def make_empty_table(row_count, column_count): """ Make an empty table Parameters ---------- row_count : int The number of rows in the new table column_count : int The number of columns in the new table Returns ------- table : list of lists of str Each cell ...
def find_nucleotid_mismatches(sbjct_start, sbjct_seq, qry_seq, promoter = False): """ This function takes two alligned sequence (subject and query), and the position on the subject where the alignment starts. The sequences are compared one nucleotide at a time. If mis matches are found they are ...
def function[find_nucleotid_mismatches, parameter[sbjct_start, sbjct_seq, qry_seq, promoter]]: constant[ This function takes two alligned sequence (subject and query), and the position on the subject where the alignment starts. The sequences are compared one nucleotide at a time. If mis matches a...
keyword[def] identifier[find_nucleotid_mismatches] ( identifier[sbjct_start] , identifier[sbjct_seq] , identifier[qry_seq] , identifier[promoter] = keyword[False] ): literal[string] identifier[mis_matches] =[] identifier[sbjct_start] = identifier[abs] ( identifier[sbjct_start] ) identifier...
def find_nucleotid_mismatches(sbjct_start, sbjct_seq, qry_seq, promoter=False): """ This function takes two alligned sequence (subject and query), and the position on the subject where the alignment starts. The sequences are compared one nucleotide at a time. If mis matches are found they are sa...
def build_local_filename(download_url=None, filename=None, decompress=False): """ Determine which local filename to use based on the file's source URL, an optional desired filename, and whether a compression suffix needs to be removed """ assert download_url or filename, "Either filename or URL ...
def function[build_local_filename, parameter[download_url, filename, decompress]]: constant[ Determine which local filename to use based on the file's source URL, an optional desired filename, and whether a compression suffix needs to be removed ] assert[<ast.BoolOp object at 0x7da1b0bdb760>...
keyword[def] identifier[build_local_filename] ( identifier[download_url] = keyword[None] , identifier[filename] = keyword[None] , identifier[decompress] = keyword[False] ): literal[string] keyword[assert] identifier[download_url] keyword[or] identifier[filename] , literal[string] keyword[if]...
def build_local_filename(download_url=None, filename=None, decompress=False): """ Determine which local filename to use based on the file's source URL, an optional desired filename, and whether a compression suffix needs to be removed """ assert download_url or filename, 'Either filename or URL ...
def _package_path(package): """Returns the full path to the default package configuration file. Args: package (str): name of the python package to return a path for. """ from os import path confdir = config_dir() return path.join(confdir, "{}.cfg".format(package))
def function[_package_path, parameter[package]]: constant[Returns the full path to the default package configuration file. Args: package (str): name of the python package to return a path for. ] from relative_module[os] import module[path] variable[confdir] assign[=] call[name[confi...
keyword[def] identifier[_package_path] ( identifier[package] ): literal[string] keyword[from] identifier[os] keyword[import] identifier[path] identifier[confdir] = identifier[config_dir] () keyword[return] identifier[path] . identifier[join] ( identifier[confdir] , literal[string] . identifi...
def _package_path(package): """Returns the full path to the default package configuration file. Args: package (str): name of the python package to return a path for. """ from os import path confdir = config_dir() return path.join(confdir, '{}.cfg'.format(package))
def get_proficiency_lookup_session(self): """Gets the OsidSession associated with the proficiency lookup service. return: (osid.learning.ProficiencyLookupSession) - a ProficiencyLookupSession raise: OperationFailed - unable to complete request raise: Unimplemen...
def function[get_proficiency_lookup_session, parameter[self]]: constant[Gets the OsidSession associated with the proficiency lookup service. return: (osid.learning.ProficiencyLookupSession) - a ProficiencyLookupSession raise: OperationFailed - unable to complete request...
keyword[def] identifier[get_proficiency_lookup_session] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[supports_proficiency_lookup] (): keyword[raise] identifier[Unimplemented] () keyword[try] : keyword[from] . keyw...
def get_proficiency_lookup_session(self): """Gets the OsidSession associated with the proficiency lookup service. return: (osid.learning.ProficiencyLookupSession) - a ProficiencyLookupSession raise: OperationFailed - unable to complete request raise: Unimplemented ...
def create_header_data(coord, radius=10., **kwargs): """ Make an empty sky region at location of skydir skydir : skymaps.SkyDir object size : size of region (deg.) kwargs : arguments passed to create_header """ header = create_header(coord, radius=radius, **kwargs) data = np.zeros( (header...
def function[create_header_data, parameter[coord, radius]]: constant[ Make an empty sky region at location of skydir skydir : skymaps.SkyDir object size : size of region (deg.) kwargs : arguments passed to create_header ] variable[header] assign[=] call[name[create_header], parameter[n...
keyword[def] identifier[create_header_data] ( identifier[coord] , identifier[radius] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[header] = identifier[create_header] ( identifier[coord] , identifier[radius] = identifier[radius] ,** identifier[kwargs] ) identifier[data] = identif...
def create_header_data(coord, radius=10.0, **kwargs): """ Make an empty sky region at location of skydir skydir : skymaps.SkyDir object size : size of region (deg.) kwargs : arguments passed to create_header """ header = create_header(coord, radius=radius, **kwargs) data = np.zeros((header...
def get_task_tree(white_list=None): """Returns a tree of Task instances The tree is comprised of dictionaries containing strings for keys and either dictionaries or Task instances for values. When WHITE_LIST is given, only the tasks and plugins in this list will become part of the task tree. The ...
def function[get_task_tree, parameter[white_list]]: constant[Returns a tree of Task instances The tree is comprised of dictionaries containing strings for keys and either dictionaries or Task instances for values. When WHITE_LIST is given, only the tasks and plugins in this list will become pa...
keyword[def] identifier[get_task_tree] ( identifier[white_list] = keyword[None] ): literal[string] keyword[assert] identifier[white_list] keyword[is] keyword[None] keyword[or] identifier[isinstance] ( identifier[white_list] , identifier[list] ), identifier[type] ( identifier[white_list] ) keywor...
def get_task_tree(white_list=None): """Returns a tree of Task instances The tree is comprised of dictionaries containing strings for keys and either dictionaries or Task instances for values. When WHITE_LIST is given, only the tasks and plugins in this list will become part of the task tree. The ...
def rotate(self, vecs): """Rotate input vector(s) by the rotation matrix.` Args: vecs (np.ndarray): Input vector(s) with dtype=np.float32. The shape can be a single vector (D, ) or several vectors (N, D) Returns: np.ndarray: Rotated vectors with the same...
def function[rotate, parameter[self, vecs]]: constant[Rotate input vector(s) by the rotation matrix.` Args: vecs (np.ndarray): Input vector(s) with dtype=np.float32. The shape can be a single vector (D, ) or several vectors (N, D) Returns: np.ndarray: Ro...
keyword[def] identifier[rotate] ( identifier[self] , identifier[vecs] ): literal[string] keyword[assert] identifier[vecs] . identifier[dtype] == identifier[np] . identifier[float32] keyword[assert] identifier[vecs] . identifier[ndim] keyword[in] [ literal[int] , literal[int] ] ...
def rotate(self, vecs): """Rotate input vector(s) by the rotation matrix.` Args: vecs (np.ndarray): Input vector(s) with dtype=np.float32. The shape can be a single vector (D, ) or several vectors (N, D) Returns: np.ndarray: Rotated vectors with the same sha...
def main(argv=None): """ Entry point for the command line tool 'uflash'. Will print help text if the optional first argument is "help". Otherwise it will ensure the optional first argument ends in ".py" (the source Python script). An optional second argument is used to reference the path to th...
def function[main, parameter[argv]]: constant[ Entry point for the command line tool 'uflash'. Will print help text if the optional first argument is "help". Otherwise it will ensure the optional first argument ends in ".py" (the source Python script). An optional second argument is used t...
keyword[def] identifier[main] ( identifier[argv] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[argv] : identifier[argv] = identifier[sys] . identifier[argv] [ literal[int] :] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[descri...
def main(argv=None): """ Entry point for the command line tool 'uflash'. Will print help text if the optional first argument is "help". Otherwise it will ensure the optional first argument ends in ".py" (the source Python script). An optional second argument is used to reference the path to th...
def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ import sys if sys.vers...
def function[handle_display_options, parameter[self, option_order]]: constant[If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. ] import mod...
keyword[def] identifier[handle_display_options] ( identifier[self] , identifier[option_order] ): literal[string] keyword[import] identifier[sys] keyword[if] identifier[sys] . identifier[version_info] <( literal[int] ,) keyword[or] identifier[self] . identifier[help_commands] : ...
def handle_display_options(self, option_order): """If there were any non-global "display-only" options (--help-commands or the metadata display options) on the command line, display the requested info and return true; else return false. """ import sys if sys.version_info < (3...
def get_name(modality_type, value=None): """Gets default name for transformations; if none available, return value.""" # For legacy reasons, modalities vary in their naming scheme. Future plans are # to remove any need for get_name. We do not recommend using it. if modality_type == ModalityType.AUDIO: retur...
def function[get_name, parameter[modality_type, value]]: constant[Gets default name for transformations; if none available, return value.] if compare[name[modality_type] equal[==] name[ModalityType].AUDIO] begin[:] return[<ast.Lambda object at 0x7da20c6e74c0>] return[name[value]]
keyword[def] identifier[get_name] ( identifier[modality_type] , identifier[value] = keyword[None] ): literal[string] keyword[if] identifier[modality_type] == identifier[ModalityType] . identifier[AUDIO] : keyword[return] keyword[lambda] identifier[model_hparams] , identifier[vocab_size] : literal...
def get_name(modality_type, value=None): """Gets default name for transformations; if none available, return value.""" # For legacy reasons, modalities vary in their naming scheme. Future plans are # to remove any need for get_name. We do not recommend using it. if modality_type == ModalityType.AUDIO: ...
def _zforce(self,R,z,phi=0.,t=0.): """ NAME: _zforce PURPOSE: evaluate the vertical force for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t - time OUTPUT: ...
def function[_zforce, parameter[self, R, z, phi, t]]: constant[ NAME: _zforce PURPOSE: evaluate the vertical force for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t -...
keyword[def] identifier[_zforce] ( identifier[self] , identifier[R] , identifier[z] , identifier[phi] = literal[int] , identifier[t] = literal[int] ): literal[string] identifier[l] , identifier[n] = identifier[bovy_coords] . identifier[Rz_to_lambdanu] ( identifier[R] , identifier[z] , identifier[ac...
def _zforce(self, R, z, phi=0.0, t=0.0): """ NAME: _zforce PURPOSE: evaluate the vertical force for this potential INPUT: R - Galactocentric cylindrical radius z - vertical height phi - azimuth t - time OUTPUT: ...
def get_state_machine(self): """Get a reference of the state_machine the state belongs to :rtype rafcon.core.state_machine.StateMachine :return: respective state machine """ if self.parent: if self.is_root_state: return self.parent else: ...
def function[get_state_machine, parameter[self]]: constant[Get a reference of the state_machine the state belongs to :rtype rafcon.core.state_machine.StateMachine :return: respective state machine ] if name[self].parent begin[:] if name[self].is_root_state begin[...
keyword[def] identifier[get_state_machine] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[parent] : keyword[if] identifier[self] . identifier[is_root_state] : keyword[return] identifier[self] . identifier[parent] keywor...
def get_state_machine(self): """Get a reference of the state_machine the state belongs to :rtype rafcon.core.state_machine.StateMachine :return: respective state machine """ if self.parent: if self.is_root_state: return self.parent # depends on [control=['if'], data...
def loads(self, s, salt=None, return_header=False): """Reverse of :meth:`dumps`. If requested via `return_header` it will return a tuple of payload and header. """ payload, header = self.load_payload( self.make_signer(salt, self.algorithm).unsign(want_bytes(s)), r...
def function[loads, parameter[self, s, salt, return_header]]: constant[Reverse of :meth:`dumps`. If requested via `return_header` it will return a tuple of payload and header. ] <ast.Tuple object at 0x7da2045645e0> assign[=] call[name[self].load_payload, parameter[call[call[name[self].ma...
keyword[def] identifier[loads] ( identifier[self] , identifier[s] , identifier[salt] = keyword[None] , identifier[return_header] = keyword[False] ): literal[string] identifier[payload] , identifier[header] = identifier[self] . identifier[load_payload] ( identifier[self] . identifier[make_s...
def loads(self, s, salt=None, return_header=False): """Reverse of :meth:`dumps`. If requested via `return_header` it will return a tuple of payload and header. """ (payload, header) = self.load_payload(self.make_signer(salt, self.algorithm).unsign(want_bytes(s)), return_header=True) if heade...
def QA_util_random_with_zh_stock_code(stockNumber=10): ''' 随机生成股票代码 :param stockNumber: 生成个数 :return: ['60XXXX', '00XXXX', '300XXX'] ''' codeList = [] pt = 0 for i in range(stockNumber): if pt == 0: #print("random 60XXXX") iCode = random.randint(600000, 6...
def function[QA_util_random_with_zh_stock_code, parameter[stockNumber]]: constant[ 随机生成股票代码 :param stockNumber: 生成个数 :return: ['60XXXX', '00XXXX', '300XXX'] ] variable[codeList] assign[=] list[[]] variable[pt] assign[=] constant[0] for taget[name[i]] in starred[call[name...
keyword[def] identifier[QA_util_random_with_zh_stock_code] ( identifier[stockNumber] = literal[int] ): literal[string] identifier[codeList] =[] identifier[pt] = literal[int] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[stockNumber] ): keyword[if] identifier[...
def QA_util_random_with_zh_stock_code(stockNumber=10): """ 随机生成股票代码 :param stockNumber: 生成个数 :return: ['60XXXX', '00XXXX', '300XXX'] """ codeList = [] pt = 0 for i in range(stockNumber): if pt == 0: #print("random 60XXXX") iCode = random.randint(600000, 6...
def find(self, haystack, needle): """ Finds needle in haystack. If needle is found return True, if not return False. Required arguments: * haystack - Text to search in. * needle - Text to search for. """ try: qstatus = haystack.find(needle) ...
def function[find, parameter[self, haystack, needle]]: constant[ Finds needle in haystack. If needle is found return True, if not return False. Required arguments: * haystack - Text to search in. * needle - Text to search for. ] <ast.Try object at 0x7da2054a4d...
keyword[def] identifier[find] ( identifier[self] , identifier[haystack] , identifier[needle] ): literal[string] keyword[try] : identifier[qstatus] = identifier[haystack] . identifier[find] ( identifier[needle] ) keyword[except] identifier[AttributeError] : keywor...
def find(self, haystack, needle): """ Finds needle in haystack. If needle is found return True, if not return False. Required arguments: * haystack - Text to search in. * needle - Text to search for. """ try: qstatus = haystack.find(needle) # depends on [...
def renew_lease(self, lease_id, increment=None): """Renew a lease, requesting to extend the lease. Supported methods: PUT: /sys/leases/renew. Produces: 200 application/json :param lease_id: The ID of the lease to extend. :type lease_id: str | unicode :param incremen...
def function[renew_lease, parameter[self, lease_id, increment]]: constant[Renew a lease, requesting to extend the lease. Supported methods: PUT: /sys/leases/renew. Produces: 200 application/json :param lease_id: The ID of the lease to extend. :type lease_id: str | unicode ...
keyword[def] identifier[renew_lease] ( identifier[self] , identifier[lease_id] , identifier[increment] = keyword[None] ): literal[string] identifier[params] ={ literal[string] : identifier[lease_id] , literal[string] : identifier[increment] , } identifier[api_path...
def renew_lease(self, lease_id, increment=None): """Renew a lease, requesting to extend the lease. Supported methods: PUT: /sys/leases/renew. Produces: 200 application/json :param lease_id: The ID of the lease to extend. :type lease_id: str | unicode :param increment: T...
def handle_exception(exc_info=None, source_hint=None, tb_override=_NO): """Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template. """ global _make_traceback if exc_info is None: # pragma: no cover exc_info =...
def function[handle_exception, parameter[exc_info, source_hint, tb_override]]: constant[Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template. ] <ast.Global object at 0x7da1b0acbd90> if compare[name[exc_info] ...
keyword[def] identifier[handle_exception] ( identifier[exc_info] = keyword[None] , identifier[source_hint] = keyword[None] , identifier[tb_override] = identifier[_NO] ): literal[string] keyword[global] identifier[_make_traceback] keyword[if] identifier[exc_info] keyword[is] keyword[None] : ...
def handle_exception(exc_info=None, source_hint=None, tb_override=_NO): """Exception handling helper. This is used internally to either raise rewritten exceptions or return a rendered traceback for the template. """ global _make_traceback if exc_info is None: # pragma: no cover exc_info = ...
def reject(self, delivery_tag, requeue=False): ''' Reject a message. ''' args = Writer() args.write_longlong(delivery_tag).\ write_bit(requeue) self.send_frame(MethodFrame(self.channel_id, 60, 90, args))
def function[reject, parameter[self, delivery_tag, requeue]]: constant[ Reject a message. ] variable[args] assign[=] call[name[Writer], parameter[]] call[call[name[args].write_longlong, parameter[name[delivery_tag]]].write_bit, parameter[name[requeue]]] call[name[self].se...
keyword[def] identifier[reject] ( identifier[self] , identifier[delivery_tag] , identifier[requeue] = keyword[False] ): literal[string] identifier[args] = identifier[Writer] () identifier[args] . identifier[write_longlong] ( identifier[delivery_tag] ). identifier[write_bit] ( identifier[re...
def reject(self, delivery_tag, requeue=False): """ Reject a message. """ args = Writer() args.write_longlong(delivery_tag).write_bit(requeue) self.send_frame(MethodFrame(self.channel_id, 60, 90, args))