code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def window(iterable, size=2, cast=tuple): # type: (Iterable, int, Callable) -> Iterable """ Yields iterms by bunch of a given size, but rolling only one item in and out at a time when iterating. >>> list(window([1, 2, 3])) [(1, 2), (2, 3)] By default, this will cast the...
def function[window, parameter[iterable, size, cast]]: constant[ Yields iterms by bunch of a given size, but rolling only one item in and out at a time when iterating. >>> list(window([1, 2, 3])) [(1, 2), (2, 3)] By default, this will cast the window to a tuple before y...
keyword[def] identifier[window] ( identifier[iterable] , identifier[size] = literal[int] , identifier[cast] = identifier[tuple] ): literal[string] identifier[iterable] = identifier[iter] ( identifier[iterable] ) identifier[d] = identifier[deque] ( identifier[itertools] . identifier[islice] ( identifi...
def window(iterable, size=2, cast=tuple): # type: (Iterable, int, Callable) -> Iterable "\n Yields iterms by bunch of a given size, but rolling only one item\n in and out at a time when iterating.\n\n >>> list(window([1, 2, 3]))\n [(1, 2), (2, 3)]\n\n By default, this will cas...
def get_dashboard_registry_record(): """ Return the 'bika.lims.dashboard_panels_visibility' values. :return: A dictionary or None """ try: registry = api.portal.get_registry_record( 'bika.lims.dashboard_panels_visibility') return registry except InvalidParameterError:...
def function[get_dashboard_registry_record, parameter[]]: constant[ Return the 'bika.lims.dashboard_panels_visibility' values. :return: A dictionary or None ] <ast.Try object at 0x7da2054a7e50> return[call[name[dict], parameter[]]]
keyword[def] identifier[get_dashboard_registry_record] (): literal[string] keyword[try] : identifier[registry] = identifier[api] . identifier[portal] . identifier[get_registry_record] ( literal[string] ) keyword[return] identifier[registry] keyword[except] identifier[Inva...
def get_dashboard_registry_record(): """ Return the 'bika.lims.dashboard_panels_visibility' values. :return: A dictionary or None """ try: registry = api.portal.get_registry_record('bika.lims.dashboard_panels_visibility') return registry # depends on [control=['try'], data=[]] e...
def chi2(T1, T2): """ chi-squared test of difference between two transition matrices. Parameters ---------- T1 : array (k, k), matrix of transitions (counts). T2 : array (k, k), matrix of transitions (counts) to use to form the probabilities under the n...
def function[chi2, parameter[T1, T2]]: constant[ chi-squared test of difference between two transition matrices. Parameters ---------- T1 : array (k, k), matrix of transitions (counts). T2 : array (k, k), matrix of transitions (counts) to use to form the ...
keyword[def] identifier[chi2] ( identifier[T1] , identifier[T2] ): literal[string] identifier[rs2] = identifier[T2] . identifier[sum] ( identifier[axis] = literal[int] ) identifier[rs1] = identifier[T1] . identifier[sum] ( identifier[axis] = literal[int] ) identifier[rs2nz] = identifier[rs2] > li...
def chi2(T1, T2): """ chi-squared test of difference between two transition matrices. Parameters ---------- T1 : array (k, k), matrix of transitions (counts). T2 : array (k, k), matrix of transitions (counts) to use to form the probabilities under the n...
def get_methodnames(self, node): '''Given a node, generate all names for matching visitor methods. ''' nodekey = self.get_nodekey(node) prefix = self._method_prefix if isinstance(nodekey, self.GeneratorType): for nodekey in nodekey: yield self._method_...
def function[get_methodnames, parameter[self, node]]: constant[Given a node, generate all names for matching visitor methods. ] variable[nodekey] assign[=] call[name[self].get_nodekey, parameter[name[node]]] variable[prefix] assign[=] name[self]._method_prefix if call[name[isinst...
keyword[def] identifier[get_methodnames] ( identifier[self] , identifier[node] ): literal[string] identifier[nodekey] = identifier[self] . identifier[get_nodekey] ( identifier[node] ) identifier[prefix] = identifier[self] . identifier[_method_prefix] keyword[if] identifier[isins...
def get_methodnames(self, node): """Given a node, generate all names for matching visitor methods. """ nodekey = self.get_nodekey(node) prefix = self._method_prefix if isinstance(nodekey, self.GeneratorType): for nodekey in nodekey: yield (self._method_prefix + nodekey) # de...
def untar(fname, verbose=True): """ Uunzip and untar a tar.gz file into a subdir of the BIGDATA_PATH directory """ if fname.lower().endswith(".tar.gz"): dirpath = os.path.join(BIGDATA_PATH, os.path.basename(fname)[:-7]) if os.path.isdir(dirpath): return dirpath with tarfile.o...
def function[untar, parameter[fname, verbose]]: constant[ Uunzip and untar a tar.gz file into a subdir of the BIGDATA_PATH directory ] if call[call[name[fname].lower, parameter[]].endswith, parameter[constant[.tar.gz]]] begin[:] variable[dirpath] assign[=] call[name[os].path.join, parame...
keyword[def] identifier[untar] ( identifier[fname] , identifier[verbose] = keyword[True] ): literal[string] keyword[if] identifier[fname] . identifier[lower] (). identifier[endswith] ( literal[string] ): identifier[dirpath] = identifier[os] . identifier[path] . identifier[join] ( identifier[BIGDA...
def untar(fname, verbose=True): """ Uunzip and untar a tar.gz file into a subdir of the BIGDATA_PATH directory """ if fname.lower().endswith('.tar.gz'): dirpath = os.path.join(BIGDATA_PATH, os.path.basename(fname)[:-7]) if os.path.isdir(dirpath): return dirpath # depends on [control...
def _run(self, index): """Run method for one thread or process Just pull an item off the queue and process it, until the queue is empty. :param index: Sequential index of this process or thread :type index: int """ while 1: try: item =...
def function[_run, parameter[self, index]]: constant[Run method for one thread or process Just pull an item off the queue and process it, until the queue is empty. :param index: Sequential index of this process or thread :type index: int ] while constant[1] begin...
keyword[def] identifier[_run] ( identifier[self] , identifier[index] ): literal[string] keyword[while] literal[int] : keyword[try] : identifier[item] = identifier[self] . identifier[_queue] . identifier[get] ( identifier[timeout] = literal[int] ) iden...
def _run(self, index): """Run method for one thread or process Just pull an item off the queue and process it, until the queue is empty. :param index: Sequential index of this process or thread :type index: int """ while 1: try: item = self._queue.get...
def get_list_of_sql_string_literals_from_quoted_csv(x: str) -> List[str]: """ Used to extract SQL column type parameters. For example, MySQL has column types that look like ``ENUM('a', 'b', 'c', 'd')``. This function takes the ``"'a', 'b', 'c', 'd'"`` and converts it to ``['a', 'b', 'c', 'd']``. """...
def function[get_list_of_sql_string_literals_from_quoted_csv, parameter[x]]: constant[ Used to extract SQL column type parameters. For example, MySQL has column types that look like ``ENUM('a', 'b', 'c', 'd')``. This function takes the ``"'a', 'b', 'c', 'd'"`` and converts it to ``['a', 'b', 'c', 'd...
keyword[def] identifier[get_list_of_sql_string_literals_from_quoted_csv] ( identifier[x] : identifier[str] )-> identifier[List] [ identifier[str] ]: literal[string] identifier[f] = identifier[io] . identifier[StringIO] ( identifier[x] ) identifier[reader] = identifier[csv] . identifier[reader] ( ident...
def get_list_of_sql_string_literals_from_quoted_csv(x: str) -> List[str]: """ Used to extract SQL column type parameters. For example, MySQL has column types that look like ``ENUM('a', 'b', 'c', 'd')``. This function takes the ``"'a', 'b', 'c', 'd'"`` and converts it to ``['a', 'b', 'c', 'd']``. """...
def triangle(self, verts=True, lines=True): """ Converts actor polygons and strips to triangles. """ tf = vtk.vtkTriangleFilter() tf.SetPassLines(lines) tf.SetPassVerts(verts) tf.SetInputData(self.poly) tf.Update() return self.updateMesh(tf.GetOutp...
def function[triangle, parameter[self, verts, lines]]: constant[ Converts actor polygons and strips to triangles. ] variable[tf] assign[=] call[name[vtk].vtkTriangleFilter, parameter[]] call[name[tf].SetPassLines, parameter[name[lines]]] call[name[tf].SetPassVerts, parame...
keyword[def] identifier[triangle] ( identifier[self] , identifier[verts] = keyword[True] , identifier[lines] = keyword[True] ): literal[string] identifier[tf] = identifier[vtk] . identifier[vtkTriangleFilter] () identifier[tf] . identifier[SetPassLines] ( identifier[lines] ) ident...
def triangle(self, verts=True, lines=True): """ Converts actor polygons and strips to triangles. """ tf = vtk.vtkTriangleFilter() tf.SetPassLines(lines) tf.SetPassVerts(verts) tf.SetInputData(self.poly) tf.Update() return self.updateMesh(tf.GetOutput())
def api(accept_return_dict): """ Wrapper that calls @api_accepts and @api_returns in sequence. For example: @api({ 'accepts': { 'x': forms.IntegerField(min_value=0), 'y': forms.IntegerField(min_value=0), }, 'returns': [ 200: 'Operation success...
def function[api, parameter[accept_return_dict]]: constant[ Wrapper that calls @api_accepts and @api_returns in sequence. For example: @api({ 'accepts': { 'x': forms.IntegerField(min_value=0), 'y': forms.IntegerField(min_value=0), }, 'returns': [ ...
keyword[def] identifier[api] ( identifier[accept_return_dict] ): literal[string] keyword[def] identifier[decorator] ( identifier[func] ): @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapped_func] ( identifier[request] ,* identifier[args] ,** identifier[kwargs] ): ...
def api(accept_return_dict): """ Wrapper that calls @api_accepts and @api_returns in sequence. For example: @api({ 'accepts': { 'x': forms.IntegerField(min_value=0), 'y': forms.IntegerField(min_value=0), }, 'returns': [ 200: 'Operation success...
def map_async(self, func, iterable, chunksize=None, callback=None): """A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it...
def function[map_async, parameter[self, func, iterable, chunksize, callback]]: constant[A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback...
keyword[def] identifier[map_async] ( identifier[self] , identifier[func] , identifier[iterable] , identifier[chunksize] = keyword[None] , identifier[callback] = keyword[None] ): literal[string] identifier[apply_result] = identifier[ApplyResult] ( identifier[callback] = identifier[callback] ) ...
def map_async(self, func, iterable, chunksize=None, callback=None): """A variant of the map() method which returns a ApplyResult object. If callback is specified then it should be a callable which accepts a single argument. When the result becomes ready callback is applied to it (un...
async def on_raw_354(self, message): """ WHOX results have arrived. """ # Is the message for us? target, identifier = message.params[:2] if identifier != WHOX_IDENTIFIER: return # Great. Extract relevant information. metadata = { 'nickname': messa...
<ast.AsyncFunctionDef object at 0x7da207f00970>
keyword[async] keyword[def] identifier[on_raw_354] ( identifier[self] , identifier[message] ): literal[string] identifier[target] , identifier[identifier] = identifier[message] . identifier[params] [: literal[int] ] keyword[if] identifier[identifier] != identifier[WHOX_IDENTIFIE...
async def on_raw_354(self, message): """ WHOX results have arrived. """ # Is the message for us? (target, identifier) = message.params[:2] if identifier != WHOX_IDENTIFIER: return # depends on [control=['if'], data=[]] # Great. Extract relevant information. metadata = {'nickname': messa...
def deploy_lambda(awsclient, function_name, role, handler_filename, handler_function, folders, description, timeout, memory, subnet_ids=None, security_groups=None, artifact_bucket=None, zipfile=None, fail_deployment_on_unsuccessfu...
def function[deploy_lambda, parameter[awsclient, function_name, role, handler_filename, handler_function, folders, description, timeout, memory, subnet_ids, security_groups, artifact_bucket, zipfile, fail_deployment_on_unsuccessful_ping, runtime, settings, environment, retention_in_days]]: constant[Create or up...
keyword[def] identifier[deploy_lambda] ( identifier[awsclient] , identifier[function_name] , identifier[role] , identifier[handler_filename] , identifier[handler_function] , identifier[folders] , identifier[description] , identifier[timeout] , identifier[memory] , identifier[subnet_ids] = keyword[None] , identifie...
def deploy_lambda(awsclient, function_name, role, handler_filename, handler_function, folders, description, timeout, memory, subnet_ids=None, security_groups=None, artifact_bucket=None, zipfile=None, fail_deployment_on_unsuccessful_ping=False, runtime='python2.7', settings=None, environment=None, retention_in_days=None...
def list_components(self, dependency_order=True): """ Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.lis...
def function[list_components, parameter[self, dependency_order]]: constant[ Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True ...
keyword[def] identifier[list_components] ( identifier[self] , identifier[dependency_order] = keyword[True] ): literal[string] keyword[if] identifier[dependency_order] : keyword[return] identifier[list] ( identifier[itertools] . identifier[chain] . identifier[from_iterable] ([ identi...
def list_components(self, dependency_order=True): """ Lists the Components by dependency resolving. Usage:: >>> manager = Manager(("./manager/tests/tests_manager/resources/components/core",)) >>> manager.register_components() True >>> manager.list_co...
def main(): """ NAME pmag_results_extract.py DESCRIPTION make a tab delimited output file from pmag_results table SYNTAX pmag_results_extract.py [command line options] OPTIONS -h prints help message and quits -f RFILE, specify pmag_results table; default ...
def function[main, parameter[]]: constant[ NAME pmag_results_extract.py DESCRIPTION make a tab delimited output file from pmag_results table SYNTAX pmag_results_extract.py [command line options] OPTIONS -h prints help message and quits -f RFILE, speci...
keyword[def] identifier[main] (): literal[string] identifier[do_help] = identifier[pmag] . identifier[get_flag_arg_from_sys] ( literal[string] ) keyword[if] identifier[do_help] : identifier[print] ( identifier[main] . identifier[__doc__] ) keyword[return] keyword[False] ident...
def main(): """ NAME pmag_results_extract.py DESCRIPTION make a tab delimited output file from pmag_results table SYNTAX pmag_results_extract.py [command line options] OPTIONS -h prints help message and quits -f RFILE, specify pmag_results table; default ...
def references2marc(self, key, value): """Populate the ``999C5`` MARC field.""" reference = value.get('reference', {}) pids = force_list(reference.get('persistent_identifiers')) a_values = ['doi:' + el for el in force_list(reference.get('dois'))] a_values.extend(['hdl:' + el['value'] for el in pids...
def function[references2marc, parameter[self, key, value]]: constant[Populate the ``999C5`` MARC field.] variable[reference] assign[=] call[name[value].get, parameter[constant[reference], dictionary[[], []]]] variable[pids] assign[=] call[name[force_list], parameter[call[name[reference].get, par...
keyword[def] identifier[references2marc] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] identifier[reference] = identifier[value] . identifier[get] ( literal[string] ,{}) identifier[pids] = identifier[force_list] ( identifier[reference] . identifier[get] ( literal[string]...
def references2marc(self, key, value): """Populate the ``999C5`` MARC field.""" reference = value.get('reference', {}) pids = force_list(reference.get('persistent_identifiers')) a_values = ['doi:' + el for el in force_list(reference.get('dois'))] a_values.extend(['hdl:' + el['value'] for el in pids ...
def mapfo(ol,**kwargs): ''' #mapfo i不作为map_func参数,v不作为map_func参数 # NOT take value as a param for map_func,NOT take index as a param for map_func #map_func diff_func(*diff_args) ''' diff_args_arr = kwargs['map_func_args_array'] diff_funcs_arr = k...
def function[mapfo, parameter[ol]]: constant[ #mapfo i不作为map_func参数,v不作为map_func参数 # NOT take value as a param for map_func,NOT take index as a param for map_func #map_func diff_func(*diff_args) ] variable[diff_args_arr] assign[=] call[name[...
keyword[def] identifier[mapfo] ( identifier[ol] ,** identifier[kwargs] ): literal[string] identifier[diff_args_arr] = identifier[kwargs] [ literal[string] ] identifier[diff_funcs_arr] = identifier[kwargs] [ literal[string] ] identifier[lngth] = identifier[ol] . identifier[__len__] () identif...
def mapfo(ol, **kwargs): """ #mapfo i不作为map_func参数,v不作为map_func参数 # NOT take value as a param for map_func,NOT take index as a param for map_func #map_func diff_func(*diff_args) """ diff_args_arr = kwargs['map_func_args_array'] diff_funcs_arr = ...
def reset(self): """Reset class MNISTCustomIter(mx.io.NDArrayIter):""" # shuffle data if self.is_train: np.random.shuffle(self.idx) self.data = _shuffle(self.data, self.idx) self.label = _shuffle(self.label, self.idx) if self.last_batch_handle == 'rol...
def function[reset, parameter[self]]: constant[Reset class MNISTCustomIter(mx.io.NDArrayIter):] if name[self].is_train begin[:] call[name[np].random.shuffle, parameter[name[self].idx]] name[self].data assign[=] call[name[_shuffle], parameter[name[self].data, name[self].id...
keyword[def] identifier[reset] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[is_train] : identifier[np] . identifier[random] . identifier[shuffle] ( identifier[self] . identifier[idx] ) identifier[self] . identifier[data] = ident...
def reset(self): """Reset class MNISTCustomIter(mx.io.NDArrayIter):""" # shuffle data if self.is_train: np.random.shuffle(self.idx) self.data = _shuffle(self.data, self.idx) self.label = _shuffle(self.label, self.idx) # depends on [control=['if'], data=[]] if self.last_batch_han...
def index_content(self) -> str: """ Returns the contents of the index RST file. """ # Build the toctree command index_filename = self.index_filename spacer = " " toctree_lines = [ ".. toctree::", spacer + ":maxdepth: {}".format(self.toc...
def function[index_content, parameter[self]]: constant[ Returns the contents of the index RST file. ] variable[index_filename] assign[=] name[self].index_filename variable[spacer] assign[=] constant[ ] variable[toctree_lines] assign[=] list[[<ast.Constant object at 0x7...
keyword[def] identifier[index_content] ( identifier[self] )-> identifier[str] : literal[string] identifier[index_filename] = identifier[self] . identifier[index_filename] identifier[spacer] = literal[string] identifier[toctree_lines] =[ literal[string] , ...
def index_content(self) -> str: """ Returns the contents of the index RST file. """ # Build the toctree command index_filename = self.index_filename spacer = ' ' toctree_lines = ['.. toctree::', spacer + ':maxdepth: {}'.format(self.toctree_maxdepth), ''] for f in self.files_t...
def reset(self, **kwargs): """ Reset all of the motor parameter attributes to their default value. This will also have the effect of stopping the motor. """ for key in kwargs: setattr(self, key, kwargs[key]) self.command = self.COMMAND_RESET
def function[reset, parameter[self]]: constant[ Reset all of the motor parameter attributes to their default value. This will also have the effect of stopping the motor. ] for taget[name[key]] in starred[name[kwargs]] begin[:] call[name[setattr], parameter[name[se...
keyword[def] identifier[reset] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[for] identifier[key] keyword[in] identifier[kwargs] : identifier[setattr] ( identifier[self] , identifier[key] , identifier[kwargs] [ identifier[key] ]) identifier[self] . id...
def reset(self, **kwargs): """ Reset all of the motor parameter attributes to their default value. This will also have the effect of stopping the motor. """ for key in kwargs: setattr(self, key, kwargs[key]) # depends on [control=['for'], data=['key']] self.command = self.CO...
def start(self, plugins): """Start listening for msgpack-rpc requests and notifications.""" self.nvim.run_loop(self._on_request, self._on_notification, lambda: self._load(plugins), err_cb=self._on_async_err)
def function[start, parameter[self, plugins]]: constant[Start listening for msgpack-rpc requests and notifications.] call[name[self].nvim.run_loop, parameter[name[self]._on_request, name[self]._on_notification, <ast.Lambda object at 0x7da1b22ae6b0>]]
keyword[def] identifier[start] ( identifier[self] , identifier[plugins] ): literal[string] identifier[self] . identifier[nvim] . identifier[run_loop] ( identifier[self] . identifier[_on_request] , identifier[self] . identifier[_on_notification] , keyword[lambda] : identifier[self]...
def start(self, plugins): """Start listening for msgpack-rpc requests and notifications.""" self.nvim.run_loop(self._on_request, self._on_notification, lambda : self._load(plugins), err_cb=self._on_async_err)
def extend_parents(parents): """ extend_parents(parents) Returns a set containing nearest conditionally stochastic (Stochastic, not Deterministic) ancestors. """ new_parents = set() for parent in parents: new_parents.add(parent) if isinstance(parent, DeterministicBase): ...
def function[extend_parents, parameter[parents]]: constant[ extend_parents(parents) Returns a set containing nearest conditionally stochastic (Stochastic, not Deterministic) ancestors. ] variable[new_parents] assign[=] call[name[set], parameter[]] for taget[name[parent]] in star...
keyword[def] identifier[extend_parents] ( identifier[parents] ): literal[string] identifier[new_parents] = identifier[set] () keyword[for] identifier[parent] keyword[in] identifier[parents] : identifier[new_parents] . identifier[add] ( identifier[parent] ) keyword[if] identifi...
def extend_parents(parents): """ extend_parents(parents) Returns a set containing nearest conditionally stochastic (Stochastic, not Deterministic) ancestors. """ new_parents = set() for parent in parents: new_parents.add(parent) if isinstance(parent, DeterministicBase): ...
def command(engine, format, filepath=None, renderer=None, formatter=None): """Return args list for ``subprocess.Popen`` and name of the rendered file.""" if formatter is not None and renderer is None: raise RequiredArgumentError('formatter given without renderer') if engine not in ENGINES: ...
def function[command, parameter[engine, format, filepath, renderer, formatter]]: constant[Return args list for ``subprocess.Popen`` and name of the rendered file.] if <ast.BoolOp object at 0x7da1b1ec1630> begin[:] <ast.Raise object at 0x7da18dc9beb0> if compare[name[engine] <ast.NotIn ob...
keyword[def] identifier[command] ( identifier[engine] , identifier[format] , identifier[filepath] = keyword[None] , identifier[renderer] = keyword[None] , identifier[formatter] = keyword[None] ): literal[string] keyword[if] identifier[formatter] keyword[is] keyword[not] keyword[None] keyword[and] ide...
def command(engine, format, filepath=None, renderer=None, formatter=None): """Return args list for ``subprocess.Popen`` and name of the rendered file.""" if formatter is not None and renderer is None: raise RequiredArgumentError('formatter given without renderer') # depends on [control=['if'], data=[]]...
def get_options_from_file(self, file_path): """ Return the options parsed from a JSON file. """ # read options JSON file with open(file_path) as options_file: options_dict = json.load(options_file) options = [] for opt_name in options_dict: ...
def function[get_options_from_file, parameter[self, file_path]]: constant[ Return the options parsed from a JSON file. ] with call[name[open], parameter[name[file_path]]] begin[:] variable[options_dict] assign[=] call[name[json].load, parameter[name[options_file]]] ...
keyword[def] identifier[get_options_from_file] ( identifier[self] , identifier[file_path] ): literal[string] keyword[with] identifier[open] ( identifier[file_path] ) keyword[as] identifier[options_file] : identifier[options_dict] = identifier[json] . identifier[load] ( ident...
def get_options_from_file(self, file_path): """ Return the options parsed from a JSON file. """ # read options JSON file with open(file_path) as options_file: options_dict = json.load(options_file) # depends on [control=['with'], data=['options_file']] options = [] for opt_n...
def _update(self): r"""Update This method updates the current reconstruction Notes ----- Implements algorithm 10.7 (or 10.5) from [B2011]_ """ # Step 1 from alg.10.7. self._grad.get_grad(self._z_old) y_old = self._z_old - self._beta * self._gra...
def function[_update, parameter[self]]: constant[Update This method updates the current reconstruction Notes ----- Implements algorithm 10.7 (or 10.5) from [B2011]_ ] call[name[self]._grad.get_grad, parameter[name[self]._z_old]] variable[y_old] assign[=...
keyword[def] identifier[_update] ( identifier[self] ): literal[string] identifier[self] . identifier[_grad] . identifier[get_grad] ( identifier[self] . identifier[_z_old] ) identifier[y_old] = identifier[self] . identifier[_z_old] - identifier[self] . identifier[_beta] * identifi...
def _update(self): """Update This method updates the current reconstruction Notes ----- Implements algorithm 10.7 (or 10.5) from [B2011]_ """ # Step 1 from alg.10.7. self._grad.get_grad(self._z_old) y_old = self._z_old - self._beta * self._grad.grad # Step ...
def check_unassigned(self, data): """Checks for unassigned character codes.""" for char in data: for lookup in self.unassigned: if lookup(char): raise StringprepError("Unassigned character: {0!r}" ...
def function[check_unassigned, parameter[self, data]]: constant[Checks for unassigned character codes.] for taget[name[char]] in starred[name[data]] begin[:] for taget[name[lookup]] in starred[name[self].unassigned] begin[:] if call[name[lookup], parameter[name[ch...
keyword[def] identifier[check_unassigned] ( identifier[self] , identifier[data] ): literal[string] keyword[for] identifier[char] keyword[in] identifier[data] : keyword[for] identifier[lookup] keyword[in] identifier[self] . identifier[unassigned] : keyword[if] id...
def check_unassigned(self, data): """Checks for unassigned character codes.""" for char in data: for lookup in self.unassigned: if lookup(char): raise StringprepError('Unassigned character: {0!r}'.format(char)) # depends on [control=['if'], data=[]] # depends on [control=['...
def xdr(self): """Create an base64 encoded XDR string for this :class:`Asset`. :return str: A base64 encoded XDR object representing this :class:`Asset`. """ asset = Xdr.StellarXDRPacker() asset.pack_Asset(self.to_xdr_object()) return base64.b64encode(asset....
def function[xdr, parameter[self]]: constant[Create an base64 encoded XDR string for this :class:`Asset`. :return str: A base64 encoded XDR object representing this :class:`Asset`. ] variable[asset] assign[=] call[name[Xdr].StellarXDRPacker, parameter[]] call[name[a...
keyword[def] identifier[xdr] ( identifier[self] ): literal[string] identifier[asset] = identifier[Xdr] . identifier[StellarXDRPacker] () identifier[asset] . identifier[pack_Asset] ( identifier[self] . identifier[to_xdr_object] ()) keyword[return] identifier[base64] . identifier[b...
def xdr(self): """Create an base64 encoded XDR string for this :class:`Asset`. :return str: A base64 encoded XDR object representing this :class:`Asset`. """ asset = Xdr.StellarXDRPacker() asset.pack_Asset(self.to_xdr_object()) return base64.b64encode(asset.get_buffer())
def get_next_colour(): """ Gets the next colour in the Geckoboard colour list. """ colour = settings.GECKOBOARD_COLOURS[get_next_colour.cur_colour] get_next_colour.cur_colour += 1 if get_next_colour.cur_colour >= len(settings.GECKOBOARD_COLOURS): get_next_colour.cur_colour = 0 ret...
def function[get_next_colour, parameter[]]: constant[ Gets the next colour in the Geckoboard colour list. ] variable[colour] assign[=] call[name[settings].GECKOBOARD_COLOURS][name[get_next_colour].cur_colour] <ast.AugAssign object at 0x7da1b023f850> if compare[name[get_next_colour].c...
keyword[def] identifier[get_next_colour] (): literal[string] identifier[colour] = identifier[settings] . identifier[GECKOBOARD_COLOURS] [ identifier[get_next_colour] . identifier[cur_colour] ] identifier[get_next_colour] . identifier[cur_colour] += literal[int] keyword[if] identifier[get_next...
def get_next_colour(): """ Gets the next colour in the Geckoboard colour list. """ colour = settings.GECKOBOARD_COLOURS[get_next_colour.cur_colour] get_next_colour.cur_colour += 1 if get_next_colour.cur_colour >= len(settings.GECKOBOARD_COLOURS): get_next_colour.cur_colour = 0 # depends...
def update_category(uid, post_data): ''' Update the category of the post. :param uid: The ID of the post. Extra info would get by requests. ''' # deprecated # catid = kwargs['catid'] if MCategory.get_by_uid(kwargs.get('catid')) else None # post_data = self.get_post_data() if 'gcat0' in...
def function[update_category, parameter[uid, post_data]]: constant[ Update the category of the post. :param uid: The ID of the post. Extra info would get by requests. ] if compare[constant[gcat0] in name[post_data]] begin[:] pass variable[the_cats_arr] assign[=] list[[]] ...
keyword[def] identifier[update_category] ( identifier[uid] , identifier[post_data] ): literal[string] keyword[if] literal[string] keyword[in] identifier[post_data] : keyword[pass] keyword[else] : keyword[return] keyword[False] identifier[the_cats_...
def update_category(uid, post_data): """ Update the category of the post. :param uid: The ID of the post. Extra info would get by requests. """ # deprecated # catid = kwargs['catid'] if MCategory.get_by_uid(kwargs.get('catid')) else None # post_data = self.get_post_data() if 'gcat0' in ...
def computeExpectations(self, A_n, output='averages', compute_uncertainty=True, uncertainty_method=None, warning_cutoff=1.0e-10, return_theta=False, useGeneral = False, state_dependent = False): """Compute the expectation of an observable of a phase space function. Compute the expectation of an observa...
def function[computeExpectations, parameter[self, A_n, output, compute_uncertainty, uncertainty_method, warning_cutoff, return_theta, useGeneral, state_dependent]]: constant[Compute the expectation of an observable of a phase space function. Compute the expectation of an observable of phase space ...
keyword[def] identifier[computeExpectations] ( identifier[self] , identifier[A_n] , identifier[output] = literal[string] , identifier[compute_uncertainty] = keyword[True] , identifier[uncertainty_method] = keyword[None] , identifier[warning_cutoff] = literal[int] , identifier[return_theta] = keyword[False] , identifi...
def computeExpectations(self, A_n, output='averages', compute_uncertainty=True, uncertainty_method=None, warning_cutoff=1e-10, return_theta=False, useGeneral=False, state_dependent=False): """Compute the expectation of an observable of a phase space function. Compute the expectation of an observable of pha...
def ReqConnect(self, pAddress: str): """连接行情前置 :param pAddress: """ self.q.CreateApi() spi = self.q.CreateSpi() self.q.RegisterSpi(spi) self.q.OnFrontConnected = self._OnFrontConnected self.q.OnFrontDisconnected = self._OnFrontDisConnected self.q...
def function[ReqConnect, parameter[self, pAddress]]: constant[连接行情前置 :param pAddress: ] call[name[self].q.CreateApi, parameter[]] variable[spi] assign[=] call[name[self].q.CreateSpi, parameter[]] call[name[self].q.RegisterSpi, parameter[name[spi]]] name[self].q.O...
keyword[def] identifier[ReqConnect] ( identifier[self] , identifier[pAddress] : identifier[str] ): literal[string] identifier[self] . identifier[q] . identifier[CreateApi] () identifier[spi] = identifier[self] . identifier[q] . identifier[CreateSpi] () identifier[self] . identifie...
def ReqConnect(self, pAddress: str): """连接行情前置 :param pAddress: """ self.q.CreateApi() spi = self.q.CreateSpi() self.q.RegisterSpi(spi) self.q.OnFrontConnected = self._OnFrontConnected self.q.OnFrontDisconnected = self._OnFrontDisConnected self.q.OnRspUserLogin = self._OnRsp...
def connect(transport=None, host='localhost', username='admin', password='', port=None, timeout=60, return_node=False, **kwargs): """ Creates a connection using the supplied settings This function will create a connection to an Arista EOS node using the arguments. All arguments are optional wi...
def function[connect, parameter[transport, host, username, password, port, timeout, return_node]]: constant[ Creates a connection using the supplied settings This function will create a connection to an Arista EOS node using the arguments. All arguments are optional with default values. Args: ...
keyword[def] identifier[connect] ( identifier[transport] = keyword[None] , identifier[host] = literal[string] , identifier[username] = literal[string] , identifier[password] = literal[string] , identifier[port] = keyword[None] , identifier[timeout] = literal[int] , identifier[return_node] = keyword[False] ,** identi...
def connect(transport=None, host='localhost', username='admin', password='', port=None, timeout=60, return_node=False, **kwargs): """ Creates a connection using the supplied settings This function will create a connection to an Arista EOS node using the arguments. All arguments are optional with default v...
def correct(self, calib, temp, we_t, ae_t): """ Compute weC from weT, aeT """ if not A4TempComp.in_range(temp): return None if self.__algorithm == 1: return self.__eq1(temp, we_t, ae_t) if self.__algorithm == 2: return self.__eq2(temp...
def function[correct, parameter[self, calib, temp, we_t, ae_t]]: constant[ Compute weC from weT, aeT ] if <ast.UnaryOp object at 0x7da20c76d210> begin[:] return[constant[None]] if compare[name[self].__algorithm equal[==] constant[1]] begin[:] return[call[name[self...
keyword[def] identifier[correct] ( identifier[self] , identifier[calib] , identifier[temp] , identifier[we_t] , identifier[ae_t] ): literal[string] keyword[if] keyword[not] identifier[A4TempComp] . identifier[in_range] ( identifier[temp] ): keyword[return] keyword[None] k...
def correct(self, calib, temp, we_t, ae_t): """ Compute weC from weT, aeT """ if not A4TempComp.in_range(temp): return None # depends on [control=['if'], data=[]] if self.__algorithm == 1: return self.__eq1(temp, we_t, ae_t) # depends on [control=['if'], data=[]] if sel...
def cmd_system_time(self, args): '''control behaviour of the module''' if len(args) == 0: print(self.usage()) elif args[0] == "status": print(self.status()) elif args[0] == "set": self.system_time_settings.command(args[1:]) else: pr...
def function[cmd_system_time, parameter[self, args]]: constant[control behaviour of the module] if compare[call[name[len], parameter[name[args]]] equal[==] constant[0]] begin[:] call[name[print], parameter[call[name[self].usage, parameter[]]]]
keyword[def] identifier[cmd_system_time] ( identifier[self] , identifier[args] ): literal[string] keyword[if] identifier[len] ( identifier[args] )== literal[int] : identifier[print] ( identifier[self] . identifier[usage] ()) keyword[elif] identifier[args] [ literal[int] ]== ...
def cmd_system_time(self, args): """control behaviour of the module""" if len(args) == 0: print(self.usage()) # depends on [control=['if'], data=[]] elif args[0] == 'status': print(self.status()) # depends on [control=['if'], data=[]] elif args[0] == 'set': self.system_time_set...
def assert_json_type(value: JsonValue, expected_type: JsonCheckType) -> None: """Check that a value has a certain JSON type. Raise TypeError if the type does not match. Supported types: str, int, float, bool, list, dict, and None. float will match any number, int will only match numbers without fr...
def function[assert_json_type, parameter[value, expected_type]]: constant[Check that a value has a certain JSON type. Raise TypeError if the type does not match. Supported types: str, int, float, bool, list, dict, and None. float will match any number, int will only match numbers without fract...
keyword[def] identifier[assert_json_type] ( identifier[value] : identifier[JsonValue] , identifier[expected_type] : identifier[JsonCheckType] )-> keyword[None] : literal[string] keyword[def] identifier[type_name] ( identifier[t] : identifier[Union] [ identifier[JsonCheckType] , identifier[Type] [ keyword...
def assert_json_type(value: JsonValue, expected_type: JsonCheckType) -> None: """Check that a value has a certain JSON type. Raise TypeError if the type does not match. Supported types: str, int, float, bool, list, dict, and None. float will match any number, int will only match numbers without fr...
def get_configs(__pkg: str, __name: str = 'config') -> List[str]: """Return all configs for given package. Args: __pkg: Package name __name: Configuration file name """ dirs = [user_config(__pkg), ] dirs.extend(path.expanduser(path.sep.join([d, __pkg])) for d in gete...
def function[get_configs, parameter[__pkg, __name]]: constant[Return all configs for given package. Args: __pkg: Package name __name: Configuration file name ] variable[dirs] assign[=] list[[<ast.Call object at 0x7da20c6c5870>]] call[name[dirs].extend, parameter[<ast.Gen...
keyword[def] identifier[get_configs] ( identifier[__pkg] : identifier[str] , identifier[__name] : identifier[str] = literal[string] )-> identifier[List] [ identifier[str] ]: literal[string] identifier[dirs] =[ identifier[user_config] ( identifier[__pkg] ),] identifier[dirs] . identifier[extend] ( iden...
def get_configs(__pkg: str, __name: str='config') -> List[str]: """Return all configs for given package. Args: __pkg: Package name __name: Configuration file name """ dirs = [user_config(__pkg)] dirs.extend((path.expanduser(path.sep.join([d, __pkg])) for d in getenv('XDG_CONFIG_DIRS...
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
def function[_read_mode_unpack, parameter[self, size, kind]]: constant[Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 op...
keyword[def] identifier[_read_mode_unpack] ( identifier[self] , identifier[size] , identifier[kind] ): literal[string] keyword[if] identifier[size] < literal[int] : keyword[raise] identifier[ProtocolError] ( literal[string] ) identifier[data] = identifier[dict] ( i...
def _read_mode_unpack(self, size, kind): """Read options request unpack process. Positional arguments: * size - int, length of option * kind - int, option kind value Returns: * dict -- extracted option Structure of IPv4 options: Octets ...
def get_saltbridge_frequency(self,analysis_cutoff): """Calculates the frequency of salt bridges throughout simulations. If the frequency exceeds the analysis cutoff, this interaction will be taken for further consideration. Takes: * analysis_cutoff * - fraction of simulation time a f...
def function[get_saltbridge_frequency, parameter[self, analysis_cutoff]]: constant[Calculates the frequency of salt bridges throughout simulations. If the frequency exceeds the analysis cutoff, this interaction will be taken for further consideration. Takes: * analysis_cutoff * - fra...
keyword[def] identifier[get_saltbridge_frequency] ( identifier[self] , identifier[analysis_cutoff] ): literal[string] identifier[self] . identifier[frequency] = identifier[defaultdict] ( identifier[int] ) keyword[for] identifier[traj] keyword[in] identifier[self] . identifier[saltbridge...
def get_saltbridge_frequency(self, analysis_cutoff): """Calculates the frequency of salt bridges throughout simulations. If the frequency exceeds the analysis cutoff, this interaction will be taken for further consideration. Takes: * analysis_cutoff * - fraction of simulation time a feat...
def crick_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'): """Returns the Crick angle for each CA atom in the `Polymer`. Notes ----- The final value is in the returned list is `None`, since the angle calculation requires pairs of points on both the primitive and reference_ax...
def function[crick_angles, parameter[p, reference_axis, tag, reference_axis_name]]: constant[Returns the Crick angle for each CA atom in the `Polymer`. Notes ----- The final value is in the returned list is `None`, since the angle calculation requires pairs of points on both the primitive and ...
keyword[def] identifier[crick_angles] ( identifier[p] , identifier[reference_axis] , identifier[tag] = keyword[True] , identifier[reference_axis_name] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[len] ( identifier[p] )== identifier[len] ( identifier[reference_axis] ): ...
def crick_angles(p, reference_axis, tag=True, reference_axis_name='ref_axis'): """Returns the Crick angle for each CA atom in the `Polymer`. Notes ----- The final value is in the returned list is `None`, since the angle calculation requires pairs of points on both the primitive and reference_ax...
def defer(callable): '''Defers execution of the callable to a thread. For example: >>> def foo(): ... print('bar') >>> join = defer(foo) >>> join() ''' t = threading.Thread(target=callable) t.start() return t.join
def function[defer, parameter[callable]]: constant[Defers execution of the callable to a thread. For example: >>> def foo(): ... print('bar') >>> join = defer(foo) >>> join() ] variable[t] assign[=] call[name[threading].Thread, parameter[]] call[name...
keyword[def] identifier[defer] ( identifier[callable] ): literal[string] identifier[t] = identifier[threading] . identifier[Thread] ( identifier[target] = identifier[callable] ) identifier[t] . identifier[start] () keyword[return] identifier[t] . identifier[join]
def defer(callable): """Defers execution of the callable to a thread. For example: >>> def foo(): ... print('bar') >>> join = defer(foo) >>> join() """ t = threading.Thread(target=callable) t.start() return t.join
def recv(self, packet, interface): """run incoming packet through the filters, then place it in its inq""" # the packet is piped into the first filter, then the result of that into the second filter, etc. for f in self.filters: if not packet: break packet ...
def function[recv, parameter[self, packet, interface]]: constant[run incoming packet through the filters, then place it in its inq] for taget[name[f]] in starred[name[self].filters] begin[:] if <ast.UnaryOp object at 0x7da1b26af880> begin[:] break variable[pac...
keyword[def] identifier[recv] ( identifier[self] , identifier[packet] , identifier[interface] ): literal[string] keyword[for] identifier[f] keyword[in] identifier[self] . identifier[filters] : keyword[if] keyword[not] identifier[packet] : keyword[break] ...
def recv(self, packet, interface): """run incoming packet through the filters, then place it in its inq""" # the packet is piped into the first filter, then the result of that into the second filter, etc. for f in self.filters: if not packet: break # depends on [control=['if'], data=[]]...
def com_google_fonts_check_varfont_weight_instances(ttFont): """Variable font weight coordinates must be multiples of 100.""" failed = False for instance in ttFont["fvar"].instances: if 'wght' in instance.coordinates and instance.coordinates['wght'] % 100 != 0: failed = True yield FAIL, ("Found a...
def function[com_google_fonts_check_varfont_weight_instances, parameter[ttFont]]: constant[Variable font weight coordinates must be multiples of 100.] variable[failed] assign[=] constant[False] for taget[name[instance]] in starred[call[name[ttFont]][constant[fvar]].instances] begin[:] ...
keyword[def] identifier[com_google_fonts_check_varfont_weight_instances] ( identifier[ttFont] ): literal[string] identifier[failed] = keyword[False] keyword[for] identifier[instance] keyword[in] identifier[ttFont] [ literal[string] ]. identifier[instances] : keyword[if] literal[string] keyword[i...
def com_google_fonts_check_varfont_weight_instances(ttFont): """Variable font weight coordinates must be multiples of 100.""" failed = False for instance in ttFont['fvar'].instances: if 'wght' in instance.coordinates and instance.coordinates['wght'] % 100 != 0: failed = True ...
def get_import_update_hash_from_outputs( outputs ): """ This is meant for NAME_IMPORT operations, which have five outputs: the OP_RETURN, the sender (i.e. the namespace owner), the name's recipient, the name's update hash, and the burn output. This method extracts the name update hash from ...
def function[get_import_update_hash_from_outputs, parameter[outputs]]: constant[ This is meant for NAME_IMPORT operations, which have five outputs: the OP_RETURN, the sender (i.e. the namespace owner), the name's recipient, the name's update hash, and the burn output. This method extracts ...
keyword[def] identifier[get_import_update_hash_from_outputs] ( identifier[outputs] ): literal[string] keyword[if] identifier[len] ( identifier[outputs] )< literal[int] : keyword[raise] identifier[Exception] ( literal[string] ) identifier[update_addr] = keyword[None] keyword[try] : ...
def get_import_update_hash_from_outputs(outputs): """ This is meant for NAME_IMPORT operations, which have five outputs: the OP_RETURN, the sender (i.e. the namespace owner), the name's recipient, the name's update hash, and the burn output. This method extracts the name update hash from t...
def make_time(gps_datetime_str): """Makes datetime object from string object""" if not 'n/a' == gps_datetime_str: datetime_string = gps_datetime_str datetime_object = datetime.strptime(datetime_string, "%Y-%m-%dT%H:%M:%S") return datetime_object
def function[make_time, parameter[gps_datetime_str]]: constant[Makes datetime object from string object] if <ast.UnaryOp object at 0x7da18bc73a30> begin[:] variable[datetime_string] assign[=] name[gps_datetime_str] variable[datetime_object] assign[=] call[name[datetime].s...
keyword[def] identifier[make_time] ( identifier[gps_datetime_str] ): literal[string] keyword[if] keyword[not] literal[string] == identifier[gps_datetime_str] : identifier[datetime_string] = identifier[gps_datetime_str] identifier[datetime_object] = identifier[datetime] . identifier[str...
def make_time(gps_datetime_str): """Makes datetime object from string object""" if not 'n/a' == gps_datetime_str: datetime_string = gps_datetime_str datetime_object = datetime.strptime(datetime_string, '%Y-%m-%dT%H:%M:%S') return datetime_object # depends on [control=['if'], data=[]]
def chain(self, wrapper, *args, **kwargs): """ Add a wrapper to the chain. Any extra positional or keyword arguments will be passed to that wrapper through construction of a ``TendrilPartial``. For convenience, returns the WrapperChain object, allowing ``chain()`` to be called ...
def function[chain, parameter[self, wrapper]]: constant[ Add a wrapper to the chain. Any extra positional or keyword arguments will be passed to that wrapper through construction of a ``TendrilPartial``. For convenience, returns the WrapperChain object, allowing ``chain()`` to ...
keyword[def] identifier[chain] ( identifier[self] , identifier[wrapper] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[args] keyword[or] identifier[kwargs] : identifier[wrapper] = identifier[TendrilPartial] ( identifier[wrapper] ,* identifier[a...
def chain(self, wrapper, *args, **kwargs): """ Add a wrapper to the chain. Any extra positional or keyword arguments will be passed to that wrapper through construction of a ``TendrilPartial``. For convenience, returns the WrapperChain object, allowing ``chain()`` to be called on t...
def case_insensitive_file_search(directory, pattern): """ Looks for file with pattern with case insensitive search """ try: return os.path.join( directory, [filename for filename in os.listdir(directory) if re.search(pattern, filename, re.IGNORECASE)][0]) ...
def function[case_insensitive_file_search, parameter[directory, pattern]]: constant[ Looks for file with pattern with case insensitive search ] <ast.Try object at 0x7da1b0ebf970>
keyword[def] identifier[case_insensitive_file_search] ( identifier[directory] , identifier[pattern] ): literal[string] keyword[try] : keyword[return] identifier[os] . identifier[path] . identifier[join] ( identifier[directory] , [ identifier[filename] keyword[for] identifier[fi...
def case_insensitive_file_search(directory, pattern): """ Looks for file with pattern with case insensitive search """ try: return os.path.join(directory, [filename for filename in os.listdir(directory) if re.search(pattern, filename, re.IGNORECASE)][0]) # depends on [control=['try'], data=[]] ...
def split_multimol2(mol2_path): r""" Splits a multi-mol2 file into individual Mol2 file contents. Parameters ----------- mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns ----------- A generator object for lists for every ex...
def function[split_multimol2, parameter[mol2_path]]: constant[ Splits a multi-mol2 file into individual Mol2 file contents. Parameters ----------- mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns ----------- A generator...
keyword[def] identifier[split_multimol2] ( identifier[mol2_path] ): literal[string] keyword[if] identifier[mol2_path] . identifier[endswith] ( literal[string] ): identifier[open_file] = identifier[gzip] . identifier[open] identifier[read_mode] = literal[string] keyword[else] : ...
def split_multimol2(mol2_path): """ Splits a multi-mol2 file into individual Mol2 file contents. Parameters ----------- mol2_path : str Path to the multi-mol2 file. Parses gzip files if the filepath ends on .gz. Returns ----------- A generator object for lists for every ext...
def connect(self, attempts=20, delay=0.5): """ Connects to a gateway, blocking until a connection is made and bulbs are found. Step 1: send a gateway discovery packet to the broadcast address, wait until we've received some info about the gateway. Step 2: connect to a d...
def function[connect, parameter[self, attempts, delay]]: constant[ Connects to a gateway, blocking until a connection is made and bulbs are found. Step 1: send a gateway discovery packet to the broadcast address, wait until we've received some info about the gateway. St...
keyword[def] identifier[connect] ( identifier[self] , identifier[attempts] = literal[int] , identifier[delay] = literal[int] ): literal[string] identifier[sock] = identifier[socket] . identifier[socket] ( identifier[socket] . identifier[AF_INET] , identifier[socket] . identifier[SOCK_DGRAM...
def connect(self, attempts=20, delay=0.5): """ Connects to a gateway, blocking until a connection is made and bulbs are found. Step 1: send a gateway discovery packet to the broadcast address, wait until we've received some info about the gateway. Step 2: connect to a disco...
def predict_task_proba(self, X, t=0, **kwargs): """Predicts probabilistic labels for an input X on task t Args: X: The input for the predict_proba method t: The task index to predict for which to predict probabilities Returns: An [n, K_t] tensor of prediction...
def function[predict_task_proba, parameter[self, X, t]]: constant[Predicts probabilistic labels for an input X on task t Args: X: The input for the predict_proba method t: The task index to predict for which to predict probabilities Returns: An [n, K_t] tenso...
keyword[def] identifier[predict_task_proba] ( identifier[self] , identifier[X] , identifier[t] = literal[int] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[self] . identifier[predict_proba] ( identifier[X] ,** identifier[kwargs] )[ identifier[t] ]
def predict_task_proba(self, X, t=0, **kwargs): """Predicts probabilistic labels for an input X on task t Args: X: The input for the predict_proba method t: The task index to predict for which to predict probabilities Returns: An [n, K_t] tensor of predictions fo...
def index2bool(index, length=None): """ Returns a numpy boolean array with Trues in the input index positions. :param index: index array with the Trues positions. :type index: ndarray (type=int) :param length: Length of the returned array. :type length: int or None :return...
def function[index2bool, parameter[index, length]]: constant[ Returns a numpy boolean array with Trues in the input index positions. :param index: index array with the Trues positions. :type index: ndarray (type=int) :param length: Length of the returned array. :type length: int or...
keyword[def] identifier[index2bool] ( identifier[index] , identifier[length] = keyword[None] ): literal[string] keyword[if] identifier[index] . identifier[shape] [ literal[int] ]== literal[int] keyword[and] identifier[length] keyword[is] keyword[None] : keyword[return] identifier[np] . id...
def index2bool(index, length=None): """ Returns a numpy boolean array with Trues in the input index positions. :param index: index array with the Trues positions. :type index: ndarray (type=int) :param length: Length of the returned array. :type length: int or None :returns: array ...
def string(self): # noqa: C901 """ Return a human-readable version of the decoded report. """ lines = ["station: %s" % self.station_id] if self.type: lines.append("type: %s" % self.report_type()) if self.time: lines.append("time: %s" % self.time.c...
def function[string, parameter[self]]: constant[ Return a human-readable version of the decoded report. ] variable[lines] assign[=] list[[<ast.BinOp object at 0x7da18dc04670>]] if name[self].type begin[:] call[name[lines].append, parameter[binary_operation[constan...
keyword[def] identifier[string] ( identifier[self] ): literal[string] identifier[lines] =[ literal[string] % identifier[self] . identifier[station_id] ] keyword[if] identifier[self] . identifier[type] : identifier[lines] . identifier[append] ( literal[string] % identifier[sel...
def string(self): # noqa: C901 '\n Return a human-readable version of the decoded report.\n ' lines = ['station: %s' % self.station_id] if self.type: lines.append('type: %s' % self.report_type()) # depends on [control=['if'], data=[]] if self.time: lines.append('time: %s'...
def get_maps(A): """Get mappings from the square array A to the flat vector of parameters alpha. Helper function for PCCA+ optimization. Parameters ---------- A : ndarray The transformation matrix A. Returns ------- flat_map : ndarray Mapping from flat indices (k) ...
def function[get_maps, parameter[A]]: constant[Get mappings from the square array A to the flat vector of parameters alpha. Helper function for PCCA+ optimization. Parameters ---------- A : ndarray The transformation matrix A. Returns ------- flat_map : ndarray ...
keyword[def] identifier[get_maps] ( identifier[A] ): literal[string] identifier[N] = identifier[A] . identifier[shape] [ literal[int] ] identifier[flat_map] =[] keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[N] ): keyword[for] identifier[j] key...
def get_maps(A): """Get mappings from the square array A to the flat vector of parameters alpha. Helper function for PCCA+ optimization. Parameters ---------- A : ndarray The transformation matrix A. Returns ------- flat_map : ndarray Mapping from flat indices (k) ...
def del_actor(self, actor): """Remove an actor when the socket is closed.""" if _debug: TCPClientDirector._debug("del_actor %r", actor) del self.clients[actor.peer] # tell the ASE the client has gone away if self.serviceElement: self.sap_request(del_actor=actor) ...
def function[del_actor, parameter[self, actor]]: constant[Remove an actor when the socket is closed.] if name[_debug] begin[:] call[name[TCPClientDirector]._debug, parameter[constant[del_actor %r], name[actor]]] <ast.Delete object at 0x7da1b084c490> if name[self].serviceEleme...
keyword[def] identifier[del_actor] ( identifier[self] , identifier[actor] ): literal[string] keyword[if] identifier[_debug] : identifier[TCPClientDirector] . identifier[_debug] ( literal[string] , identifier[actor] ) keyword[del] identifier[self] . identifier[clients] [ identifier[actor...
def del_actor(self, actor): """Remove an actor when the socket is closed.""" if _debug: TCPClientDirector._debug('del_actor %r', actor) # depends on [control=['if'], data=[]] del self.clients[actor.peer] # tell the ASE the client has gone away if self.serviceElement: self.sap_reques...
def msg(self, msg, *args): """Print a debug message, when the debug level is > 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator. """ if self.debuglevel > 0: self.stderr.write('Telnet(%s,%d): ' % (se...
def function[msg, parameter[self, msg]]: constant[Print a debug message, when the debug level is > 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator. ] if compare[name[self].debuglevel greater[>] constant[0]] be...
keyword[def] identifier[msg] ( identifier[self] , identifier[msg] ,* identifier[args] ): literal[string] keyword[if] identifier[self] . identifier[debuglevel] > literal[int] : identifier[self] . identifier[stderr] . identifier[write] ( literal[string] %( identifier[self] . identifier[...
def msg(self, msg, *args): """Print a debug message, when the debug level is > 0. If extra arguments are present, they are substituted in the message using the standard string formatting operator. """ if self.debuglevel > 0: self.stderr.write('Telnet(%s,%d): ' % (self.host, sel...
def create_disk_from_distro(vm_, linode_id, swap_size=None): r''' Creates the disk for the Linode from the distribution. vm\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size The size of the disk...
def function[create_disk_from_distro, parameter[vm_, linode_id, swap_size]]: constant[ Creates the disk for the Linode from the distribution. vm\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size ...
keyword[def] identifier[create_disk_from_distro] ( identifier[vm_] , identifier[linode_id] , identifier[swap_size] = keyword[None] ): literal[string] identifier[kwargs] ={} keyword[if] identifier[swap_size] keyword[is] keyword[None] : identifier[swap_size] = identifier[get_swap_size] ( id...
def create_disk_from_distro(vm_, linode_id, swap_size=None): """ Creates the disk for the Linode from the distribution. vm\\_ The VM profile to create the disk for. linode_id The ID of the Linode to create the distribution disk for. Required. swap_size The size of the disk...
def stop(self): """Output Checkstyle XML reports.""" et = ET.ElementTree(self.checkstyle_element) f = BytesIO() et.write(f, encoding='utf-8', xml_declaration=True) xml = f.getvalue().decode('utf-8') if self.output_fd is None: print(xml) else: ...
def function[stop, parameter[self]]: constant[Output Checkstyle XML reports.] variable[et] assign[=] call[name[ET].ElementTree, parameter[name[self].checkstyle_element]] variable[f] assign[=] call[name[BytesIO], parameter[]] call[name[et].write, parameter[name[f]]] variable[xml] ...
keyword[def] identifier[stop] ( identifier[self] ): literal[string] identifier[et] = identifier[ET] . identifier[ElementTree] ( identifier[self] . identifier[checkstyle_element] ) identifier[f] = identifier[BytesIO] () identifier[et] . identifier[write] ( identifier[f] , identifie...
def stop(self): """Output Checkstyle XML reports.""" et = ET.ElementTree(self.checkstyle_element) f = BytesIO() et.write(f, encoding='utf-8', xml_declaration=True) xml = f.getvalue().decode('utf-8') if self.output_fd is None: print(xml) # depends on [control=['if'], data=[]] else: ...
def jhk_to_sdssu(jmag,hmag,kmag): '''Converts given J, H, Ks mags to an SDSS u magnitude value. Parameters ---------- jmag,hmag,kmag : float 2MASS J, H, Ks mags of the object. Returns ------- float The converted SDSS u band magnitude. ''' return convert_constant...
def function[jhk_to_sdssu, parameter[jmag, hmag, kmag]]: constant[Converts given J, H, Ks mags to an SDSS u magnitude value. Parameters ---------- jmag,hmag,kmag : float 2MASS J, H, Ks mags of the object. Returns ------- float The converted SDSS u band magnitude. ...
keyword[def] identifier[jhk_to_sdssu] ( identifier[jmag] , identifier[hmag] , identifier[kmag] ): literal[string] keyword[return] identifier[convert_constants] ( identifier[jmag] , identifier[hmag] , identifier[kmag] , identifier[SDSSU_JHK] , identifier[SDSSU_JH] , identifier[SDSSU_JK] , identi...
def jhk_to_sdssu(jmag, hmag, kmag): """Converts given J, H, Ks mags to an SDSS u magnitude value. Parameters ---------- jmag,hmag,kmag : float 2MASS J, H, Ks mags of the object. Returns ------- float The converted SDSS u band magnitude. """ return convert_constan...
def add_copy_spec_scl(self, scl, copyspecs): """Same as add_copy_spec, except that it prepends path to SCL root to "copyspecs". """ if isinstance(copyspecs, six.string_types): copyspecs = [copyspecs] scl_copyspecs = [] for copyspec in copyspecs: sc...
def function[add_copy_spec_scl, parameter[self, scl, copyspecs]]: constant[Same as add_copy_spec, except that it prepends path to SCL root to "copyspecs". ] if call[name[isinstance], parameter[name[copyspecs], name[six].string_types]] begin[:] variable[copyspecs] assign[=...
keyword[def] identifier[add_copy_spec_scl] ( identifier[self] , identifier[scl] , identifier[copyspecs] ): literal[string] keyword[if] identifier[isinstance] ( identifier[copyspecs] , identifier[six] . identifier[string_types] ): identifier[copyspecs] =[ identifier[copyspecs] ] ...
def add_copy_spec_scl(self, scl, copyspecs): """Same as add_copy_spec, except that it prepends path to SCL root to "copyspecs". """ if isinstance(copyspecs, six.string_types): copyspecs = [copyspecs] # depends on [control=['if'], data=[]] scl_copyspecs = [] for copyspec in copys...
def build(self): """Finalise the graph, after adding all input files to it.""" assert not self.final, 'Trying to mutate a final graph.' # Replace each strongly connected component with a single node `NodeSet` for scc in sorted(nx.kosaraju_strongly_connected_components(self.graph), ...
def function[build, parameter[self]]: constant[Finalise the graph, after adding all input files to it.] assert[<ast.UnaryOp object at 0x7da1b07453c0>] for taget[name[scc]] in starred[call[name[sorted], parameter[call[name[nx].kosaraju_strongly_connected_components, parameter[name[self].graph]]]]] be...
keyword[def] identifier[build] ( identifier[self] ): literal[string] keyword[assert] keyword[not] identifier[self] . identifier[final] , literal[string] keyword[for] identifier[scc] keyword[in] identifier[sorted] ( identifier[nx] . identifier[kosaraju_strongly_connected_co...
def build(self): """Finalise the graph, after adding all input files to it.""" assert not self.final, 'Trying to mutate a final graph.' # Replace each strongly connected component with a single node `NodeSet` for scc in sorted(nx.kosaraju_strongly_connected_components(self.graph), key=len, reverse=True)...
def _mkdir(path): """ Make a directory or bail. """ try: os.mkdir(path) except OSError as e: if e.errno == 17: show_error("ABORTING: Directory {0} already exists.".format(path)) else: show_error("ABORTING: OSError {0}".format(e)) sys.exit()
def function[_mkdir, parameter[path]]: constant[ Make a directory or bail. ] <ast.Try object at 0x7da1b193fd00>
keyword[def] identifier[_mkdir] ( identifier[path] ): literal[string] keyword[try] : identifier[os] . identifier[mkdir] ( identifier[path] ) keyword[except] identifier[OSError] keyword[as] identifier[e] : keyword[if] identifier[e] . identifier[errno] == literal[int] : ...
def _mkdir(path): """ Make a directory or bail. """ try: os.mkdir(path) # depends on [control=['try'], data=[]] except OSError as e: if e.errno == 17: show_error('ABORTING: Directory {0} already exists.'.format(path)) # depends on [control=['if'], data=[]] else:...
def set_headline(self, level, message, timestamp=None, now_reference=None): """Set the persistent headline message for this service. Args: level (int): The level of the message (info, warning, error) message (string): The message contents timestamp (float): An option...
def function[set_headline, parameter[self, level, message, timestamp, now_reference]]: constant[Set the persistent headline message for this service. Args: level (int): The level of the message (info, warning, error) message (string): The message contents timestamp (...
keyword[def] identifier[set_headline] ( identifier[self] , identifier[level] , identifier[message] , identifier[timestamp] = keyword[None] , identifier[now_reference] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[headline] keyword[is] keyword[not] keyword[None] ...
def set_headline(self, level, message, timestamp=None, now_reference=None): """Set the persistent headline message for this service. Args: level (int): The level of the message (info, warning, error) message (string): The message contents timestamp (float): An optional m...
def _patch(): """Patch pymongo's Collection object to add a tail method. While not nessicarily recommended, you can use this to inject `tail` as a method into Collection, making it generally accessible. """ if not __debug__: # pragma: no cover import warnings warnings.warn("A catgirl has died.", ImportWar...
def function[_patch, parameter[]]: constant[Patch pymongo's Collection object to add a tail method. While not nessicarily recommended, you can use this to inject `tail` as a method into Collection, making it generally accessible. ] if <ast.UnaryOp object at 0x7da18fe930d0> begin[:] import m...
keyword[def] identifier[_patch] (): literal[string] keyword[if] keyword[not] identifier[__debug__] : keyword[import] identifier[warnings] identifier[warnings] . identifier[warn] ( literal[string] , identifier[ImportWarning] ) keyword[from] identifier[pymongo] . identifier[collection] keyword[impo...
def _patch(): """Patch pymongo's Collection object to add a tail method. While not nessicarily recommended, you can use this to inject `tail` as a method into Collection, making it generally accessible. """ if not __debug__: # pragma: no cover import warnings warnings.warn('A catgirl has d...
def transform_matrix_offset_center(matrix, y, x): """Convert the matrix from Cartesian coordinates (the origin in the middle of image) to Image coordinates (the origin on the top-left of image). Parameters ---------- matrix : numpy.array Transform matrix. x and y : 2 int Size of ima...
def function[transform_matrix_offset_center, parameter[matrix, y, x]]: constant[Convert the matrix from Cartesian coordinates (the origin in the middle of image) to Image coordinates (the origin on the top-left of image). Parameters ---------- matrix : numpy.array Transform matrix. x an...
keyword[def] identifier[transform_matrix_offset_center] ( identifier[matrix] , identifier[y] , identifier[x] ): literal[string] identifier[o_x] =( identifier[x] - literal[int] )/ literal[int] identifier[o_y] =( identifier[y] - literal[int] )/ literal[int] identifier[offset_matrix] = identifier[...
def transform_matrix_offset_center(matrix, y, x): """Convert the matrix from Cartesian coordinates (the origin in the middle of image) to Image coordinates (the origin on the top-left of image). Parameters ---------- matrix : numpy.array Transform matrix. x and y : 2 int Size of ima...
def enqueue(self, function, name=None, times=1, data=None): """ Appends a function to the queue for execution. The times argument specifies the number of attempts if the function raises an exception. If the name argument is None it defaults to whatever id(function) returns. ...
def function[enqueue, parameter[self, function, name, times, data]]: constant[ Appends a function to the queue for execution. The times argument specifies the number of attempts if the function raises an exception. If the name argument is None it defaults to whatever id(function) ...
keyword[def] identifier[enqueue] ( identifier[self] , identifier[function] , identifier[name] = keyword[None] , identifier[times] = literal[int] , identifier[data] = keyword[None] ): literal[string] identifier[self] . identifier[_check_if_ready] () keyword[return] identifier[self] . ident...
def enqueue(self, function, name=None, times=1, data=None): """ Appends a function to the queue for execution. The times argument specifies the number of attempts if the function raises an exception. If the name argument is None it defaults to whatever id(function) returns. ...
def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if d is None: continue elif SCons.Util.is_List(d) or isinstance(d, tuple): ...
def function[processDefines, parameter[defs]]: constant[process defines, resolving strings, lists, dictionaries, into a list of strings ] if call[name[SCons].Util.is_List, parameter[name[defs]]] begin[:] variable[l] assign[=] list[[]] for taget[name[d]] in starred...
keyword[def] identifier[processDefines] ( identifier[defs] ): literal[string] keyword[if] identifier[SCons] . identifier[Util] . identifier[is_List] ( identifier[defs] ): identifier[l] =[] keyword[for] identifier[d] keyword[in] identifier[defs] : keyword[if] identifier[d...
def processDefines(defs): """process defines, resolving strings, lists, dictionaries, into a list of strings """ if SCons.Util.is_List(defs): l = [] for d in defs: if d is None: continue # depends on [control=['if'], data=[]] elif SCons.Util.is_Li...
def js_reverse_inline(context): """ Outputs a string of javascript that can generate URLs via the use of the names given to those URLs. """ if 'request' in context: default_urlresolver = get_resolver(getattr(context['request'], 'urlconf', None)) else: default_urlresolver = get_re...
def function[js_reverse_inline, parameter[context]]: constant[ Outputs a string of javascript that can generate URLs via the use of the names given to those URLs. ] if compare[constant[request] in name[context]] begin[:] variable[default_urlresolver] assign[=] call[name[get_r...
keyword[def] identifier[js_reverse_inline] ( identifier[context] ): literal[string] keyword[if] literal[string] keyword[in] identifier[context] : identifier[default_urlresolver] = identifier[get_resolver] ( identifier[getattr] ( identifier[context] [ literal[string] ], literal[string] , keyword...
def js_reverse_inline(context): """ Outputs a string of javascript that can generate URLs via the use of the names given to those URLs. """ if 'request' in context: default_urlresolver = get_resolver(getattr(context['request'], 'urlconf', None)) # depends on [control=['if'], data=['context'...
def _find_fld_pkt_val(self, pkt, val): """Given a Packet instance `pkt` and the value `val` to be set, returns the Field subclass to be used, and the updated `val` if necessary. """ fld = self._iterate_fields_cond(pkt, val, True) # Default ? (in this case, let's make sure it's up-do-dat...
def function[_find_fld_pkt_val, parameter[self, pkt, val]]: constant[Given a Packet instance `pkt` and the value `val` to be set, returns the Field subclass to be used, and the updated `val` if necessary. ] variable[fld] assign[=] call[name[self]._iterate_fields_cond, parameter[name[pkt], name[...
keyword[def] identifier[_find_fld_pkt_val] ( identifier[self] , identifier[pkt] , identifier[val] ): literal[string] identifier[fld] = identifier[self] . identifier[_iterate_fields_cond] ( identifier[pkt] , identifier[val] , keyword[True] ) identifier[dflts_pkt] = identifier[pkt] ...
def _find_fld_pkt_val(self, pkt, val): """Given a Packet instance `pkt` and the value `val` to be set, returns the Field subclass to be used, and the updated `val` if necessary. """ fld = self._iterate_fields_cond(pkt, val, True) # Default ? (in this case, let's make sure it's up-do-date) dflts...
def choice_install(self): """Download, build and install package """ pkg_security([self.name]) if not find_package(self.prgnam, self.meta.pkg_path): self.build() self.install() delete(self.build_folder) raise SystemExit() else: ...
def function[choice_install, parameter[self]]: constant[Download, build and install package ] call[name[pkg_security], parameter[list[[<ast.Attribute object at 0x7da20e960880>]]]] if <ast.UnaryOp object at 0x7da20e961ab0> begin[:] call[name[self].build, parameter[]] ...
keyword[def] identifier[choice_install] ( identifier[self] ): literal[string] identifier[pkg_security] ([ identifier[self] . identifier[name] ]) keyword[if] keyword[not] identifier[find_package] ( identifier[self] . identifier[prgnam] , identifier[self] . identifier[meta] . identifier[pk...
def choice_install(self): """Download, build and install package """ pkg_security([self.name]) if not find_package(self.prgnam, self.meta.pkg_path): self.build() self.install() delete(self.build_folder) raise SystemExit() # depends on [control=['if'], data=[]] el...
def set_domain(self, domain='https://api.anaconda.org'): """Reset current api domain.""" logger.debug(str((domain))) config = binstar_client.utils.get_config() config['url'] = domain binstar_client.utils.set_config(config) self._anaconda_client_api = binstar_client.utils...
def function[set_domain, parameter[self, domain]]: constant[Reset current api domain.] call[name[logger].debug, parameter[call[name[str], parameter[name[domain]]]]] variable[config] assign[=] call[name[binstar_client].utils.get_config, parameter[]] call[name[config]][constant[url]] assig...
keyword[def] identifier[set_domain] ( identifier[self] , identifier[domain] = literal[string] ): literal[string] identifier[logger] . identifier[debug] ( identifier[str] (( identifier[domain] ))) identifier[config] = identifier[binstar_client] . identifier[utils] . identifier[get_config] (...
def set_domain(self, domain='https://api.anaconda.org'): """Reset current api domain.""" logger.debug(str(domain)) config = binstar_client.utils.get_config() config['url'] = domain binstar_client.utils.set_config(config) self._anaconda_client_api = binstar_client.utils.get_server_api(token=None,...
def space(self): """Total Hilbert space""" args_spaces = (self.S.space, self.L.space, self.H.space) return ProductSpace.create(*args_spaces)
def function[space, parameter[self]]: constant[Total Hilbert space] variable[args_spaces] assign[=] tuple[[<ast.Attribute object at 0x7da204344460>, <ast.Attribute object at 0x7da204344dc0>, <ast.Attribute object at 0x7da204344b50>]] return[call[name[ProductSpace].create, parameter[<ast.Starred obje...
keyword[def] identifier[space] ( identifier[self] ): literal[string] identifier[args_spaces] =( identifier[self] . identifier[S] . identifier[space] , identifier[self] . identifier[L] . identifier[space] , identifier[self] . identifier[H] . identifier[space] ) keyword[return] identifier[P...
def space(self): """Total Hilbert space""" args_spaces = (self.S.space, self.L.space, self.H.space) return ProductSpace.create(*args_spaces)
def serialize( self, value, # type: Any state # type: _ProcessorState ): # type: (...) -> ET.Element """Serialize the value and returns it.""" xml_value = _hooks_apply_before_serialize(self._hooks, state, value) return self._processor.serialize(x...
def function[serialize, parameter[self, value, state]]: constant[Serialize the value and returns it.] variable[xml_value] assign[=] call[name[_hooks_apply_before_serialize], parameter[name[self]._hooks, name[state], name[value]]] return[call[name[self]._processor.serialize, parameter[name[xml_value]...
keyword[def] identifier[serialize] ( identifier[self] , identifier[value] , identifier[state] ): literal[string] identifier[xml_value] = identifier[_hooks_apply_before_serialize] ( identifier[self] . identifier[_hooks] , identifier[state] , identifier[value] ) keyword[return] identif...
def serialize(self, value, state): # type: Any # type: _ProcessorState # type: (...) -> ET.Element 'Serialize the value and returns it.' xml_value = _hooks_apply_before_serialize(self._hooks, state, value) return self._processor.serialize(xml_value, state)
def parseAddress(address): """ Parse the given RFC 2821 email address into a structured object. @type address: C{str} @param address: The address to parse. @rtype: L{Address} @raise xmantissa.error.ArgumentError: The given string was not a valid RFC 2821 address. """ parts = [] ...
def function[parseAddress, parameter[address]]: constant[ Parse the given RFC 2821 email address into a structured object. @type address: C{str} @param address: The address to parse. @rtype: L{Address} @raise xmantissa.error.ArgumentError: The given string was not a valid RFC 2821 add...
keyword[def] identifier[parseAddress] ( identifier[address] ): literal[string] identifier[parts] =[] identifier[parser] = identifier[_AddressParser] () identifier[end] = identifier[parser] ( identifier[parts] , identifier[address] ) keyword[if] identifier[end] != identifier[len] ( identifie...
def parseAddress(address): """ Parse the given RFC 2821 email address into a structured object. @type address: C{str} @param address: The address to parse. @rtype: L{Address} @raise xmantissa.error.ArgumentError: The given string was not a valid RFC 2821 address. """ parts = [] ...
def hmac(key, message, tag=None, alg=hashlib.sha256): """ Generates a hashed message authentication code (HMAC) by prepending the specified @tag string to a @message, then hashing with to HMAC using a cryptographic @key and hashing @alg -orithm. """ return HMAC.new(str(key), str(tag) + str(mess...
def function[hmac, parameter[key, message, tag, alg]]: constant[ Generates a hashed message authentication code (HMAC) by prepending the specified @tag string to a @message, then hashing with to HMAC using a cryptographic @key and hashing @alg -orithm. ] return[call[call[name[HMAC].new, par...
keyword[def] identifier[hmac] ( identifier[key] , identifier[message] , identifier[tag] = keyword[None] , identifier[alg] = identifier[hashlib] . identifier[sha256] ): literal[string] keyword[return] identifier[HMAC] . identifier[new] ( identifier[str] ( identifier[key] ), identifier[str] ( identifier[tag...
def hmac(key, message, tag=None, alg=hashlib.sha256): """ Generates a hashed message authentication code (HMAC) by prepending the specified @tag string to a @message, then hashing with to HMAC using a cryptographic @key and hashing @alg -orithm. """ return HMAC.new(str(key), str(tag) + str(mess...
def modified(self): """ Whether the map has staged local modifications. """ if self._removes: return True for v in self._value: if self._value[v].modified: return True for v in self._updates: if self._updates[v].modified...
def function[modified, parameter[self]]: constant[ Whether the map has staged local modifications. ] if name[self]._removes begin[:] return[constant[True]] for taget[name[v]] in starred[name[self]._value] begin[:] if call[name[self]._value][name[v]].modifi...
keyword[def] identifier[modified] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_removes] : keyword[return] keyword[True] keyword[for] identifier[v] keyword[in] identifier[self] . identifier[_value] : keyword[if] identifier...
def modified(self): """ Whether the map has staged local modifications. """ if self._removes: return True # depends on [control=['if'], data=[]] for v in self._value: if self._value[v].modified: return True # depends on [control=['if'], data=[]] # depends on [c...
def permutations(x): '''Given a listlike, x, return all permutations of x Returns the permutations of x in the lexical order of their indices: e.g. >>> x = [ 1, 2, 3, 4 ] >>> for p in permutations(x): >>> print p [ 1, 2, 3, 4 ] [ 1, 2, 4, 3 ] [ 1, 3, 2, 4 ] [ 1, 3, 4, 2 ] ...
def function[permutations, parameter[x]]: constant[Given a listlike, x, return all permutations of x Returns the permutations of x in the lexical order of their indices: e.g. >>> x = [ 1, 2, 3, 4 ] >>> for p in permutations(x): >>> print p [ 1, 2, 3, 4 ] [ 1, 2, 4, 3 ] [ 1, 3,...
keyword[def] identifier[permutations] ( identifier[x] ): literal[string] keyword[yield] identifier[list] ( identifier[x] ) identifier[x] = identifier[np] . identifier[array] ( identifier[x] ) identifier[a] = identifier[np] . i...
def permutations(x): """Given a listlike, x, return all permutations of x Returns the permutations of x in the lexical order of their indices: e.g. >>> x = [ 1, 2, 3, 4 ] >>> for p in permutations(x): >>> print p [ 1, 2, 3, 4 ] [ 1, 2, 4, 3 ] [ 1, 3, 2, 4 ] [ 1, 3, 4, 2 ] ...
def simple_prot(x, start): """Find the first peak to the right of start""" # start must b >= 1 for i in range(start,len(x)-1): a,b,c = x[i-1], x[i], x[i+1] if b - a > 0 and b -c >= 0: return i else: return None
def function[simple_prot, parameter[x, start]]: constant[Find the first peak to the right of start] for taget[name[i]] in starred[call[name[range], parameter[name[start], binary_operation[call[name[len], parameter[name[x]]] - constant[1]]]]] begin[:] <ast.Tuple object at 0x7da20c6e5300> ...
keyword[def] identifier[simple_prot] ( identifier[x] , identifier[start] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[start] , identifier[len] ( identifier[x] )- literal[int] ): identifier[a] , identifier[b] , identifier[c] = identifier[x] [ id...
def simple_prot(x, start): """Find the first peak to the right of start""" # start must b >= 1 for i in range(start, len(x) - 1): (a, b, c) = (x[i - 1], x[i], x[i + 1]) if b - a > 0 and b - c >= 0: return i # depends on [control=['if'], data=[]] # depends on [control=['for'], d...
def read_wait_cell(self): """Read the value of the cell holding the 'wait' value, Returns the int value of whatever it has, or None if the cell doesn't exist. """ table_state = self.bt_table.read_row( TABLE_STATE, filter_=bigtable_row_filters.ColumnRange...
def function[read_wait_cell, parameter[self]]: constant[Read the value of the cell holding the 'wait' value, Returns the int value of whatever it has, or None if the cell doesn't exist. ] variable[table_state] assign[=] call[name[self].bt_table.read_row, parameter[name[TABLE_STA...
keyword[def] identifier[read_wait_cell] ( identifier[self] ): literal[string] identifier[table_state] = identifier[self] . identifier[bt_table] . identifier[read_row] ( identifier[TABLE_STATE] , identifier[filter_] = identifier[bigtable_row_filters] . identifier[ColumnRangeFilter...
def read_wait_cell(self): """Read the value of the cell holding the 'wait' value, Returns the int value of whatever it has, or None if the cell doesn't exist. """ table_state = self.bt_table.read_row(TABLE_STATE, filter_=bigtable_row_filters.ColumnRangeFilter(METADATA, WAIT_CELL, WAIT_C...
def count_n_grams_py_polarity(self, data_set_reader, n_grams, filters): """ Returns a map of n-gram and the number of times it appeared in positive context and the number of times it appeared in negative context in dataset file. :param data_set_reader: Dataset containing tweets and thei...
def function[count_n_grams_py_polarity, parameter[self, data_set_reader, n_grams, filters]]: constant[ Returns a map of n-gram and the number of times it appeared in positive context and the number of times it appeared in negative context in dataset file. :param data_set_reader: Dataset...
keyword[def] identifier[count_n_grams_py_polarity] ( identifier[self] , identifier[data_set_reader] , identifier[n_grams] , identifier[filters] ): literal[string] identifier[self] . identifier[data_set_reader] = identifier[data_set_reader] identifier[token_trie] = identifier[TokenTrie] ( ...
def count_n_grams_py_polarity(self, data_set_reader, n_grams, filters): """ Returns a map of n-gram and the number of times it appeared in positive context and the number of times it appeared in negative context in dataset file. :param data_set_reader: Dataset containing tweets and their cl...
def get_past_events(self): """ Get past PythonKC meetup events. Returns ------- List of ``pythonkc_meetups.types.MeetupEvent``, ordered by event time, descending. Exceptions ---------- * PythonKCMeetupsBadJson * PythonKCMeetupsBadResponse...
def function[get_past_events, parameter[self]]: constant[ Get past PythonKC meetup events. Returns ------- List of ``pythonkc_meetups.types.MeetupEvent``, ordered by event time, descending. Exceptions ---------- * PythonKCMeetupsBadJson *...
keyword[def] identifier[get_past_events] ( identifier[self] ): literal[string] keyword[def] identifier[get_attendees] ( identifier[event] ): keyword[return] [ identifier[attendee] keyword[for] identifier[event_id] , identifier[attendee] keyword[in] identifier[events_attendees] ...
def get_past_events(self): """ Get past PythonKC meetup events. Returns ------- List of ``pythonkc_meetups.types.MeetupEvent``, ordered by event time, descending. Exceptions ---------- * PythonKCMeetupsBadJson * PythonKCMeetupsBadResponse ...
def is_proxy(): ''' Return True if this minion is a proxy minion. Leverages the fact that is_linux() and is_windows both return False for proxies. TODO: Need to extend this for proxies that might run on other Unices ''' import __main__ as main # This is a hack. If a proxy minion is ...
def function[is_proxy, parameter[]]: constant[ Return True if this minion is a proxy minion. Leverages the fact that is_linux() and is_windows both return False for proxies. TODO: Need to extend this for proxies that might run on other Unices ] import module[__main__] as alias[main] ...
keyword[def] identifier[is_proxy] (): literal[string] keyword[import] identifier[__main__] keyword[as] identifier[main] identifier[ret] = keyword[False] keyword[try] : keyword[if] literal[string] keyword[in] identifier[main] . identifier[__...
def is_proxy(): """ Return True if this minion is a proxy minion. Leverages the fact that is_linux() and is_windows both return False for proxies. TODO: Need to extend this for proxies that might run on other Unices """ import __main__ as main # This is a hack. If a proxy minion is ...
def replaceext(filepath, new_ext): """Replace any existing file extension with a new one Example:: >>> replaceext('/foo/bar.txt', 'py') '/foo/bar.py' >>> replaceext('/foo/bar.txt', '.doc') '/foo/bar.doc' Args: filepath (str, path): file path new_ext (str): ...
def function[replaceext, parameter[filepath, new_ext]]: constant[Replace any existing file extension with a new one Example:: >>> replaceext('/foo/bar.txt', 'py') '/foo/bar.py' >>> replaceext('/foo/bar.txt', '.doc') '/foo/bar.doc' Args: filepath (str, path): fi...
keyword[def] identifier[replaceext] ( identifier[filepath] , identifier[new_ext] ): literal[string] keyword[if] identifier[new_ext] keyword[and] identifier[new_ext] [ literal[int] ]!= literal[string] : identifier[new_ext] = literal[string] + identifier[new_ext] identifier[root] , identif...
def replaceext(filepath, new_ext): """Replace any existing file extension with a new one Example:: >>> replaceext('/foo/bar.txt', 'py') '/foo/bar.py' >>> replaceext('/foo/bar.txt', '.doc') '/foo/bar.doc' Args: filepath (str, path): file path new_ext (str): ...
def from_join(cls, join: Join) -> 'ConditionalJoin': """Creates a new :see:ConditionalJoin from the specified :see:Join object. Arguments: join: The :see:Join object to create the :see:ConditionalJoin object from. Returns: A :see:...
def function[from_join, parameter[cls, join]]: constant[Creates a new :see:ConditionalJoin from the specified :see:Join object. Arguments: join: The :see:Join object to create the :see:ConditionalJoin object from. Returns: A :see:...
keyword[def] identifier[from_join] ( identifier[cls] , identifier[join] : identifier[Join] )-> literal[string] : literal[string] keyword[return] identifier[cls] ( identifier[join] . identifier[table_name] , identifier[join] . identifier[parent_alias] , identifier[join] ...
def from_join(cls, join: Join) -> 'ConditionalJoin': """Creates a new :see:ConditionalJoin from the specified :see:Join object. Arguments: join: The :see:Join object to create the :see:ConditionalJoin object from. Returns: A :see:Cond...
def main(): """Handles external calling for this module Execute this python module and provide the args shown below to external call this module to send email messages! :return: None """ log = logging.getLogger(mod_logger + '.main') parser = argparse.ArgumentParser(description='This module...
def function[main, parameter[]]: constant[Handles external calling for this module Execute this python module and provide the args shown below to external call this module to send email messages! :return: None ] variable[log] assign[=] call[name[logging].getLogger, parameter[binary_ope...
keyword[def] identifier[main] (): literal[string] identifier[log] = identifier[logging] . identifier[getLogger] ( identifier[mod_logger] + literal[string] ) identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = literal[string] ) identifier[parser] . id...
def main(): """Handles external calling for this module Execute this python module and provide the args shown below to external call this module to send email messages! :return: None """ log = logging.getLogger(mod_logger + '.main') parser = argparse.ArgumentParser(description='This module...
def profile_func(filename=None): ''' Decorator for adding profiling to a nested function in Salt ''' def proffunc(fun): def profiled_func(*args, **kwargs): logging.info('Profiling function %s', fun.__name__) try: profiler = cProfile.Profile() ...
def function[profile_func, parameter[filename]]: constant[ Decorator for adding profiling to a nested function in Salt ] def function[proffunc, parameter[fun]]: def function[profiled_func, parameter[]]: call[name[logging].info, parameter[constant[Profiling...
keyword[def] identifier[profile_func] ( identifier[filename] = keyword[None] ): literal[string] keyword[def] identifier[proffunc] ( identifier[fun] ): keyword[def] identifier[profiled_func] (* identifier[args] ,** identifier[kwargs] ): identifier[logging] . identifier[info] ( litera...
def profile_func(filename=None): """ Decorator for adding profiling to a nested function in Salt """ def proffunc(fun): def profiled_func(*args, **kwargs): logging.info('Profiling function %s', fun.__name__) try: profiler = cProfile.Profile() ...
def range(self, start='-', stop='+', count=None): """ Read a range of values from a stream. :param start: start key of range (inclusive) or '-' for oldest message :param stop: stop key of range (inclusive) or '+' for newest message :param count: limit number of messages returned...
def function[range, parameter[self, start, stop, count]]: constant[ Read a range of values from a stream. :param start: start key of range (inclusive) or '-' for oldest message :param stop: stop key of range (inclusive) or '+' for newest message :param count: limit number of mes...
keyword[def] identifier[range] ( identifier[self] , identifier[start] = literal[string] , identifier[stop] = literal[string] , identifier[count] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[database] . identifier[xrange] ( identifier[self] . identifier[key] , id...
def range(self, start='-', stop='+', count=None): """ Read a range of values from a stream. :param start: start key of range (inclusive) or '-' for oldest message :param stop: stop key of range (inclusive) or '+' for newest message :param count: limit number of messages returned ...
async def verify(self, message: bytes, signature: bytes, signer: str = None) -> bool: """ Verify signature with input signer verification key (via lookup by DID first if need be). Raise WalletState if wallet is closed. :param message: Content to sign, as bytes :param signature: ...
<ast.AsyncFunctionDef object at 0x7da20c6c7190>
keyword[async] keyword[def] identifier[verify] ( identifier[self] , identifier[message] : identifier[bytes] , identifier[signature] : identifier[bytes] , identifier[signer] : identifier[str] = keyword[None] )-> identifier[bool] : literal[string] identifier[LOGGER] . identifier[debug] ( literal[st...
async def verify(self, message: bytes, signature: bytes, signer: str=None) -> bool: """ Verify signature with input signer verification key (via lookup by DID first if need be). Raise WalletState if wallet is closed. :param message: Content to sign, as bytes :param signature: signat...
def update_connection_public_key(self, connection_id, public_key): """Adds the public_key to the connection definition. Args: connection_id (str): The identifier for the connection. public_key (str): The public key used to enforce permissions on connections. ...
def function[update_connection_public_key, parameter[self, connection_id, public_key]]: constant[Adds the public_key to the connection definition. Args: connection_id (str): The identifier for the connection. public_key (str): The public key used to enforce permissions on ...
keyword[def] identifier[update_connection_public_key] ( identifier[self] , identifier[connection_id] , identifier[public_key] ): literal[string] keyword[if] identifier[connection_id] keyword[in] identifier[self] . identifier[_connections] : identifier[connection_info] = identifier[s...
def update_connection_public_key(self, connection_id, public_key): """Adds the public_key to the connection definition. Args: connection_id (str): The identifier for the connection. public_key (str): The public key used to enforce permissions on connections. ...
def hsv_to_rgb(h, s=None, v=None): """Convert the color from RGB coordinates to HSV. Parameters: :h: The Hus component value [0...1] :s: The Saturation component value [0...1] :v: The Value component [0...1] Returns: The color as an (r, g, b) tuple in the range: r[0...1], ...
def function[hsv_to_rgb, parameter[h, s, v]]: constant[Convert the color from RGB coordinates to HSV. Parameters: :h: The Hus component value [0...1] :s: The Saturation component value [0...1] :v: The Value component [0...1] Returns: The color as an (r, g, b) tuple in the...
keyword[def] identifier[hsv_to_rgb] ( identifier[h] , identifier[s] = keyword[None] , identifier[v] = keyword[None] ): literal[string] keyword[if] identifier[type] ( identifier[h] ) keyword[in] [ identifier[list] , identifier[tuple] ]: identifier[h] , identifier[s] , identifier[v] = identifier[h] ke...
def hsv_to_rgb(h, s=None, v=None): """Convert the color from RGB coordinates to HSV. Parameters: :h: The Hus component value [0...1] :s: The Saturation component value [0...1] :v: The Value component [0...1] Returns: The color as an (r, g, b) tuple in the range: r[0...1],...
def _queue_task(self, host, task, task_vars, play_context): """ Many PluginLoader caches are defective as they are only populated in the ephemeral WorkerProcess. Touch each plug-in path before forking to ensure all workers receive a hot cache. """ ansible_mitogen.loaders....
def function[_queue_task, parameter[self, host, task, task_vars, play_context]]: constant[ Many PluginLoader caches are defective as they are only populated in the ephemeral WorkerProcess. Touch each plug-in path before forking to ensure all workers receive a hot cache. ] ...
keyword[def] identifier[_queue_task] ( identifier[self] , identifier[host] , identifier[task] , identifier[task_vars] , identifier[play_context] ): literal[string] identifier[ansible_mitogen] . identifier[loaders] . identifier[module_loader] . identifier[find_plugin] ( identifier[name] = i...
def _queue_task(self, host, task, task_vars, play_context): """ Many PluginLoader caches are defective as they are only populated in the ephemeral WorkerProcess. Touch each plug-in path before forking to ensure all workers receive a hot cache. """ ansible_mitogen.loaders.module_l...
def vlag_commit_mode_disable(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") vlag_commit_mode = ET.SubElement(config, "vlag-commit-mode", xmlns="urn:brocade.com:mgmt:brocade-lacp") disable = ET.SubElement(vlag_commit_mode, "disable") callback = ...
def function[vlag_commit_mode_disable, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[vlag_commit_mode] assign[=] call[name[ET].SubElement, parameter[name[config], constant[vlag-commit-mode]]] ...
keyword[def] identifier[vlag_commit_mode_disable] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[vlag_commit_mode] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal...
def vlag_commit_mode_disable(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') vlag_commit_mode = ET.SubElement(config, 'vlag-commit-mode', xmlns='urn:brocade.com:mgmt:brocade-lacp') disable = ET.SubElement(vlag_commit_mode, 'disable') callback = kwargs.pop('callback'...
def lookstr(table, limit=0, **kwargs): """Like :func:`petl.util.vis.look` but use str() rather than repr() for data values. """ kwargs['vrepr'] = str return look(table, limit=limit, **kwargs)
def function[lookstr, parameter[table, limit]]: constant[Like :func:`petl.util.vis.look` but use str() rather than repr() for data values. ] call[name[kwargs]][constant[vrepr]] assign[=] name[str] return[call[name[look], parameter[name[table]]]]
keyword[def] identifier[lookstr] ( identifier[table] , identifier[limit] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= identifier[str] keyword[return] identifier[look] ( identifier[table] , identifier[limit] = identifier[limit] ,** identifier[kwarg...
def lookstr(table, limit=0, **kwargs): """Like :func:`petl.util.vis.look` but use str() rather than repr() for data values. """ kwargs['vrepr'] = str return look(table, limit=limit, **kwargs)
def concat_multiple_inputs(data, sample): """ If multiple fastq files were appended into the list of fastqs for samples then we merge them here before proceeding. """ ## if more than one tuple in fastq list if len(sample.files.fastqs) > 1: ## create a cat command to append them all (d...
def function[concat_multiple_inputs, parameter[data, sample]]: constant[ If multiple fastq files were appended into the list of fastqs for samples then we merge them here before proceeding. ] if compare[call[name[len], parameter[name[sample].files.fastqs]] greater[>] constant[1]] begin[:] ...
keyword[def] identifier[concat_multiple_inputs] ( identifier[data] , identifier[sample] ): literal[string] keyword[if] identifier[len] ( identifier[sample] . identifier[files] . identifier[fastqs] )> literal[int] : identifier[cmd1] =[ literal[string] ]+[ identifier[i] [ literal[in...
def concat_multiple_inputs(data, sample): """ If multiple fastq files were appended into the list of fastqs for samples then we merge them here before proceeding. """ ## if more than one tuple in fastq list if len(sample.files.fastqs) > 1: ## create a cat command to append them all (doesn't m...
def capture_exception(self, error=None): # type: (Optional[BaseException]) -> Optional[str] """Captures an exception. The argument passed can be `None` in which case the last exception will be reported, otherwise an exception object or an `exc_info` tuple. """ cl...
def function[capture_exception, parameter[self, error]]: constant[Captures an exception. The argument passed can be `None` in which case the last exception will be reported, otherwise an exception object or an `exc_info` tuple. ] variable[client] assign[=] name[self].cli...
keyword[def] identifier[capture_exception] ( identifier[self] , identifier[error] = keyword[None] ): literal[string] identifier[client] = identifier[self] . identifier[client] keyword[if] identifier[client] keyword[is] keyword[None] : keyword[return] keyword[None] ...
def capture_exception(self, error=None): # type: (Optional[BaseException]) -> Optional[str] 'Captures an exception.\n\n The argument passed can be `None` in which case the last exception\n will be reported, otherwise an exception object or an `exc_info`\n tuple.\n ' client = self...
def Rotate(self, degrees: int, waitTime: float = OPERATION_WAIT_TIME) -> bool: """ Call IUIAutomationTransformPattern::Rotate. Rotates the UI Automation element. degrees: int. waitTime: float. Return bool, True if succeed otherwise False. Refer https://docs.micros...
def function[Rotate, parameter[self, degrees, waitTime]]: constant[ Call IUIAutomationTransformPattern::Rotate. Rotates the UI Automation element. degrees: int. waitTime: float. Return bool, True if succeed otherwise False. Refer https://docs.microsoft.com/en-us/w...
keyword[def] identifier[Rotate] ( identifier[self] , identifier[degrees] : identifier[int] , identifier[waitTime] : identifier[float] = identifier[OPERATION_WAIT_TIME] )-> identifier[bool] : literal[string] identifier[ret] = identifier[self] . identifier[pattern] . identifier[Rotate] ( identifier[d...
def Rotate(self, degrees: int, waitTime: float=OPERATION_WAIT_TIME) -> bool: """ Call IUIAutomationTransformPattern::Rotate. Rotates the UI Automation element. degrees: int. waitTime: float. Return bool, True if succeed otherwise False. Refer https://docs.microsoft.co...
def update(self): """ Preparse the packaging system for installations. """ packager = self.packager if packager == APT: self.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update') elif packager == YUM: self.sudo('yum update') else: ...
def function[update, parameter[self]]: constant[ Preparse the packaging system for installations. ] variable[packager] assign[=] name[self].packager if compare[name[packager] equal[==] name[APT]] begin[:] call[name[self].sudo, parameter[constant[DEBIAN_FRONTEND=no...
keyword[def] identifier[update] ( identifier[self] ): literal[string] identifier[packager] = identifier[self] . identifier[packager] keyword[if] identifier[packager] == identifier[APT] : identifier[self] . identifier[sudo] ( literal[string] ) keyword[elif] identifi...
def update(self): """ Preparse the packaging system for installations. """ packager = self.packager if packager == APT: self.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq update') # depends on [control=['if'], data=[]] elif packager == YUM: self.sudo('yum update') # ...
def reference_id_from_filename(filename): """\ Extracts the reference identifier from the provided filename. """ reference_id = os.path.basename(filename) if reference_id.rfind('.htm') > 0: reference_id = reference_id[:reference_id.rfind('.')] #TODO: else: raise ValueError('bla bla')? ...
def function[reference_id_from_filename, parameter[filename]]: constant[ Extracts the reference identifier from the provided filename. ] variable[reference_id] assign[=] call[name[os].path.basename, parameter[name[filename]]] if compare[call[name[reference_id].rfind, parameter[constant[.h...
keyword[def] identifier[reference_id_from_filename] ( identifier[filename] ): literal[string] identifier[reference_id] = identifier[os] . identifier[path] . identifier[basename] ( identifier[filename] ) keyword[if] identifier[reference_id] . identifier[rfind] ( literal[string] )> literal[int] : ...
def reference_id_from_filename(filename): """ Extracts the reference identifier from the provided filename. """ reference_id = os.path.basename(filename) if reference_id.rfind('.htm') > 0: reference_id = reference_id[:reference_id.rfind('.')] # depends on [control=['if'], data=[]] #TODO:...
def get(self, request, **resources): """ Default GET method. Return instance (collection) by model. :return object: instance or collection from self model """ instance = resources.get(self._meta.name) if not instance is None: return instance return self.pa...
def function[get, parameter[self, request]]: constant[ Default GET method. Return instance (collection) by model. :return object: instance or collection from self model ] variable[instance] assign[=] call[name[resources].get, parameter[name[self]._meta.name]] if <ast.UnaryOp ob...
keyword[def] identifier[get] ( identifier[self] , identifier[request] ,** identifier[resources] ): literal[string] identifier[instance] = identifier[resources] . identifier[get] ( identifier[self] . identifier[_meta] . identifier[name] ) keyword[if] keyword[not] identifier[instance] ke...
def get(self, request, **resources): """ Default GET method. Return instance (collection) by model. :return object: instance or collection from self model """ instance = resources.get(self._meta.name) if not instance is None: return instance # depends on [control=['if'], data=[]] ...
def expand_variable_dicts( list_of_variable_dicts: 'List[Union[Dataset, OrderedDict]]', ) -> 'List[Mapping[Any, Variable]]': """Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for t...
def function[expand_variable_dicts, parameter[list_of_variable_dicts]]: constant[Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for the mappings must be of the following types: ...
keyword[def] identifier[expand_variable_dicts] ( identifier[list_of_variable_dicts] : literal[string] , )-> literal[string] : literal[string] keyword[from] . identifier[dataarray] keyword[import] identifier[DataArray] keyword[from] . identifier[dataset] keyword[import] identifier[Dataset] ...
def expand_variable_dicts(list_of_variable_dicts: 'List[Union[Dataset, OrderedDict]]') -> 'List[Mapping[Any, Variable]]': """Given a list of dicts with xarray object values, expand the values. Parameters ---------- list_of_variable_dicts : list of dict or Dataset objects Each value for the mapp...
def load_sample(sample): """ Load meter data, temperature data, and metadata for associated with a particular sample identifier. Note: samples are simulated, not real, data. Parameters ---------- sample : :any:`str` Identifier of sample. Complete list can be obtained with :any:`eeme...
def function[load_sample, parameter[sample]]: constant[ Load meter data, temperature data, and metadata for associated with a particular sample identifier. Note: samples are simulated, not real, data. Parameters ---------- sample : :any:`str` Identifier of sample. Complete list can be o...
keyword[def] identifier[load_sample] ( identifier[sample] ): literal[string] identifier[sample_metadata] = identifier[_load_sample_metadata] () identifier[metadata] = identifier[sample_metadata] . identifier[get] ( identifier[sample] ) keyword[if] identifier[metadata] keyword[is] keyword[None]...
def load_sample(sample): """ Load meter data, temperature data, and metadata for associated with a particular sample identifier. Note: samples are simulated, not real, data. Parameters ---------- sample : :any:`str` Identifier of sample. Complete list can be obtained with :any:`eeme...
def hash(self): """Generate a hash value.""" h = hash_pandas_object(self, index=True) return hashlib.md5(h.values.tobytes()).hexdigest()
def function[hash, parameter[self]]: constant[Generate a hash value.] variable[h] assign[=] call[name[hash_pandas_object], parameter[name[self]]] return[call[call[name[hashlib].md5, parameter[call[name[h].values.tobytes, parameter[]]]].hexdigest, parameter[]]]
keyword[def] identifier[hash] ( identifier[self] ): literal[string] identifier[h] = identifier[hash_pandas_object] ( identifier[self] , identifier[index] = keyword[True] ) keyword[return] identifier[hashlib] . identifier[md5] ( identifier[h] . identifier[values] . identifier[tobytes] ())....
def hash(self): """Generate a hash value.""" h = hash_pandas_object(self, index=True) return hashlib.md5(h.values.tobytes()).hexdigest()
def decompressSkeletalBoneData(self, pvCompressedBuffer, unCompressedBufferSize, eTransformSpace, unTransformArrayCount): """Turns a compressed buffer from GetSkeletalBoneDataCompressed and turns it back into a bone transform array.""" fn = self.function_table.decompressSkeletalBoneData pTransf...
def function[decompressSkeletalBoneData, parameter[self, pvCompressedBuffer, unCompressedBufferSize, eTransformSpace, unTransformArrayCount]]: constant[Turns a compressed buffer from GetSkeletalBoneDataCompressed and turns it back into a bone transform array.] variable[fn] assign[=] name[self].function_...
keyword[def] identifier[decompressSkeletalBoneData] ( identifier[self] , identifier[pvCompressedBuffer] , identifier[unCompressedBufferSize] , identifier[eTransformSpace] , identifier[unTransformArrayCount] ): literal[string] identifier[fn] = identifier[self] . identifier[function_table] . identif...
def decompressSkeletalBoneData(self, pvCompressedBuffer, unCompressedBufferSize, eTransformSpace, unTransformArrayCount): """Turns a compressed buffer from GetSkeletalBoneDataCompressed and turns it back into a bone transform array.""" fn = self.function_table.decompressSkeletalBoneData pTransformArray = VR...