code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def str_on_2_unicode_on_3(s): """ argparse is way too awesome when doing repr() on choices when printing usage :param s: str or unicode :return: str on 2, unicode on 3 """ if not PY3: return str(s) else: # 3+ if not isinstance(s, str): return str(s, encoding="u...
def function[str_on_2_unicode_on_3, parameter[s]]: constant[ argparse is way too awesome when doing repr() on choices when printing usage :param s: str or unicode :return: str on 2, unicode on 3 ] if <ast.UnaryOp object at 0x7da1b0e0f0a0> begin[:] return[call[name[str], paramete...
keyword[def] identifier[str_on_2_unicode_on_3] ( identifier[s] ): literal[string] keyword[if] keyword[not] identifier[PY3] : keyword[return] identifier[str] ( identifier[s] ) keyword[else] : keyword[if] keyword[not] identifier[isinstance] ( identifier[s] , identifier[str] ): ...
def str_on_2_unicode_on_3(s): """ argparse is way too awesome when doing repr() on choices when printing usage :param s: str or unicode :return: str on 2, unicode on 3 """ if not PY3: return str(s) # depends on [control=['if'], data=[]] else: # 3+ if not isinstance(s, str)...
def process_command(self, command): '''Processes a user command using aliases Arguments: command A user command list (e.g. argv) Returns: A ScubaContext object with the following attributes: script: a list of command line strings image: the docker image ...
def function[process_command, parameter[self, command]]: constant[Processes a user command using aliases Arguments: command A user command list (e.g. argv) Returns: A ScubaContext object with the following attributes: script: a list of command line strings ...
keyword[def] identifier[process_command] ( identifier[self] , identifier[command] ): literal[string] identifier[result] = identifier[ScubaContext] () identifier[result] . identifier[script] = keyword[None] identifier[result] . identifier[image] = identifier[self] . identifier[ima...
def process_command(self, command): """Processes a user command using aliases Arguments: command A user command list (e.g. argv) Returns: A ScubaContext object with the following attributes: script: a list of command line strings image: the docker image name...
def install(self, release_id): """Install the contents of the local directory into a release directory. If the directory for the given release ID does not exist on the remote system, it will be created. The directory will be created according to the standard Tunic directory structure (s...
def function[install, parameter[self, release_id]]: constant[Install the contents of the local directory into a release directory. If the directory for the given release ID does not exist on the remote system, it will be created. The directory will be created according to the standard T...
keyword[def] identifier[install] ( identifier[self] , identifier[release_id] ): literal[string] identifier[release_path] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[_releases] , identifier[release_id] ) keyword[if] keyword[not] identifier[self] ...
def install(self, release_id): """Install the contents of the local directory into a release directory. If the directory for the given release ID does not exist on the remote system, it will be created. The directory will be created according to the standard Tunic directory structure (see :...
def set_chime_volume(self, volume): """ :param volume: one of [low, medium, high] """ values = { "desired_state": { "chime_volume": volume } } response = self.api_interface.set_device_state(self, values) self._upda...
def function[set_chime_volume, parameter[self, volume]]: constant[ :param volume: one of [low, medium, high] ] variable[values] assign[=] dictionary[[<ast.Constant object at 0x7da1b2633040>], [<ast.Dict object at 0x7da1b2630b20>]] variable[response] assign[=] call[name[self].api_...
keyword[def] identifier[set_chime_volume] ( identifier[self] , identifier[volume] ): literal[string] identifier[values] ={ literal[string] :{ literal[string] : identifier[volume] } } identifier[response] = identifier[self] . identifier[api_interfac...
def set_chime_volume(self, volume): """ :param volume: one of [low, medium, high] """ values = {'desired_state': {'chime_volume': volume}} response = self.api_interface.set_device_state(self, values) self._update_state_from_response(response)
def string_to_one_hot(string, maxchar): """Converts an ASCII string to a one-of-k encoding.""" ascii = np.array([ord(c) for c in string]).T return np.array(ascii[:,None] == np.arange(maxchar)[None, :], dtype=int)
def function[string_to_one_hot, parameter[string, maxchar]]: constant[Converts an ASCII string to a one-of-k encoding.] variable[ascii] assign[=] call[name[np].array, parameter[<ast.ListComp object at 0x7da2054a5f90>]].T return[call[name[np].array, parameter[compare[call[name[ascii]][tuple[[<ast.Sli...
keyword[def] identifier[string_to_one_hot] ( identifier[string] , identifier[maxchar] ): literal[string] identifier[ascii] = identifier[np] . identifier[array] ([ identifier[ord] ( identifier[c] ) keyword[for] identifier[c] keyword[in] identifier[string] ]). identifier[T] keyword[return] identifi...
def string_to_one_hot(string, maxchar): """Converts an ASCII string to a one-of-k encoding.""" ascii = np.array([ord(c) for c in string]).T return np.array(ascii[:, None] == np.arange(maxchar)[None, :], dtype=int)
def corba_name_to_string(name): '''Convert a CORBA CosNaming.Name to a string.''' parts = [] if type(name) is not list and type(name) is not tuple: raise NotCORBANameError(name) if len(name) == 0: raise NotCORBANameError(name) for nc in name: if not nc.kind: part...
def function[corba_name_to_string, parameter[name]]: constant[Convert a CORBA CosNaming.Name to a string.] variable[parts] assign[=] list[[]] if <ast.BoolOp object at 0x7da18dc9a2f0> begin[:] <ast.Raise object at 0x7da18bc71360> if compare[call[name[len], parameter[name[name]]] e...
keyword[def] identifier[corba_name_to_string] ( identifier[name] ): literal[string] identifier[parts] =[] keyword[if] identifier[type] ( identifier[name] ) keyword[is] keyword[not] identifier[list] keyword[and] identifier[type] ( identifier[name] ) keyword[is] keyword[not] identifier[tuple] : ...
def corba_name_to_string(name): """Convert a CORBA CosNaming.Name to a string.""" parts = [] if type(name) is not list and type(name) is not tuple: raise NotCORBANameError(name) # depends on [control=['if'], data=[]] if len(name) == 0: raise NotCORBANameError(name) # depends on [contro...
def update_file(finfo, sample_info, config, pass_uptodate=False): """Update the file in local filesystem storage. """ storage_dir = utils.safe_makedir(_get_storage_dir(finfo, config)) if finfo.get("type") == "directory": return _copy_finfo_directory(finfo, storage_dir) else: return _...
def function[update_file, parameter[finfo, sample_info, config, pass_uptodate]]: constant[Update the file in local filesystem storage. ] variable[storage_dir] assign[=] call[name[utils].safe_makedir, parameter[call[name[_get_storage_dir], parameter[name[finfo], name[config]]]]] if compare[ca...
keyword[def] identifier[update_file] ( identifier[finfo] , identifier[sample_info] , identifier[config] , identifier[pass_uptodate] = keyword[False] ): literal[string] identifier[storage_dir] = identifier[utils] . identifier[safe_makedir] ( identifier[_get_storage_dir] ( identifier[finfo] , identifier[conf...
def update_file(finfo, sample_info, config, pass_uptodate=False): """Update the file in local filesystem storage. """ storage_dir = utils.safe_makedir(_get_storage_dir(finfo, config)) if finfo.get('type') == 'directory': return _copy_finfo_directory(finfo, storage_dir) # depends on [control=['i...
def fetch_friends(self, user, paginate=False): """ fethces friends from facebook using the oauth_token fethched by django-social-auth. Note - user isn't a user - it's a UserSocialAuth if using social auth, or a SocialAccount if using allauth Returns: collection of f...
def function[fetch_friends, parameter[self, user, paginate]]: constant[ fethces friends from facebook using the oauth_token fethched by django-social-auth. Note - user isn't a user - it's a UserSocialAuth if using social auth, or a SocialAccount if using allauth Returns: ...
keyword[def] identifier[fetch_friends] ( identifier[self] , identifier[user] , identifier[paginate] = keyword[False] ): literal[string] keyword[if] identifier[USING_ALLAUTH] : identifier[social_app] = identifier[SocialApp] . identifier[objects] . identifier[get_current] ( literal[str...
def fetch_friends(self, user, paginate=False): """ fethces friends from facebook using the oauth_token fethched by django-social-auth. Note - user isn't a user - it's a UserSocialAuth if using social auth, or a SocialAccount if using allauth Returns: collection of frien...
def has_submenu_items(self, current_page, allow_repeating_parents, original_menu_tag, menu_instance=None, request=None): """ When rendering pages in a menu template a `has_children_in_menu` attribute is added to each page, letting template developers know whethe...
def function[has_submenu_items, parameter[self, current_page, allow_repeating_parents, original_menu_tag, menu_instance, request]]: constant[ When rendering pages in a menu template a `has_children_in_menu` attribute is added to each page, letting template developers know whether or not ...
keyword[def] identifier[has_submenu_items] ( identifier[self] , identifier[current_page] , identifier[allow_repeating_parents] , identifier[original_menu_tag] , identifier[menu_instance] = keyword[None] , identifier[request] = keyword[None] ): literal[string] keyword[return] identifier[menu_insta...
def has_submenu_items(self, current_page, allow_repeating_parents, original_menu_tag, menu_instance=None, request=None): """ When rendering pages in a menu template a `has_children_in_menu` attribute is added to each page, letting template developers know whether or not the item has a submen...
def run(self, *args, **kwargs): """Iterate through all AWS accounts and apply roles and policies from Github Args: *args: Optional list of arguments **kwargs: Optional list of keyword arguments Returns: `None` """ accounts = list(AWSAccount.g...
def function[run, parameter[self]]: constant[Iterate through all AWS accounts and apply roles and policies from Github Args: *args: Optional list of arguments **kwargs: Optional list of keyword arguments Returns: `None` ] variable[accounts] a...
keyword[def] identifier[run] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[accounts] = identifier[list] ( identifier[AWSAccount] . identifier[get_all] ( identifier[include_disabled] = keyword[False] ). identifier[values] ()) identifier[self] . ...
def run(self, *args, **kwargs): """Iterate through all AWS accounts and apply roles and policies from Github Args: *args: Optional list of arguments **kwargs: Optional list of keyword arguments Returns: `None` """ accounts = list(AWSAccount.get_all(i...
def zplane(self,auto_scale=True,size=2,detect_mult=True,tol=0.001): """ Plot the poles and zeros of the FIR filter in the z-plane """ ssd.zplane(self.b,[1],auto_scale,size,tol)
def function[zplane, parameter[self, auto_scale, size, detect_mult, tol]]: constant[ Plot the poles and zeros of the FIR filter in the z-plane ] call[name[ssd].zplane, parameter[name[self].b, list[[<ast.Constant object at 0x7da18f721d50>]], name[auto_scale], name[size], name[tol]]]
keyword[def] identifier[zplane] ( identifier[self] , identifier[auto_scale] = keyword[True] , identifier[size] = literal[int] , identifier[detect_mult] = keyword[True] , identifier[tol] = literal[int] ): literal[string] identifier[ssd] . identifier[zplane] ( identifier[self] . identifier[b] ,[ lite...
def zplane(self, auto_scale=True, size=2, detect_mult=True, tol=0.001): """ Plot the poles and zeros of the FIR filter in the z-plane """ ssd.zplane(self.b, [1], auto_scale, size, tol)
def update_appt(self, complex: str, house: str, price: str, square: str, id: str, **kwargs): """ Update existing appartment """ self.check_house(complex, house) kwargs['price'] = self._format_decimal(price) kwargs['square'] = self._format_decimal(square) self.pu...
def function[update_appt, parameter[self, complex, house, price, square, id]]: constant[ Update existing appartment ] call[name[self].check_house, parameter[name[complex], name[house]]] call[name[kwargs]][constant[price]] assign[=] call[name[self]._format_decimal, parameter[name[...
keyword[def] identifier[update_appt] ( identifier[self] , identifier[complex] : identifier[str] , identifier[house] : identifier[str] , identifier[price] : identifier[str] , identifier[square] : identifier[str] , identifier[id] : identifier[str] ,** identifier[kwargs] ): literal[string] identifier[...
def update_appt(self, complex: str, house: str, price: str, square: str, id: str, **kwargs): """ Update existing appartment """ self.check_house(complex, house) kwargs['price'] = self._format_decimal(price) kwargs['square'] = self._format_decimal(square) self.put('developers/{develop...
async def amerge(*agens) -> AsyncGenerator[Any, None]: """Thin wrapper around aiostream.stream.merge.""" xs = stream.merge(*agens) async with xs.stream() as streamer: async for x in streamer: yield x
<ast.AsyncFunctionDef object at 0x7da1b0930490>
keyword[async] keyword[def] identifier[amerge] (* identifier[agens] )-> identifier[AsyncGenerator] [ identifier[Any] , keyword[None] ]: literal[string] identifier[xs] = identifier[stream] . identifier[merge] (* identifier[agens] ) keyword[async] keyword[with] identifier[xs] . identifier[stream] () ...
async def amerge(*agens) -> AsyncGenerator[Any, None]: """Thin wrapper around aiostream.stream.merge.""" xs = stream.merge(*agens) async with xs.stream() as streamer: async for x in streamer: yield x
def get_code_breakpoint(self, dwProcessId, address): """ Returns the internally used breakpoint object, for the code breakpoint defined at the given address. @warning: It's usually best to call the L{Debug} methods instead of accessing the breakpoint objects directly. ...
def function[get_code_breakpoint, parameter[self, dwProcessId, address]]: constant[ Returns the internally used breakpoint object, for the code breakpoint defined at the given address. @warning: It's usually best to call the L{Debug} methods instead of accessing the breakpoi...
keyword[def] identifier[get_code_breakpoint] ( identifier[self] , identifier[dwProcessId] , identifier[address] ): literal[string] identifier[key] =( identifier[dwProcessId] , identifier[address] ) keyword[if] identifier[key] keyword[not] keyword[in] identifier[self] . identifier[__cod...
def get_code_breakpoint(self, dwProcessId, address): """ Returns the internally used breakpoint object, for the code breakpoint defined at the given address. @warning: It's usually best to call the L{Debug} methods instead of accessing the breakpoint objects directly. @...
def instruction_ST8(self, opcode, ea, register): """ Writes the contents of an 8-bit register into a memory location. source code forms: STA P; STB P CC bits "HNZVC": -aa0- """ value = register.value # log.debug("$%x ST8 store value $%x from %s at $%x \t| %s" % (...
def function[instruction_ST8, parameter[self, opcode, ea, register]]: constant[ Writes the contents of an 8-bit register into a memory location. source code forms: STA P; STB P CC bits "HNZVC": -aa0- ] variable[value] assign[=] name[register].value call[name[sel...
keyword[def] identifier[instruction_ST8] ( identifier[self] , identifier[opcode] , identifier[ea] , identifier[register] ): literal[string] identifier[value] = identifier[register] . identifier[value] identifier[self] . identifier[clear_NZV] ()...
def instruction_ST8(self, opcode, ea, register): """ Writes the contents of an 8-bit register into a memory location. source code forms: STA P; STB P CC bits "HNZVC": -aa0- """ value = register.value # log.debug("$%x ST8 store value $%x from %s at $%x \t| %s" % ( ...
def run(self): ''' Make the salt client call ''' if self.opts['chunked']: ret = self.run_chunked() else: ret = self.run_oldstyle() salt.output.display_output( ret, self.opts.get('output', 'nested'), ...
def function[run, parameter[self]]: constant[ Make the salt client call ] if call[name[self].opts][constant[chunked]] begin[:] variable[ret] assign[=] call[name[self].run_chunked, parameter[]] call[name[salt].output.display_output, parameter[name[ret], call[name[s...
keyword[def] identifier[run] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[opts] [ literal[string] ]: identifier[ret] = identifier[self] . identifier[run_chunked] () keyword[else] : identifier[ret] = identifier[self] . identifier...
def run(self): """ Make the salt client call """ if self.opts['chunked']: ret = self.run_chunked() # depends on [control=['if'], data=[]] else: ret = self.run_oldstyle() salt.output.display_output(ret, self.opts.get('output', 'nested'), self.opts)
def getPluginActions(self, index): """Return actions from plug-in at `index` Arguments: index (int): Index at which item is located in model """ index = self.data["proxies"]["plugin"].mapToSource( self.data["proxies"]["plugin"].index( index, 0, ...
def function[getPluginActions, parameter[self, index]]: constant[Return actions from plug-in at `index` Arguments: index (int): Index at which item is located in model ] variable[index] assign[=] call[call[call[call[name[self].data][constant[proxies]]][constant[plugin]].map...
keyword[def] identifier[getPluginActions] ( identifier[self] , identifier[index] ): literal[string] identifier[index] = identifier[self] . identifier[data] [ literal[string] ][ literal[string] ]. identifier[mapToSource] ( identifier[self] . identifier[data] [ literal[string] ][ literal[st...
def getPluginActions(self, index): """Return actions from plug-in at `index` Arguments: index (int): Index at which item is located in model """ index = self.data['proxies']['plugin'].mapToSource(self.data['proxies']['plugin'].index(index, 0, QtCore.QModelIndex())).row() item =...
def action(method=None, **kwargs): """ Decorator that turns a function or controller method into an kervi action. it is possible to call the action in other kervi processes or modules. @action def my_action(p) ... call it via Actions["my_action"](10) @a...
def function[action, parameter[method]]: constant[ Decorator that turns a function or controller method into an kervi action. it is possible to call the action in other kervi processes or modules. @action def my_action(p) ... call it via Actions["my_action"]...
keyword[def] identifier[action] ( identifier[method] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[action_wrap] ( identifier[f] ): identifier[action_id] = identifier[kwargs] . identifier[get] ( literal[string] , identifier[f] . identifier[__name__] ) ...
def action(method=None, **kwargs): """ Decorator that turns a function or controller method into an kervi action. it is possible to call the action in other kervi processes or modules. @action def my_action(p) ... call it via Actions["my_action"](10) @a...
def refinements(self): """Details for the visualization.""" self.rc("setattr a color gray @CENTROID") self.rc("setattr a radius 0.3 @CENTROID") self.rc("represent sphere @CENTROID") self.rc("setattr a color orange @CHARGE") self.rc("setattr a radius 0.4 @CHARGE") ...
def function[refinements, parameter[self]]: constant[Details for the visualization.] call[name[self].rc, parameter[constant[setattr a color gray @CENTROID]]] call[name[self].rc, parameter[constant[setattr a radius 0.3 @CENTROID]]] call[name[self].rc, parameter[constant[represent sphere @...
keyword[def] identifier[refinements] ( identifier[self] ): literal[string] identifier[self] . identifier[rc] ( literal[string] ) identifier[self] . identifier[rc] ( literal[string] ) identifier[self] . identifier[rc] ( literal[string] ) identifier[self] . identifier[rc] (...
def refinements(self): """Details for the visualization.""" self.rc('setattr a color gray @CENTROID') self.rc('setattr a radius 0.3 @CENTROID') self.rc('represent sphere @CENTROID') self.rc('setattr a color orange @CHARGE') self.rc('setattr a radius 0.4 @CHARGE') self.rc('represent sphere @C...
def get_item(item, **kwargs): """ API versioning for each OpenStack service is independent. Generically capture the public members (non-routine and non-private) of the OpenStack SDK objects. Note the lack of the modify_output decorator. Preserving the field naming allows us to reconstruct o...
def function[get_item, parameter[item]]: constant[ API versioning for each OpenStack service is independent. Generically capture the public members (non-routine and non-private) of the OpenStack SDK objects. Note the lack of the modify_output decorator. Preserving the field naming allows ...
keyword[def] identifier[get_item] ( identifier[item] ,** identifier[kwargs] ): literal[string] identifier[_item] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identifier[inspect] . identifier[getmembers] ( identifier[item] , keyword[lambda] identifier[a] : keyword[not] ( identifier[in...
def get_item(item, **kwargs): """ API versioning for each OpenStack service is independent. Generically capture the public members (non-routine and non-private) of the OpenStack SDK objects. Note the lack of the modify_output decorator. Preserving the field naming allows us to reconstruct o...
def as_artist(self, origin=(0, 0), **kwargs): """ Matplotlib Text object for this region (`matplotlib.text.Text`). Parameters ---------- origin : array_like, optional The ``(x, y)`` pixel position of the origin of the displayed image. Default is (0, 0). ...
def function[as_artist, parameter[self, origin]]: constant[ Matplotlib Text object for this region (`matplotlib.text.Text`). Parameters ---------- origin : array_like, optional The ``(x, y)`` pixel position of the origin of the displayed image. Default is...
keyword[def] identifier[as_artist] ( identifier[self] , identifier[origin] =( literal[int] , literal[int] ),** identifier[kwargs] ): literal[string] keyword[from] identifier[matplotlib] . identifier[text] keyword[import] identifier[Text] identifier[mpl_params] = identifier[self] . ide...
def as_artist(self, origin=(0, 0), **kwargs): """ Matplotlib Text object for this region (`matplotlib.text.Text`). Parameters ---------- origin : array_like, optional The ``(x, y)`` pixel position of the origin of the displayed image. Default is (0, 0). ...
def _parse_topic_path(topic_path): """Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/\ reference/rest/v1beta1/projects#\ Project.FIELDS.project_id .. _topic spec: https://c...
def function[_parse_topic_path, parameter[topic_path]]: constant[Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/ reference/rest/v1beta1/projects# Project.FIELDS.project_id ...
keyword[def] identifier[_parse_topic_path] ( identifier[topic_path] ): literal[string] identifier[match] = identifier[_TOPIC_REF_RE] . identifier[match] ( identifier[topic_path] ) keyword[if] identifier[match] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( identifier[...
def _parse_topic_path(topic_path): """Verify that a topic path is in the correct format. .. _resource manager docs: https://cloud.google.com/resource-manager/ reference/rest/v1beta1/projects# Project.FIELDS.project_id .. _topic spec: https://cloud...
def get_default(self, *args, **kwargs): """Get the default parameters as defined in the Settings instance. This function proceeds to seamlessly retrieve the argument to pass through, depending on either it was overidden or not: If no argument was overridden in a function of the toolbox,...
def function[get_default, parameter[self]]: constant[Get the default parameters as defined in the Settings instance. This function proceeds to seamlessly retrieve the argument to pass through, depending on either it was overidden or not: If no argument was overridden in a function of th...
keyword[def] identifier[get_default] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[retrieve_param] ( identifier[i] ): keyword[try] : keyword[return] identifier[self] . identifier[__getattribute__] ( identifie...
def get_default(self, *args, **kwargs): """Get the default parameters as defined in the Settings instance. This function proceeds to seamlessly retrieve the argument to pass through, depending on either it was overidden or not: If no argument was overridden in a function of the toolbox, the...
def get_changeset(changeset): """Get the changeset using the OSM API and return the content as a XML ElementTree. Args: changeset: the id of the changeset. """ url = 'https://www.openstreetmap.org/api/0.6/changeset/{}/download'.format( changeset ) return ET.fromstring(re...
def function[get_changeset, parameter[changeset]]: constant[Get the changeset using the OSM API and return the content as a XML ElementTree. Args: changeset: the id of the changeset. ] variable[url] assign[=] call[constant[https://www.openstreetmap.org/api/0.6/changeset/{}/download]...
keyword[def] identifier[get_changeset] ( identifier[changeset] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[changeset] ) keyword[return] identifier[ET] . identifier[fromstring] ( identifier[requests] . identifier[get] ( identifier[url] ). identifier...
def get_changeset(changeset): """Get the changeset using the OSM API and return the content as a XML ElementTree. Args: changeset: the id of the changeset. """ url = 'https://www.openstreetmap.org/api/0.6/changeset/{}/download'.format(changeset) return ET.fromstring(requests.get(url).co...
def predecessors(self, node, exclude_compressed=True): """ Returns the list of predecessors of a given node Parameters ---------- node : str The target node exclude_compressed : boolean If true, compressed nodes are excluded from the predecessors...
def function[predecessors, parameter[self, node, exclude_compressed]]: constant[ Returns the list of predecessors of a given node Parameters ---------- node : str The target node exclude_compressed : boolean If true, compressed nodes are excluded...
keyword[def] identifier[predecessors] ( identifier[self] , identifier[node] , identifier[exclude_compressed] = keyword[True] ): literal[string] identifier[preds] = identifier[super] ( identifier[Graph] , identifier[self] ). identifier[predecessors] ( identifier[node] ) keyword[if] identif...
def predecessors(self, node, exclude_compressed=True): """ Returns the list of predecessors of a given node Parameters ---------- node : str The target node exclude_compressed : boolean If true, compressed nodes are excluded from the predecessors lis...
def grouper(n, iterable): """Itertools recipe >>> list(grouper(3, iter('ABCDEFG'))) [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] """ return (iterable[i:i + n] for i in range(0, len(iterable), n))
def function[grouper, parameter[n, iterable]]: constant[Itertools recipe >>> list(grouper(3, iter('ABCDEFG'))) [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] ] return[<ast.GeneratorExp object at 0x7da1b1f4abc0>]
keyword[def] identifier[grouper] ( identifier[n] , identifier[iterable] ): literal[string] keyword[return] ( identifier[iterable] [ identifier[i] : identifier[i] + identifier[n] ] keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[len] ( identifier[iterable] ), identifi...
def grouper(n, iterable): """Itertools recipe >>> list(grouper(3, iter('ABCDEFG'))) [['A', 'B', 'C'], ['D', 'E', 'F'], ['G']] """ return (iterable[i:i + n] for i in range(0, len(iterable), n))
def _clean(self): """Remove references of inactive workers periodically.""" if self._workers: for w in self._workers: if w.is_finished(): self._workers.remove(w) else: self._current_worker = None self._timer.stop()
def function[_clean, parameter[self]]: constant[Remove references of inactive workers periodically.] if name[self]._workers begin[:] for taget[name[w]] in starred[name[self]._workers] begin[:] if call[name[w].is_finished, parameter[]] begin[:] ...
keyword[def] identifier[_clean] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_workers] : keyword[for] identifier[w] keyword[in] identifier[self] . identifier[_workers] : keyword[if] identifier[w] . identifier[is_finished] (): ...
def _clean(self): """Remove references of inactive workers periodically.""" if self._workers: for w in self._workers: if w.is_finished(): self._workers.remove(w) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['w']] # depends on [control=['if'],...
def add_header(self, name, value): """ Add an additional response header, not removing duplicates. """ self._headers.setdefault(_hkey(name), []).append(_hval(value))
def function[add_header, parameter[self, name, value]]: constant[ Add an additional response header, not removing duplicates. ] call[call[name[self]._headers.setdefault, parameter[call[name[_hkey], parameter[name[name]]], list[[]]]].append, parameter[call[name[_hval], parameter[name[value]]]]]
keyword[def] identifier[add_header] ( identifier[self] , identifier[name] , identifier[value] ): literal[string] identifier[self] . identifier[_headers] . identifier[setdefault] ( identifier[_hkey] ( identifier[name] ),[]). identifier[append] ( identifier[_hval] ( identifier[value] ))
def add_header(self, name, value): """ Add an additional response header, not removing duplicates. """ self._headers.setdefault(_hkey(name), []).append(_hval(value))
def addToPrePrepares(self, pp: PrePrepare) -> None: """ Add the specified PRE-PREPARE to this replica's list of received PRE-PREPAREs and try sending PREPARE :param pp: the PRE-PREPARE to add to the list """ key = (pp.viewNo, pp.ppSeqNo) self.prePrepares[key] = p...
def function[addToPrePrepares, parameter[self, pp]]: constant[ Add the specified PRE-PREPARE to this replica's list of received PRE-PREPAREs and try sending PREPARE :param pp: the PRE-PREPARE to add to the list ] variable[key] assign[=] tuple[[<ast.Attribute object at 0x...
keyword[def] identifier[addToPrePrepares] ( identifier[self] , identifier[pp] : identifier[PrePrepare] )-> keyword[None] : literal[string] identifier[key] =( identifier[pp] . identifier[viewNo] , identifier[pp] . identifier[ppSeqNo] ) identifier[self] . identifier[prePrepares] [ identifier...
def addToPrePrepares(self, pp: PrePrepare) -> None: """ Add the specified PRE-PREPARE to this replica's list of received PRE-PREPAREs and try sending PREPARE :param pp: the PRE-PREPARE to add to the list """ key = (pp.viewNo, pp.ppSeqNo) self.prePrepares[key] = pp self.l...
def _see_remote_link_node(self, node_id, fringe=None, dist=None, check_dsp=lambda x: True): """ See data remote links of the node (set output to remote links). :param node_id: Node id. :type node_id: str :param fringe: Heapq...
def function[_see_remote_link_node, parameter[self, node_id, fringe, dist, check_dsp]]: constant[ See data remote links of the node (set output to remote links). :param node_id: Node id. :type node_id: str :param fringe: Heapq of closest available nodes....
keyword[def] identifier[_see_remote_link_node] ( identifier[self] , identifier[node_id] , identifier[fringe] = keyword[None] , identifier[dist] = keyword[None] , identifier[check_dsp] = keyword[lambda] identifier[x] : keyword[True] ): literal[string] identifier[node] , identifier[p_id] ,...
def _see_remote_link_node(self, node_id, fringe=None, dist=None, check_dsp=lambda x: True): """ See data remote links of the node (set output to remote links). :param node_id: Node id. :type node_id: str :param fringe: Heapq of closest available nodes. ...
def check_dimensions(self, dataset): ''' Checks that the feature types of this dataset are consistent with a timeseries-profile-orthogonal dataset. :param netCDF4.Dataset dataset: An open netCDF dataset ''' results = [] required_ctx = TestCtx(BaseCheck.HIGH, 'All geophys...
def function[check_dimensions, parameter[self, dataset]]: constant[ Checks that the feature types of this dataset are consistent with a timeseries-profile-orthogonal dataset. :param netCDF4.Dataset dataset: An open netCDF dataset ] variable[results] assign[=] list[[]] va...
keyword[def] identifier[check_dimensions] ( identifier[self] , identifier[dataset] ): literal[string] identifier[results] =[] identifier[required_ctx] = identifier[TestCtx] ( identifier[BaseCheck] . identifier[HIGH] , literal[string] ) identifier[message] = literal[string] ...
def check_dimensions(self, dataset): """ Checks that the feature types of this dataset are consistent with a timeseries-profile-orthogonal dataset. :param netCDF4.Dataset dataset: An open netCDF dataset """ results = [] required_ctx = TestCtx(BaseCheck.HIGH, 'All geophysical variabl...
def rename_next_state_fluent(name: str) -> str: '''Returns next state fluent canonical name. Args: name (str): The current state fluent name. Returns: str: The next state fluent name. ''' i = name.index('/') functor = name[:i-1] arity = name[i+1:] return "{}/{}".format(...
def function[rename_next_state_fluent, parameter[name]]: constant[Returns next state fluent canonical name. Args: name (str): The current state fluent name. Returns: str: The next state fluent name. ] variable[i] assign[=] call[name[name].index, parameter[constant[/]]] ...
keyword[def] identifier[rename_next_state_fluent] ( identifier[name] : identifier[str] )-> identifier[str] : literal[string] identifier[i] = identifier[name] . identifier[index] ( literal[string] ) identifier[functor] = identifier[name] [: identifier[i] - literal[int] ] identifier[arity] = identi...
def rename_next_state_fluent(name: str) -> str: """Returns next state fluent canonical name. Args: name (str): The current state fluent name. Returns: str: The next state fluent name. """ i = name.index('/') functor = name[:i - 1] arity = name[i + 1:] return '{}/{}'.for...
def ext_pillar(minion_id, pillar, *args, **kwargs): ''' Execute queries against POSTGRES, merge and return as a dict ''' return POSTGRESExtPillar().fetch(minion_id, pillar, *args, **kwargs)
def function[ext_pillar, parameter[minion_id, pillar]]: constant[ Execute queries against POSTGRES, merge and return as a dict ] return[call[call[name[POSTGRESExtPillar], parameter[]].fetch, parameter[name[minion_id], name[pillar], <ast.Starred object at 0x7da18dc99c60>]]]
keyword[def] identifier[ext_pillar] ( identifier[minion_id] , identifier[pillar] , * identifier[args] , ** identifier[kwargs] ): literal[string] keyword[return] identifier[POSTGRESExtPillar] (). identifier[fetch] ( identifier[minion_id] , identifier[pillar] ,* identifier[args] ,** identifier[kwargs] )
def ext_pillar(minion_id, pillar, *args, **kwargs): """ Execute queries against POSTGRES, merge and return as a dict """ return POSTGRESExtPillar().fetch(minion_id, pillar, *args, **kwargs)
def _check_transition_validity(self, check_transition): """ Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState. Start transitions are forbidden in the ConcurrencyState. :param check_transition: the transition to check for validity :return: ...
def function[_check_transition_validity, parameter[self, check_transition]]: constant[ Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState. Start transitions are forbidden in the ConcurrencyState. :param check_transition: the transition to check for valid...
keyword[def] identifier[_check_transition_validity] ( identifier[self] , identifier[check_transition] ): literal[string] identifier[valid] , identifier[message] = identifier[super] ( identifier[BarrierConcurrencyState] , identifier[self] ). identifier[_check_transition_validity] ( identifier[check_...
def _check_transition_validity(self, check_transition): """ Transition of BarrierConcurrencyStates must least fulfill the condition of a ContainerState. Start transitions are forbidden in the ConcurrencyState. :param check_transition: the transition to check for validity :return: ""...
def status( message: str = None, progress: float = None, section_message: str = None, section_progress: float = None, ): """ Updates the status display, which is only visible while a step is running. This is useful for providing feedback and information during long-running ...
def function[status, parameter[message, progress, section_message, section_progress]]: constant[ Updates the status display, which is only visible while a step is running. This is useful for providing feedback and information during long-running steps. A section progress is also available for c...
keyword[def] identifier[status] ( identifier[message] : identifier[str] = keyword[None] , identifier[progress] : identifier[float] = keyword[None] , identifier[section_message] : identifier[str] = keyword[None] , identifier[section_progress] : identifier[float] = keyword[None] , ): literal[string] iden...
def status(message: str=None, progress: float=None, section_message: str=None, section_progress: float=None): """ Updates the status display, which is only visible while a step is running. This is useful for providing feedback and information during long-running steps. A section progress is also av...
def close(self): """Close the file, and for mode 'w', 'x' and 'a' write the ending records.""" if self.fp is None: return try: if self.mode in ('w', 'x', 'a') and self._didModify: # write ending records with self._lock: if sel...
def function[close, parameter[self]]: constant[Close the file, and for mode 'w', 'x' and 'a' write the ending records.] if compare[name[self].fp is constant[None]] begin[:] return[None] <ast.Try object at 0x7da1b11123e0>
keyword[def] identifier[close] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[fp] keyword[is] keyword[None] : keyword[return] keyword[try] : keyword[if] identifier[self] . identifier[mode] keyword[in] ( literal[string] , lit...
def close(self): """Close the file, and for mode 'w', 'x' and 'a' write the ending records.""" if self.fp is None: return # depends on [control=['if'], data=[]] try: if self.mode in ('w', 'x', 'a') and self._didModify: # write ending records with self._lock: ...
def write_raster_window( in_tile=None, in_data=None, out_profile=None, out_tile=None, out_path=None, tags=None, bucket_resource=None ): """ Write a window from a numpy array to an output file. Parameters ---------- in_tile : ``BufferedTile`` ``BufferedTile`` with a data attribute ho...
def function[write_raster_window, parameter[in_tile, in_data, out_profile, out_tile, out_path, tags, bucket_resource]]: constant[ Write a window from a numpy array to an output file. Parameters ---------- in_tile : ``BufferedTile`` ``BufferedTile`` with a data attribute holding NumPy da...
keyword[def] identifier[write_raster_window] ( identifier[in_tile] = keyword[None] , identifier[in_data] = keyword[None] , identifier[out_profile] = keyword[None] , identifier[out_tile] = keyword[None] , identifier[out_path] = keyword[None] , identifier[tags] = keyword[None] , identifier[bucket_resource] = keyword[...
def write_raster_window(in_tile=None, in_data=None, out_profile=None, out_tile=None, out_path=None, tags=None, bucket_resource=None): """ Write a window from a numpy array to an output file. Parameters ---------- in_tile : ``BufferedTile`` ``BufferedTile`` with a data attribute holding NumP...
def get_translation(self, language_code, related_name=None): """ Fetch the translated model """ meta = self._parler_meta._get_extension_by_related_name(related_name) return self._get_translated_model(language_code, meta=meta)
def function[get_translation, parameter[self, language_code, related_name]]: constant[ Fetch the translated model ] variable[meta] assign[=] call[name[self]._parler_meta._get_extension_by_related_name, parameter[name[related_name]]] return[call[name[self]._get_translated_model, param...
keyword[def] identifier[get_translation] ( identifier[self] , identifier[language_code] , identifier[related_name] = keyword[None] ): literal[string] identifier[meta] = identifier[self] . identifier[_parler_meta] . identifier[_get_extension_by_related_name] ( identifier[related_name] ) key...
def get_translation(self, language_code, related_name=None): """ Fetch the translated model """ meta = self._parler_meta._get_extension_by_related_name(related_name) return self._get_translated_model(language_code, meta=meta)
def setUrl(self, url): """ Attempt to safely set the URL by string. """ if isUrl(url): self._url = url else: raise exceptions.BadUrlException(url) return self
def function[setUrl, parameter[self, url]]: constant[ Attempt to safely set the URL by string. ] if call[name[isUrl], parameter[name[url]]] begin[:] name[self]._url assign[=] name[url] return[name[self]]
keyword[def] identifier[setUrl] ( identifier[self] , identifier[url] ): literal[string] keyword[if] identifier[isUrl] ( identifier[url] ): identifier[self] . identifier[_url] = identifier[url] keyword[else] : keyword[raise] identifier[exceptions] . identifier[B...
def setUrl(self, url): """ Attempt to safely set the URL by string. """ if isUrl(url): self._url = url # depends on [control=['if'], data=[]] else: raise exceptions.BadUrlException(url) return self
def explain_prediction_df(estimator, doc, **kwargs): # type: (...) -> pd.DataFrame """ Explain prediction and export explanation to ``pandas.DataFrame`` All keyword arguments are passed to :func:`eli5.explain_prediction`. Weights of all features are exported by default. """ kwargs = _set_default...
def function[explain_prediction_df, parameter[estimator, doc]]: constant[ Explain prediction and export explanation to ``pandas.DataFrame`` All keyword arguments are passed to :func:`eli5.explain_prediction`. Weights of all features are exported by default. ] variable[kwargs] assign[=] call[...
keyword[def] identifier[explain_prediction_df] ( identifier[estimator] , identifier[doc] ,** identifier[kwargs] ): literal[string] identifier[kwargs] = identifier[_set_defaults] ( identifier[kwargs] ) keyword[return] identifier[format_as_dataframe] ( identifier[eli5] . identifier[explain_predic...
def explain_prediction_df(estimator, doc, **kwargs): # type: (...) -> pd.DataFrame ' Explain prediction and export explanation to ``pandas.DataFrame``\n All keyword arguments are passed to :func:`eli5.explain_prediction`.\n Weights of all features are exported by default.\n ' kwargs = _set_defaults...
def histogram(values, mode=0, bin_function=None): """Return a list of (value, count) pairs, summarizing the input values. Sorted by increasing value, or if mode=1, by decreasing count. If bin_function is given, map it over values first.""" if bin_function: values = map(bin_function, values) bins = {...
def function[histogram, parameter[values, mode, bin_function]]: constant[Return a list of (value, count) pairs, summarizing the input values. Sorted by increasing value, or if mode=1, by decreasing count. If bin_function is given, map it over values first.] if name[bin_function] begin[:] ...
keyword[def] identifier[histogram] ( identifier[values] , identifier[mode] = literal[int] , identifier[bin_function] = keyword[None] ): literal[string] keyword[if] identifier[bin_function] : identifier[values] = identifier[map] ( identifier[bin_function] , identifier[values] ) identifier[bins] ={} ...
def histogram(values, mode=0, bin_function=None): """Return a list of (value, count) pairs, summarizing the input values. Sorted by increasing value, or if mode=1, by decreasing count. If bin_function is given, map it over values first.""" if bin_function: values = map(bin_function, values) # d...
def read(self): """ (Re)read the configuration. Beware that the current work directory may affect this operation: If there is a 'paperwork.conf' in the current directory, it will be read instead of '~/.paperwork.conf', see __init__()) """ logger.info("Reloading %...
def function[read, parameter[self]]: constant[ (Re)read the configuration. Beware that the current work directory may affect this operation: If there is a 'paperwork.conf' in the current directory, it will be read instead of '~/.paperwork.conf', see __init__()) ] ...
keyword[def] identifier[read] ( identifier[self] ): literal[string] identifier[logger] . identifier[info] ( literal[string] % identifier[self] . identifier[__configfile] ) identifier[self] . identifier[_configparser] = identifier[configparser] . identifier[SafeConfigParser] () ...
def read(self): """ (Re)read the configuration. Beware that the current work directory may affect this operation: If there is a 'paperwork.conf' in the current directory, it will be read instead of '~/.paperwork.conf', see __init__()) """ logger.info('Reloading %s ...' %...
def register_pubkey(self): """ XXX Support compressed point format. XXX Check that the pubkey received is on the curve. """ # point_format = 0 # if self.point[0] in [b'\x02', b'\x03']: # point_format = 1 curve_name = _tls_named_curves[self.named_curve]...
def function[register_pubkey, parameter[self]]: constant[ XXX Support compressed point format. XXX Check that the pubkey received is on the curve. ] variable[curve_name] assign[=] call[name[_tls_named_curves]][name[self].named_curve] variable[curve] assign[=] call[call[na...
keyword[def] identifier[register_pubkey] ( identifier[self] ): literal[string] identifier[curve_name] = identifier[_tls_named_curves] [ identifier[self] . identifier[named_curve] ] identifier[curve] = identifier[ec] . identifier[_CURVE_TYPES] [ identifier[curve_...
def register_pubkey(self): """ XXX Support compressed point format. XXX Check that the pubkey received is on the curve. """ # point_format = 0 # if self.point[0] in [b'\x02', b'\x03']: # point_format = 1 curve_name = _tls_named_curves[self.named_curve] curve = ec._CURV...
def any_datetime(from_date=datetime(1990, 1, 1), to_date=datetime.now()): """ Return random datetime from the [from_date, to_date] interval >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3)) >>> type(result) <type 'datetime.datetime'> >>> result >= dateti...
def function[any_datetime, parameter[from_date, to_date]]: constant[ Return random datetime from the [from_date, to_date] interval >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3)) >>> type(result) <type 'datetime.datetime'> >>> result >= datetime(1990,1,1)...
keyword[def] identifier[any_datetime] ( identifier[from_date] = identifier[datetime] ( literal[int] , literal[int] , literal[int] ), identifier[to_date] = identifier[datetime] . identifier[now] ()): literal[string] identifier[days] = identifier[any_int] ( identifier[min_value] = literal[int] , identifier...
def any_datetime(from_date=datetime(1990, 1, 1), to_date=datetime.now()): """ Return random datetime from the [from_date, to_date] interval >>> result = any_datetime(from_date=datetime(1990,1,1), to_date=datetime(1990,1,3)) >>> type(result) <type 'datetime.datetime'> >>> result >= datetime(1990...
def sniff_csv_format(csv_file, potential_sep=['\t', ',', ';', '|', '-', '_'], max_test_lines=10, zip_file=None): """ Tries to get the separator, nr of index cols and header rows in a csv file Parameters ---------- csv_file: str Pat...
def function[sniff_csv_format, parameter[csv_file, potential_sep, max_test_lines, zip_file]]: constant[ Tries to get the separator, nr of index cols and header rows in a csv file Parameters ---------- csv_file: str Path to a csv file potential_sep: list, optional List of poten...
keyword[def] identifier[sniff_csv_format] ( identifier[csv_file] , identifier[potential_sep] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] ], identifier[max_test_lines] = literal[int] , identifier[zip_file] = keyword[None] ): literal[string] ...
def sniff_csv_format(csv_file, potential_sep=['\t', ',', ';', '|', '-', '_'], max_test_lines=10, zip_file=None): """ Tries to get the separator, nr of index cols and header rows in a csv file Parameters ---------- csv_file: str Path to a csv file potential_sep: list, optional List...
def is_solved(self): """ Check if Cube's F2L is solved. """ if self.cube.D == [[Square(self.cube["D"].colour)] * 3] * 3: for face in "LFRB": if self.cube.get_face(face)[1:] != [[Square(self.cube[face].colour)] * 3] * 2: return False ...
def function[is_solved, parameter[self]]: constant[ Check if Cube's F2L is solved. ] if compare[name[self].cube.D equal[==] binary_operation[list[[<ast.BinOp object at 0x7da1b07b6f80>]] * constant[3]]] begin[:] for taget[name[face]] in starred[constant[LFRB]] begin[:] ...
keyword[def] identifier[is_solved] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[cube] . identifier[D] ==[[ identifier[Square] ( identifier[self] . identifier[cube] [ literal[string] ]. identifier[colour] )]* literal[int] ]* literal[int] : keyword[for...
def is_solved(self): """ Check if Cube's F2L is solved. """ if self.cube.D == [[Square(self.cube['D'].colour)] * 3] * 3: for face in 'LFRB': if self.cube.get_face(face)[1:] != [[Square(self.cube[face].colour)] * 3] * 2: return False # depends on [control=['if...
def update_datetime(value, range = None): """ Updates (drifts) a Date value within specified range defined :param value: a Date value to drift. :param range: (optional) a range in milliseconds. Default: 10 days :return: an updated DateTime value. """ range = ra...
def function[update_datetime, parameter[value, range]]: constant[ Updates (drifts) a Date value within specified range defined :param value: a Date value to drift. :param range: (optional) a range in milliseconds. Default: 10 days :return: an updated DateTime value. ] ...
keyword[def] identifier[update_datetime] ( identifier[value] , identifier[range] = keyword[None] ): literal[string] identifier[range] = identifier[range] keyword[if] identifier[range] != keyword[None] keyword[else] literal[int] keyword[if] identifier[range] < literal[int] : ...
def update_datetime(value, range=None): """ Updates (drifts) a Date value within specified range defined :param value: a Date value to drift. :param range: (optional) a range in milliseconds. Default: 10 days :return: an updated DateTime value. """ range = range if ran...
def hit(self, event): """ Notify a breakpoint that it's been hit. This triggers the corresponding state transition and sets the C{breakpoint} property of the given L{Event} object. @see: L{disable}, L{enable}, L{one_shot}, L{running} @type event: L{Event} @par...
def function[hit, parameter[self, event]]: constant[ Notify a breakpoint that it's been hit. This triggers the corresponding state transition and sets the C{breakpoint} property of the given L{Event} object. @see: L{disable}, L{enable}, L{one_shot}, L{running} @type e...
keyword[def] identifier[hit] ( identifier[self] , identifier[event] ): literal[string] identifier[aProcess] = identifier[event] . identifier[get_process] () identifier[aThread] = identifier[event] . identifier[get_thread] () identifier[state] = identifier[self] . identifier[get_st...
def hit(self, event): """ Notify a breakpoint that it's been hit. This triggers the corresponding state transition and sets the C{breakpoint} property of the given L{Event} object. @see: L{disable}, L{enable}, L{one_shot}, L{running} @type event: L{Event} @param e...
def compute_diff(dir_base, dir_cmp): """ Compare `dir_base' and `dir_cmp' and returns a list with the following keys: - deleted files `deleted' - created files `created' - updated files `updated' - deleted directories `deleted_dirs' """ data = {} data['deleted'] = list(set(dir_c...
def function[compute_diff, parameter[dir_base, dir_cmp]]: constant[ Compare `dir_base' and `dir_cmp' and returns a list with the following keys: - deleted files `deleted' - created files `created' - updated files `updated' - deleted directories `deleted_dirs' ] variable[data...
keyword[def] identifier[compute_diff] ( identifier[dir_base] , identifier[dir_cmp] ): literal[string] identifier[data] ={} identifier[data] [ literal[string] ]= identifier[list] ( identifier[set] ( identifier[dir_cmp] [ literal[string] ])- identifier[set] ( identifier[dir_base] [ literal[string] ])) ...
def compute_diff(dir_base, dir_cmp): """ Compare `dir_base' and `dir_cmp' and returns a list with the following keys: - deleted files `deleted' - created files `created' - updated files `updated' - deleted directories `deleted_dirs' """ data = {} data['deleted'] = list(set(dir_c...
def replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): """ Returns a new datetime.datetime or asn1crypto.util.extended_datetime object with the specified components replaced :return: A datetime....
def function[replace, parameter[self, year, month, day, hour, minute, second, microsecond, tzinfo]]: constant[ Returns a new datetime.datetime or asn1crypto.util.extended_datetime object with the specified components replaced :return: A datetime.datetime or asn1crypto.util.e...
keyword[def] identifier[replace] ( identifier[self] , identifier[year] = keyword[None] , identifier[month] = keyword[None] , identifier[day] = keyword[None] , identifier[hour] = keyword[None] , identifier[minute] = keyword[None] , identifier[second] = keyword[None] , identifier[microsecond] = keyword[None] , identif...
def replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=None): """ Returns a new datetime.datetime or asn1crypto.util.extended_datetime object with the specified components replaced :return: A datetime.datetime or asn1cryp...
def fcoe_get_login_output_fcoe_login_list_fcoe_login_direct_attached(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") fcoe_get_login = ET.Element("fcoe_get_login") config = fcoe_get_login output = ET.SubElement(fcoe_get_login, "output") fc...
def function[fcoe_get_login_output_fcoe_login_list_fcoe_login_direct_attached, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[fcoe_get_login] assign[=] call[name[ET].Element, parameter[constant[fcoe...
keyword[def] identifier[fcoe_get_login_output_fcoe_login_list_fcoe_login_direct_attached] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[fcoe_get_login] = identifier[ET] . identifier[Elem...
def fcoe_get_login_output_fcoe_login_list_fcoe_login_direct_attached(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') fcoe_get_login = ET.Element('fcoe_get_login') config = fcoe_get_login output = ET.SubElement(fcoe_get_login, 'output') fcoe_login_list = ET.SubEl...
def from_dict(self, mapdict): """ Import the attribute map from a dictionary :param mapdict: The dictionary """ self.name_format = mapdict["identifier"] try: self._fro = dict( [(k.lower(), v) for k, v in mapdict["fro"].items()]) except KeyEr...
def function[from_dict, parameter[self, mapdict]]: constant[ Import the attribute map from a dictionary :param mapdict: The dictionary ] name[self].name_format assign[=] call[name[mapdict]][constant[identifier]] <ast.Try object at 0x7da1b206a4d0> <ast.Try object at 0x7da20e9608...
keyword[def] identifier[from_dict] ( identifier[self] , identifier[mapdict] ): literal[string] identifier[self] . identifier[name_format] = identifier[mapdict] [ literal[string] ] keyword[try] : identifier[self] . identifier[_fro] = identifier[dict] ( [( identifie...
def from_dict(self, mapdict): """ Import the attribute map from a dictionary :param mapdict: The dictionary """ self.name_format = mapdict['identifier'] try: self._fro = dict([(k.lower(), v) for (k, v) in mapdict['fro'].items()]) # depends on [control=['try'], data=[]] except ...
def sign(self, blob, identity): """Sign a given blob using the specified identity on the device.""" conn = self.conn_factory() return conn.sign_ssh_challenge(blob=blob, identity=identity)
def function[sign, parameter[self, blob, identity]]: constant[Sign a given blob using the specified identity on the device.] variable[conn] assign[=] call[name[self].conn_factory, parameter[]] return[call[name[conn].sign_ssh_challenge, parameter[]]]
keyword[def] identifier[sign] ( identifier[self] , identifier[blob] , identifier[identity] ): literal[string] identifier[conn] = identifier[self] . identifier[conn_factory] () keyword[return] identifier[conn] . identifier[sign_ssh_challenge] ( identifier[blob] = identifier[blob] , identif...
def sign(self, blob, identity): """Sign a given blob using the specified identity on the device.""" conn = self.conn_factory() return conn.sign_ssh_challenge(blob=blob, identity=identity)
def to_sparse(self, format='csr', **kwargs): """Convert into a sparse matrix. Parameters ---------- format : {'coo', 'csc', 'csr', 'dia', 'dok', 'lil'} Sparse matrix format. kwargs : keyword arguments Passed through to sparse matrix constructor. ...
def function[to_sparse, parameter[self, format]]: constant[Convert into a sparse matrix. Parameters ---------- format : {'coo', 'csc', 'csr', 'dia', 'dok', 'lil'} Sparse matrix format. kwargs : keyword arguments Passed through to sparse matrix constructor...
keyword[def] identifier[to_sparse] ( identifier[self] , identifier[format] = literal[string] ,** identifier[kwargs] ): literal[string] identifier[h] = identifier[self] . identifier[to_haplotypes] () identifier[m] = identifier[h] . identifier[to_sparse] ( identifier[format] = identifier[fo...
def to_sparse(self, format='csr', **kwargs): """Convert into a sparse matrix. Parameters ---------- format : {'coo', 'csc', 'csr', 'dia', 'dok', 'lil'} Sparse matrix format. kwargs : keyword arguments Passed through to sparse matrix constructor. Retu...
def last_active(self): """ Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor """ result = None for actor in reversed(self.actors): if not actor.skip: result = actor ...
def function[last_active, parameter[self]]: constant[ Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor ] variable[result] assign[=] constant[None] for taget[name[actor]] in starred[call[name[reversed], parame...
keyword[def] identifier[last_active] ( identifier[self] ): literal[string] identifier[result] = keyword[None] keyword[for] identifier[actor] keyword[in] identifier[reversed] ( identifier[self] . identifier[actors] ): keyword[if] keyword[not] identifier[actor] . identifie...
def last_active(self): """ Returns the last non-skipped actor. :return: the last active actor, None if not available :rtype: Actor """ result = None for actor in reversed(self.actors): if not actor.skip: result = actor break # depends on [con...
def csv_tolist(path_to_file, **kwargs): """ Parse the csv file to a list of rows. """ result = [] encoding = kwargs.get('encoding', 'utf-8') delimiter = kwargs.get('delimiter', ',') dialect = kwargs.get('dialect', csv.excel) _, _ext = path_to_file.split('.', 1) try: file...
def function[csv_tolist, parameter[path_to_file]]: constant[ Parse the csv file to a list of rows. ] variable[result] assign[=] list[[]] variable[encoding] assign[=] call[name[kwargs].get, parameter[constant[encoding], constant[utf-8]]] variable[delimiter] assign[=] call[name[kwa...
keyword[def] identifier[csv_tolist] ( identifier[path_to_file] ,** identifier[kwargs] ): literal[string] identifier[result] =[] identifier[encoding] = identifier[kwargs] . identifier[get] ( literal[string] , literal[string] ) identifier[delimiter] = identifier[kwargs] . identifier[get] ( litera...
def csv_tolist(path_to_file, **kwargs): """ Parse the csv file to a list of rows. """ result = [] encoding = kwargs.get('encoding', 'utf-8') delimiter = kwargs.get('delimiter', ',') dialect = kwargs.get('dialect', csv.excel) (_, _ext) = path_to_file.split('.', 1) try: file = ...
def recommendations(self, **kwargs): """ Get a list of recommended movies for a movie. Args: language: (optional) ISO 639-1 code. page: (optional) Minimum value of 1. Expected value is an integer. Returns: A dict representation of the JSON returned ...
def function[recommendations, parameter[self]]: constant[ Get a list of recommended movies for a movie. Args: language: (optional) ISO 639-1 code. page: (optional) Minimum value of 1. Expected value is an integer. Returns: A dict representation of t...
keyword[def] identifier[recommendations] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[path] = identifier[self] . identifier[_get_id_path] ( literal[string] ) identifier[response] = identifier[self] . identifier[_GET] ( identifier[path] , identifier[kwargs] ) ...
def recommendations(self, **kwargs): """ Get a list of recommended movies for a movie. Args: language: (optional) ISO 639-1 code. page: (optional) Minimum value of 1. Expected value is an integer. Returns: A dict representation of the JSON returned from...
def add_user(self, group, username): """ Add a user to the specified LDAP group. Args: group: Name of group to update username: Username of user to add Raises: ldap_tools.exceptions.InvalidResult: Results of the query were invalid. T...
def function[add_user, parameter[self, group, username]]: constant[ Add a user to the specified LDAP group. Args: group: Name of group to update username: Username of user to add Raises: ldap_tools.exceptions.InvalidResult: Results of...
keyword[def] identifier[add_user] ( identifier[self] , identifier[group] , identifier[username] ): literal[string] keyword[try] : identifier[self] . identifier[lookup_id] ( identifier[group] ) keyword[except] identifier[ldap_tools] . identifier[exceptions] . identifier[Invali...
def add_user(self, group, username): """ Add a user to the specified LDAP group. Args: group: Name of group to update username: Username of user to add Raises: ldap_tools.exceptions.InvalidResult: Results of the query were invalid. The a...
def tx_xml(self): """ Return the ``<c:tx>`` (tx is short for 'text') element for this series as unicode text. This element contains the series name. """ return self._tx_tmpl.format(**{ 'wksht_ref': self._series.name_ref, 'series_name': self.name, ...
def function[tx_xml, parameter[self]]: constant[ Return the ``<c:tx>`` (tx is short for 'text') element for this series as unicode text. This element contains the series name. ] return[call[name[self]._tx_tmpl.format, parameter[]]]
keyword[def] identifier[tx_xml] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[_tx_tmpl] . identifier[format] (**{ literal[string] : identifier[self] . identifier[_series] . identifier[name_ref] , literal[string] : identifier[self] . identifie...
def tx_xml(self): """ Return the ``<c:tx>`` (tx is short for 'text') element for this series as unicode text. This element contains the series name. """ return self._tx_tmpl.format(**{'wksht_ref': self._series.name_ref, 'series_name': self.name, 'nsdecls': ''})
def create_item(self, token, name, parent_id, **kwargs): """ Create an item to the server. :param token: A valid token for the user in question. :type token: string :param name: The name of the item to be created. :type name: string :param parent_id: The id of th...
def function[create_item, parameter[self, token, name, parent_id]]: constant[ Create an item to the server. :param token: A valid token for the user in question. :type token: string :param name: The name of the item to be created. :type name: string :param parent...
keyword[def] identifier[create_item] ( identifier[self] , identifier[token] , identifier[name] , identifier[parent_id] ,** identifier[kwargs] ): literal[string] identifier[parameters] = identifier[dict] () identifier[parameters] [ literal[string] ]= identifier[token] identifier[p...
def create_item(self, token, name, parent_id, **kwargs): """ Create an item to the server. :param token: A valid token for the user in question. :type token: string :param name: The name of the item to be created. :type name: string :param parent_id: The id of the de...
def get_all_payments_of_incoming(self, incoming_id): """ Get all payments of incoming This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing :param incoming_id: the incoming id :retur...
def function[get_all_payments_of_incoming, parameter[self, incoming_id]]: constant[ Get all payments of incoming This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing :param incoming_id: the...
keyword[def] identifier[get_all_payments_of_incoming] ( identifier[self] , identifier[incoming_id] ): literal[string] keyword[return] identifier[self] . identifier[_iterate_through_pages] ( identifier[get_function] = identifier[self] . identifier[get_payments_of_incoming_per_page] , ...
def get_all_payments_of_incoming(self, incoming_id): """ Get all payments of incoming This will iterate over all pages until it gets all elements. So if the rate limit exceeded it will throw an Exception and you will get nothing :param incoming_id: the incoming id :return: l...
def work(self): """ Entry point after argument processing. :return: """ self.roca.do_print = True ret = self.process_inputs() if self.args.dump: self.roca.dump(ret) if self.roca.found > 0: logger.info('Fingerprinted keys found: %s...
def function[work, parameter[self]]: constant[ Entry point after argument processing. :return: ] name[self].roca.do_print assign[=] constant[True] variable[ret] assign[=] call[name[self].process_inputs, parameter[]] if name[self].args.dump begin[:] ...
keyword[def] identifier[work] ( identifier[self] ): literal[string] identifier[self] . identifier[roca] . identifier[do_print] = keyword[True] identifier[ret] = identifier[self] . identifier[process_inputs] () keyword[if] identifier[self] . identifier[args] . identifier[dump] :...
def work(self): """ Entry point after argument processing. :return: """ self.roca.do_print = True ret = self.process_inputs() if self.args.dump: self.roca.dump(ret) # depends on [control=['if'], data=[]] if self.roca.found > 0: logger.info('Fingerprinted keys...
def make_placeholders(seq, start=1): """ Generate placeholders for the given sequence. """ if len(seq) == 0: raise ValueError('Sequence must have at least one element.') param_style = Context.current().param_style placeholders = None if isinstance(seq, dict): if param_style i...
def function[make_placeholders, parameter[seq, start]]: constant[ Generate placeholders for the given sequence. ] if compare[call[name[len], parameter[name[seq]]] equal[==] constant[0]] begin[:] <ast.Raise object at 0x7da1b28fe440> variable[param_style] assign[=] call[name[Contex...
keyword[def] identifier[make_placeholders] ( identifier[seq] , identifier[start] = literal[int] ): literal[string] keyword[if] identifier[len] ( identifier[seq] )== literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[param_style] = identifier[Context] . ident...
def make_placeholders(seq, start=1): """ Generate placeholders for the given sequence. """ if len(seq) == 0: raise ValueError('Sequence must have at least one element.') # depends on [control=['if'], data=[]] param_style = Context.current().param_style placeholders = None if isinsta...
async def loop(self): """Pulse every timeout seconds until stopped.""" while not self.stopped: self.timeout_handle = self.pyvlx.connection.loop.call_later( self.timeout_in_seconds, self.loop_timeout) await self.loop_event.wait() if not self.stopped: ...
<ast.AsyncFunctionDef object at 0x7da18f58d960>
keyword[async] keyword[def] identifier[loop] ( identifier[self] ): literal[string] keyword[while] keyword[not] identifier[self] . identifier[stopped] : identifier[self] . identifier[timeout_handle] = identifier[self] . identifier[pyvlx] . identifier[connection] . identifier[loop] . ...
async def loop(self): """Pulse every timeout seconds until stopped.""" while not self.stopped: self.timeout_handle = self.pyvlx.connection.loop.call_later(self.timeout_in_seconds, self.loop_timeout) await self.loop_event.wait() if not self.stopped: self.loop_event.clear() ...
def bibitem_as_plaintext(bibitem): """ Return a plaintext representation of a bibitem from the ``.bbl`` file. .. note:: This plaintext representation can be super ugly, contain URLs and so \ on. .. note:: You need to have ``delatex`` installed system-wide, or to build it in \...
def function[bibitem_as_plaintext, parameter[bibitem]]: constant[ Return a plaintext representation of a bibitem from the ``.bbl`` file. .. note:: This plaintext representation can be super ugly, contain URLs and so on. .. note:: You need to have ``delatex`` installed sys...
keyword[def] identifier[bibitem_as_plaintext] ( identifier[bibitem] ): literal[string] keyword[try] : identifier[output] = identifier[subprocess] . identifier[check_output] ([ literal[string] , literal[string] ], identifier[input] = identifier[bibitem] . identifier[encode] ( lite...
def bibitem_as_plaintext(bibitem): """ Return a plaintext representation of a bibitem from the ``.bbl`` file. .. note:: This plaintext representation can be super ugly, contain URLs and so on. .. note:: You need to have ``delatex`` installed system-wide, or to build it in ...
def recover(self, requeue=False): """Redeliver unacknowledged messages. :param bool requeue: Re-queue the messages :raises AMQPInvalidArgument: Invalid Parameters :raises AMQPChannelError: Raises if the channel encountered an error. :raises AMQPConnectionError: Raises if the co...
def function[recover, parameter[self, requeue]]: constant[Redeliver unacknowledged messages. :param bool requeue: Re-queue the messages :raises AMQPInvalidArgument: Invalid Parameters :raises AMQPChannelError: Raises if the channel encountered an error. :raises AMQPConnectionEr...
keyword[def] identifier[recover] ( identifier[self] , identifier[requeue] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[requeue] , identifier[bool] ): keyword[raise] identifier[AMQPInvalidArgument] ( literal[string] ) ident...
def recover(self, requeue=False): """Redeliver unacknowledged messages. :param bool requeue: Re-queue the messages :raises AMQPInvalidArgument: Invalid Parameters :raises AMQPChannelError: Raises if the channel encountered an error. :raises AMQPConnectionError: Raises if the connec...
def present(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None): ''' Ensure that the named schema is present in the database. dbname The database's name will work on name The name of the schema to manage ...
def function[present, parameter[dbname, name, owner, user, db_user, db_password, db_host, db_port]]: constant[ Ensure that the named schema is present in the database. dbname The database's name will work on name The name of the schema to manage user system user all op...
keyword[def] identifier[present] ( identifier[dbname] , identifier[name] , identifier[owner] = keyword[None] , identifier[user] = keyword[None] , identifier[db_user] = keyword[None] , identifier[db_password] = keyword[None] , identifier[db_host] = keyword[None] , identifier[db_port] = keyword[None] ): literal...
def present(dbname, name, owner=None, user=None, db_user=None, db_password=None, db_host=None, db_port=None): """ Ensure that the named schema is present in the database. dbname The database's name will work on name The name of the schema to manage user system user all ope...
def _map(self, event): """Extract elements from an operation event and map to a named event.""" description = event.get('description', '') start_time = google_base.parse_rfc3339_utc_string( event.get('timestamp', '')) for name, regex in _EVENT_REGEX_MAP.items(): match = regex.match(descri...
def function[_map, parameter[self, event]]: constant[Extract elements from an operation event and map to a named event.] variable[description] assign[=] call[name[event].get, parameter[constant[description], constant[]]] variable[start_time] assign[=] call[name[google_base].parse_rfc3339_utc_str...
keyword[def] identifier[_map] ( identifier[self] , identifier[event] ): literal[string] identifier[description] = identifier[event] . identifier[get] ( literal[string] , literal[string] ) identifier[start_time] = identifier[google_base] . identifier[parse_rfc3339_utc_string] ( identifier[event] ....
def _map(self, event): """Extract elements from an operation event and map to a named event.""" description = event.get('description', '') start_time = google_base.parse_rfc3339_utc_string(event.get('timestamp', '')) for (name, regex) in _EVENT_REGEX_MAP.items(): match = regex.match(description)...
def has_code(state, text, pattern=True, not_typed_msg=None): """Test the student code. Tests if the student typed a (pattern of) text. It is advised to use ``has_equal_ast()`` instead of ``has_code()``, as it is more robust to small syntactical differences that don't change the code's behavior. Args: ...
def function[has_code, parameter[state, text, pattern, not_typed_msg]]: constant[Test the student code. Tests if the student typed a (pattern of) text. It is advised to use ``has_equal_ast()`` instead of ``has_code()``, as it is more robust to small syntactical differences that don't change the code's ...
keyword[def] identifier[has_code] ( identifier[state] , identifier[text] , identifier[pattern] = keyword[True] , identifier[not_typed_msg] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[not_typed_msg] : keyword[if] identifier[pattern] : identifier[not_typed_...
def has_code(state, text, pattern=True, not_typed_msg=None): """Test the student code. Tests if the student typed a (pattern of) text. It is advised to use ``has_equal_ast()`` instead of ``has_code()``, as it is more robust to small syntactical differences that don't change the code's behavior. Args: ...
def dragEnterEvent(self, event): """ Listens for query's being dragged and dropped onto this tree. :param event | <QDragEnterEvent> """ data = event.mimeData() if data.hasFormat('application/x-orb-table') and \ data.hasFormat('application/...
def function[dragEnterEvent, parameter[self, event]]: constant[ Listens for query's being dragged and dropped onto this tree. :param event | <QDragEnterEvent> ] variable[data] assign[=] call[name[event].mimeData, parameter[]] if <ast.BoolOp object at 0x7da18...
keyword[def] identifier[dragEnterEvent] ( identifier[self] , identifier[event] ): literal[string] identifier[data] = identifier[event] . identifier[mimeData] () keyword[if] identifier[data] . identifier[hasFormat] ( literal[string] ) keyword[and] identifier[data] . identifier[hasForma...
def dragEnterEvent(self, event): """ Listens for query's being dragged and dropped onto this tree. :param event | <QDragEnterEvent> """ data = event.mimeData() if data.hasFormat('application/x-orb-table') and data.hasFormat('application/x-orb-query'): tableName ...
def print_options(self): """ print description of the component options """ summary = [] for opt_name, opt in self.options.items(): if opt.hidden: continue summary.append(opt.summary()) print("\n".join(summary))
def function[print_options, parameter[self]]: constant[ print description of the component options ] variable[summary] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da20c76c2e0>, <ast.Name object at 0x7da20c76ca60>]]] in starred[call[name[self].options.items, parameter[]]] b...
keyword[def] identifier[print_options] ( identifier[self] ): literal[string] identifier[summary] =[] keyword[for] identifier[opt_name] , identifier[opt] keyword[in] identifier[self] . identifier[options] . identifier[items] (): keyword[if] identifier[opt] . identifier[hidd...
def print_options(self): """ print description of the component options """ summary = [] for (opt_name, opt) in self.options.items(): if opt.hidden: continue # depends on [control=['if'], data=[]] summary.append(opt.summary()) # depends on [control=['for'], data=[]] ...
def parse_cell(self, cell, coords, cell_mode=CellMode.cooked): """Tries to convert the value first to an int, then a float and if neither is successful it returns the string value. """ try: return int(cell) except ValueError: pass try: return float(cell) except ValueError: ...
def function[parse_cell, parameter[self, cell, coords, cell_mode]]: constant[Tries to convert the value first to an int, then a float and if neither is successful it returns the string value. ] <ast.Try object at 0x7da2044c05b0> <ast.Try object at 0x7da2044c1330> return[name[cell]]
keyword[def] identifier[parse_cell] ( identifier[self] , identifier[cell] , identifier[coords] , identifier[cell_mode] = identifier[CellMode] . identifier[cooked] ): literal[string] keyword[try] : keyword[return] identifier[int] ( identifier[cell] ) keyword[except] identifier[ValueError] : ...
def parse_cell(self, cell, coords, cell_mode=CellMode.cooked): """Tries to convert the value first to an int, then a float and if neither is successful it returns the string value. """ try: return int(cell) # depends on [control=['try'], data=[]] except ValueError: pass # depends o...
def _set_link_oam(self, v, load=False): """ Setter method for link_oam, mapped from YANG variable /protocol/link_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_link_oam is considered as a private method. Backends looking to populate this variable sho...
def function[_set_link_oam, parameter[self, v, load]]: constant[ Setter method for link_oam, mapped from YANG variable /protocol/link_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_link_oam is considered as a private method. Backends looking to p...
keyword[def] identifier[_set_link_oam] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ident...
def _set_link_oam(self, v, load=False): """ Setter method for link_oam, mapped from YANG variable /protocol/link_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_link_oam is considered as a private method. Backends looking to populate this variable sho...
def normalTriad(phi, theta): """ Calculate the so-called normal triad [p, q, r] which is associated with a spherical coordinate system . The three vectors are: p - The unit tangent vector in the direction of increasing longitudinal angle phi. q - The unit tangent vector in the direction of increasing latitud...
def function[normalTriad, parameter[phi, theta]]: constant[ Calculate the so-called normal triad [p, q, r] which is associated with a spherical coordinate system . The three vectors are: p - The unit tangent vector in the direction of increasing longitudinal angle phi. q - The unit tangent vector in th...
keyword[def] identifier[normalTriad] ( identifier[phi] , identifier[theta] ): literal[string] identifier[sphi] = identifier[sin] ( identifier[phi] ) identifier[stheta] = identifier[sin] ( identifier[theta] ) identifier[cphi] = identifier[cos] ( identifier[phi] ) identifier[ctheta] = identifier[cos] ( ...
def normalTriad(phi, theta): """ Calculate the so-called normal triad [p, q, r] which is associated with a spherical coordinate system . The three vectors are: p - The unit tangent vector in the direction of increasing longitudinal angle phi. q - The unit tangent vector in the direction of increasing latit...
def validate_utf8(alleged_utf8, error = None) : "alleged_utf8 must be null-terminated bytes." error, my_error = _get_error(error) result = dbus.dbus_validate_utf8(alleged_utf8, error._dbobj) != 0 my_error.raise_if_set() return \ result
def function[validate_utf8, parameter[alleged_utf8, error]]: constant[alleged_utf8 must be null-terminated bytes.] <ast.Tuple object at 0x7da20c993700> assign[=] call[name[_get_error], parameter[name[error]]] variable[result] assign[=] compare[call[name[dbus].dbus_validate_utf8, parameter[name[a...
keyword[def] identifier[validate_utf8] ( identifier[alleged_utf8] , identifier[error] = keyword[None] ): literal[string] identifier[error] , identifier[my_error] = identifier[_get_error] ( identifier[error] ) identifier[result] = identifier[dbus] . identifier[dbus_validate_utf8] ( identifier[alleged_u...
def validate_utf8(alleged_utf8, error=None): """alleged_utf8 must be null-terminated bytes.""" (error, my_error) = _get_error(error) result = dbus.dbus_validate_utf8(alleged_utf8, error._dbobj) != 0 my_error.raise_if_set() return result
def add_include(self, name, module_spec): """Adds a module as an included module. :param name: Name under which the included module should be exposed in the current module. :param module_spec: ModuleSpec of the included module. """ assert name...
def function[add_include, parameter[self, name, module_spec]]: constant[Adds a module as an included module. :param name: Name under which the included module should be exposed in the current module. :param module_spec: ModuleSpec of the included module. ...
keyword[def] identifier[add_include] ( identifier[self] , identifier[name] , identifier[module_spec] ): literal[string] keyword[assert] identifier[name] , literal[string] keyword[assert] identifier[self] . identifier[can_include] keyword[if] identifier[name] keyword[in] id...
def add_include(self, name, module_spec): """Adds a module as an included module. :param name: Name under which the included module should be exposed in the current module. :param module_spec: ModuleSpec of the included module. """ assert name, 'name ...
def plot(self): """ Plots reaction energy as a function of mixing ratio x in self.c1 - self.c2 tie line using pylab. Returns: Pylab object that plots reaction energy as a function of mixing ratio x. """ plt.rcParams['xtick.major.pad'] = '6' ...
def function[plot, parameter[self]]: constant[ Plots reaction energy as a function of mixing ratio x in self.c1 - self.c2 tie line using pylab. Returns: Pylab object that plots reaction energy as a function of mixing ratio x. ] call[name[plt].rcPa...
keyword[def] identifier[plot] ( identifier[self] ): literal[string] identifier[plt] . identifier[rcParams] [ literal[string] ]= literal[string] identifier[plt] . identifier[rcParams] [ literal[string] ]= literal[string] identifier[plt] . identifier[rcParams] [ literal[string] ]=...
def plot(self): """ Plots reaction energy as a function of mixing ratio x in self.c1 - self.c2 tie line using pylab. Returns: Pylab object that plots reaction energy as a function of mixing ratio x. """ plt.rcParams['xtick.major.pad'] = '6' plt.rcPara...
def andrew(S): """Convex hull by Andrew :param S: list of points as coordinate pairs :requires: S has at least 2 points :returns: list of points of the convex hull :complexity: `O(n log n)` """ S.sort() top = [] bot = [] for p in S: while len(top) >= 2 and not left_turn(...
def function[andrew, parameter[S]]: constant[Convex hull by Andrew :param S: list of points as coordinate pairs :requires: S has at least 2 points :returns: list of points of the convex hull :complexity: `O(n log n)` ] call[name[S].sort, parameter[]] variable[top] assign[=] ...
keyword[def] identifier[andrew] ( identifier[S] ): literal[string] identifier[S] . identifier[sort] () identifier[top] =[] identifier[bot] =[] keyword[for] identifier[p] keyword[in] identifier[S] : keyword[while] identifier[len] ( identifier[top] )>= literal[int] keyword[and] ...
def andrew(S): """Convex hull by Andrew :param S: list of points as coordinate pairs :requires: S has at least 2 points :returns: list of points of the convex hull :complexity: `O(n log n)` """ S.sort() top = [] bot = [] for p in S: while len(top) >= 2 and (not left_turn...
def create_node(self, bank, tags=None): """ Set up a CondorDagmanNode class to run splitbank code Parameters ---------- bank : pycbc.workflow.core.File The File containing the template bank to be split Returns -------- node : pycbc.workflow.c...
def function[create_node, parameter[self, bank, tags]]: constant[ Set up a CondorDagmanNode class to run splitbank code Parameters ---------- bank : pycbc.workflow.core.File The File containing the template bank to be split Returns -------- n...
keyword[def] identifier[create_node] ( identifier[self] , identifier[bank] , identifier[tags] = keyword[None] ): literal[string] keyword[if] identifier[tags] keyword[is] keyword[None] : identifier[tags] =[] identifier[node] = identifier[Node] ( identifier[self] ) i...
def create_node(self, bank, tags=None): """ Set up a CondorDagmanNode class to run splitbank code Parameters ---------- bank : pycbc.workflow.core.File The File containing the template bank to be split Returns -------- node : pycbc.workflow.core....
def distinctBy(iterable, fn): """ uniq operation with key selector """ s = set() for i in iterable: r = fn(i) if r not in s: s.add(r) yield i
def function[distinctBy, parameter[iterable, fn]]: constant[ uniq operation with key selector ] variable[s] assign[=] call[name[set], parameter[]] for taget[name[i]] in starred[name[iterable]] begin[:] variable[r] assign[=] call[name[fn], parameter[name[i]]] ...
keyword[def] identifier[distinctBy] ( identifier[iterable] , identifier[fn] ): literal[string] identifier[s] = identifier[set] () keyword[for] identifier[i] keyword[in] identifier[iterable] : identifier[r] = identifier[fn] ( identifier[i] ) keyword[if] identifier[r] keyword[not]...
def distinctBy(iterable, fn): """ uniq operation with key selector """ s = set() for i in iterable: r = fn(i) if r not in s: s.add(r) yield i # depends on [control=['if'], data=['r', 's']] # depends on [control=['for'], data=['i']]
def __args_check(self, envelope, target, modification_code): """ Method checks arguments, that are specified to the :meth:`.WMessengerFixedModificationLayer.encode` and :meth:`.WMessengerFixedModificationLayer.decode` methods :param envelope: same as envelope in :meth:`.WMessengerFixedModificationLayer.encode`...
def function[__args_check, parameter[self, envelope, target, modification_code]]: constant[ Method checks arguments, that are specified to the :meth:`.WMessengerFixedModificationLayer.encode` and :meth:`.WMessengerFixedModificationLayer.decode` methods :param envelope: same as envelope in :meth:`.WMessen...
keyword[def] identifier[__args_check] ( identifier[self] , identifier[envelope] , identifier[target] , identifier[modification_code] ): literal[string] keyword[if] identifier[target] keyword[is] keyword[None] : keyword[raise] identifier[RuntimeError] ( literal[string] ) keyword[if] identifier[modif...
def __args_check(self, envelope, target, modification_code): """ Method checks arguments, that are specified to the :meth:`.WMessengerFixedModificationLayer.encode` and :meth:`.WMessengerFixedModificationLayer.decode` methods :param envelope: same as envelope in :meth:`.WMessengerFixedModificationLayer.encod...
def is_directory(self, path): """Return True if <path> is a directory, False if it's NOT a directory""" return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-d', self._full_hdfs_path(path)]) == 0
def function[is_directory, parameter[self, path]]: constant[Return True if <path> is a directory, False if it's NOT a directory] return[compare[call[name[self]._getReturnCodeCmd, parameter[list[[<ast.Attribute object at 0x7da1b08faa10>, <ast.Constant object at 0x7da1b08fab90>, <ast.Constant object at 0x7da1...
keyword[def] identifier[is_directory] ( identifier[self] , identifier[path] ): literal[string] keyword[return] identifier[self] . identifier[_getReturnCodeCmd] ([ identifier[self] . identifier[_hadoop_cmd] , literal[string] , literal[string] , literal[string] , identifier[self] . identifier[_full_...
def is_directory(self, path): """Return True if <path> is a directory, False if it's NOT a directory""" return self._getReturnCodeCmd([self._hadoop_cmd, 'fs', '-test', '-d', self._full_hdfs_path(path)]) == 0
def typify(self, stack: Stack) -> List[Stack]: """ Appends a typing stack after the given stack, but only if required (aka don't have two typing layers following each other). """ if len(stack.layers) == 1 and isinstance(stack.layers[0], lyr.Typing): return [stack] ...
def function[typify, parameter[self, stack]]: constant[ Appends a typing stack after the given stack, but only if required (aka don't have two typing layers following each other). ] if <ast.BoolOp object at 0x7da18dc99420> begin[:] return[list[[<ast.Name object at 0x7da18...
keyword[def] identifier[typify] ( identifier[self] , identifier[stack] : identifier[Stack] )-> identifier[List] [ identifier[Stack] ]: literal[string] keyword[if] identifier[len] ( identifier[stack] . identifier[layers] )== literal[int] keyword[and] identifier[isinstance] ( identifier[stack] . ...
def typify(self, stack: Stack) -> List[Stack]: """ Appends a typing stack after the given stack, but only if required (aka don't have two typing layers following each other). """ if len(stack.layers) == 1 and isinstance(stack.layers[0], lyr.Typing): return [stack] # depends on [...
def _read_response(self, response): """ JSON Documentation: https://www.jfrog.com/confluence/display/RTF/Security+Configuration+JSON """ self.name = response['name'] self.description = response['description'] self.autoJoin = response['autoJoin'] self.realm = respo...
def function[_read_response, parameter[self, response]]: constant[ JSON Documentation: https://www.jfrog.com/confluence/display/RTF/Security+Configuration+JSON ] name[self].name assign[=] call[name[response]][constant[name]] name[self].description assign[=] call[name[response]][c...
keyword[def] identifier[_read_response] ( identifier[self] , identifier[response] ): literal[string] identifier[self] . identifier[name] = identifier[response] [ literal[string] ] identifier[self] . identifier[description] = identifier[response] [ literal[string] ] identifier[self...
def _read_response(self, response): """ JSON Documentation: https://www.jfrog.com/confluence/display/RTF/Security+Configuration+JSON """ self.name = response['name'] self.description = response['description'] self.autoJoin = response['autoJoin'] self.realm = response['realm'] sel...
def parse_meta(self, meta): """Parses the meta field in the message, copies it's keys into a new dict and replaces the values, which should be attribute paths relative to the passed in object, with the current value at the end of that path. This function will run recursively when it enco...
def function[parse_meta, parameter[self, meta]]: constant[Parses the meta field in the message, copies it's keys into a new dict and replaces the values, which should be attribute paths relative to the passed in object, with the current value at the end of that path. This function will r...
keyword[def] identifier[parse_meta] ( identifier[self] , identifier[meta] ): literal[string] identifier[res] ={} keyword[for] identifier[key] , identifier[val] keyword[in] identifier[meta] . identifier[items] (): keyword[if] keyword[not] identifier[val] : ...
def parse_meta(self, meta): """Parses the meta field in the message, copies it's keys into a new dict and replaces the values, which should be attribute paths relative to the passed in object, with the current value at the end of that path. This function will run recursively when it encounte...
def create_archive_dir(self): """ Create the archive dir """ archive_dir = os.path.join(self.tmp_dir, self.archive_name) os.makedirs(archive_dir, 0o700) return archive_dir
def function[create_archive_dir, parameter[self]]: constant[ Create the archive dir ] variable[archive_dir] assign[=] call[name[os].path.join, parameter[name[self].tmp_dir, name[self].archive_name]] call[name[os].makedirs, parameter[name[archive_dir], constant[448]]] return[n...
keyword[def] identifier[create_archive_dir] ( identifier[self] ): literal[string] identifier[archive_dir] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[tmp_dir] , identifier[self] . identifier[archive_name] ) identifier[os] . identifier[makedirs] ( ...
def create_archive_dir(self): """ Create the archive dir """ archive_dir = os.path.join(self.tmp_dir, self.archive_name) os.makedirs(archive_dir, 448) return archive_dir
def supports(self, config, context): """ Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ try: from ...
def function[supports, parameter[self, config, context]]: constant[ Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. ] <...
keyword[def] identifier[supports] ( identifier[self] , identifier[config] , identifier[context] ): literal[string] keyword[try] : keyword[from] identifier[flask] keyword[import] identifier[request] keyword[except] identifier[ImportError] : keyword[return] ke...
def supports(self, config, context): """ Check whether we are in a Flask request context. :param config: honeybadger configuration. :param context: current honeybadger configuration. :return: True if this is a django request, False else. """ try: from flask import...
def __remove_pyc_pyo(fname): """Eventually remove .pyc and .pyo files associated to a Python script""" if osp.splitext(fname)[1] == '.py': for ending in ('c', 'o'): if osp.exists(fname+ending): os.remove(fname+ending)
def function[__remove_pyc_pyo, parameter[fname]]: constant[Eventually remove .pyc and .pyo files associated to a Python script] if compare[call[call[name[osp].splitext, parameter[name[fname]]]][constant[1]] equal[==] constant[.py]] begin[:] for taget[name[ending]] in starred[tuple[[<ast....
keyword[def] identifier[__remove_pyc_pyo] ( identifier[fname] ): literal[string] keyword[if] identifier[osp] . identifier[splitext] ( identifier[fname] )[ literal[int] ]== literal[string] : keyword[for] identifier[ending] keyword[in] ( literal[string] , literal[string] ): keywo...
def __remove_pyc_pyo(fname): """Eventually remove .pyc and .pyo files associated to a Python script""" if osp.splitext(fname)[1] == '.py': for ending in ('c', 'o'): if osp.exists(fname + ending): os.remove(fname + ending) # depends on [control=['if'], data=[]] # depends on ...
def whoami(*args, **kwargs): """ Prints information about the current user. Assumes the user is already logged-in. """ user = client.whoami() if user: print_user(user) else: print('You are not logged-in.')
def function[whoami, parameter[]]: constant[ Prints information about the current user. Assumes the user is already logged-in. ] variable[user] assign[=] call[name[client].whoami, parameter[]] if name[user] begin[:] call[name[print_user], parameter[name[user]]]
keyword[def] identifier[whoami] (* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[user] = identifier[client] . identifier[whoami] () keyword[if] identifier[user] : identifier[print_user] ( identifier[user] ) keyword[else] : identifier[print] ( literal[st...
def whoami(*args, **kwargs): """ Prints information about the current user. Assumes the user is already logged-in. """ user = client.whoami() if user: print_user(user) # depends on [control=['if'], data=[]] else: print('You are not logged-in.')
def unique_row(array, use_columns=None, selected_columns_only=False): '''Takes a numpy array and returns the array reduced to unique rows. If columns are defined only these columns are taken to define a unique row. The returned array can have all columns of the original array or only the columns defined in use_...
def function[unique_row, parameter[array, use_columns, selected_columns_only]]: constant[Takes a numpy array and returns the array reduced to unique rows. If columns are defined only these columns are taken to define a unique row. The returned array can have all columns of the original array or only the col...
keyword[def] identifier[unique_row] ( identifier[array] , identifier[use_columns] = keyword[None] , identifier[selected_columns_only] = keyword[False] ): literal[string] keyword[if] identifier[array] . identifier[dtype] . identifier[names] keyword[is] keyword[None] : keyword[if] identifier[use...
def unique_row(array, use_columns=None, selected_columns_only=False): """Takes a numpy array and returns the array reduced to unique rows. If columns are defined only these columns are taken to define a unique row. The returned array can have all columns of the original array or only the columns defined in use_...
def help(): """Print this help""" safe_print('Run "make [-p <PYTHON>] <target>" where <target> is one of:') for name in sorted(_cmds): safe_print( " %-20s %s" % (name.replace('_', '-'), _cmds[name] or '')) sys.exit(1)
def function[help, parameter[]]: constant[Print this help] call[name[safe_print], parameter[constant[Run "make [-p <PYTHON>] <target>" where <target> is one of:]]] for taget[name[name]] in starred[call[name[sorted], parameter[name[_cmds]]]] begin[:] call[name[safe_print], paramet...
keyword[def] identifier[help] (): literal[string] identifier[safe_print] ( literal[string] ) keyword[for] identifier[name] keyword[in] identifier[sorted] ( identifier[_cmds] ): identifier[safe_print] ( literal[string] %( identifier[name] . identifier[replace] ( literal[string] , l...
def help(): """Print this help""" safe_print('Run "make [-p <PYTHON>] <target>" where <target> is one of:') for name in sorted(_cmds): safe_print(' %-20s %s' % (name.replace('_', '-'), _cmds[name] or '')) # depends on [control=['for'], data=['name']] sys.exit(1)
def delta(self): """ Variance ratio between ``K`` and ``I``. """ v = float(self._logistic.value) if v > 0.0: v = 1 / (1 + exp(-v)) else: v = exp(v) v = v / (v + 1.0) return min(max(v, epsilon.tiny), 1 - epsilon.tiny)
def function[delta, parameter[self]]: constant[ Variance ratio between ``K`` and ``I``. ] variable[v] assign[=] call[name[float], parameter[name[self]._logistic.value]] if compare[name[v] greater[>] constant[0.0]] begin[:] variable[v] assign[=] binary_operation[co...
keyword[def] identifier[delta] ( identifier[self] ): literal[string] identifier[v] = identifier[float] ( identifier[self] . identifier[_logistic] . identifier[value] ) keyword[if] identifier[v] > literal[int] : identifier[v] = literal[int] /( literal[int] + identifier[exp] ...
def delta(self): """ Variance ratio between ``K`` and ``I``. """ v = float(self._logistic.value) if v > 0.0: v = 1 / (1 + exp(-v)) # depends on [control=['if'], data=['v']] else: v = exp(v) v = v / (v + 1.0) return min(max(v, epsilon.tiny), 1 - epsilon.tiny)
def setClockFormat(clockFormat, **kwargs): ''' Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username> ''' if clockFormat != '12h' and clockFormat != '24h': return False _gsession = _GSettin...
def function[setClockFormat, parameter[clockFormat]]: constant[ Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username> ] if <ast.BoolOp object at 0x7da1b21a0b20> begin[:] return[constan...
keyword[def] identifier[setClockFormat] ( identifier[clockFormat] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[clockFormat] != literal[string] keyword[and] identifier[clockFormat] != literal[string] : keyword[return] keyword[False] identifier[_gsession] = identifier[_...
def setClockFormat(clockFormat, **kwargs): """ Set the clock format, either 12h or 24h format. CLI Example: .. code-block:: bash salt '*' gnome.setClockFormat <12h|24h> user=<username> """ if clockFormat != '12h' and clockFormat != '24h': return False # depends on [control=[...
def save_model(self, directory=None, append_timestep=True): """ Save TensorFlow model. If no checkpoint directory is given, the model's default saver directory is used. Optionally appends current timestep to prevent overwriting previous checkpoint files. Turn off to be able to load model...
def function[save_model, parameter[self, directory, append_timestep]]: constant[ Save TensorFlow model. If no checkpoint directory is given, the model's default saver directory is used. Optionally appends current timestep to prevent overwriting previous checkpoint files. Turn off to be a...
keyword[def] identifier[save_model] ( identifier[self] , identifier[directory] = keyword[None] , identifier[append_timestep] = keyword[True] ): literal[string] keyword[return] identifier[self] . identifier[model] . identifier[save] ( identifier[directory] = identifier[directory] , identifier[appen...
def save_model(self, directory=None, append_timestep=True): """ Save TensorFlow model. If no checkpoint directory is given, the model's default saver directory is used. Optionally appends current timestep to prevent overwriting previous checkpoint files. Turn off to be able to load model fro...
def viewitems(obj, **kwargs): """ Function for iterating over dictionary items with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.""" func = getattr(obj, "viewitems", None) if not func: func = obj.items return func(**kwargs)
def function[viewitems, parameter[obj]]: constant[ Function for iterating over dictionary items with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.] variable[func] assign[=] call[name[getattr], parameter[name[obj], constant[viewitems], constant[None]]] if <...
keyword[def] identifier[viewitems] ( identifier[obj] ,** identifier[kwargs] ): literal[string] identifier[func] = identifier[getattr] ( identifier[obj] , literal[string] , keyword[None] ) keyword[if] keyword[not] identifier[func] : identifier[func] = identifier[obj] . identifier[items] ...
def viewitems(obj, **kwargs): """ Function for iterating over dictionary items with the same set-like behaviour on Py2.7 as on Py3. Passes kwargs to method.""" func = getattr(obj, 'viewitems', None) if not func: func = obj.items # depends on [control=['if'], data=[]] return func(**...
def disable_hardware_breakpoint(self, dwThreadId, address): """ Disables the hardware breakpoint at the given address. @see: L{define_hardware_breakpoint}, L{has_hardware_breakpoint}, L{get_hardware_breakpoint}, L{enable_hardware_breakpoint} ...
def function[disable_hardware_breakpoint, parameter[self, dwThreadId, address]]: constant[ Disables the hardware breakpoint at the given address. @see: L{define_hardware_breakpoint}, L{has_hardware_breakpoint}, L{get_hardware_breakpoint}, L{enable...
keyword[def] identifier[disable_hardware_breakpoint] ( identifier[self] , identifier[dwThreadId] , identifier[address] ): literal[string] identifier[t] = identifier[self] . identifier[system] . identifier[get_thread] ( identifier[dwThreadId] ) identifier[p] = identifier[t] . identifier[get...
def disable_hardware_breakpoint(self, dwThreadId, address): """ Disables the hardware breakpoint at the given address. @see: L{define_hardware_breakpoint}, L{has_hardware_breakpoint}, L{get_hardware_breakpoint}, L{enable_hardware_breakpoint} ...
def run(task=None, loop=None): '''Run the event loop forever or until the task/future *task* is finished. :param task: Optional. Task or Future which is run until complete. If parameter is ``None`` runs the event loop forever. :param loop: Optional. Event loop to use. If the paramet...
def function[run, parameter[task, loop]]: constant[Run the event loop forever or until the task/future *task* is finished. :param task: Optional. Task or Future which is run until complete. If parameter is ``None`` runs the event loop forever. :param loop: Optional. Event loop t...
keyword[def] identifier[run] ( identifier[task] = keyword[None] , identifier[loop] = keyword[None] ): literal[string] keyword[if] identifier[loop] keyword[is] keyword[None] : identifier[loop] = identifier[asyncio] . identifier[get_event_loop] () keyword[if] identifier[task] keyword[is] ...
def run(task=None, loop=None): """Run the event loop forever or until the task/future *task* is finished. :param task: Optional. Task or Future which is run until complete. If parameter is ``None`` runs the event loop forever. :param loop: Optional. Event loop to use. If the paramet...
def keys_to_string(data): """ Function to convert all the unicode keys in string keys """ if isinstance(data, dict): for key in list(data.keys()): if isinstance(key, six.string_types): value = data[key] val = keys_to_string(value) del d...
def function[keys_to_string, parameter[data]]: constant[ Function to convert all the unicode keys in string keys ] if call[name[isinstance], parameter[name[data], name[dict]]] begin[:] for taget[name[key]] in starred[call[name[list], parameter[call[name[data].keys, parameter[]]]]...
keyword[def] identifier[keys_to_string] ( identifier[data] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[dict] ): keyword[for] identifier[key] keyword[in] identifier[list] ( identifier[data] . identifier[keys] ()): keyword[if] identifier[is...
def keys_to_string(data): """ Function to convert all the unicode keys in string keys """ if isinstance(data, dict): for key in list(data.keys()): if isinstance(key, six.string_types): value = data[key] val = keys_to_string(value) del d...
def in_units(self, units, equivalence=None, **kwargs): """ Creates a copy of this array with the data converted to the supplied units, and returns it. Optionally, an equivalence can be specified to convert to an equivalent quantity which is not in the same dimensions. P...
def function[in_units, parameter[self, units, equivalence]]: constant[ Creates a copy of this array with the data converted to the supplied units, and returns it. Optionally, an equivalence can be specified to convert to an equivalent quantity which is not in the same dimensions...
keyword[def] identifier[in_units] ( identifier[self] , identifier[units] , identifier[equivalence] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[units] = identifier[_sanitize_units_convert] ( identifier[units] , identifier[self] . identifier[units] . identifier[registry] ) ...
def in_units(self, units, equivalence=None, **kwargs): """ Creates a copy of this array with the data converted to the supplied units, and returns it. Optionally, an equivalence can be specified to convert to an equivalent quantity which is not in the same dimensions. Param...
def GetCellValue (self, column, default = None): """ get a cell, return default if that cell does not exist note that column and row START AT 1 same as excel """ if isinstance(column, str): column = ColumnToIndex(column...
def function[GetCellValue, parameter[self, column, default]]: constant[ get a cell, return default if that cell does not exist note that column and row START AT 1 same as excel ] if call[name[isinstance], parameter[name[column], name[str]]] begin[:] ...
keyword[def] identifier[GetCellValue] ( identifier[self] , identifier[column] , identifier[default] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[column] , identifier[str] ): identifier[column] = identifier[ColumnToIn...
def GetCellValue(self, column, default=None): """ get a cell, return default if that cell does not exist note that column and row START AT 1 same as excel """ if isinstance(column, str): column = ColumnToIndex(column) # depends on [control=['if'], data=[]] if...