code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def kmeans_segmentation(image, k, kmask=None, mrf=0.1): """ K-means image segmentation that is a wrapper around `ants.atropos` ANTsR function: `kmeansSegmentation` Arguments --------- image : ANTsImage input image k : integer integer number of classes kmask : ANTsImag...
def function[kmeans_segmentation, parameter[image, k, kmask, mrf]]: constant[ K-means image segmentation that is a wrapper around `ants.atropos` ANTsR function: `kmeansSegmentation` Arguments --------- image : ANTsImage input image k : integer integer number of classes...
keyword[def] identifier[kmeans_segmentation] ( identifier[image] , identifier[k] , identifier[kmask] = keyword[None] , identifier[mrf] = literal[int] ): literal[string] identifier[dim] = identifier[image] . identifier[dimension] identifier[kmimage] = identifier[utils] . identifier[iMath] ( identifier...
def kmeans_segmentation(image, k, kmask=None, mrf=0.1): """ K-means image segmentation that is a wrapper around `ants.atropos` ANTsR function: `kmeansSegmentation` Arguments --------- image : ANTsImage input image k : integer integer number of classes kmask : ANTsImag...
def with_proxies(proxy_map, get_key): """Class decorator factory; adds proxy class variables to target class. :param dict proxy_map: Mapping between class variable labels and proxied classes :param function get_key: Extension-specific key function; may return e.g. the current Flask request ...
def function[with_proxies, parameter[proxy_map, get_key]]: constant[Class decorator factory; adds proxy class variables to target class. :param dict proxy_map: Mapping between class variable labels and proxied classes :param function get_key: Extension-specific key function; may return e.g. ...
keyword[def] identifier[with_proxies] ( identifier[proxy_map] , identifier[get_key] ): literal[string] keyword[def] identifier[wrapper] ( identifier[cls] ): keyword[for] identifier[label] , identifier[ProxiedClass] keyword[in] identifier[six] . identifier[iteritems] ( identifier[proxy_map] ): ...
def with_proxies(proxy_map, get_key): """Class decorator factory; adds proxy class variables to target class. :param dict proxy_map: Mapping between class variable labels and proxied classes :param function get_key: Extension-specific key function; may return e.g. the current Flask request ...
def remove_location(self, location): # type: (str) -> bool """Remove a location. If the location is already added, it is ignored. Args: location (str): Location to remove Returns: bool: True if location removed or False if not """ res = self._rem...
def function[remove_location, parameter[self, location]]: constant[Remove a location. If the location is already added, it is ignored. Args: location (str): Location to remove Returns: bool: True if location removed or False if not ] variable[res] assign...
keyword[def] identifier[remove_location] ( identifier[self] , identifier[location] ): literal[string] identifier[res] = identifier[self] . identifier[_remove_hdxobject] ( identifier[self] . identifier[data] . identifier[get] ( literal[string] ), identifier[location] , identifier[matchon] = literal...
def remove_location(self, location): # type: (str) -> bool 'Remove a location. If the location is already added, it is ignored.\n\n Args:\n location (str): Location to remove\n\n Returns:\n bool: True if location removed or False if not\n ' res = self._remove_hdxob...
def prefix_dirs(path): """ Return an iterable of all prefix directories of path, descending from root. """ _dirname = posixpath.dirname path = path.strip('/') out = [] while path != '': path = _dirname(path) out.append(path) return reversed(out)
def function[prefix_dirs, parameter[path]]: constant[ Return an iterable of all prefix directories of path, descending from root. ] variable[_dirname] assign[=] name[posixpath].dirname variable[path] assign[=] call[name[path].strip, parameter[constant[/]]] variable[out] assign[=]...
keyword[def] identifier[prefix_dirs] ( identifier[path] ): literal[string] identifier[_dirname] = identifier[posixpath] . identifier[dirname] identifier[path] = identifier[path] . identifier[strip] ( literal[string] ) identifier[out] =[] keyword[while] identifier[path] != literal[string] :...
def prefix_dirs(path): """ Return an iterable of all prefix directories of path, descending from root. """ _dirname = posixpath.dirname path = path.strip('/') out = [] while path != '': path = _dirname(path) out.append(path) # depends on [control=['while'], data=['path']] ...
def send_document(self, *args, **kwargs): """See :func:`send_document`""" return send_document(*args, **self._merge_overrides(**kwargs)).run()
def function[send_document, parameter[self]]: constant[See :func:`send_document`] return[call[call[name[send_document], parameter[<ast.Starred object at 0x7da1b0e9c310>]].run, parameter[]]]
keyword[def] identifier[send_document] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[send_document] (* identifier[args] ,** identifier[self] . identifier[_merge_overrides] (** identifier[kwargs] )). identifier[run] ()
def send_document(self, *args, **kwargs): """See :func:`send_document`""" return send_document(*args, **self._merge_overrides(**kwargs)).run()
def filter(self, func): """Returns a packet list filtered by a truth function. This truth function has to take a packet as the only argument and return a boolean value.""" # noqa: E501 return self.__class__([x for x in self.res if func(x)], name="filtered %s" % sel...
def function[filter, parameter[self, func]]: constant[Returns a packet list filtered by a truth function. This truth function has to take a packet as the only argument and return a boolean value.] return[call[name[self].__class__, parameter[<ast.ListComp object at 0x7da2044c3070>]]]
keyword[def] identifier[filter] ( identifier[self] , identifier[func] ): literal[string] keyword[return] identifier[self] . identifier[__class__] ([ identifier[x] keyword[for] identifier[x] keyword[in] identifier[self] . identifier[res] keyword[if] identifier[func] ( identifier[x] )], ...
def filter(self, func): """Returns a packet list filtered by a truth function. This truth function has to take a packet as the only argument and return a boolean value.""" # noqa: E501 return self.__class__([x for x in self.res if func(x)], name='filtered %s' % self.listname)
def consume_asset(event, agreement_id, did, service_agreement, consumer_account, consume_callback): """ Consumption of an asset after get the event call. :param event: AttributeDict with the event data. :param agreement_id: id of the agreement, hex str :param did: DID, str :param service_agreem...
def function[consume_asset, parameter[event, agreement_id, did, service_agreement, consumer_account, consume_callback]]: constant[ Consumption of an asset after get the event call. :param event: AttributeDict with the event data. :param agreement_id: id of the agreement, hex str :param did: DID...
keyword[def] identifier[consume_asset] ( identifier[event] , identifier[agreement_id] , identifier[did] , identifier[service_agreement] , identifier[consumer_account] , identifier[consume_callback] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] ) keyword[if] identifier[co...
def consume_asset(event, agreement_id, did, service_agreement, consumer_account, consume_callback): """ Consumption of an asset after get the event call. :param event: AttributeDict with the event data. :param agreement_id: id of the agreement, hex str :param did: DID, str :param service_agreem...
def as_stream(self): """ Return a zipped package as a readable stream """ stream = io.BytesIO() self._store(stream) stream.seek(0) return stream
def function[as_stream, parameter[self]]: constant[ Return a zipped package as a readable stream ] variable[stream] assign[=] call[name[io].BytesIO, parameter[]] call[name[self]._store, parameter[name[stream]]] call[name[stream].seek, parameter[constant[0]]] return[name[stream]]
keyword[def] identifier[as_stream] ( identifier[self] ): literal[string] identifier[stream] = identifier[io] . identifier[BytesIO] () identifier[self] . identifier[_store] ( identifier[stream] ) identifier[stream] . identifier[seek] ( literal[int] ) keyword[return] identifier[stream]
def as_stream(self): """ Return a zipped package as a readable stream """ stream = io.BytesIO() self._store(stream) stream.seek(0) return stream
def share_file_with_user(self, path, user, **kwargs): """Shares a remote file with specified user :param path: path to the remote file to share :param user: name of the user whom we want to share a file/folder :param perms (optional): permissions of the shared object default...
def function[share_file_with_user, parameter[self, path, user]]: constant[Shares a remote file with specified user :param path: path to the remote file to share :param user: name of the user whom we want to share a file/folder :param perms (optional): permissions of the shared object ...
keyword[def] identifier[share_file_with_user] ( identifier[self] , identifier[path] , identifier[user] ,** identifier[kwargs] ): literal[string] identifier[remote_user] = identifier[kwargs] . identifier[get] ( literal[string] , keyword[False] ) identifier[perms] = identifier[kwargs] . iden...
def share_file_with_user(self, path, user, **kwargs): """Shares a remote file with specified user :param path: path to the remote file to share :param user: name of the user whom we want to share a file/folder :param perms (optional): permissions of the shared object defaults to...
def avail_locations(call=None): ''' Return a dict of all available VM locations on the cloud provider with relevant data ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_locations function must be called with ' '-f or --function, or with the --list-locat...
def function[avail_locations, parameter[call]]: constant[ Return a dict of all available VM locations on the cloud provider with relevant data ] if compare[name[call] equal[==] constant[action]] begin[:] <ast.Raise object at 0x7da1b1f4beb0> variable[items] assign[=] call[name...
keyword[def] identifier[avail_locations] ( identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] == literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] literal[string] ) identifier[items] = identifier[que...
def avail_locations(call=None): """ Return a dict of all available VM locations on the cloud provider with relevant data """ if call == 'action': raise SaltCloudSystemExit('The avail_locations function must be called with -f or --function, or with the --list-locations option') # depends on ...
def main(args=None): """Parse command-line arguments, tconvert inputs, and print """ # define command line arguments parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("-V", "--version", action="version", version=__version__, hel...
def function[main, parameter[args]]: constant[Parse command-line arguments, tconvert inputs, and print ] variable[parser] assign[=] call[name[argparse].ArgumentParser, parameter[]] call[name[parser].add_argument, parameter[constant[-V], constant[--version]]] call[name[parser].add_arg...
keyword[def] identifier[main] ( identifier[args] = keyword[None] ): literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = identifier[__doc__] ) identifier[parser] . identifier[add_argument] ( literal[string] , literal[string] , identifi...
def main(args=None): """Parse command-line arguments, tconvert inputs, and print """ # define command line arguments parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('-V', '--version', action='version', version=__version__, help='show version number and exit') parser.add...
def delete(self, id, product_id, session): '''taobao.product.img.delete 删除产品非主图 1.传入非主图ID 2.传入产品ID 删除产品非主图''' request = TOPRequest('taobao.product.img.delete') request['id'] = id request['product_id'] = product_id self.create(self.execute(request, session)['produ...
def function[delete, parameter[self, id, product_id, session]]: constant[taobao.product.img.delete 删除产品非主图 1.传入非主图ID 2.传入产品ID 删除产品非主图] variable[request] assign[=] call[name[TOPRequest], parameter[constant[taobao.product.img.delete]]] call[name[request]][constant[id]] assign[=] n...
keyword[def] identifier[delete] ( identifier[self] , identifier[id] , identifier[product_id] , identifier[session] ): literal[string] identifier[request] = identifier[TOPRequest] ( literal[string] ) identifier[request] [ literal[string] ]= identifier[id] identifier[request] [ lit...
def delete(self, id, product_id, session): """taobao.product.img.delete 删除产品非主图 1.传入非主图ID 2.传入产品ID 删除产品非主图""" request = TOPRequest('taobao.product.img.delete') request['id'] = id request['product_id'] = product_id self.create(self.execute(request, session)['product_img']) return...
def decode_packet(data): """decode the data, return some kind of PDU.""" if _debug: decode_packet._debug("decode_packet %r", data) # empty strings are some other kind of pcap content if not data: return None # assume it is ethernet for now d = decode_ethernet(data) pduSource = Addr...
def function[decode_packet, parameter[data]]: constant[decode the data, return some kind of PDU.] if name[_debug] begin[:] call[name[decode_packet]._debug, parameter[constant[decode_packet %r], name[data]]] if <ast.UnaryOp object at 0x7da2041d9f60> begin[:] return[constan...
keyword[def] identifier[decode_packet] ( identifier[data] ): literal[string] keyword[if] identifier[_debug] : identifier[decode_packet] . identifier[_debug] ( literal[string] , identifier[data] ) keyword[if] keyword[not] identifier[data] : keyword[return] keyword[None] ...
def decode_packet(data): """decode the data, return some kind of PDU.""" if _debug: decode_packet._debug('decode_packet %r', data) # depends on [control=['if'], data=[]] # empty strings are some other kind of pcap content if not data: return None # depends on [control=['if'], data=[]] ...
def aggregate_task_losses(hparams, problem_hparams, logits, feature_name, feature): """Multiproblem loss function.""" # If no reweighting, we want the default loss to mimic the LM loss. if not hparams.multipro...
def function[aggregate_task_losses, parameter[hparams, problem_hparams, logits, feature_name, feature]]: constant[Multiproblem loss function.] if <ast.UnaryOp object at 0x7da18c4cf0d0> begin[:] return[call[name[aggregate_task_lm_losses], parameter[]]] variable[summaries] assign[=] list[[...
keyword[def] identifier[aggregate_task_losses] ( identifier[hparams] , identifier[problem_hparams] , identifier[logits] , identifier[feature_name] , identifier[feature] ): literal[string] keyword[if] keyword[not] identifier[hparams] . identifier[multiproblem_reweight_label_loss] : keyword[return...
def aggregate_task_losses(hparams, problem_hparams, logits, feature_name, feature): """Multiproblem loss function.""" # If no reweighting, we want the default loss to mimic the LM loss. if not hparams.multiproblem_reweight_label_loss: return aggregate_task_lm_losses(hparams=hparams, problem_hparams=...
def get_upscaled_value_tuple(self): """ Scales an RGB color object from decimal 0.0-1.0 to int 0-255. """ # Scale up to 0-255 values. rgb_r = int(math.floor(0.5 + self.rgb_r * 255)) rgb_g = int(math.floor(0.5 + self.rgb_g * 255)) rgb_b = int(math.floor(0.5 + self....
def function[get_upscaled_value_tuple, parameter[self]]: constant[ Scales an RGB color object from decimal 0.0-1.0 to int 0-255. ] variable[rgb_r] assign[=] call[name[int], parameter[call[name[math].floor, parameter[binary_operation[constant[0.5] + binary_operation[name[self].rgb_r * con...
keyword[def] identifier[get_upscaled_value_tuple] ( identifier[self] ): literal[string] identifier[rgb_r] = identifier[int] ( identifier[math] . identifier[floor] ( literal[int] + identifier[self] . identifier[rgb_r] * literal[int] )) identifier[rgb_g] = identifier[int] ( identifi...
def get_upscaled_value_tuple(self): """ Scales an RGB color object from decimal 0.0-1.0 to int 0-255. """ # Scale up to 0-255 values. rgb_r = int(math.floor(0.5 + self.rgb_r * 255)) rgb_g = int(math.floor(0.5 + self.rgb_g * 255)) rgb_b = int(math.floor(0.5 + self.rgb_b * 255)) re...
def _precompute_absense_costs(dictionary, removal_costs, insertion_costs, n, allow_spaces=False): """ Вычисляет минимальную стоимость появления нового символа в узлах словаря в соответствии со штрафами из costs Аргументы: --------------- dictionary : Trie с...
def function[_precompute_absense_costs, parameter[dictionary, removal_costs, insertion_costs, n, allow_spaces]]: constant[ Вычисляет минимальную стоимость появления нового символа в узлах словаря в соответствии со штрафами из costs Аргументы: --------------- dictionary : Trie словар...
keyword[def] identifier[_precompute_absense_costs] ( identifier[dictionary] , identifier[removal_costs] , identifier[insertion_costs] , identifier[n] , identifier[allow_spaces] = keyword[False] ): literal[string] identifier[answer] =[ identifier[dict] () keyword[for] identifier[node] keyword[in] identi...
def _precompute_absense_costs(dictionary, removal_costs, insertion_costs, n, allow_spaces=False): """ Вычисляет минимальную стоимость появления нового символа в узлах словаря в соответствии со штрафами из costs Аргументы: --------------- dictionary : Trie словарь, хранящийся в виде ацик...
def feed(self, *args): '''Set the input(s) for the next operation by replacing the terminal nodes. The arguments can be either layer names or the actual layers. ''' assert len(args) != 0 self.terminals = [] for fed_layer in args: if isinstance(fed_layer, str):...
def function[feed, parameter[self]]: constant[Set the input(s) for the next operation by replacing the terminal nodes. The arguments can be either layer names or the actual layers. ] assert[compare[call[name[len], parameter[name[args]]] not_equal[!=] constant[0]]] name[self].terminal...
keyword[def] identifier[feed] ( identifier[self] ,* identifier[args] ): literal[string] keyword[assert] identifier[len] ( identifier[args] )!= literal[int] identifier[self] . identifier[terminals] =[] keyword[for] identifier[fed_layer] keyword[in] identifier[args] : ...
def feed(self, *args): """Set the input(s) for the next operation by replacing the terminal nodes. The arguments can be either layer names or the actual layers. """ assert len(args) != 0 self.terminals = [] for fed_layer in args: if isinstance(fed_layer, str): try: ...
def _badpath(path, base): """ joinpath will ignore base if path is absolute. """ return not _resolved(os.path.join(base, path)).startswith(base)
def function[_badpath, parameter[path, base]]: constant[ joinpath will ignore base if path is absolute. ] return[<ast.UnaryOp object at 0x7da20c6a92d0>]
keyword[def] identifier[_badpath] ( identifier[path] , identifier[base] ): literal[string] keyword[return] keyword[not] identifier[_resolved] ( identifier[os] . identifier[path] . identifier[join] ( identifier[base] , identifier[path] )). identifier[startswith] ( identifier[base] )
def _badpath(path, base): """ joinpath will ignore base if path is absolute. """ return not _resolved(os.path.join(base, path)).startswith(base)
def detectBOM(self): """Attempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return None""" bomDict = { codecs.BOM_UTF8: 'utf-8', codecs.BOM_UTF16_LE: 'utf-16-le', codecs.BOM_...
def function[detectBOM, parameter[self]]: constant[Attempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return None] variable[bomDict] assign[=] dictionary[[<ast.Attribute object at 0x7da204623220>, ...
keyword[def] identifier[detectBOM] ( identifier[self] ): literal[string] identifier[bomDict] ={ identifier[codecs] . identifier[BOM_UTF8] : literal[string] , identifier[codecs] . identifier[BOM_UTF16_LE] : literal[string] , identifier[codecs] . identifier[BOM_UTF16_BE] : literal[s...
def detectBOM(self): """Attempts to detect at BOM at the start of the stream. If an encoding can be determined from the BOM return the name of the encoding otherwise return None""" bomDict = {codecs.BOM_UTF8: 'utf-8', codecs.BOM_UTF16_LE: 'utf-16-le', codecs.BOM_UTF16_BE: 'utf-16-be', codecs.BOM...
def register_admin_models(admin_site): """Registers dynamically created preferences models for Admin interface. :param admin.AdminSite admin_site: AdminSite object. """ global __MODELS_REGISTRY prefs = get_prefs() for app_label, prefs_items in prefs.items(): model_class = get_pref_m...
def function[register_admin_models, parameter[admin_site]]: constant[Registers dynamically created preferences models for Admin interface. :param admin.AdminSite admin_site: AdminSite object. ] <ast.Global object at 0x7da1afe1bd30> variable[prefs] assign[=] call[name[get_prefs], parameter[...
keyword[def] identifier[register_admin_models] ( identifier[admin_site] ): literal[string] keyword[global] identifier[__MODELS_REGISTRY] identifier[prefs] = identifier[get_prefs] () keyword[for] identifier[app_label] , identifier[prefs_items] keyword[in] identifier[prefs] . identifier[item...
def register_admin_models(admin_site): """Registers dynamically created preferences models for Admin interface. :param admin.AdminSite admin_site: AdminSite object. """ global __MODELS_REGISTRY prefs = get_prefs() for (app_label, prefs_items) in prefs.items(): model_class = get_pref_mo...
def do_grep(self, path, match): """ grep's work horse """ try: children = self.get_children(path) except (NoNodeError, NoAuthError): children = [] for child in children: full_path = os.path.join(path, child) try: value, _ =...
def function[do_grep, parameter[self, path, match]]: constant[ grep's work horse ] <ast.Try object at 0x7da20c9920e0> for taget[name[child]] in starred[name[children]] begin[:] variable[full_path] assign[=] call[name[os].path.join, parameter[name[path], name[child]]] <ast.Try...
keyword[def] identifier[do_grep] ( identifier[self] , identifier[path] , identifier[match] ): literal[string] keyword[try] : identifier[children] = identifier[self] . identifier[get_children] ( identifier[path] ) keyword[except] ( identifier[NoNodeError] , identifier[NoAuthErr...
def do_grep(self, path, match): """ grep's work horse """ try: children = self.get_children(path) # depends on [control=['try'], data=[]] except (NoNodeError, NoAuthError): children = [] # depends on [control=['except'], data=[]] for child in children: full_path = os.path.join(...
def depth(args): """ %prog depth DP.tsv Plot read depths across all TREDs. """ import seaborn as sns p = OptionParser(depth.__doc__) opts, args, iopts = p.set_image_options(args, figsize="14x14") if len(args) != 1: sys.exit(not p.print_help()) tsvfile, = args fig, ((a...
def function[depth, parameter[args]]: constant[ %prog depth DP.tsv Plot read depths across all TREDs. ] import module[seaborn] as alias[sns] variable[p] assign[=] call[name[OptionParser], parameter[name[depth].__doc__]] <ast.Tuple object at 0x7da1b084c370> assign[=] call[name[p]...
keyword[def] identifier[depth] ( identifier[args] ): literal[string] keyword[import] identifier[seaborn] keyword[as] identifier[sns] identifier[p] = identifier[OptionParser] ( identifier[depth] . identifier[__doc__] ) identifier[opts] , identifier[args] , identifier[iopts] = identifier[p] . ...
def depth(args): """ %prog depth DP.tsv Plot read depths across all TREDs. """ import seaborn as sns p = OptionParser(depth.__doc__) (opts, args, iopts) = p.set_image_options(args, figsize='14x14') if len(args) != 1: sys.exit(not p.print_help()) # depends on [control=['if'], da...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: FieldTypeContext for this FieldTypeInstance :rtype: twilio.rest.autopilot.v1.assistant.field_type...
def function[_proxy, parameter[self]]: constant[ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: FieldTypeContext for this FieldTypeInstance :rtype: twilio.rest.autopi...
keyword[def] identifier[_proxy] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_context] keyword[is] keyword[None] : identifier[self] . identifier[_context] = identifier[FieldTypeContext] ( identifier[self] . identifier[_version] , ...
def _proxy(self): """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context :returns: FieldTypeContext for this FieldTypeInstance :rtype: twilio.rest.autopilot.v1.assistant.field_type.Fie...
def startTimer(self): """Starts the timer for this source""" self.td = self.t.start(self.inter) if self.use_ssh and self.ssh_connector: self.ssh_client.connect()
def function[startTimer, parameter[self]]: constant[Starts the timer for this source] name[self].td assign[=] call[name[self].t.start, parameter[name[self].inter]] if <ast.BoolOp object at 0x7da2044c2980> begin[:] call[name[self].ssh_client.connect, parameter[]]
keyword[def] identifier[startTimer] ( identifier[self] ): literal[string] identifier[self] . identifier[td] = identifier[self] . identifier[t] . identifier[start] ( identifier[self] . identifier[inter] ) keyword[if] identifier[self] . identifier[use_ssh] keyword[and] identifier[self] ....
def startTimer(self): """Starts the timer for this source""" self.td = self.t.start(self.inter) if self.use_ssh and self.ssh_connector: self.ssh_client.connect() # depends on [control=['if'], data=[]]
def load_js(abspath, default=dict(), compress=False, enable_verbose=True): """Load Json from file. If file are not exists, returns ``default``. :param abspath: File path. Use absolute path as much as you can. File extension has to be ``.json`` or ``.gz``. (for compressed Json) :type abspath: strin...
def function[load_js, parameter[abspath, default, compress, enable_verbose]]: constant[Load Json from file. If file are not exists, returns ``default``. :param abspath: File path. Use absolute path as much as you can. File extension has to be ``.json`` or ``.gz``. (for compressed Json) :type a...
keyword[def] identifier[load_js] ( identifier[abspath] , identifier[default] = identifier[dict] (), identifier[compress] = keyword[False] , identifier[enable_verbose] = keyword[True] ): literal[string] identifier[abspath] = identifier[str] ( identifier[abspath] ) keyword[if] identifier[compress] : ...
def load_js(abspath, default=dict(), compress=False, enable_verbose=True): """Load Json from file. If file are not exists, returns ``default``. :param abspath: File path. Use absolute path as much as you can. File extension has to be ``.json`` or ``.gz``. (for compressed Json) :type abspath: strin...
def compute_evolution_by_frequency( df, id_cols: List[str], date_col: Union[str, Dict[str, str]], value_col: str, freq=1, method: str = 'abs', format: str = 'column', offseted_suffix: str = '_offseted', evolution_col_name: str = 'evolution_computed', missing_date_as_zero: bool = ...
def function[compute_evolution_by_frequency, parameter[df, id_cols, date_col, value_col, freq, method, format, offseted_suffix, evolution_col_name, missing_date_as_zero, raise_duplicate_error]]: constant[ This function answers the question: how has a value changed on a weekly, monthly, yearly basis ? -...
keyword[def] identifier[compute_evolution_by_frequency] ( identifier[df] , identifier[id_cols] : identifier[List] [ identifier[str] ], identifier[date_col] : identifier[Union] [ identifier[str] , identifier[Dict] [ identifier[str] , identifier[str] ]], identifier[value_col] : identifier[str] , identifier[freq] =...
def compute_evolution_by_frequency(df, id_cols: List[str], date_col: Union[str, Dict[str, str]], value_col: str, freq=1, method: str='abs', format: str='column', offseted_suffix: str='_offseted', evolution_col_name: str='evolution_computed', missing_date_as_zero: bool=False, raise_duplicate_error: bool=True): """ ...
def GetMessages(self, formatter_mediator, event): """Determines the formatted message strings for an event object. Args: formatter_mediator (FormatterMediator): mediates the interactions between formatters and other components, such as storage and Windows EventLog resources. eve...
def function[GetMessages, parameter[self, formatter_mediator, event]]: constant[Determines the formatted message strings for an event object. Args: formatter_mediator (FormatterMediator): mediates the interactions between formatters and other components, such as storage and Windows EventLog...
keyword[def] identifier[GetMessages] ( identifier[self] , identifier[formatter_mediator] , identifier[event] ): literal[string] keyword[if] identifier[self] . identifier[DATA_TYPE] != identifier[event] . identifier[data_type] : keyword[raise] identifier[errors] . identifier[WrongFormatter] ( liter...
def GetMessages(self, formatter_mediator, event): """Determines the formatted message strings for an event object. Args: formatter_mediator (FormatterMediator): mediates the interactions between formatters and other components, such as storage and Windows EventLog resources. eve...
def set_or_edit_conditional_breakpoint(self): """Set conditional breakpoint""" if self.data: editor = self.get_current_editor() editor.debugger.toogle_breakpoint(edit_condition=True)
def function[set_or_edit_conditional_breakpoint, parameter[self]]: constant[Set conditional breakpoint] if name[self].data begin[:] variable[editor] assign[=] call[name[self].get_current_editor, parameter[]] call[name[editor].debugger.toogle_breakpoint, parameter[]]
keyword[def] identifier[set_or_edit_conditional_breakpoint] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[data] : identifier[editor] = identifier[self] . identifier[get_current_editor] () identifier[editor] . identifier[debugger] . id...
def set_or_edit_conditional_breakpoint(self): """Set conditional breakpoint""" if self.data: editor = self.get_current_editor() editor.debugger.toogle_breakpoint(edit_condition=True) # depends on [control=['if'], data=[]]
def delete(self, callback=None, errback=None): """ Delete the record from the zone, including all advanced configuration, meta data, etc. """ if not self.data: raise RecordException('record not loaded') def success(result, *args): if callback: ...
def function[delete, parameter[self, callback, errback]]: constant[ Delete the record from the zone, including all advanced configuration, meta data, etc. ] if <ast.UnaryOp object at 0x7da1b068a290> begin[:] <ast.Raise object at 0x7da1b068b340> def function[succes...
keyword[def] identifier[delete] ( identifier[self] , identifier[callback] = keyword[None] , identifier[errback] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[data] : keyword[raise] identifier[RecordException] ( literal[string] ) ...
def delete(self, callback=None, errback=None): """ Delete the record from the zone, including all advanced configuration, meta data, etc. """ if not self.data: raise RecordException('record not loaded') # depends on [control=['if'], data=[]] def success(result, *args): ...
def camera_disable(self, camera_id, **kwargs): """Disable camera.""" api = self._api_info['camera'] payload = dict({ '_sid': self._sid, 'api': api['name'], 'method': 'Disable', 'version': 9, 'idList': camera_id, }, **kwargs) ...
def function[camera_disable, parameter[self, camera_id]]: constant[Disable camera.] variable[api] assign[=] call[name[self]._api_info][constant[camera]] variable[payload] assign[=] call[name[dict], parameter[dictionary[[<ast.Constant object at 0x7da1b02850c0>, <ast.Constant object at 0x7da1b0286...
keyword[def] identifier[camera_disable] ( identifier[self] , identifier[camera_id] ,** identifier[kwargs] ): literal[string] identifier[api] = identifier[self] . identifier[_api_info] [ literal[string] ] identifier[payload] = identifier[dict] ({ literal[string] : identifier[self] ...
def camera_disable(self, camera_id, **kwargs): """Disable camera.""" api = self._api_info['camera'] payload = dict({'_sid': self._sid, 'api': api['name'], 'method': 'Disable', 'version': 9, 'idList': camera_id}, **kwargs) print(api['url']) print(payload) response = self._get(api['url'], payload)...
def add_named_concept_filters(self, named_filter_concepts): """ Adds named concept filters :param named_filter_concepts: dict with named filter concepts which will be mapped as the key as query param and the value as search string """ for concept_key, concept_name in named_filte...
def function[add_named_concept_filters, parameter[self, named_filter_concepts]]: constant[ Adds named concept filters :param named_filter_concepts: dict with named filter concepts which will be mapped as the key as query param and the value as search string ] for taget[tuple[[<a...
keyword[def] identifier[add_named_concept_filters] ( identifier[self] , identifier[named_filter_concepts] ): literal[string] keyword[for] identifier[concept_key] , identifier[concept_name] keyword[in] identifier[named_filter_concepts] . identifier[items] (): identifier[self] . ident...
def add_named_concept_filters(self, named_filter_concepts): """ Adds named concept filters :param named_filter_concepts: dict with named filter concepts which will be mapped as the key as query param and the value as search string """ for (concept_key, concept_name) in named_filter_conc...
def _keep( word_freq: int, min_freq: int, min_len: int, max_len: int, dict_filter: Callable[[str], bool], ): """ Keep only Thai words with at least min_freq frequency and has length between min_len and max_len characters """ if not word_freq or word_freq[1] < min_freq: re...
def function[_keep, parameter[word_freq, min_freq, min_len, max_len, dict_filter]]: constant[ Keep only Thai words with at least min_freq frequency and has length between min_len and max_len characters ] if <ast.BoolOp object at 0x7da1b17a4940> begin[:] return[constant[False]] ...
keyword[def] identifier[_keep] ( identifier[word_freq] : identifier[int] , identifier[min_freq] : identifier[int] , identifier[min_len] : identifier[int] , identifier[max_len] : identifier[int] , identifier[dict_filter] : identifier[Callable] [[ identifier[str] ], identifier[bool] ], ): literal[string] ...
def _keep(word_freq: int, min_freq: int, min_len: int, max_len: int, dict_filter: Callable[[str], bool]): """ Keep only Thai words with at least min_freq frequency and has length between min_len and max_len characters """ if not word_freq or word_freq[1] < min_freq: return False # depends o...
def merge(self, imgs): """Merge image channels. Parameters ---------- imgs : `list` of `PIL.Image.Image` Returns ------- `PIL.Image.Image` Raises ------ ValueError If image channel list is empty. """ if not im...
def function[merge, parameter[self, imgs]]: constant[Merge image channels. Parameters ---------- imgs : `list` of `PIL.Image.Image` Returns ------- `PIL.Image.Image` Raises ------ ValueError If image channel list is empty. ...
keyword[def] identifier[merge] ( identifier[self] , identifier[imgs] ): literal[string] keyword[if] keyword[not] identifier[imgs] : keyword[raise] identifier[ValueError] ( literal[string] ) keyword[if] identifier[len] ( identifier[imgs] )== literal[int] : keyw...
def merge(self, imgs): """Merge image channels. Parameters ---------- imgs : `list` of `PIL.Image.Image` Returns ------- `PIL.Image.Image` Raises ------ ValueError If image channel list is empty. """ if not imgs: ...
def resource_response(resource, depth=0): """Return a response for the *resource* of the appropriate content type. :param resource: resource to be returned in request :type resource: :class:`sandman.model.Model` :rtype: :class:`flask.Response` """ if _get_acceptable_response_type() == JSON: ...
def function[resource_response, parameter[resource, depth]]: constant[Return a response for the *resource* of the appropriate content type. :param resource: resource to be returned in request :type resource: :class:`sandman.model.Model` :rtype: :class:`flask.Response` ] if compare[call...
keyword[def] identifier[resource_response] ( identifier[resource] , identifier[depth] = literal[int] ): literal[string] keyword[if] identifier[_get_acceptable_response_type] ()== identifier[JSON] : identifier[depth] = literal[int] keyword[if] literal[string] keyword[in] identifier[re...
def resource_response(resource, depth=0): """Return a response for the *resource* of the appropriate content type. :param resource: resource to be returned in request :type resource: :class:`sandman.model.Model` :rtype: :class:`flask.Response` """ if _get_acceptable_response_type() == JSON: ...
def _parse_msg_for_mongodb(self, msgs): ''' >>> mdbf = MongoDBForwarder('no_host', '27017', 'deadpool', ... 'chimichanga', 'logs', 'collection') >>> log = [{u'data': {u'_': {u'file': u'log.py', ... u'fn': u'start', ... ...
def function[_parse_msg_for_mongodb, parameter[self, msgs]]: constant[ >>> mdbf = MongoDBForwarder('no_host', '27017', 'deadpool', ... 'chimichanga', 'logs', 'collection') >>> log = [{u'data': {u'_': {u'file': u'log.py', ... u'fn': u...
keyword[def] identifier[_parse_msg_for_mongodb] ( identifier[self] , identifier[msgs] ): literal[string] identifier[msgs_list] =[] keyword[for] identifier[msg] keyword[in] identifier[msgs] : keyword[try] : identifier[msg] [ literal[string] ]= identifier[msg...
def _parse_msg_for_mongodb(self, msgs): """ >>> mdbf = MongoDBForwarder('no_host', '27017', 'deadpool', ... 'chimichanga', 'logs', 'collection') >>> log = [{u'data': {u'_': {u'file': u'log.py', ... u'fn': u'start', ... ...
def as_dict(self): """ Json-serializable dict representation of PhononDos. """ return {"@module": self.__class__.__module__, "@class": self.__class__.__name__, "frequencies": list(self.frequencies), "densities": list(self.densities)}
def function[as_dict, parameter[self]]: constant[ Json-serializable dict representation of PhononDos. ] return[dictionary[[<ast.Constant object at 0x7da20c6c5ff0>, <ast.Constant object at 0x7da20c6c5ae0>, <ast.Constant object at 0x7da20c6c6e30>, <ast.Constant object at 0x7da20c6c7460>], [<as...
keyword[def] identifier[as_dict] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[__class__] . identifier[__module__] , literal[string] : identifier[self] . identifier[__class__] . identifier[__name__] , literal[string] : iden...
def as_dict(self): """ Json-serializable dict representation of PhononDos. """ return {'@module': self.__class__.__module__, '@class': self.__class__.__name__, 'frequencies': list(self.frequencies), 'densities': list(self.densities)}
def request_absolute_cursor_position(self): """ Get current cursor position. For vt100: Do CPR request. (answer will arrive later.) For win32: Do API call. (Answer comes immediately.) """ # Only do this request when the cursor is at the top row. (after a # clear o...
def function[request_absolute_cursor_position, parameter[self]]: constant[ Get current cursor position. For vt100: Do CPR request. (answer will arrive later.) For win32: Do API call. (Answer comes immediately.) ] assert[compare[name[self]._cursor_pos.y equal[==] constant[0]]]...
keyword[def] identifier[request_absolute_cursor_position] ( identifier[self] ): literal[string] keyword[assert] identifier[self] . identifier[_cursor_pos] . identifier[y] == literal[int] keyword[if] identifier[is_windows] (): identifier[...
def request_absolute_cursor_position(self): """ Get current cursor position. For vt100: Do CPR request. (answer will arrive later.) For win32: Do API call. (Answer comes immediately.) """ # Only do this request when the cursor is at the top row. (after a # clear or reset). We...
def _length_hint(obj): """Returns the length hint of an object.""" try: return len(obj) except (AttributeError, TypeError): try: get_hint = type(obj).__length_hint__ except AttributeError: return None try: hint = get_hint(obj) excep...
def function[_length_hint, parameter[obj]]: constant[Returns the length hint of an object.] <ast.Try object at 0x7da18ede50c0>
keyword[def] identifier[_length_hint] ( identifier[obj] ): literal[string] keyword[try] : keyword[return] identifier[len] ( identifier[obj] ) keyword[except] ( identifier[AttributeError] , identifier[TypeError] ): keyword[try] : identifier[get_hint] = identifier[type] (...
def _length_hint(obj): """Returns the length hint of an object.""" try: return len(obj) # depends on [control=['try'], data=[]] except (AttributeError, TypeError): try: get_hint = type(obj).__length_hint__ # depends on [control=['try'], data=[]] except AttributeError: ...
def decrypt_message(encrypted_data, decryption_key): """Function parses an ASN.1 encrypted message and extracts/decrypts the original message. :param encrypted_data: A CMS ASN.1 byte string containing the encrypted data. :param decryption_key: The key to be used for decrypting the data. ...
def function[decrypt_message, parameter[encrypted_data, decryption_key]]: constant[Function parses an ASN.1 encrypted message and extracts/decrypts the original message. :param encrypted_data: A CMS ASN.1 byte string containing the encrypted data. :param decryption_key: The key to be...
keyword[def] identifier[decrypt_message] ( identifier[encrypted_data] , identifier[decryption_key] ): literal[string] identifier[cms_content] = identifier[cms] . identifier[ContentInfo] . identifier[load] ( identifier[encrypted_data] ) identifier[cipher] , identifier[decrypted_content] = keyword[None...
def decrypt_message(encrypted_data, decryption_key): """Function parses an ASN.1 encrypted message and extracts/decrypts the original message. :param encrypted_data: A CMS ASN.1 byte string containing the encrypted data. :param decryption_key: The key to be used for decrypting the data. ...
def addDocEntity(self, name, type, ExternalID, SystemID, content): """Register a new entity for this document. """ ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content) if ret is None:raise treeError('xmlAddDocEntity() failed') __tmp = xmlEntity(_obj=ret) ...
def function[addDocEntity, parameter[self, name, type, ExternalID, SystemID, content]]: constant[Register a new entity for this document. ] variable[ret] assign[=] call[name[libxml2mod].xmlAddDocEntity, parameter[name[self]._o, name[name], name[type], name[ExternalID], name[SystemID], name[content]]] ...
keyword[def] identifier[addDocEntity] ( identifier[self] , identifier[name] , identifier[type] , identifier[ExternalID] , identifier[SystemID] , identifier[content] ): literal[string] identifier[ret] = identifier[libxml2mod] . identifier[xmlAddDocEntity] ( identifier[self] . identifier[_o] , identi...
def addDocEntity(self, name, type, ExternalID, SystemID, content): """Register a new entity for this document. """ ret = libxml2mod.xmlAddDocEntity(self._o, name, type, ExternalID, SystemID, content) if ret is None: raise treeError('xmlAddDocEntity() failed') # depends on [control=['if'], data=[]] ...
def unblock(self, item: str) -> None: """ Unblock an item and/or reset it's fail count :param str item: The item to unblock """ assert item is not None item = self._encode_item(item) watchlist_key = self.__redis_conf['watchlist_template'].format(item) bla...
def function[unblock, parameter[self, item]]: constant[ Unblock an item and/or reset it's fail count :param str item: The item to unblock ] assert[compare[name[item] is_not constant[None]]] variable[item] assign[=] call[name[self]._encode_item, parameter[name[item]]] ...
keyword[def] identifier[unblock] ( identifier[self] , identifier[item] : identifier[str] )-> keyword[None] : literal[string] keyword[assert] identifier[item] keyword[is] keyword[not] keyword[None] identifier[item] = identifier[self] . identifier[_encode_item] ( identifier[item] ) ...
def unblock(self, item: str) -> None: """ Unblock an item and/or reset it's fail count :param str item: The item to unblock """ assert item is not None item = self._encode_item(item) watchlist_key = self.__redis_conf['watchlist_template'].format(item) blacklist_key = self.__...
def read_string(self, content): """ Reads a Python string that contains C++ code, and return the declarations tree. """ header_file = utils.create_temp_file_name(suffix='.h') with open(header_file, "w+") as f: f.write(content) try: decls...
def function[read_string, parameter[self, content]]: constant[ Reads a Python string that contains C++ code, and return the declarations tree. ] variable[header_file] assign[=] call[name[utils].create_temp_file_name, parameter[]] with call[name[open], parameter[name[head...
keyword[def] identifier[read_string] ( identifier[self] , identifier[content] ): literal[string] identifier[header_file] = identifier[utils] . identifier[create_temp_file_name] ( identifier[suffix] = literal[string] ) keyword[with] identifier[open] ( identifier[header_file] , literal[str...
def read_string(self, content): """ Reads a Python string that contains C++ code, and return the declarations tree. """ header_file = utils.create_temp_file_name(suffix='.h') with open(header_file, 'w+') as f: f.write(content) # depends on [control=['with'], data=['f']] ...
def plot_spectra_pages_pdf(ss, pdf_filename='pages.pdf', setup=_default_setup): """ Plots spectra into a PDF file, one spectrum per page. Splits into several pieces of width Args: ss: list of Spectrum objects pdf_filename: name of output file """ logger = a99.get_python_logger() ...
def function[plot_spectra_pages_pdf, parameter[ss, pdf_filename, setup]]: constant[ Plots spectra into a PDF file, one spectrum per page. Splits into several pieces of width Args: ss: list of Spectrum objects pdf_filename: name of output file ] variable[logger] assign[=] ca...
keyword[def] identifier[plot_spectra_pages_pdf] ( identifier[ss] , identifier[pdf_filename] = literal[string] , identifier[setup] = identifier[_default_setup] ): literal[string] identifier[logger] = identifier[a99] . identifier[get_python_logger] () identifier[xmin] , identifier[xmax] , identifier[ymi...
def plot_spectra_pages_pdf(ss, pdf_filename='pages.pdf', setup=_default_setup): """ Plots spectra into a PDF file, one spectrum per page. Splits into several pieces of width Args: ss: list of Spectrum objects pdf_filename: name of output file """ logger = a99.get_python_logger() ...
def get_gradients(self, analytes=None, win=15, filt=False, samples=None, subset=None, recalc=True): """ Collect all data from all samples into a single array. Data from standards is not collected. Parameters ---------- filt : str, dict or bool Either logical ...
def function[get_gradients, parameter[self, analytes, win, filt, samples, subset, recalc]]: constant[ Collect all data from all samples into a single array. Data from standards is not collected. Parameters ---------- filt : str, dict or bool Either logical fi...
keyword[def] identifier[get_gradients] ( identifier[self] , identifier[analytes] = keyword[None] , identifier[win] = literal[int] , identifier[filt] = keyword[False] , identifier[samples] = keyword[None] , identifier[subset] = keyword[None] , identifier[recalc] = keyword[True] ): literal[string] ke...
def get_gradients(self, analytes=None, win=15, filt=False, samples=None, subset=None, recalc=True): """ Collect all data from all samples into a single array. Data from standards is not collected. Parameters ---------- filt : str, dict or bool Either logical filt...
def SegmentMax(a, ids): """ Segmented max op. """ func = lambda idxs: np.amax(a[idxs], axis=0) return seg_map(func, a, ids),
def function[SegmentMax, parameter[a, ids]]: constant[ Segmented max op. ] variable[func] assign[=] <ast.Lambda object at 0x7da1b06fe770> return[tuple[[<ast.Call object at 0x7da1b0651870>]]]
keyword[def] identifier[SegmentMax] ( identifier[a] , identifier[ids] ): literal[string] identifier[func] = keyword[lambda] identifier[idxs] : identifier[np] . identifier[amax] ( identifier[a] [ identifier[idxs] ], identifier[axis] = literal[int] ) keyword[return] identifier[seg_map] ( identifier[fu...
def SegmentMax(a, ids): """ Segmented max op. """ func = lambda idxs: np.amax(a[idxs], axis=0) return (seg_map(func, a, ids),)
def atrm_magic(meas_file, dir_path=".", input_dir_path="", input_spec_file='specimens.txt', output_spec_file='specimens.txt', data_model_num=3): """ Converts ATRM data to best-fit tensor (6 elements plus sigma) Parameters ---------- meas_file : str input measu...
def function[atrm_magic, parameter[meas_file, dir_path, input_dir_path, input_spec_file, output_spec_file, data_model_num]]: constant[ Converts ATRM data to best-fit tensor (6 elements plus sigma) Parameters ---------- meas_file : str input measurement file dir_path : str o...
keyword[def] identifier[atrm_magic] ( identifier[meas_file] , identifier[dir_path] = literal[string] , identifier[input_dir_path] = literal[string] , identifier[input_spec_file] = literal[string] , identifier[output_spec_file] = literal[string] , identifier[data_model_num] = literal[int] ): literal[string] ...
def atrm_magic(meas_file, dir_path='.', input_dir_path='', input_spec_file='specimens.txt', output_spec_file='specimens.txt', data_model_num=3): """ Converts ATRM data to best-fit tensor (6 elements plus sigma) Parameters ---------- meas_file : str input measurement file dir_path : str...
def encode(self, data, content_encoding="aes128gcm"): """Encrypt the data. :param data: A serialized block of byte data (String, JSON, bit array, etc.) Make sure that whatever you send, your client knows how to understand it. :type data: str :param content_encodi...
def function[encode, parameter[self, data, content_encoding]]: constant[Encrypt the data. :param data: A serialized block of byte data (String, JSON, bit array, etc.) Make sure that whatever you send, your client knows how to understand it. :type data: str :param...
keyword[def] identifier[encode] ( identifier[self] , identifier[data] , identifier[content_encoding] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[data] : keyword[return] keyword[if] keyword[not] identifier[self] . identifier[auth_key] ...
def encode(self, data, content_encoding='aes128gcm'): """Encrypt the data. :param data: A serialized block of byte data (String, JSON, bit array, etc.) Make sure that whatever you send, your client knows how to understand it. :type data: str :param content_encoding: ...
def get_anchor_diff(anchor): """Get the get_anchor_diff between an anchor and the current state of its source. Returns: A tuple of get_anchor_diff lines. If there is not different, then this returns an empty tuple. """ new_anchor = make_anchor( file_path=anchor.file_path, offset...
def function[get_anchor_diff, parameter[anchor]]: constant[Get the get_anchor_diff between an anchor and the current state of its source. Returns: A tuple of get_anchor_diff lines. If there is not different, then this returns an empty tuple. ] variable[new_anchor] assign[=] call[name[ma...
keyword[def] identifier[get_anchor_diff] ( identifier[anchor] ): literal[string] identifier[new_anchor] = identifier[make_anchor] ( identifier[file_path] = identifier[anchor] . identifier[file_path] , identifier[offset] = identifier[anchor] . identifier[context] . identifier[offset] , identi...
def get_anchor_diff(anchor): """Get the get_anchor_diff between an anchor and the current state of its source. Returns: A tuple of get_anchor_diff lines. If there is not different, then this returns an empty tuple. """ new_anchor = make_anchor(file_path=anchor.file_path, offset=anchor.context.o...
def broadcast_change(): ''' Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: .. code-block:: python ...
def function[broadcast_change, parameter[]]: constant[ Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: ...
keyword[def] identifier[broadcast_change] (): literal[string] identifier[_] , identifier[res] = identifier[win32gui] . identifier[SendMessageTimeout] ( identifier[win32con] . identifier[HWND_BROADCAST] , identifier[win32con] . identifier[WM_SETTINGCHANGE] , literal[int] , literal[int] , iden...
def broadcast_change(): """ Refresh the windows environment. .. note:: This will only effect new processes and windows. Services will not see the change until the system restarts. Returns: bool: True if successful, otherwise False Usage: .. code-block:: python ...
def p_expr_assign_op(p): '''expr : variable PLUS_EQUAL expr | variable MINUS_EQUAL expr | variable MUL_EQUAL expr | variable DIV_EQUAL expr | variable CONCAT_EQUAL expr | variable MOD_EQUAL expr | variable AND_EQUAL expr | variable ...
def function[p_expr_assign_op, parameter[p]]: constant[expr : variable PLUS_EQUAL expr | variable MINUS_EQUAL expr | variable MUL_EQUAL expr | variable DIV_EQUAL expr | variable CONCAT_EQUAL expr | variable MOD_EQUAL expr | variable AND_EQU...
keyword[def] identifier[p_expr_assign_op] ( identifier[p] ): literal[string] identifier[p] [ literal[int] ]= identifier[ast] . identifier[AssignOp] ( identifier[p] [ literal[int] ], identifier[p] [ literal[int] ], identifier[p] [ literal[int] ], identifier[lineno] = identifier[p] . identifier[lineno] ( lit...
def p_expr_assign_op(p): """expr : variable PLUS_EQUAL expr | variable MINUS_EQUAL expr | variable MUL_EQUAL expr | variable DIV_EQUAL expr | variable CONCAT_EQUAL expr | variable MOD_EQUAL expr | variable AND_EQUAL expr | variable ...
def certs(self, entity_id, descriptor, use="signing"): ''' Returns certificates for the given Entity ''' ent = self[entity_id] def extract_certs(srvs): res = [] for srv in srvs: if "key_descriptor" in srv: for key in sr...
def function[certs, parameter[self, entity_id, descriptor, use]]: constant[ Returns certificates for the given Entity ] variable[ent] assign[=] call[name[self]][name[entity_id]] def function[extract_certs, parameter[srvs]]: variable[res] assign[=] list[[]] ...
keyword[def] identifier[certs] ( identifier[self] , identifier[entity_id] , identifier[descriptor] , identifier[use] = literal[string] ): literal[string] identifier[ent] = identifier[self] [ identifier[entity_id] ] keyword[def] identifier[extract_certs] ( identifier[srvs] ): ...
def certs(self, entity_id, descriptor, use='signing'): """ Returns certificates for the given Entity """ ent = self[entity_id] def extract_certs(srvs): res = [] for srv in srvs: if 'key_descriptor' in srv: for key in srv['key_descriptor']: ...
def cb(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__cb_url = self.__cb_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__cb_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) ...
def function[cb, parameter[self, min_volume]]: constant[以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 ] name[self].__cb_url assign[=] call[name[self].__cb_url.format, parameter[]] variable[rep] assign[=] call[name[requests].get, parameter[name[self].__cb_url]] variable[fundj...
keyword[def] identifier[cb] ( identifier[self] , identifier[min_volume] = literal[int] ): literal[string] identifier[self] . identifier[__cb_url] = identifier[self] . identifier[__cb_url] . identifier[format] ( identifier[ctime] = identifier[int] ( identifier[time] . identifier[time] ())) ...
def cb(self, min_volume=0): """以字典形式返回QDII数据 :param min_volume:最小交易量,单位万元 """ # 添加当前的ctime self.__cb_url = self.__cb_url.format(ctime=int(time.time())) # 请求数据 rep = requests.get(self.__cb_url) # 获取返回的json字符串 fundjson = json.loads(rep.text) # 格式化返回的json字符串 data = self....
def _executor_script(self): """Create shell-script in charge of executing the benchmark and return its path. """ fd, path = tempfile.mkstemp(suffix='.sh', dir=os.getcwd()) os.close(fd) with open(path, 'w') as ostr: self._write_executor_script(ostr) mod...
def function[_executor_script, parameter[self]]: constant[Create shell-script in charge of executing the benchmark and return its path. ] <ast.Tuple object at 0x7da1b26add20> assign[=] call[name[tempfile].mkstemp, parameter[]] call[name[os].close, parameter[name[fd]]] wit...
keyword[def] identifier[_executor_script] ( identifier[self] ): literal[string] identifier[fd] , identifier[path] = identifier[tempfile] . identifier[mkstemp] ( identifier[suffix] = literal[string] , identifier[dir] = identifier[os] . identifier[getcwd] ()) identifier[os] . identifier[clos...
def _executor_script(self): """Create shell-script in charge of executing the benchmark and return its path. """ (fd, path) = tempfile.mkstemp(suffix='.sh', dir=os.getcwd()) os.close(fd) with open(path, 'w') as ostr: self._write_executor_script(ostr) # depends on [control=['with...
def wvalue(wave, indep_var): r""" Return the dependent variable value at a given independent variable point. If the independent variable point is not in the independent variable vector the dependent variable value is obtained by linear interpolation :param wave: Waveform :type wave: :py:class...
def function[wvalue, parameter[wave, indep_var]]: constant[ Return the dependent variable value at a given independent variable point. If the independent variable point is not in the independent variable vector the dependent variable value is obtained by linear interpolation :param wave: Wavef...
keyword[def] identifier[wvalue] ( identifier[wave] , identifier[indep_var] ): literal[string] identifier[close_min] = identifier[np] . identifier[isclose] ( identifier[indep_var] , identifier[wave] . identifier[_indep_vector] [ literal[int] ], identifier[FP_RTOL] , identifier[FP_ATOL] ) identifier[clo...
def wvalue(wave, indep_var): """ Return the dependent variable value at a given independent variable point. If the independent variable point is not in the independent variable vector the dependent variable value is obtained by linear interpolation :param wave: Waveform :type wave: :py:class:...
def run_task(message): """Internal ``RUN_TASK`` consumer to run the task's callable""" task = Task.objects.get(pk=message['id']) if task.allow_overlap: task.run(message) else: if not task.running: task.running = True task.save() try: ta...
def function[run_task, parameter[message]]: constant[Internal ``RUN_TASK`` consumer to run the task's callable] variable[task] assign[=] call[name[Task].objects.get, parameter[]] if name[task].allow_overlap begin[:] call[name[task].run, parameter[name[message]]]
keyword[def] identifier[run_task] ( identifier[message] ): literal[string] identifier[task] = identifier[Task] . identifier[objects] . identifier[get] ( identifier[pk] = identifier[message] [ literal[string] ]) keyword[if] identifier[task] . identifier[allow_overlap] : identifier[task] . ide...
def run_task(message): """Internal ``RUN_TASK`` consumer to run the task's callable""" task = Task.objects.get(pk=message['id']) if task.allow_overlap: task.run(message) # depends on [control=['if'], data=[]] elif not task.running: task.running = True task.save() try: ...
def _intersperse_insertion_rows_and_columns(self, pairwise_pvals): """Return pvals matrix with inserted NaN rows and columns, as numpy.ndarray. Each insertion (a header or a subtotal) creates an offset in the calculated pvals. These need to be taken into account when converting each pval to a ...
def function[_intersperse_insertion_rows_and_columns, parameter[self, pairwise_pvals]]: constant[Return pvals matrix with inserted NaN rows and columns, as numpy.ndarray. Each insertion (a header or a subtotal) creates an offset in the calculated pvals. These need to be taken into account when ...
keyword[def] identifier[_intersperse_insertion_rows_and_columns] ( identifier[self] , identifier[pairwise_pvals] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[self] . identifier[_insertion_indices] : identifier[pairwise_pvals] = identifier[np] . identifier[ins...
def _intersperse_insertion_rows_and_columns(self, pairwise_pvals): """Return pvals matrix with inserted NaN rows and columns, as numpy.ndarray. Each insertion (a header or a subtotal) creates an offset in the calculated pvals. These need to be taken into account when converting each pval to a ...
def sign_envelope(envelope, key_file): """Sign the given soap request with the given key""" doc = etree.fromstring(envelope) body = get_body(doc) queue = SignQueue() queue.push_and_mark(body) security_node = ensure_security_header(doc, queue) security_token_node = create_binary_security_to...
def function[sign_envelope, parameter[envelope, key_file]]: constant[Sign the given soap request with the given key] variable[doc] assign[=] call[name[etree].fromstring, parameter[name[envelope]]] variable[body] assign[=] call[name[get_body], parameter[name[doc]]] variable[queue] assign[...
keyword[def] identifier[sign_envelope] ( identifier[envelope] , identifier[key_file] ): literal[string] identifier[doc] = identifier[etree] . identifier[fromstring] ( identifier[envelope] ) identifier[body] = identifier[get_body] ( identifier[doc] ) identifier[queue] = identifier[SignQueue] () ...
def sign_envelope(envelope, key_file): """Sign the given soap request with the given key""" doc = etree.fromstring(envelope) body = get_body(doc) queue = SignQueue() queue.push_and_mark(body) security_node = ensure_security_header(doc, queue) security_token_node = create_binary_security_toke...
def all(self): """ Gets all saved queries for a project from the Keen IO API. Master key must be set. """ response = self._get_json(HTTPMethods.GET, self.saved_query_url, self._get_master_key()) return response
def function[all, parameter[self]]: constant[ Gets all saved queries for a project from the Keen IO API. Master key must be set. ] variable[response] assign[=] call[name[self]._get_json, parameter[name[HTTPMethods].GET, name[self].saved_query_url, call[name[self]._get_master_key,...
keyword[def] identifier[all] ( identifier[self] ): literal[string] identifier[response] = identifier[self] . identifier[_get_json] ( identifier[HTTPMethods] . identifier[GET] , identifier[self] . identifier[saved_query_url] , identifier[self] . identifier[_get_master_key] ()) keyword[ret...
def all(self): """ Gets all saved queries for a project from the Keen IO API. Master key must be set. """ response = self._get_json(HTTPMethods.GET, self.saved_query_url, self._get_master_key()) return response
def execute(self, request): '''Execute a new ``request``. ''' handle = None if request: request[0] = command = to_string(request[0]).lower() info = COMMANDS_INFO.get(command) if info: handle = getattr(self.store, info.method_name) ...
def function[execute, parameter[self, request]]: constant[Execute a new ``request``. ] variable[handle] assign[=] constant[None] if name[request] begin[:] call[name[request]][constant[0]] assign[=] call[call[name[to_string], parameter[call[name[request]][constant[0]]]].lo...
keyword[def] identifier[execute] ( identifier[self] , identifier[request] ): literal[string] identifier[handle] = keyword[None] keyword[if] identifier[request] : identifier[request] [ literal[int] ]= identifier[command] = identifier[to_string] ( identifier[request] [ literal...
def execute(self, request): """Execute a new ``request``. """ handle = None if request: request[0] = command = to_string(request[0]).lower() info = COMMANDS_INFO.get(command) if info: handle = getattr(self.store, info.method_name) # depends on [control=['if'], da...
def _check_wait_input_flag(self): """ Returns a function to stop the search of the investigated node of the ArciDispatch algorithm. :return: A function to stop the search. :rtype: (bool, str) -> bool """ wf_pred = self._wf_pred # Namespace shortcuts...
def function[_check_wait_input_flag, parameter[self]]: constant[ Returns a function to stop the search of the investigated node of the ArciDispatch algorithm. :return: A function to stop the search. :rtype: (bool, str) -> bool ] variable[wf_pred] assi...
keyword[def] identifier[_check_wait_input_flag] ( identifier[self] ): literal[string] identifier[wf_pred] = identifier[self] . identifier[_wf_pred] identifier[pred] ={ identifier[k] : identifier[set] ( identifier[v] ). identifier[issubset] keyword[for] identifier[k] , identifier[v] ke...
def _check_wait_input_flag(self): """ Returns a function to stop the search of the investigated node of the ArciDispatch algorithm. :return: A function to stop the search. :rtype: (bool, str) -> bool """ wf_pred = self._wf_pred # Namespace shortcuts. pre...
def rownumbers(self, table=None): """Return a list containing the row numbers of this table. This method can be useful after a selection or a sort. It returns the row numbers of the rows in this table with respect to the given table. If no table is given, the original table is used. ...
def function[rownumbers, parameter[self, table]]: constant[Return a list containing the row numbers of this table. This method can be useful after a selection or a sort. It returns the row numbers of the rows in this table with respect to the given table. If no table is given, the origi...
keyword[def] identifier[rownumbers] ( identifier[self] , identifier[table] = keyword[None] ): literal[string] keyword[if] identifier[table] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[_rownumbers] ( identifier[Table] ()) keyword[return] ident...
def rownumbers(self, table=None): """Return a list containing the row numbers of this table. This method can be useful after a selection or a sort. It returns the row numbers of the rows in this table with respect to the given table. If no table is given, the original table is used. ...
def get_function_spec(name): """Return a dictionary with the specification of a function: parameter names and defaults (value, bounds, scale, etc.). Returns ------- par_names : list List of parameter names for this function. norm_par : str Name of normalization parameter. ...
def function[get_function_spec, parameter[name]]: constant[Return a dictionary with the specification of a function: parameter names and defaults (value, bounds, scale, etc.). Returns ------- par_names : list List of parameter names for this function. norm_par : str Name of...
keyword[def] identifier[get_function_spec] ( identifier[name] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[get_function_spec] , literal[string] ): identifier[modelfile] = identifier[os] . identifier[path] . identifier[join] ( literal[string] , literal[str...
def get_function_spec(name): """Return a dictionary with the specification of a function: parameter names and defaults (value, bounds, scale, etc.). Returns ------- par_names : list List of parameter names for this function. norm_par : str Name of normalization parameter. ...
def RunValidationOutputFromOptions(feed, options): """Validate feed, output results per options and return an exit code.""" if options.output.upper() == "CONSOLE": return RunValidationOutputToConsole(feed, options) else: return RunValidationOutputToFilename(feed, options, options.output)
def function[RunValidationOutputFromOptions, parameter[feed, options]]: constant[Validate feed, output results per options and return an exit code.] if compare[call[name[options].output.upper, parameter[]] equal[==] constant[CONSOLE]] begin[:] return[call[name[RunValidationOutputToConsole], para...
keyword[def] identifier[RunValidationOutputFromOptions] ( identifier[feed] , identifier[options] ): literal[string] keyword[if] identifier[options] . identifier[output] . identifier[upper] ()== literal[string] : keyword[return] identifier[RunValidationOutputToConsole] ( identifier[feed] , identifier[opt...
def RunValidationOutputFromOptions(feed, options): """Validate feed, output results per options and return an exit code.""" if options.output.upper() == 'CONSOLE': return RunValidationOutputToConsole(feed, options) # depends on [control=['if'], data=[]] else: return RunValidationOutputToFil...
def resolve_post(self, post): """Mark post as resolved :type post: dict|str|int :param post: Either the post dict returned by another API method, or the `cid` field of that post. :returns: True if it is successful. False otherwise """ try: cid = ...
def function[resolve_post, parameter[self, post]]: constant[Mark post as resolved :type post: dict|str|int :param post: Either the post dict returned by another API method, or the `cid` field of that post. :returns: True if it is successful. False otherwise ] <a...
keyword[def] identifier[resolve_post] ( identifier[self] , identifier[post] ): literal[string] keyword[try] : identifier[cid] = identifier[post] [ literal[string] ] keyword[except] identifier[KeyError] : identifier[cid] = identifier[post] identifier[pa...
def resolve_post(self, post): """Mark post as resolved :type post: dict|str|int :param post: Either the post dict returned by another API method, or the `cid` field of that post. :returns: True if it is successful. False otherwise """ try: cid = post['id'] ...
def console_set_char_background( con: tcod.console.Console, x: int, y: int, col: Tuple[int, int, int], flag: int = BKGND_SET, ) -> None: """Change the background color of x,y to col using a blend mode. Args: con (Console): Any Console instance. x (int): Character x position ...
def function[console_set_char_background, parameter[con, x, y, col, flag]]: constant[Change the background color of x,y to col using a blend mode. Args: con (Console): Any Console instance. x (int): Character x position from the left. y (int): Character y position from the top. ...
keyword[def] identifier[console_set_char_background] ( identifier[con] : identifier[tcod] . identifier[console] . identifier[Console] , identifier[x] : identifier[int] , identifier[y] : identifier[int] , identifier[col] : identifier[Tuple] [ identifier[int] , identifier[int] , identifier[int] ], identifier[flag]...
def console_set_char_background(con: tcod.console.Console, x: int, y: int, col: Tuple[int, int, int], flag: int=BKGND_SET) -> None: """Change the background color of x,y to col using a blend mode. Args: con (Console): Any Console instance. x (int): Character x position from the left. y ...
def parse_limits_list(path, limits): """Parse a structured list of flux limits as obtained from a YAML file Yields tuples of reaction ID, lower and upper flux bounds. Path can be given as a string or a context. """ context = FilePathContext(path) for limit_def in limits: if 'include' ...
def function[parse_limits_list, parameter[path, limits]]: constant[Parse a structured list of flux limits as obtained from a YAML file Yields tuples of reaction ID, lower and upper flux bounds. Path can be given as a string or a context. ] variable[context] assign[=] call[name[FilePathConte...
keyword[def] identifier[parse_limits_list] ( identifier[path] , identifier[limits] ): literal[string] identifier[context] = identifier[FilePathContext] ( identifier[path] ) keyword[for] identifier[limit_def] keyword[in] identifier[limits] : keyword[if] literal[string] keyword[in] iden...
def parse_limits_list(path, limits): """Parse a structured list of flux limits as obtained from a YAML file Yields tuples of reaction ID, lower and upper flux bounds. Path can be given as a string or a context. """ context = FilePathContext(path) for limit_def in limits: if 'include' in...
def find_schemas(self, schema_path, schema_type=SCHEMA_TYPE_PROCESS, verbosity=1): """Find schemas in packages that match filters.""" schema_matches = [] if not os.path.isdir(schema_path): if verbosity > 0: self.stdout.write("Invalid path {}".format(schema_path)) ...
def function[find_schemas, parameter[self, schema_path, schema_type, verbosity]]: constant[Find schemas in packages that match filters.] variable[schema_matches] assign[=] list[[]] if <ast.UnaryOp object at 0x7da1b1b84bb0> begin[:] if compare[name[verbosity] greater[>] constant[0...
keyword[def] identifier[find_schemas] ( identifier[self] , identifier[schema_path] , identifier[schema_type] = identifier[SCHEMA_TYPE_PROCESS] , identifier[verbosity] = literal[int] ): literal[string] identifier[schema_matches] =[] keyword[if] keyword[not] identifier[os] . identifier[pa...
def find_schemas(self, schema_path, schema_type=SCHEMA_TYPE_PROCESS, verbosity=1): """Find schemas in packages that match filters.""" schema_matches = [] if not os.path.isdir(schema_path): if verbosity > 0: self.stdout.write('Invalid path {}'.format(schema_path)) # depends on [control=[...
def ar1_gen(rho, mu, sigma, size=1): """Create an autoregressive series of order one AR(1) generator. .. math:: X_t = \mu_t + \rho (X_{t-1}-\mu_{t-1} + \epsilon_t If mu is a sequence and size > len(mu), the algorithm loops through mu. :Stochastics: rho : scalar in [0,1] mu...
def function[ar1_gen, parameter[rho, mu, sigma, size]]: constant[Create an autoregressive series of order one AR(1) generator. .. math:: X_t = \mu_t + ho (X_{t-1}-\mu_{t-1} + \epsilon_t If mu is a sequence and size > len(mu), the algorithm loops through mu. :Stochastics: rho ...
keyword[def] identifier[ar1_gen] ( identifier[rho] , identifier[mu] , identifier[sigma] , identifier[size] = literal[int] ): literal[string] identifier[mu] = identifier[np] . identifier[asarray] ( identifier[mu] , identifier[float] ) identifier[mu] = identifier[np] . identifier[resize] ( identifier[mu...
def ar1_gen(rho, mu, sigma, size=1): """Create an autoregressive series of order one AR(1) generator. .. math:: X_t = \\mu_t + \rho (X_{t-1}-\\mu_{t-1} + \\epsilon_t If mu is a sequence and size > len(mu), the algorithm loops through mu. :Stochastics: rho : scalar in [0,1] ...
def wherefunc(self, func, fieldname=None, negate=False): """ .wherefunc(func, fieldname=None, negate=False) Applies a function to an entire row and filters the rows based on the boolean output of that function. If you pass in the fieldname, optionally, the function will simply ...
def function[wherefunc, parameter[self, func, fieldname, negate]]: constant[ .wherefunc(func, fieldname=None, negate=False) Applies a function to an entire row and filters the rows based on the boolean output of that function. If you pass in the fieldname, optionally, the funct...
keyword[def] identifier[wherefunc] ( identifier[self] , identifier[func] , identifier[fieldname] = keyword[None] , identifier[negate] = keyword[False] ): literal[string] keyword[if] identifier[fieldname] keyword[is] keyword[not] keyword[None] : keyword[if] identifier[negate] : ...
def wherefunc(self, func, fieldname=None, negate=False): """ .wherefunc(func, fieldname=None, negate=False) Applies a function to an entire row and filters the rows based on the boolean output of that function. If you pass in the fieldname, optionally, the function will simply ...
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): ...
def function[bootstrap, parameter[version, script, hosts, script_args, roster, ssh_user, ssh_password, ssh_priv_key, tmp_dir, http_backend]]: constant[ Bootstrap minions with salt-bootstrap version : develop Git tag of version to install script : https://bootstrap.saltstack.com URL...
keyword[def] identifier[bootstrap] ( identifier[version] = literal[string] , identifier[script] = keyword[None] , identifier[hosts] = literal[string] , identifier[script_args] = literal[string] , identifier[roster] = literal[string] , identifier[ssh_user] = keyword[None] , identifier[ssh_password] = keyword[Non...
def bootstrap(version='develop', script=None, hosts='', script_args='', roster='flat', ssh_user=None, ssh_password=None, ssh_priv_key=None, tmp_dir='/tmp/.bootstrap', http_backend='tornado'): """ Bootstrap minions with salt-bootstrap version : develop Git tag of version to install script : htt...
def directory_listing_content_check(directory_path, listing): """ Checks if a given listing is present under the given directory path. :param directory_path: The path to the base directory :param listing: The listing to check :return: None if no errors could be found, otherwise ...
def function[directory_listing_content_check, parameter[directory_path, listing]]: constant[ Checks if a given listing is present under the given directory path. :param directory_path: The path to the base directory :param listing: The listing to check :return: None if no errors...
keyword[def] identifier[directory_listing_content_check] ( identifier[directory_path] , identifier[listing] ): literal[string] keyword[if] identifier[listing] : keyword[for] identifier[sub] keyword[in] identifier[listing] : identifier[path] = identifier[os] . ident...
def directory_listing_content_check(directory_path, listing): """ Checks if a given listing is present under the given directory path. :param directory_path: The path to the base directory :param listing: The listing to check :return: None if no errors could be found, otherwise a st...
def inverse(self): """Inverse of the quaternion object, encapsulated in a new instance. For a unit quaternion, this is the inverse rotation, i.e. when combined with the original rotation, will result in the null rotation. Returns: A new Quaternion object representing the inverse of...
def function[inverse, parameter[self]]: constant[Inverse of the quaternion object, encapsulated in a new instance. For a unit quaternion, this is the inverse rotation, i.e. when combined with the original rotation, will result in the null rotation. Returns: A new Quaternion object ...
keyword[def] identifier[inverse] ( identifier[self] ): literal[string] identifier[ss] = identifier[self] . identifier[_sum_of_squares] () keyword[if] identifier[ss] > literal[int] : keyword[return] identifier[self] . identifier[__class__] ( identifier[array] =( identifier[se...
def inverse(self): """Inverse of the quaternion object, encapsulated in a new instance. For a unit quaternion, this is the inverse rotation, i.e. when combined with the original rotation, will result in the null rotation. Returns: A new Quaternion object representing the inverse of thi...
def user_exists(username, token_manager=None, app_url=defaults.APP_URL): """ check if the user exists with the specified username """ headers = token_manager.get_access_token_headers() auth_url = environment.get_auth_url(app_url=app_url) url = "%s/api/v1/accounts...
def function[user_exists, parameter[username, token_manager, app_url]]: constant[ check if the user exists with the specified username ] variable[headers] assign[=] call[name[token_manager].get_access_token_headers, parameter[]] variable[auth_url] assign[=] call[name[environment].get_au...
keyword[def] identifier[user_exists] ( identifier[username] , identifier[token_manager] = keyword[None] , identifier[app_url] = identifier[defaults] . identifier[APP_URL] ): literal[string] identifier[headers] = identifier[token_manager] . identifier[get_access_token_headers] () identifier[auth_url]...
def user_exists(username, token_manager=None, app_url=defaults.APP_URL): """ check if the user exists with the specified username """ headers = token_manager.get_access_token_headers() auth_url = environment.get_auth_url(app_url=app_url) url = '%s/api/v1/accounts?username=%s' % (auth_url, usern...
def run_wrap(self, args): """ Wrap some standard protocol around a command's run method. This wrapper should generally never capture exceptions. It can look at them and do things but prerun and postrun should always be symmetric. Any exception suppression should happen in the `session....
def function[run_wrap, parameter[self, args]]: constant[ Wrap some standard protocol around a command's run method. This wrapper should generally never capture exceptions. It can look at them and do things but prerun and postrun should always be symmetric. Any exception suppression sho...
keyword[def] identifier[run_wrap] ( identifier[self] , identifier[args] ): literal[string] identifier[self] . identifier[fire_event] ( literal[string] , identifier[args] ) identifier[self] . identifier[prerun] ( identifier[args] ) keyword[try] : keyword[if] identifie...
def run_wrap(self, args): """ Wrap some standard protocol around a command's run method. This wrapper should generally never capture exceptions. It can look at them and do things but prerun and postrun should always be symmetric. Any exception suppression should happen in the `session.exec...
def remap_variables(fn): """ Use fn to map the output of any variable getter. Args: fn (tf.Variable -> tf.Tensor) Returns: The current variable scope with a custom_getter that maps all the variables by fn. Example: .. code-block:: python with varreplac...
def function[remap_variables, parameter[fn]]: constant[ Use fn to map the output of any variable getter. Args: fn (tf.Variable -> tf.Tensor) Returns: The current variable scope with a custom_getter that maps all the variables by fn. Example: .. code-block:: pyt...
keyword[def] identifier[remap_variables] ( identifier[fn] ): literal[string] keyword[def] identifier[custom_getter] ( identifier[getter] ,* identifier[args] ,** identifier[kwargs] ): identifier[v] = identifier[getter] (* identifier[args] ,** identifier[kwargs] ) keyword[return] identifi...
def remap_variables(fn): """ Use fn to map the output of any variable getter. Args: fn (tf.Variable -> tf.Tensor) Returns: The current variable scope with a custom_getter that maps all the variables by fn. Example: .. code-block:: python with varreplac...
def y(self, y): """Project y as x""" if y is None: return None if self._force_vertical: return super(HorizontalView, self).y(y) return super(HorizontalView, self).x(y)
def function[y, parameter[self, y]]: constant[Project y as x] if compare[name[y] is constant[None]] begin[:] return[constant[None]] if name[self]._force_vertical begin[:] return[call[call[name[super], parameter[name[HorizontalView], name[self]]].y, parameter[name[y]]]] return...
keyword[def] identifier[y] ( identifier[self] , identifier[y] ): literal[string] keyword[if] identifier[y] keyword[is] keyword[None] : keyword[return] keyword[None] keyword[if] identifier[self] . identifier[_force_vertical] : keyword[return] identifier[supe...
def y(self, y): """Project y as x""" if y is None: return None # depends on [control=['if'], data=[]] if self._force_vertical: return super(HorizontalView, self).y(y) # depends on [control=['if'], data=[]] return super(HorizontalView, self).x(y)
def set_misc(self): '''Set more parameters, after the tank is better defined than in the __init__ function. Notes ----- Two of D, L, and L_over_D must be known when this function runs. The other one is set from the other two first thing in this function. a_ratio ...
def function[set_misc, parameter[self]]: constant[Set more parameters, after the tank is better defined than in the __init__ function. Notes ----- Two of D, L, and L_over_D must be known when this function runs. The other one is set from the other two first thing in this...
keyword[def] identifier[set_misc] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[D] keyword[and] identifier[self] . identifier[L] : identifier[self] . identifier[L_over_D] = identifier[self] . identifier[L] / identifier[self] . identifier[D]...
def set_misc(self): """Set more parameters, after the tank is better defined than in the __init__ function. Notes ----- Two of D, L, and L_over_D must be known when this function runs. The other one is set from the other two first thing in this function. a_ratio para...
def delete_queue(self, queue_name, fail_not_exist=False): """Delete a queue entity. :param queue_name: The name of the queue to delete. :type queue_name: str :param fail_not_exist: Whether to raise an exception if the named queue is not found. If set to True, a ServiceBusResour...
def function[delete_queue, parameter[self, queue_name, fail_not_exist]]: constant[Delete a queue entity. :param queue_name: The name of the queue to delete. :type queue_name: str :param fail_not_exist: Whether to raise an exception if the named queue is not found. If set to Tru...
keyword[def] identifier[delete_queue] ( identifier[self] , identifier[queue_name] , identifier[fail_not_exist] = keyword[False] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[mgmt_client] . identifier[delete_queue] ( identifier[queue_name] , identifier...
def delete_queue(self, queue_name, fail_not_exist=False): """Delete a queue entity. :param queue_name: The name of the queue to delete. :type queue_name: str :param fail_not_exist: Whether to raise an exception if the named queue is not found. If set to True, a ServiceBusResourceNo...
def get_include(): """ Returns a list of header include paths (for lxml itself, libxml2 and libxslt) needed to compile C code against lxml if it was built with statically linked libraries. """ import os lxml_path = __path__[0] include_path = os.path.join(lxml_path, 'includes') includ...
def function[get_include, parameter[]]: constant[ Returns a list of header include paths (for lxml itself, libxml2 and libxslt) needed to compile C code against lxml if it was built with statically linked libraries. ] import module[os] variable[lxml_path] assign[=] call[name[__path__...
keyword[def] identifier[get_include] (): literal[string] keyword[import] identifier[os] identifier[lxml_path] = identifier[__path__] [ literal[int] ] identifier[include_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[lxml_path] , literal[string] ) identifier[inclu...
def get_include(): """ Returns a list of header include paths (for lxml itself, libxml2 and libxslt) needed to compile C code against lxml if it was built with statically linked libraries. """ import os lxml_path = __path__[0] include_path = os.path.join(lxml_path, 'includes') includ...
def create_db(): """ Create all your database objects (SQLAlchemy specific). """ from flask_appbuilder.models.sqla import Model engine = current_app.appbuilder.get_session.get_bind(mapper=None, clause=None) Model.metadata.create_all(engine) click.echo(click.style("DB objects created", f...
def function[create_db, parameter[]]: constant[ Create all your database objects (SQLAlchemy specific). ] from relative_module[flask_appbuilder.models.sqla] import module[Model] variable[engine] assign[=] call[name[current_app].appbuilder.get_session.get_bind, parameter[]] call[n...
keyword[def] identifier[create_db] (): literal[string] keyword[from] identifier[flask_appbuilder] . identifier[models] . identifier[sqla] keyword[import] identifier[Model] identifier[engine] = identifier[current_app] . identifier[appbuilder] . identifier[get_session] . identifier[get_bind] ( iden...
def create_db(): """ Create all your database objects (SQLAlchemy specific). """ from flask_appbuilder.models.sqla import Model engine = current_app.appbuilder.get_session.get_bind(mapper=None, clause=None) Model.metadata.create_all(engine) click.echo(click.style('DB objects created', fg...
def get_script_property(value, is_bytes=False): """Get `SC` property.""" obj = unidata.ascii_scripts if is_bytes else unidata.unicode_scripts if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['script'].get(negated, negated) else: value = unidata....
def function[get_script_property, parameter[value, is_bytes]]: constant[Get `SC` property.] variable[obj] assign[=] <ast.IfExp object at 0x7da1b032f1c0> if call[name[value].startswith, parameter[constant[^]]] begin[:] variable[negated] assign[=] call[name[value]][<ast.Slice objec...
keyword[def] identifier[get_script_property] ( identifier[value] , identifier[is_bytes] = keyword[False] ): literal[string] identifier[obj] = identifier[unidata] . identifier[ascii_scripts] keyword[if] identifier[is_bytes] keyword[else] identifier[unidata] . identifier[unicode_scripts] keyword[...
def get_script_property(value, is_bytes=False): """Get `SC` property.""" obj = unidata.ascii_scripts if is_bytes else unidata.unicode_scripts if value.startswith('^'): negated = value[1:] value = '^' + unidata.unicode_alias['script'].get(negated, negated) # depends on [control=['if'], data=...
def list(self, request, *args, **kwargs): """ To get a list of alerts, run **GET** against */api/alerts/* as authenticated user. Alert severity field can take one of this values: "Error", "Warning", "Info", "Debug". Field scope will contain link to object that cause alert. Conte...
def function[list, parameter[self, request]]: constant[ To get a list of alerts, run **GET** against */api/alerts/* as authenticated user. Alert severity field can take one of this values: "Error", "Warning", "Info", "Debug". Field scope will contain link to object that cause alert. ...
keyword[def] identifier[list] ( identifier[self] , identifier[request] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[super] ( identifier[AlertViewSet] , identifier[self] ). identifier[list] ( identifier[request] ,* identifier[args] ,** identifier[kwargs] ...
def list(self, request, *args, **kwargs): """ To get a list of alerts, run **GET** against */api/alerts/* as authenticated user. Alert severity field can take one of this values: "Error", "Warning", "Info", "Debug". Field scope will contain link to object that cause alert. Context -...
def get_balance(self, address): """ returns the balance object from blockcypher for address """ url_append = "/balance?token=%s" % self.api_key url = self.base_url("addrs/%s" % (address + url_append)) result = json.loads(urlopen(url).read().decode("utf8")) return ...
def function[get_balance, parameter[self, address]]: constant[ returns the balance object from blockcypher for address ] variable[url_append] assign[=] binary_operation[constant[/balance?token=%s] <ast.Mod object at 0x7da2590d6920> name[self].api_key] variable[url] assign[=] call...
keyword[def] identifier[get_balance] ( identifier[self] , identifier[address] ): literal[string] identifier[url_append] = literal[string] % identifier[self] . identifier[api_key] identifier[url] = identifier[self] . identifier[base_url] ( literal[string] %( identifier[address] + identifie...
def get_balance(self, address): """ returns the balance object from blockcypher for address """ url_append = '/balance?token=%s' % self.api_key url = self.base_url('addrs/%s' % (address + url_append)) result = json.loads(urlopen(url).read().decode('utf8')) return result
def take_bug_report(self, test_name, begin_time, timeout=300, destination=None): """Takes a bug report on the device and stores it in a file. Args: test_name: Name of the test method that trigger...
def function[take_bug_report, parameter[self, test_name, begin_time, timeout, destination]]: constant[Takes a bug report on the device and stores it in a file. Args: test_name: Name of the test method that triggered this bug report. begin_time: Timestamp of when the test started...
keyword[def] identifier[take_bug_report] ( identifier[self] , identifier[test_name] , identifier[begin_time] , identifier[timeout] = literal[int] , identifier[destination] = keyword[None] ): literal[string] identifier[new_br] = keyword[True] keyword[try] : identifier[stdo...
def take_bug_report(self, test_name, begin_time, timeout=300, destination=None): """Takes a bug report on the device and stores it in a file. Args: test_name: Name of the test method that triggered this bug report. begin_time: Timestamp of when the test started. timeout:...
def pong(self, message=None): '''Write a pong ``frame``. ''' return self.write(self.parser.pong(message), encode=False)
def function[pong, parameter[self, message]]: constant[Write a pong ``frame``. ] return[call[name[self].write, parameter[call[name[self].parser.pong, parameter[name[message]]]]]]
keyword[def] identifier[pong] ( identifier[self] , identifier[message] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[write] ( identifier[self] . identifier[parser] . identifier[pong] ( identifier[message] ), identifier[encode] = keyword[False] )
def pong(self, message=None): """Write a pong ``frame``. """ return self.write(self.parser.pong(message), encode=False)
def from_pb(cls, instance_pb, client): """Creates an instance from a protobuf. :type instance_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param instance_pb: A instance protobuf object. :type client: :class:`~google.cloud.spanner_v1.client.Client` ...
def function[from_pb, parameter[cls, instance_pb, client]]: constant[Creates an instance from a protobuf. :type instance_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param instance_pb: A instance protobuf object. :type client: :class:`~google.cloud.sp...
keyword[def] identifier[from_pb] ( identifier[cls] , identifier[instance_pb] , identifier[client] ): literal[string] identifier[match] = identifier[_INSTANCE_NAME_RE] . identifier[match] ( identifier[instance_pb] . identifier[name] ) keyword[if] identifier[match] keyword[is] keyword[Non...
def from_pb(cls, instance_pb, client): """Creates an instance from a protobuf. :type instance_pb: :class:`google.spanner.v2.spanner_instance_admin_pb2.Instance` :param instance_pb: A instance protobuf object. :type client: :class:`~google.cloud.spanner_v1.client.Client` ...
def verify(info, directory_path): """Return True if the checksum values in the torrent file match the computed checksum values of downloaded file(s) in the directory and if each file has the correct length as specified in the torrent file. """ base_path = os.path.join(directory_path, info['name']) ...
def function[verify, parameter[info, directory_path]]: constant[Return True if the checksum values in the torrent file match the computed checksum values of downloaded file(s) in the directory and if each file has the correct length as specified in the torrent file. ] variable[base_path] ass...
keyword[def] identifier[verify] ( identifier[info] , identifier[directory_path] ): literal[string] identifier[base_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[directory_path] , identifier[info] [ literal[string] ]) keyword[if] literal[string] keyword[in] identifier[inf...
def verify(info, directory_path): """Return True if the checksum values in the torrent file match the computed checksum values of downloaded file(s) in the directory and if each file has the correct length as specified in the torrent file. """ base_path = os.path.join(directory_path, info['name']) ...
def create_all(cls, list_of_kwargs): """Batch method for creating a list of instances Args: list_of_kwargs(list of dicts): hereA list of dicts where each dict denotes the keyword args that you would pass to the create method separately Examples: ...
def function[create_all, parameter[cls, list_of_kwargs]]: constant[Batch method for creating a list of instances Args: list_of_kwargs(list of dicts): hereA list of dicts where each dict denotes the keyword args that you would pass to the create method separat...
keyword[def] identifier[create_all] ( identifier[cls] , identifier[list_of_kwargs] ): literal[string] keyword[try] : keyword[return] identifier[cls] . identifier[add_all] ([ identifier[cls] . identifier[new] (** identifier[kwargs] ) keyword[if] identifier[kwargs] keywor...
def create_all(cls, list_of_kwargs): """Batch method for creating a list of instances Args: list_of_kwargs(list of dicts): hereA list of dicts where each dict denotes the keyword args that you would pass to the create method separately Examples: ...
def __cleanup_module(self, event): """ Auxiliary method for L{_notify_unload_dll}. """ pid = event.get_pid() process = event.get_process() module = event.get_module() # Cleanup thread breakpoints on this module for tid in process.iter_thread_ids(): ...
def function[__cleanup_module, parameter[self, event]]: constant[ Auxiliary method for L{_notify_unload_dll}. ] variable[pid] assign[=] call[name[event].get_pid, parameter[]] variable[process] assign[=] call[name[event].get_process, parameter[]] variable[module] assign[=]...
keyword[def] identifier[__cleanup_module] ( identifier[self] , identifier[event] ): literal[string] identifier[pid] = identifier[event] . identifier[get_pid] () identifier[process] = identifier[event] . identifier[get_process] () identifier[module] = identifier[event] . identifier...
def __cleanup_module(self, event): """ Auxiliary method for L{_notify_unload_dll}. """ pid = event.get_pid() process = event.get_process() module = event.get_module() # Cleanup thread breakpoints on this module for tid in process.iter_thread_ids(): thread = process.get_th...
def new_signal(celf, path, iface, name) : "creates a new DBUS.MESSAGE_TYPE_SIGNAL message." result = dbus.dbus_message_new_signal(path.encode(), iface.encode(), name.encode()) if result == None : raise CallFailed("dbus_message_new_signal") #end if return \ ...
def function[new_signal, parameter[celf, path, iface, name]]: constant[creates a new DBUS.MESSAGE_TYPE_SIGNAL message.] variable[result] assign[=] call[name[dbus].dbus_message_new_signal, parameter[call[name[path].encode, parameter[]], call[name[iface].encode, parameter[]], call[name[name].encode, param...
keyword[def] identifier[new_signal] ( identifier[celf] , identifier[path] , identifier[iface] , identifier[name] ): literal[string] identifier[result] = identifier[dbus] . identifier[dbus_message_new_signal] ( identifier[path] . identifier[encode] (), identifier[iface] . identifier[encode] (), iden...
def new_signal(celf, path, iface, name): """creates a new DBUS.MESSAGE_TYPE_SIGNAL message.""" result = dbus.dbus_message_new_signal(path.encode(), iface.encode(), name.encode()) if result == None: raise CallFailed('dbus_message_new_signal') # depends on [control=['if'], data=[]] #end if re...
def write_vega(vega_data, *, title: Optional[str], write_to: str, write_format: str = "auto", indent: int = 2): """Write vega dictionary to an external file. Parameters ---------- vega_data : Valid vega data as dictionary write_to: Path to write vega JSON/HTML to. write_format: "auto" | "json" ...
def function[write_vega, parameter[vega_data]]: constant[Write vega dictionary to an external file. Parameters ---------- vega_data : Valid vega data as dictionary write_to: Path to write vega JSON/HTML to. write_format: "auto" | "json" | "html" Whether to create a JSON data file or...
keyword[def] identifier[write_vega] ( identifier[vega_data] ,*, identifier[title] : identifier[Optional] [ identifier[str] ], identifier[write_to] : identifier[str] , identifier[write_format] : identifier[str] = literal[string] , identifier[indent] : identifier[int] = literal[int] ): literal[string] identi...
def write_vega(vega_data, *, title: Optional[str], write_to: str, write_format: str='auto', indent: int=2): """Write vega dictionary to an external file. Parameters ---------- vega_data : Valid vega data as dictionary write_to: Path to write vega JSON/HTML to. write_format: "auto" | "json" | "h...
def flatten(iterable, check=is_iterable): """Produces a recursively flattened version of ``iterable`` ``check`` Recurses only if check(value) is true. """ for value in iterable: if check(value): for flat in flatten(value, check): yield flat else: ...
def function[flatten, parameter[iterable, check]]: constant[Produces a recursively flattened version of ``iterable`` ``check`` Recurses only if check(value) is true. ] for taget[name[value]] in starred[name[iterable]] begin[:] if call[name[check], parameter[name[value]]]...
keyword[def] identifier[flatten] ( identifier[iterable] , identifier[check] = identifier[is_iterable] ): literal[string] keyword[for] identifier[value] keyword[in] identifier[iterable] : keyword[if] identifier[check] ( identifier[value] ): keyword[for] identifier[flat] keyword[i...
def flatten(iterable, check=is_iterable): """Produces a recursively flattened version of ``iterable`` ``check`` Recurses only if check(value) is true. """ for value in iterable: if check(value): for flat in flatten(value, check): yield flat # depends on [con...
def message(self, msg='', level=1, tab=0): '''Print a message to the console''' if self.verbosity >= level: self.stdout.write('{}{}'.format(' ' * tab, msg))
def function[message, parameter[self, msg, level, tab]]: constant[Print a message to the console] if compare[name[self].verbosity greater_or_equal[>=] name[level]] begin[:] call[name[self].stdout.write, parameter[call[constant[{}{}].format, parameter[binary_operation[constant[ ] * nam...
keyword[def] identifier[message] ( identifier[self] , identifier[msg] = literal[string] , identifier[level] = literal[int] , identifier[tab] = literal[int] ): literal[string] keyword[if] identifier[self] . identifier[verbosity] >= identifier[level] : identifier[self] . identifier[stdo...
def message(self, msg='', level=1, tab=0): """Print a message to the console""" if self.verbosity >= level: self.stdout.write('{}{}'.format(' ' * tab, msg)) # depends on [control=['if'], data=[]]
def start(client, container, interactive=True, stdout=None, stderr=None, stdin=None, logs=None): """ Present the PTY of the container inside the current process. This is just a wrapper for PseudoTerminal(client, container).start() """ operation = RunOperation(client, container, interactive=interac...
def function[start, parameter[client, container, interactive, stdout, stderr, stdin, logs]]: constant[ Present the PTY of the container inside the current process. This is just a wrapper for PseudoTerminal(client, container).start() ] variable[operation] assign[=] call[name[RunOperation], p...
keyword[def] identifier[start] ( identifier[client] , identifier[container] , identifier[interactive] = keyword[True] , identifier[stdout] = keyword[None] , identifier[stderr] = keyword[None] , identifier[stdin] = keyword[None] , identifier[logs] = keyword[None] ): literal[string] identifier[operation] = ...
def start(client, container, interactive=True, stdout=None, stderr=None, stdin=None, logs=None): """ Present the PTY of the container inside the current process. This is just a wrapper for PseudoTerminal(client, container).start() """ operation = RunOperation(client, container, interactive=interact...
def expressionLevelsGenerator(self, request): """ Returns a generator over the (expressionLevel, nextPageToken) pairs defined by the specified request. Currently only supports searching over a specified rnaQuantification """ rnaQuantificationId = request.rna_quantificati...
def function[expressionLevelsGenerator, parameter[self, request]]: constant[ Returns a generator over the (expressionLevel, nextPageToken) pairs defined by the specified request. Currently only supports searching over a specified rnaQuantification ] variable[rnaQuantific...
keyword[def] identifier[expressionLevelsGenerator] ( identifier[self] , identifier[request] ): literal[string] identifier[rnaQuantificationId] = identifier[request] . identifier[rna_quantification_id] identifier[compoundId] = identifier[datamodel] . identifier[RnaQuantificationCompoundId]...
def expressionLevelsGenerator(self, request): """ Returns a generator over the (expressionLevel, nextPageToken) pairs defined by the specified request. Currently only supports searching over a specified rnaQuantification """ rnaQuantificationId = request.rna_quantification_id ...
def as_enum(enum): """ Turn a possibly string enum into an integer enum. """ if isinstance(enum, string_types): try: enum = getattr(gl, 'GL_' + enum.upper()) except AttributeError: try: enum = _internalformats['GL_' + enum.upper()] except K...
def function[as_enum, parameter[enum]]: constant[ Turn a possibly string enum into an integer enum. ] if call[name[isinstance], parameter[name[enum], name[string_types]]] begin[:] <ast.Try object at 0x7da18dc9a7a0> return[name[enum]]
keyword[def] identifier[as_enum] ( identifier[enum] ): literal[string] keyword[if] identifier[isinstance] ( identifier[enum] , identifier[string_types] ): keyword[try] : identifier[enum] = identifier[getattr] ( identifier[gl] , literal[string] + identifier[enum] . identifier[upper] (...
def as_enum(enum): """ Turn a possibly string enum into an integer enum. """ if isinstance(enum, string_types): try: enum = getattr(gl, 'GL_' + enum.upper()) # depends on [control=['try'], data=[]] except AttributeError: try: enum = _internalformats['...
def _transition_loop(self): """Execute all queued transitions step by step.""" while self._transitions: start = time.time() for transition in self._transitions: transition.step() if transition.finished: self._transitions.remove(...
def function[_transition_loop, parameter[self]]: constant[Execute all queued transitions step by step.] while name[self]._transitions begin[:] variable[start] assign[=] call[name[time].time, parameter[]] for taget[name[transition]] in starred[name[self]._transitions] begi...
keyword[def] identifier[_transition_loop] ( identifier[self] ): literal[string] keyword[while] identifier[self] . identifier[_transitions] : identifier[start] = identifier[time] . identifier[time] () keyword[for] identifier[transition] keyword[in] identifier[self] . id...
def _transition_loop(self): """Execute all queued transitions step by step.""" while self._transitions: start = time.time() for transition in self._transitions: transition.step() if transition.finished: self._transitions.remove(transition) # depends on [c...
def _random_weights(n_features, lam, lam_perturb, prng): """Generate a symmetric random matrix with zeros along the diagnoal and non-zero elements take the value {lam * lam_perturb, lam / lam_perturb} with probability 1/2. """ weights = np.zeros((n_features, n_features)) n_off_diag = int((n_feat...
def function[_random_weights, parameter[n_features, lam, lam_perturb, prng]]: constant[Generate a symmetric random matrix with zeros along the diagnoal and non-zero elements take the value {lam * lam_perturb, lam / lam_perturb} with probability 1/2. ] variable[weights] assign[=] call[name[np...
keyword[def] identifier[_random_weights] ( identifier[n_features] , identifier[lam] , identifier[lam_perturb] , identifier[prng] ): literal[string] identifier[weights] = identifier[np] . identifier[zeros] (( identifier[n_features] , identifier[n_features] )) identifier[n_off_diag] = identifier[int] ((...
def _random_weights(n_features, lam, lam_perturb, prng): """Generate a symmetric random matrix with zeros along the diagnoal and non-zero elements take the value {lam * lam_perturb, lam / lam_perturb} with probability 1/2. """ weights = np.zeros((n_features, n_features)) n_off_diag = int((n_feat...
def order_chunks(self, chunks): ''' Sort the chunk list verifying that the chunks follow the order specified in the order options. ''' cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): ...
def function[order_chunks, parameter[self, chunks]]: constant[ Sort the chunk list verifying that the chunks follow the order specified in the order options. ] variable[cap] assign[=] constant[1] for taget[name[chunk]] in starred[name[chunks]] begin[:] if ...
keyword[def] identifier[order_chunks] ( identifier[self] , identifier[chunks] ): literal[string] identifier[cap] = literal[int] keyword[for] identifier[chunk] keyword[in] identifier[chunks] : keyword[if] literal[string] keyword[in] identifier[chunk] : k...
def order_chunks(self, chunks): """ Sort the chunk list verifying that the chunks follow the order specified in the order options. """ cap = 1 for chunk in chunks: if 'order' in chunk: if not isinstance(chunk['order'], int): continue # depends on ...
def remove_by_tag(self, tag): """ Remove the first encountered object with the specified tag from the world. Returns true if an object was found and removed. Returns false if no object could be removed. """ obj = self.find_obj_by_tag(tag) if obj != None: ...
def function[remove_by_tag, parameter[self, tag]]: constant[ Remove the first encountered object with the specified tag from the world. Returns true if an object was found and removed. Returns false if no object could be removed. ] variable[obj] assign[=] call[name[self]....
keyword[def] identifier[remove_by_tag] ( identifier[self] , identifier[tag] ): literal[string] identifier[obj] = identifier[self] . identifier[find_obj_by_tag] ( identifier[tag] ) keyword[if] identifier[obj] != keyword[None] : identifier[self] . identifier[remove_obj] ( ident...
def remove_by_tag(self, tag): """ Remove the first encountered object with the specified tag from the world. Returns true if an object was found and removed. Returns false if no object could be removed. """ obj = self.find_obj_by_tag(tag) if obj != None: self.remove_o...