code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def write(self, input_str): """ Adds content to the Dockerfile. :param input_str: Content. :type input_str: unicode | str """ self.check_not_finalized() if isinstance(input_str, six.binary_type): self.fileobj.write(input_str) else: ...
def function[write, parameter[self, input_str]]: constant[ Adds content to the Dockerfile. :param input_str: Content. :type input_str: unicode | str ] call[name[self].check_not_finalized, parameter[]] if call[name[isinstance], parameter[name[input_str], name[six]...
keyword[def] identifier[write] ( identifier[self] , identifier[input_str] ): literal[string] identifier[self] . identifier[check_not_finalized] () keyword[if] identifier[isinstance] ( identifier[input_str] , identifier[six] . identifier[binary_type] ): identifier[self] . iden...
def write(self, input_str): """ Adds content to the Dockerfile. :param input_str: Content. :type input_str: unicode | str """ self.check_not_finalized() if isinstance(input_str, six.binary_type): self.fileobj.write(input_str) # depends on [control=['if'], data=[]] ...
def _get_battery(self): """ Get the battery """ try: battery = { "charge": self._dev.charge(), "isCharging": self._dev.isCharging() == 1, } except Exception: return None return battery
def function[_get_battery, parameter[self]]: constant[ Get the battery ] <ast.Try object at 0x7da20c795570> return[name[battery]]
keyword[def] identifier[_get_battery] ( identifier[self] ): literal[string] keyword[try] : identifier[battery] ={ literal[string] : identifier[self] . identifier[_dev] . identifier[charge] (), literal[string] : identifier[self] . identifier[_dev] . identifier[...
def _get_battery(self): """ Get the battery """ try: battery = {'charge': self._dev.charge(), 'isCharging': self._dev.isCharging() == 1} # depends on [control=['try'], data=[]] except Exception: return None # depends on [control=['except'], data=[]] return battery
def main(): """Run playbook""" for flag in ('--check',): if flag not in sys.argv: sys.argv.append(flag) obj = PlaybookCLI(sys.argv) obj.parse() obj.run()
def function[main, parameter[]]: constant[Run playbook] for taget[name[flag]] in starred[tuple[[<ast.Constant object at 0x7da1b1605a50>]]] begin[:] if compare[name[flag] <ast.NotIn object at 0x7da2590d7190> name[sys].argv] begin[:] call[name[sys].argv.append, para...
keyword[def] identifier[main] (): literal[string] keyword[for] identifier[flag] keyword[in] ( literal[string] ,): keyword[if] identifier[flag] keyword[not] keyword[in] identifier[sys] . identifier[argv] : identifier[sys] . identifier[argv] . identifier[append] ( identifier[flag]...
def main(): """Run playbook""" for flag in ('--check',): if flag not in sys.argv: sys.argv.append(flag) # depends on [control=['if'], data=['flag']] # depends on [control=['for'], data=['flag']] obj = PlaybookCLI(sys.argv) obj.parse() obj.run()
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environments') and self.environments is not None: _dict['environments'] = [x._to_dict() for x in self.environments] return _dict
def function[_to_dict, parameter[self]]: constant[Return a json dictionary representing this model.] variable[_dict] assign[=] dictionary[[], []] if <ast.BoolOp object at 0x7da18bcc94e0> begin[:] call[name[_dict]][constant[environments]] assign[=] <ast.ListComp object at 0x7da18b...
keyword[def] identifier[_to_dict] ( identifier[self] ): literal[string] identifier[_dict] ={} keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ) keyword[and] identifier[self] . identifier[environments] keyword[is] keyword[not] keyword[None] : identifie...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'environments') and self.environments is not None: _dict['environments'] = [x._to_dict() for x in self.environments] # depends on [control=['if'], data=[]] return _dict
def list_message_files (package, suffix=".mo"): """Return list of all found message files and their installation paths.""" for fname in glob.glob("po/*" + suffix): # basename (without extension) is a locale name localename = os.path.splitext(os.path.basename(fname))[0] domainname = "%s.m...
def function[list_message_files, parameter[package, suffix]]: constant[Return list of all found message files and their installation paths.] for taget[name[fname]] in starred[call[name[glob].glob, parameter[binary_operation[constant[po/*] + name[suffix]]]]] begin[:] variable[localename] ...
keyword[def] identifier[list_message_files] ( identifier[package] , identifier[suffix] = literal[string] ): literal[string] keyword[for] identifier[fname] keyword[in] identifier[glob] . identifier[glob] ( literal[string] + identifier[suffix] ): identifier[localename] = identifier[os] . ide...
def list_message_files(package, suffix='.mo'): """Return list of all found message files and their installation paths.""" for fname in glob.glob('po/*' + suffix): # basename (without extension) is a locale name localename = os.path.splitext(os.path.basename(fname))[0] domainname = '%s.mo...
def concatclusts(outhandle, alignbits): """ concatenates sorted aligned cluster tmpfiles and removes them.""" with gzip.open(outhandle, 'wb') as out: for fname in alignbits: with open(fname) as infile: out.write(infile.read()+"//\n//\n")
def function[concatclusts, parameter[outhandle, alignbits]]: constant[ concatenates sorted aligned cluster tmpfiles and removes them.] with call[name[gzip].open, parameter[name[outhandle], constant[wb]]] begin[:] for taget[name[fname]] in starred[name[alignbits]] begin[:] ...
keyword[def] identifier[concatclusts] ( identifier[outhandle] , identifier[alignbits] ): literal[string] keyword[with] identifier[gzip] . identifier[open] ( identifier[outhandle] , literal[string] ) keyword[as] identifier[out] : keyword[for] identifier[fname] keyword[in] identifier[alignbits]...
def concatclusts(outhandle, alignbits): """ concatenates sorted aligned cluster tmpfiles and removes them.""" with gzip.open(outhandle, 'wb') as out: for fname in alignbits: with open(fname) as infile: out.write(infile.read() + '//\n//\n') # depends on [control=['with'], dat...
def present(name, auth=None, **kwargs): ''' Ensure an role exists name Name of the role description An arbitrary description of the role ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_k...
def function[present, parameter[name, auth]]: constant[ Ensure an role exists name Name of the role description An arbitrary description of the role ] variable[ret] assign[=] dictionary[[<ast.Constant object at 0x7da1b217b9a0>, <ast.Constant object at 0x7da1b217bb50>, <...
keyword[def] identifier[present] ( identifier[name] , identifier[auth] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[ret] ={ literal[string] : identifier[name] , literal[string] :{}, literal[string] : keyword[True] , literal[string] : literal[string] } identifier...
def present(name, auth=None, **kwargs): """ Ensure an role exists name Name of the role description An arbitrary description of the role """ ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} kwargs = __utils__['args.clean_kwargs'](**kwargs) __salt__['ke...
def require(*args, **kwargs): ''' Install a set of packages using pip This is designed to be an interface for IPython notebooks that replicates the requirements.txt pip format. This lets notebooks specify which versions of packages they need inside the notebook itself. This function is...
def function[require, parameter[]]: constant[ Install a set of packages using pip This is designed to be an interface for IPython notebooks that replicates the requirements.txt pip format. This lets notebooks specify which versions of packages they need inside the notebook itself. ...
keyword[def] identifier[require] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[args] keyword[and] keyword[not] identifier[kwargs] : keyword[return] identifier[freeze] () identifier[requirements] = identifier[list] ( iden...
def require(*args, **kwargs): """ Install a set of packages using pip This is designed to be an interface for IPython notebooks that replicates the requirements.txt pip format. This lets notebooks specify which versions of packages they need inside the notebook itself. This function is...
def detach_screens(self, screen_ids): """Unplugs monitors from the virtual graphics card. in screen_ids of type int """ if not isinstance(screen_ids, list): raise TypeError("screen_ids can only be an instance of type list") for a in screen_ids[:10]: if n...
def function[detach_screens, parameter[self, screen_ids]]: constant[Unplugs monitors from the virtual graphics card. in screen_ids of type int ] if <ast.UnaryOp object at 0x7da20e9b3d00> begin[:] <ast.Raise object at 0x7da20e9b1720> for taget[name[a]] in starred[call[na...
keyword[def] identifier[detach_screens] ( identifier[self] , identifier[screen_ids] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[screen_ids] , identifier[list] ): keyword[raise] identifier[TypeError] ( literal[string] ) keyword[for] ident...
def detach_screens(self, screen_ids): """Unplugs monitors from the virtual graphics card. in screen_ids of type int """ if not isinstance(screen_ids, list): raise TypeError('screen_ids can only be an instance of type list') # depends on [control=['if'], data=[]] for a in screen_id...
def _send_frame(self, connection, frame): """ Sends a frame to a specific subscriber connection. (This method assumes it is being called from within a lock-guarded public method.) @param connection: The subscriber connection object to send to. @type connection: L{coilmq...
def function[_send_frame, parameter[self, connection, frame]]: constant[ Sends a frame to a specific subscriber connection. (This method assumes it is being called from within a lock-guarded public method.) @param connection: The subscriber connection object to send to. ...
keyword[def] identifier[_send_frame] ( identifier[self] , identifier[connection] , identifier[frame] ): literal[string] keyword[assert] identifier[connection] keyword[is] keyword[not] keyword[None] keyword[assert] identifier[frame] keyword[is] keyword[not] keyword[None] ...
def _send_frame(self, connection, frame): """ Sends a frame to a specific subscriber connection. (This method assumes it is being called from within a lock-guarded public method.) @param connection: The subscriber connection object to send to. @type connection: L{coilmq.ser...
def compile_to_python(exp, env, done=None): '''assemble steps from dao expression to python code''' original_exp = exp compiler = Compiler() if done is None: done = il.Done(compiler.new_var(il.ConstLocalVar('v'))) compiler.exit_block_cont_map = {} compiler.continue_block_cont_map = {} compile...
def function[compile_to_python, parameter[exp, env, done]]: constant[assemble steps from dao expression to python code] variable[original_exp] assign[=] name[exp] variable[compiler] assign[=] call[name[Compiler], parameter[]] if compare[name[done] is constant[None]] begin[:] ...
keyword[def] identifier[compile_to_python] ( identifier[exp] , identifier[env] , identifier[done] = keyword[None] ): literal[string] identifier[original_exp] = identifier[exp] identifier[compiler] = identifier[Compiler] () keyword[if] identifier[done] keyword[is] keyword[None] : identifier[...
def compile_to_python(exp, env, done=None): """assemble steps from dao expression to python code""" original_exp = exp compiler = Compiler() if done is None: done = il.Done(compiler.new_var(il.ConstLocalVar('v'))) # depends on [control=['if'], data=['done']] compiler.exit_block_cont_map = {...
def num_taps(sample_rate, transitionwidth, gpass, gstop): """Returns the number of taps for an FIR filter with the given shape Parameters ---------- sample_rate : `float` sampling rate of target data transitionwidth : `float` the width (in the same units as `sample_rate` of the tra...
def function[num_taps, parameter[sample_rate, transitionwidth, gpass, gstop]]: constant[Returns the number of taps for an FIR filter with the given shape Parameters ---------- sample_rate : `float` sampling rate of target data transitionwidth : `float` the width (in the same un...
keyword[def] identifier[num_taps] ( identifier[sample_rate] , identifier[transitionwidth] , identifier[gpass] , identifier[gstop] ): literal[string] identifier[gpass] = literal[int] **(- identifier[gpass] / literal[int] ) identifier[gstop] = literal[int] **(- identifier[gstop] / literal[int] ) ke...
def num_taps(sample_rate, transitionwidth, gpass, gstop): """Returns the number of taps for an FIR filter with the given shape Parameters ---------- sample_rate : `float` sampling rate of target data transitionwidth : `float` the width (in the same units as `sample_rate` of the tra...
def read(self): """Read the config file, if it exists. Using defaults otherwise.""" for config_file in self.config_file_paths(): logger.info('Search glances.conf file in {}'.format(config_file)) if os.path.exists(config_file): try: with open(co...
def function[read, parameter[self]]: constant[Read the config file, if it exists. Using defaults otherwise.] for taget[name[config_file]] in starred[call[name[self].config_file_paths, parameter[]]] begin[:] call[name[logger].info, parameter[call[constant[Search glances.conf file in {}].f...
keyword[def] identifier[read] ( identifier[self] ): literal[string] keyword[for] identifier[config_file] keyword[in] identifier[self] . identifier[config_file_paths] (): identifier[logger] . identifier[info] ( literal[string] . identifier[format] ( identifier[config_file] )) ...
def read(self): """Read the config file, if it exists. Using defaults otherwise.""" for config_file in self.config_file_paths(): logger.info('Search glances.conf file in {}'.format(config_file)) if os.path.exists(config_file): try: with open(config_file, encoding='utf...
def json_data(self, instance, default=None): """Get a JSON compatible value """ value = self.get(instance) return value or default
def function[json_data, parameter[self, instance, default]]: constant[Get a JSON compatible value ] variable[value] assign[=] call[name[self].get, parameter[name[instance]]] return[<ast.BoolOp object at 0x7da20c6a9960>]
keyword[def] identifier[json_data] ( identifier[self] , identifier[instance] , identifier[default] = keyword[None] ): literal[string] identifier[value] = identifier[self] . identifier[get] ( identifier[instance] ) keyword[return] identifier[value] keyword[or] identifier[default]
def json_data(self, instance, default=None): """Get a JSON compatible value """ value = self.get(instance) return value or default
def edge(self, from_node, to_node, edge_type="", **args): """draw an edge from a node to another. """ self._stream.write( '%s%sedge: {sourcename:"%s" targetname:"%s"' % (self._indent, edge_type, from_node, to_node) ) self._write_attributes(EDGE_ATTRS, **ar...
def function[edge, parameter[self, from_node, to_node, edge_type]]: constant[draw an edge from a node to another. ] call[name[self]._stream.write, parameter[binary_operation[constant[%s%sedge: {sourcename:"%s" targetname:"%s"] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x...
keyword[def] identifier[edge] ( identifier[self] , identifier[from_node] , identifier[to_node] , identifier[edge_type] = literal[string] ,** identifier[args] ): literal[string] identifier[self] . identifier[_stream] . identifier[write] ( literal[string] %( identifier[self] . ident...
def edge(self, from_node, to_node, edge_type='', **args): """draw an edge from a node to another. """ self._stream.write('%s%sedge: {sourcename:"%s" targetname:"%s"' % (self._indent, edge_type, from_node, to_node)) self._write_attributes(EDGE_ATTRS, **args) self._stream.write('}\n')
def array2root(arr, filename, treename='tree', mode='update'): """Convert a numpy array into a ROOT TTree and save it in a ROOT TFile. Fields of basic types, strings, and fixed-size subarrays of basic types are supported. ``np.object`` and ``np.float16`` are currently not supported. Parameters ---...
def function[array2root, parameter[arr, filename, treename, mode]]: constant[Convert a numpy array into a ROOT TTree and save it in a ROOT TFile. Fields of basic types, strings, and fixed-size subarrays of basic types are supported. ``np.object`` and ``np.float16`` are currently not supported. Par...
keyword[def] identifier[array2root] ( identifier[arr] , identifier[filename] , identifier[treename] = literal[string] , identifier[mode] = literal[string] ): literal[string] identifier[_librootnumpy] . identifier[array2root] ( identifier[arr] , identifier[filename] , identifier[treename] , identifier[mode]...
def array2root(arr, filename, treename='tree', mode='update'): """Convert a numpy array into a ROOT TTree and save it in a ROOT TFile. Fields of basic types, strings, and fixed-size subarrays of basic types are supported. ``np.object`` and ``np.float16`` are currently not supported. Parameters ---...
def p_new_expr(self, p): """new_expr : member_expr | NEW new_expr """ if len(p) == 2: p[0] = p[1] else: p[0] = ast.NewExpr(p[2])
def function[p_new_expr, parameter[self, p]]: constant[new_expr : member_expr | NEW new_expr ] if compare[call[name[len], parameter[name[p]]] equal[==] constant[2]] begin[:] call[name[p]][constant[0]] assign[=] call[name[p]][constant[1]]
keyword[def] identifier[p_new_expr] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]= identifier[p] [ literal[int] ] keyword[else] : identifier[p] [ literal[int] ]=...
def p_new_expr(self, p): """new_expr : member_expr | NEW new_expr """ if len(p) == 2: p[0] = p[1] # depends on [control=['if'], data=[]] else: p[0] = ast.NewExpr(p[2])
def content(self, contents): """The content(s) of the email :param contents: The content(s) of the email :type contents: Content, list(Content) """ if isinstance(contents, list): for c in contents: self.add_content(c) else: self.ad...
def function[content, parameter[self, contents]]: constant[The content(s) of the email :param contents: The content(s) of the email :type contents: Content, list(Content) ] if call[name[isinstance], parameter[name[contents], name[list]]] begin[:] for taget[name[c...
keyword[def] identifier[content] ( identifier[self] , identifier[contents] ): literal[string] keyword[if] identifier[isinstance] ( identifier[contents] , identifier[list] ): keyword[for] identifier[c] keyword[in] identifier[contents] : identifier[self] . identifier...
def content(self, contents): """The content(s) of the email :param contents: The content(s) of the email :type contents: Content, list(Content) """ if isinstance(contents, list): for c in contents: self.add_content(c) # depends on [control=['for'], data=['c']] # de...
def list_transaction(hostname, username, password, label): ''' A function to connect to a bigip device and list an existing transaction. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password label th...
def function[list_transaction, parameter[hostname, username, password, label]]: constant[ A function to connect to a bigip device and list an existing transaction. hostname The host/address of the bigip device username The iControl REST username password The iControl RES...
keyword[def] identifier[list_transaction] ( identifier[hostname] , identifier[username] , identifier[password] , identifier[label] ): literal[string] identifier[bigip_session] = identifier[_build_session] ( identifier[username] , identifier[password] ) identifier[trans_id] = identifier[__s...
def list_transaction(hostname, username, password, label): """ A function to connect to a bigip device and list an existing transaction. hostname The host/address of the bigip device username The iControl REST username password The iControl REST password label th...
def logout(self, force=False): """ Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used. **Parameters:**: - **force**: Bool, force logout API call, even when using a static AUTH_TOKEN. **Returns:** Bool of whether the opera...
def function[logout, parameter[self, force]]: constant[ Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used. **Parameters:**: - **force**: Bool, force logout API call, even when using a static AUTH_TOKEN. **Returns:** Bool...
keyword[def] identifier[logout] ( identifier[self] , identifier[force] = keyword[False] ): literal[string] identifier[session] = identifier[self] . identifier[_parent_class] . identifier[expose_session] () keyword[if] identifier[force] keyword[or] keyword[not] identi...
def logout(self, force=False): """ Interactive logout - ensures uid/tid cleared so `cloudgenix.API` object/ requests.Session can be re-used. **Parameters:**: - **force**: Bool, force logout API call, even when using a static AUTH_TOKEN. **Returns:** Bool of whether the operation...
def close(self): """Close the socket""" if self.is_open(): fd = self._fd self._fd = -1 if self.uses_nanoconfig: wrapper.nc_close(fd) else: _nn_check_positive_rtn(wrapper.nn_close(fd))
def function[close, parameter[self]]: constant[Close the socket] if call[name[self].is_open, parameter[]] begin[:] variable[fd] assign[=] name[self]._fd name[self]._fd assign[=] <ast.UnaryOp object at 0x7da2044c3f10> if name[self].uses_nanoconfig begin[:] ...
keyword[def] identifier[close] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[is_open] (): identifier[fd] = identifier[self] . identifier[_fd] identifier[self] . identifier[_fd] =- literal[int] keyword[if] identifier[self] ...
def close(self): """Close the socket""" if self.is_open(): fd = self._fd self._fd = -1 if self.uses_nanoconfig: wrapper.nc_close(fd) # depends on [control=['if'], data=[]] else: _nn_check_positive_rtn(wrapper.nn_close(fd)) # depends on [control=['if'], d...
def add_slice(self, name, input_name, output_name, axis, start_index = 0, end_index = -1, stride = 1): """ Add a slice layer. Equivalent to to numpy slice [start_index:end_index:stride], start_index is included, while end_index is exclusive. Parameters ---------- name: s...
def function[add_slice, parameter[self, name, input_name, output_name, axis, start_index, end_index, stride]]: constant[ Add a slice layer. Equivalent to to numpy slice [start_index:end_index:stride], start_index is included, while end_index is exclusive. Parameters ---------- ...
keyword[def] identifier[add_slice] ( identifier[self] , identifier[name] , identifier[input_name] , identifier[output_name] , identifier[axis] , identifier[start_index] = literal[int] , identifier[end_index] =- literal[int] , identifier[stride] = literal[int] ): literal[string] identifier[spec] = i...
def add_slice(self, name, input_name, output_name, axis, start_index=0, end_index=-1, stride=1): """ Add a slice layer. Equivalent to to numpy slice [start_index:end_index:stride], start_index is included, while end_index is exclusive. Parameters ---------- name: str ...
def _wrap(func, shape, context=None, axis=(0,), dtype=None, npartitions=None): """ Wrap an existing numpy constructor in a parallelized construction """ if isinstance(shape, int): shape = (shape,) key_shape, value_shape = get_kv_shape(shape, ConstructSpark._format_axe...
def function[_wrap, parameter[func, shape, context, axis, dtype, npartitions]]: constant[ Wrap an existing numpy constructor in a parallelized construction ] if call[name[isinstance], parameter[name[shape], name[int]]] begin[:] variable[shape] assign[=] tuple[[<ast.Name o...
keyword[def] identifier[_wrap] ( identifier[func] , identifier[shape] , identifier[context] = keyword[None] , identifier[axis] =( literal[int] ,), identifier[dtype] = keyword[None] , identifier[npartitions] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[shape] ,...
def _wrap(func, shape, context=None, axis=(0,), dtype=None, npartitions=None): """ Wrap an existing numpy constructor in a parallelized construction """ if isinstance(shape, int): shape = (shape,) # depends on [control=['if'], data=[]] (key_shape, value_shape) = get_kv_shape(shape, ...
def angular_power_spectrum(self): """Returns the angular power spectrum for the set of coefficients. That is, we compute n c_n = sum cnm * conj( cnm ) m=-n Returns: power_spectrum (numpy.array, dtype=double) spectrum as a fu...
def function[angular_power_spectrum, parameter[self]]: constant[Returns the angular power spectrum for the set of coefficients. That is, we compute n c_n = sum cnm * conj( cnm ) m=-n Returns: power_spectrum (numpy.array, dtype=double...
keyword[def] identifier[angular_power_spectrum] ( identifier[self] ): literal[string] identifier[list_of_modes] = identifier[self] . identifier[_reshape_m_vecs] () identifier[Nmodes] = identifier[len] ( identifier[list_of_modes] ) identifier[angular_pow...
def angular_power_spectrum(self): """Returns the angular power spectrum for the set of coefficients. That is, we compute n c_n = sum cnm * conj( cnm ) m=-n Returns: power_spectrum (numpy.array, dtype=double) spectrum as a function of n. ...
def _json_path_search(self, json_dict, expr): """ Scan JSON dictionary with using json-path passed sting of the format of $.element..element1[index] etc. *Args:*\n _json_dict_ - JSON dictionary;\n _expr_ - string of fuzzy search for items within the directory;\n *Return...
def function[_json_path_search, parameter[self, json_dict, expr]]: constant[ Scan JSON dictionary with using json-path passed sting of the format of $.element..element1[index] etc. *Args:* _json_dict_ - JSON dictionary; _expr_ - string of fuzzy search for items within the dire...
keyword[def] identifier[_json_path_search] ( identifier[self] , identifier[json_dict] , identifier[expr] ): literal[string] identifier[path] = identifier[parse] ( identifier[expr] ) identifier[results] = identifier[path] . identifier[find] ( identifier[json_dict] ) keyword[if] i...
def _json_path_search(self, json_dict, expr): """ Scan JSON dictionary with using json-path passed sting of the format of $.element..element1[index] etc. *Args:* _json_dict_ - JSON dictionary; _expr_ - string of fuzzy search for items within the directory; *Returns:* ...
def mutual_accessibility(graph): """ Mutual-accessibility matrix (strongly connected components). @type graph: graph, digraph @param graph: Graph. @rtype: dictionary @return: Mutual-accessibility information for each node. """ recursionlimit = getrecursionlimit() setrecursionlimi...
def function[mutual_accessibility, parameter[graph]]: constant[ Mutual-accessibility matrix (strongly connected components). @type graph: graph, digraph @param graph: Graph. @rtype: dictionary @return: Mutual-accessibility information for each node. ] variable[recursionlimit]...
keyword[def] identifier[mutual_accessibility] ( identifier[graph] ): literal[string] identifier[recursionlimit] = identifier[getrecursionlimit] () identifier[setrecursionlimit] ( identifier[max] ( identifier[len] ( identifier[graph] . identifier[nodes] ())* literal[int] , identifier[recursionlimit] ))...
def mutual_accessibility(graph): """ Mutual-accessibility matrix (strongly connected components). @type graph: graph, digraph @param graph: Graph. @rtype: dictionary @return: Mutual-accessibility information for each node. """ recursionlimit = getrecursionlimit() setrecursionlimi...
def _recursive_get(self, key, dic=None): """ Gets contents of requirement key recursively so users can search for specific keys inside nested requirement dicts. :param key: key or dot separated string of keys to look for. :param dic: Optional dictionary to use in the search. ...
def function[_recursive_get, parameter[self, key, dic]]: constant[ Gets contents of requirement key recursively so users can search for specific keys inside nested requirement dicts. :param key: key or dot separated string of keys to look for. :param dic: Optional dictionary to ...
keyword[def] identifier[_recursive_get] ( identifier[self] , identifier[key] , identifier[dic] = keyword[None] ): literal[string] keyword[return] identifier[recursive_search] ( identifier[key] , identifier[dic] ) keyword[if] identifier[dic] keyword[else] identifier[recursive_search] ( identifie...
def _recursive_get(self, key, dic=None): """ Gets contents of requirement key recursively so users can search for specific keys inside nested requirement dicts. :param key: key or dot separated string of keys to look for. :param dic: Optional dictionary to use in the search. ...
def density_und(CIJ): ''' Density is the fraction of present connections to possible connections. Parameters ---------- CIJ : NxN np.ndarray undirected (weighted/binary) connection matrix Returns ------- kden : float density N : int number of vertices k ...
def function[density_und, parameter[CIJ]]: constant[ Density is the fraction of present connections to possible connections. Parameters ---------- CIJ : NxN np.ndarray undirected (weighted/binary) connection matrix Returns ------- kden : float density N : int ...
keyword[def] identifier[density_und] ( identifier[CIJ] ): literal[string] identifier[n] = identifier[len] ( identifier[CIJ] ) identifier[k] = identifier[np] . identifier[size] ( identifier[np] . identifier[where] ( identifier[np] . identifier[triu] ( identifier[CIJ] ). identifier[flatten] ())) id...
def density_und(CIJ): """ Density is the fraction of present connections to possible connections. Parameters ---------- CIJ : NxN np.ndarray undirected (weighted/binary) connection matrix Returns ------- kden : float density N : int number of vertices k ...
def count_matching(self, selector, offset=0): """Count the number of readings matching selector. Args: selector (DataStreamSelector): The selector that we want to count matching readings for. offset (int): The starting offset that we should begin counting at. ...
def function[count_matching, parameter[self, selector, offset]]: constant[Count the number of readings matching selector. Args: selector (DataStreamSelector): The selector that we want to count matching readings for. offset (int): The starting offset that we shou...
keyword[def] identifier[count_matching] ( identifier[self] , identifier[selector] , identifier[offset] = literal[int] ): literal[string] keyword[if] identifier[selector] . identifier[output] : identifier[data] = identifier[self] . identifier[streaming_data] keyword[elif] i...
def count_matching(self, selector, offset=0): """Count the number of readings matching selector. Args: selector (DataStreamSelector): The selector that we want to count matching readings for. offset (int): The starting offset that we should begin counting at. ...
def total_energy_matrix(self): """ The total energy matrix. Each matrix element (i, j) corresponds to the total interaction energy between site i and site j. Note that this does not include the charged-cell energy, which is only important when the simulation cell is not charge b...
def function[total_energy_matrix, parameter[self]]: constant[ The total energy matrix. Each matrix element (i, j) corresponds to the total interaction energy between site i and site j. Note that this does not include the charged-cell energy, which is only important when the simu...
keyword[def] identifier[total_energy_matrix] ( identifier[self] ): literal[string] identifier[totalenergy] = identifier[self] . identifier[_recip] + identifier[self] . identifier[_real] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[len] ( identifier[self] . iden...
def total_energy_matrix(self): """ The total energy matrix. Each matrix element (i, j) corresponds to the total interaction energy between site i and site j. Note that this does not include the charged-cell energy, which is only important when the simulation cell is not charge balan...
def save(self): """Save the changes to the instance and any related objects.""" # first call save with commit=False for all Forms for form in self._forms: if isinstance(form, BaseForm): form.save(commit=False) # call save on the instance self.instanc...
def function[save, parameter[self]]: constant[Save the changes to the instance and any related objects.] for taget[name[form]] in starred[name[self]._forms] begin[:] if call[name[isinstance], parameter[name[form], name[BaseForm]]] begin[:] call[name[form].save, pa...
keyword[def] identifier[save] ( identifier[self] ): literal[string] keyword[for] identifier[form] keyword[in] identifier[self] . identifier[_forms] : keyword[if] identifier[isinstance] ( identifier[form] , identifier[BaseForm] ): identifier[form] . identi...
def save(self): """Save the changes to the instance and any related objects.""" # first call save with commit=False for all Forms for form in self._forms: if isinstance(form, BaseForm): form.save(commit=False) # depends on [control=['if'], data=[]] # depends on [control=['for'], data=[...
def run_commands(*commands, **kwargs): ''' Sends the commands over the transport to the device. This function sends the commands to the device using the nodes transport. This is a lower layer function that shouldn't normally need to be used, preferring instead to use ``config()`` or ``enable()``. ...
def function[run_commands, parameter[]]: constant[ Sends the commands over the transport to the device. This function sends the commands to the device using the nodes transport. This is a lower layer function that shouldn't normally need to be used, preferring instead to use ``config()`` or ``...
keyword[def] identifier[run_commands] (* identifier[commands] ,** identifier[kwargs] ): literal[string] identifier[encoding] = identifier[kwargs] . identifier[pop] ( literal[string] , literal[string] ) identifier[send_enable] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True] ) ...
def run_commands(*commands, **kwargs): """ Sends the commands over the transport to the device. This function sends the commands to the device using the nodes transport. This is a lower layer function that shouldn't normally need to be used, preferring instead to use ``config()`` or ``enable()``. ...
def download_to_file(url, filepath, resume=False, overwrite=False, chunk_size=1024 * 1024 * 10, loadbar_length=10): """Download a url. prints a simple loading bar [=*loadbar_length] to show progress (in console and notebook) :type url: str :type filepath: str :param filepath: path to download to ...
def function[download_to_file, parameter[url, filepath, resume, overwrite, chunk_size, loadbar_length]]: constant[Download a url. prints a simple loading bar [=*loadbar_length] to show progress (in console and notebook) :type url: str :type filepath: str :param filepath: path to download to ...
keyword[def] identifier[download_to_file] ( identifier[url] , identifier[filepath] , identifier[resume] = keyword[False] , identifier[overwrite] = keyword[False] , identifier[chunk_size] = literal[int] * literal[int] * literal[int] , identifier[loadbar_length] = literal[int] ): literal[string] identifier[r...
def download_to_file(url, filepath, resume=False, overwrite=False, chunk_size=1024 * 1024 * 10, loadbar_length=10): """Download a url. prints a simple loading bar [=*loadbar_length] to show progress (in console and notebook) :type url: str :type filepath: str :param filepath: path to download to ...
def safe_compile(self, settings, sourcepath, destination): """ Safe compile It won't raise compile error and instead return compile success state as a boolean with a message. It will create needed directory structure first if it contain some directories that does not al...
def function[safe_compile, parameter[self, settings, sourcepath, destination]]: constant[ Safe compile It won't raise compile error and instead return compile success state as a boolean with a message. It will create needed directory structure first if it contain some d...
keyword[def] identifier[safe_compile] ( identifier[self] , identifier[settings] , identifier[sourcepath] , identifier[destination] ): literal[string] identifier[source_map_destination] = keyword[None] keyword[if] identifier[settings] . identifier[SOURCE_MAP] : identifier[sou...
def safe_compile(self, settings, sourcepath, destination): """ Safe compile It won't raise compile error and instead return compile success state as a boolean with a message. It will create needed directory structure first if it contain some directories that does not allrea...
def handle_message(self, response, ignore_subscribe_messages=False): """ Parses a pub/sub message. If the channel or pattern was subscribed to with a message handler, the handler is invoked instead of a parsed message being returned. """ message_type = nativestr(response[...
def function[handle_message, parameter[self, response, ignore_subscribe_messages]]: constant[ Parses a pub/sub message. If the channel or pattern was subscribed to with a message handler, the handler is invoked instead of a parsed message being returned. ] variable[messag...
keyword[def] identifier[handle_message] ( identifier[self] , identifier[response] , identifier[ignore_subscribe_messages] = keyword[False] ): literal[string] identifier[message_type] = identifier[nativestr] ( identifier[response] [ literal[int] ]) keyword[if] identifier[message_type] == l...
def handle_message(self, response, ignore_subscribe_messages=False): """ Parses a pub/sub message. If the channel or pattern was subscribed to with a message handler, the handler is invoked instead of a parsed message being returned. """ message_type = nativestr(response[0]) ...
def safe_call(func, *args, **kwargs): """ 安全调用 """ try: return func(*args, **kwargs) except Exception as e: logger.error('exc occur. e: %s, func: %s', e, func, exc_info=True) # 调用方可以通过 isinstance(e, BaseException) 来判断是否发生了异常 return e
def function[safe_call, parameter[func]]: constant[ 安全调用 ] <ast.Try object at 0x7da18c4ce290>
keyword[def] identifier[safe_call] ( identifier[func] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[return] identifier[func] (* identifier[args] ,** identifier[kwargs] ) keyword[except] identifier[Exception] keyword[as] identifier[e] : ident...
def safe_call(func, *args, **kwargs): """ 安全调用 """ try: return func(*args, **kwargs) # depends on [control=['try'], data=[]] except Exception as e: logger.error('exc occur. e: %s, func: %s', e, func, exc_info=True) # 调用方可以通过 isinstance(e, BaseException) 来判断是否发生了异常 re...
def calculate_content_length(self): """Returns the content length if available or `None` otherwise.""" try: self._ensure_sequence() except RuntimeError: return None return sum(len(x) for x in self.response)
def function[calculate_content_length, parameter[self]]: constant[Returns the content length if available or `None` otherwise.] <ast.Try object at 0x7da20c6c6e60> return[call[name[sum], parameter[<ast.GeneratorExp object at 0x7da20c6c66b0>]]]
keyword[def] identifier[calculate_content_length] ( identifier[self] ): literal[string] keyword[try] : identifier[self] . identifier[_ensure_sequence] () keyword[except] identifier[RuntimeError] : keyword[return] keyword[None] keyword[return] identifi...
def calculate_content_length(self): """Returns the content length if available or `None` otherwise.""" try: self._ensure_sequence() # depends on [control=['try'], data=[]] except RuntimeError: return None # depends on [control=['except'], data=[]] return sum((len(x) for x in self.respo...
def process_sample(job, inputs, tar_id): """ Converts sample.tar(.gz) into two fastq files. Due to edge conditions... BEWARE: HERE BE DRAGONS :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) :param str tar_id: FileStore I...
def function[process_sample, parameter[job, inputs, tar_id]]: constant[ Converts sample.tar(.gz) into two fastq files. Due to edge conditions... BEWARE: HERE BE DRAGONS :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) ...
keyword[def] identifier[process_sample] ( identifier[job] , identifier[inputs] , identifier[tar_id] ): literal[string] identifier[job] . identifier[fileStore] . identifier[logToMaster] ( literal[string] . identifier[format] ( identifier[inputs] . identifier[uuid] )) identifier[work_dir] = identifier[j...
def process_sample(job, inputs, tar_id): """ Converts sample.tar(.gz) into two fastq files. Due to edge conditions... BEWARE: HERE BE DRAGONS :param JobFunctionWrappingJob job: passed by Toil automatically :param Namespace inputs: Stores input arguments (see main) :param str tar_id: FileStore I...
def write_json_file(self, path): """ Serialize this VariantCollection to a JSON representation and write it out to a text file. """ with open(path, "w") as f: f.write(self.to_json())
def function[write_json_file, parameter[self, path]]: constant[ Serialize this VariantCollection to a JSON representation and write it out to a text file. ] with call[name[open], parameter[name[path], constant[w]]] begin[:] call[name[f].write, parameter[call[name[...
keyword[def] identifier[write_json_file] ( identifier[self] , identifier[path] ): literal[string] keyword[with] identifier[open] ( identifier[path] , literal[string] ) keyword[as] identifier[f] : identifier[f] . identifier[write] ( identifier[self] . identifier[to_json] ())
def write_json_file(self, path): """ Serialize this VariantCollection to a JSON representation and write it out to a text file. """ with open(path, 'w') as f: f.write(self.to_json()) # depends on [control=['with'], data=['f']]
def parse_crop(crop, xy_image, xy_window): """ Returns x, y offsets for cropping. The window area should fit inside image but it works out anyway """ x_alias_percent = { 'left': '0%', 'center': '50%', 'right': '100%', } y_alias_percent = { 'top': '0%', ...
def function[parse_crop, parameter[crop, xy_image, xy_window]]: constant[ Returns x, y offsets for cropping. The window area should fit inside image but it works out anyway ] variable[x_alias_percent] assign[=] dictionary[[<ast.Constant object at 0x7da18bc71180>, <ast.Constant object at 0x7d...
keyword[def] identifier[parse_crop] ( identifier[crop] , identifier[xy_image] , identifier[xy_window] ): literal[string] identifier[x_alias_percent] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , } identifier[y_alias_p...
def parse_crop(crop, xy_image, xy_window): """ Returns x, y offsets for cropping. The window area should fit inside image but it works out anyway """ x_alias_percent = {'left': '0%', 'center': '50%', 'right': '100%'} y_alias_percent = {'top': '0%', 'center': '50%', 'bottom': '100%'} xy_crop ...
def print_subcommands(data, nested_content, markDownHelp=False, settings=None): """ Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparently there can also be ...
def function[print_subcommands, parameter[data, nested_content, markDownHelp, settings]]: constant[ Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparentl...
keyword[def] identifier[print_subcommands] ( identifier[data] , identifier[nested_content] , identifier[markDownHelp] = keyword[False] , identifier[settings] = keyword[None] ): literal[string] identifier[definitions] = identifier[map_nested_definitions] ( identifier[nested_content] ) identifier[items...
def print_subcommands(data, nested_content, markDownHelp=False, settings=None): """ Each subcommand is a dictionary with the following keys: ['usage', 'action_groups', 'bare_usage', 'name', 'help'] In essence, this is all tossed in a new section with the title 'name'. Apparently there can also be ...
def gen_radio_list(sig_dic): ''' For generating List view HTML file for RADIO. for each item. ''' view_zuoxiang = '''<span class="iga_pd_val">''' dic_tmp = sig_dic['dic'] for key in dic_tmp.keys(): tmp_str = '''{{% if postinfo.extinfo['{0}'][0] == "{1}" %}} {2} {{% end %}} '...
def function[gen_radio_list, parameter[sig_dic]]: constant[ For generating List view HTML file for RADIO. for each item. ] variable[view_zuoxiang] assign[=] constant[<span class="iga_pd_val">] variable[dic_tmp] assign[=] call[name[sig_dic]][constant[dic]] for taget[name[key]]...
keyword[def] identifier[gen_radio_list] ( identifier[sig_dic] ): literal[string] identifier[view_zuoxiang] = literal[string] identifier[dic_tmp] = identifier[sig_dic] [ literal[string] ] keyword[for] identifier[key] keyword[in] identifier[dic_tmp] . identifier[keys] (): identifier[t...
def gen_radio_list(sig_dic): """ For generating List view HTML file for RADIO. for each item. """ view_zuoxiang = '<span class="iga_pd_val">' dic_tmp = sig_dic['dic'] for key in dic_tmp.keys(): tmp_str = '{{% if postinfo.extinfo[\'{0}\'][0] == "{1}" %}} {2} {{% end %}}\n '.for...
def set_trace(self, frame=None): """Remember starting frame. This is used with pytest, which does not use pdb.set_trace(). """ if hasattr(local, '_pdbpp_completing'): # Handle set_trace being called during completion, e.g. with # fancycompleter's attr_matches. ...
def function[set_trace, parameter[self, frame]]: constant[Remember starting frame. This is used with pytest, which does not use pdb.set_trace(). ] if call[name[hasattr], parameter[name[local], constant[_pdbpp_completing]]] begin[:] return[None] if compare[name[frame] is ...
keyword[def] identifier[set_trace] ( identifier[self] , identifier[frame] = keyword[None] ): literal[string] keyword[if] identifier[hasattr] ( identifier[local] , literal[string] ): keyword[return] keyword[if] identifier[frame] keyword[is] keyword[None] ...
def set_trace(self, frame=None): """Remember starting frame. This is used with pytest, which does not use pdb.set_trace(). """ if hasattr(local, '_pdbpp_completing'): # Handle set_trace being called during completion, e.g. with # fancycompleter's attr_matches. return # ...
def p_statement(self, p): """statement : OPTION_AND_VALUE """ p[0] = ['statement', p[1][0], p[1][1]] if self.options.get('lowercasenames'): p[0][1] = p[0][1].lower() if (not self.options.get('nostripvalues') and not hasattr(p[0][2], 'is_single_quoted...
def function[p_statement, parameter[self, p]]: constant[statement : OPTION_AND_VALUE ] call[name[p]][constant[0]] assign[=] list[[<ast.Constant object at 0x7da20c7c8220>, <ast.Subscript object at 0x7da20c7cbc10>, <ast.Subscript object at 0x7da20c7c8970>]] if call[name[self].options.get, ...
keyword[def] identifier[p_statement] ( identifier[self] , identifier[p] ): literal[string] identifier[p] [ literal[int] ]=[ literal[string] , identifier[p] [ literal[int] ][ literal[int] ], identifier[p] [ literal[int] ][ literal[int] ]] keyword[if] identifier[self] . identifier[options]...
def p_statement(self, p): """statement : OPTION_AND_VALUE """ p[0] = ['statement', p[1][0], p[1][1]] if self.options.get('lowercasenames'): p[0][1] = p[0][1].lower() # depends on [control=['if'], data=[]] if not self.options.get('nostripvalues') and (not hasattr(p[0][2], 'is_single_quot...
def get_grid(grid_id): """ Return the specified grid. :param grid_id: The grid identification in h2o :returns: an :class:`H2OGridSearch` instance. """ assert_is_type(grid_id, str) grid_json = api("GET /99/Grids/%s" % grid_id) models = [get_model(key["name"]) for key in grid_json["model...
def function[get_grid, parameter[grid_id]]: constant[ Return the specified grid. :param grid_id: The grid identification in h2o :returns: an :class:`H2OGridSearch` instance. ] call[name[assert_is_type], parameter[name[grid_id], name[str]]] variable[grid_json] assign[=] call[nam...
keyword[def] identifier[get_grid] ( identifier[grid_id] ): literal[string] identifier[assert_is_type] ( identifier[grid_id] , identifier[str] ) identifier[grid_json] = identifier[api] ( literal[string] % identifier[grid_id] ) identifier[models] =[ identifier[get_model] ( identifier[key] [ literal...
def get_grid(grid_id): """ Return the specified grid. :param grid_id: The grid identification in h2o :returns: an :class:`H2OGridSearch` instance. """ assert_is_type(grid_id, str) grid_json = api('GET /99/Grids/%s' % grid_id) models = [get_model(key['name']) for key in grid_json['model...
def fastaParseSgd(header): """Custom parser for fasta headers in the SGD format, see www.yeastgenome.org. :param header: str, protein entry header from a fasta file :returns: dict, parsed header """ rePattern = '([\S]+)\s([\S]+).+(\".+\")' ID, name, description = re.match(rePattern, header...
def function[fastaParseSgd, parameter[header]]: constant[Custom parser for fasta headers in the SGD format, see www.yeastgenome.org. :param header: str, protein entry header from a fasta file :returns: dict, parsed header ] variable[rePattern] assign[=] constant[([\S]+)\s([\S]+).+(".+"...
keyword[def] identifier[fastaParseSgd] ( identifier[header] ): literal[string] identifier[rePattern] = literal[string] identifier[ID] , identifier[name] , identifier[description] = identifier[re] . identifier[match] ( identifier[rePattern] , identifier[header] ). identifier[groups] () identifier...
def fastaParseSgd(header): """Custom parser for fasta headers in the SGD format, see www.yeastgenome.org. :param header: str, protein entry header from a fasta file :returns: dict, parsed header """ rePattern = '([\\S]+)\\s([\\S]+).+(".+")' (ID, name, description) = re.match(rePattern, hea...
def find_all(cls, vid=None, pid=None): """ Returns all FTDI devices matching our vendor and product IDs. :returns: list of devices :raises: :py:class:`~alarmdecoder.util.CommError` """ if not have_pyftdi: raise ImportError('The USBDevice class has been disabl...
def function[find_all, parameter[cls, vid, pid]]: constant[ Returns all FTDI devices matching our vendor and product IDs. :returns: list of devices :raises: :py:class:`~alarmdecoder.util.CommError` ] if <ast.UnaryOp object at 0x7da1b2766830> begin[:] <ast.Raise o...
keyword[def] identifier[find_all] ( identifier[cls] , identifier[vid] = keyword[None] , identifier[pid] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[have_pyftdi] : keyword[raise] identifier[ImportError] ( literal[string] ) identifier[cls] . identi...
def find_all(cls, vid=None, pid=None): """ Returns all FTDI devices matching our vendor and product IDs. :returns: list of devices :raises: :py:class:`~alarmdecoder.util.CommError` """ if not have_pyftdi: raise ImportError('The USBDevice class has been disabled due to mi...
def grace_period(msg='', seconds=10): """ Gives user a window to stop a process before it happens """ import time print(msg) override = util_arg.get_argflag(('--yes', '--y', '-y')) print('starting grace period') if override: print('ending based on command line flag') retu...
def function[grace_period, parameter[msg, seconds]]: constant[ Gives user a window to stop a process before it happens ] import module[time] call[name[print], parameter[name[msg]]] variable[override] assign[=] call[name[util_arg].get_argflag, parameter[tuple[[<ast.Constant object at ...
keyword[def] identifier[grace_period] ( identifier[msg] = literal[string] , identifier[seconds] = literal[int] ): literal[string] keyword[import] identifier[time] identifier[print] ( identifier[msg] ) identifier[override] = identifier[util_arg] . identifier[get_argflag] (( literal[string] , lit...
def grace_period(msg='', seconds=10): """ Gives user a window to stop a process before it happens """ import time print(msg) override = util_arg.get_argflag(('--yes', '--y', '-y')) print('starting grace period') if override: print('ending based on command line flag') retu...
def _bed_iter(bed): """ Given an open BED file, yield tuples of (`chrom`, `chrom_iter`) where `chrom_iter` yields tuples of (`start`, `stop`). """ records = (line.split()[:3] for line in bed if not (line.startswith('browser') or line.startswith('track'))) for chrom, chrom_iter in...
def function[_bed_iter, parameter[bed]]: constant[ Given an open BED file, yield tuples of (`chrom`, `chrom_iter`) where `chrom_iter` yields tuples of (`start`, `stop`). ] variable[records] assign[=] <ast.GeneratorExp object at 0x7da1b2347220> for taget[tuple[[<ast.Name object at 0x7...
keyword[def] identifier[_bed_iter] ( identifier[bed] ): literal[string] identifier[records] =( identifier[line] . identifier[split] ()[: literal[int] ] keyword[for] identifier[line] keyword[in] identifier[bed] keyword[if] keyword[not] ( identifier[line] . identifier[startswith] ( literal[string] ...
def _bed_iter(bed): """ Given an open BED file, yield tuples of (`chrom`, `chrom_iter`) where `chrom_iter` yields tuples of (`start`, `stop`). """ records = (line.split()[:3] for line in bed if not (line.startswith('browser') or line.startswith('track'))) for (chrom, chrom_iter) in itertools.gro...
def decrypt_ecb_cts(self, data): """ Return an iterator that decrypts `data` using the Electronic Codebook with Ciphertext Stealing (ECB-CTS) mode of operation. ECB-CTS mode can only operate on `data` that is greater than 8 bytes in length. Each iteration, except the last, always retur...
def function[decrypt_ecb_cts, parameter[self, data]]: constant[ Return an iterator that decrypts `data` using the Electronic Codebook with Ciphertext Stealing (ECB-CTS) mode of operation. ECB-CTS mode can only operate on `data` that is greater than 8 bytes in length. Each iteration...
keyword[def] identifier[decrypt_ecb_cts] ( identifier[self] , identifier[data] ): literal[string] identifier[data_len] = identifier[len] ( identifier[data] ) keyword[if] identifier[data_len] <= literal[int] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[S1] , ide...
def decrypt_ecb_cts(self, data): """ Return an iterator that decrypts `data` using the Electronic Codebook with Ciphertext Stealing (ECB-CTS) mode of operation. ECB-CTS mode can only operate on `data` that is greater than 8 bytes in length. Each iteration, except the last, always retur...
def connection(self): """ A property to retrieve the sampler connection information. """ return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password}
def function[connection, parameter[self]]: constant[ A property to retrieve the sampler connection information. ] return[dictionary[[<ast.Constant object at 0x7da18f09c400>, <ast.Constant object at 0x7da18f09ce50>, <ast.Constant object at 0x7da18f09e5c0>, <ast.Constant object at 0x7da18f09cb...
keyword[def] identifier[connection] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[host] , literal[string] : identifier[self] . identifier[namespace] , literal[string] : identifier[self] . identifier[username] , literal[string] : identifier[s...
def connection(self): """ A property to retrieve the sampler connection information. """ return {'host': self.host, 'namespace': self.namespace, 'username': self.username, 'password': self.password}
def open_hierarchy(self, path, relative_to_object_id, object_id, create_file_type=0): """ CreateFileType 0 - Creates no new object. 1 - Creates a notebook with the specified name at the specified location. 2 - Creates a section group with the specified name at the specifi...
def function[open_hierarchy, parameter[self, path, relative_to_object_id, object_id, create_file_type]]: constant[ CreateFileType 0 - Creates no new object. 1 - Creates a notebook with the specified name at the specified location. 2 - Creates a section group with the spec...
keyword[def] identifier[open_hierarchy] ( identifier[self] , identifier[path] , identifier[relative_to_object_id] , identifier[object_id] , identifier[create_file_type] = literal[int] ): literal[string] keyword[try] : keyword[return] ( identifier[self] . identifier[process] . identifie...
def open_hierarchy(self, path, relative_to_object_id, object_id, create_file_type=0): """ CreateFileType 0 - Creates no new object. 1 - Creates a notebook with the specified name at the specified location. 2 - Creates a section group with the specified name at the specified l...
def added(self): ''' Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation ''' def _added(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[key], ...
def function[added, parameter[self]]: constant[ Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation ] def function[_added, parameter[diffs, prefix]]: variable[keys] assign[=] list[[]] ...
keyword[def] identifier[added] ( identifier[self] ): literal[string] keyword[def] identifier[_added] ( identifier[diffs] , identifier[prefix] ): identifier[keys] =[] keyword[for] identifier[key] keyword[in] identifier[diffs] . identifier[keys] (): keyw...
def added(self): """ Returns all keys that have been added. If the keys are in child dictionaries they will be represented with . notation """ def _added(diffs, prefix): keys = [] for key in diffs.keys(): if isinstance(diffs[key], dict) and 'old' not...
def list(gandi, only_data, only_snapshot, attached, detached, type, id, vm, snapshotprofile, datacenter, limit): """ List disks. """ options = { 'items_per_page': limit, } if attached and detached: raise UsageError('You cannot use both --attached and --detached.') if only_...
def function[list, parameter[gandi, only_data, only_snapshot, attached, detached, type, id, vm, snapshotprofile, datacenter, limit]]: constant[ List disks. ] variable[options] assign[=] dictionary[[<ast.Constant object at 0x7da18c4cf280>], [<ast.Name object at 0x7da18c4cef50>]] if <ast.BoolOp ob...
keyword[def] identifier[list] ( identifier[gandi] , identifier[only_data] , identifier[only_snapshot] , identifier[attached] , identifier[detached] , identifier[type] , identifier[id] , identifier[vm] , identifier[snapshotprofile] , identifier[datacenter] , identifier[limit] ): literal[string] identifier[...
def list(gandi, only_data, only_snapshot, attached, detached, type, id, vm, snapshotprofile, datacenter, limit): """ List disks. """ options = {'items_per_page': limit} if attached and detached: raise UsageError('You cannot use both --attached and --detached.') # depends on [control=['if'], data=[]...
def resolve(self, pubID, sysID): """Do a complete resolution lookup of an External Identifier """ ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID) return ret
def function[resolve, parameter[self, pubID, sysID]]: constant[Do a complete resolution lookup of an External Identifier ] variable[ret] assign[=] call[name[libxml2mod].xmlACatalogResolve, parameter[name[self]._o, name[pubID], name[sysID]]] return[name[ret]]
keyword[def] identifier[resolve] ( identifier[self] , identifier[pubID] , identifier[sysID] ): literal[string] identifier[ret] = identifier[libxml2mod] . identifier[xmlACatalogResolve] ( identifier[self] . identifier[_o] , identifier[pubID] , identifier[sysID] ) keyword[return] identifier...
def resolve(self, pubID, sysID): """Do a complete resolution lookup of an External Identifier """ ret = libxml2mod.xmlACatalogResolve(self._o, pubID, sysID) return ret
def get_name(tags_or_instance_or_id): """Helper utility to extract name out of tags dictionary or intancce. [{'Key': 'Name', 'Value': 'nexus'}] -> 'nexus' Assert fails if there's more than one name. Returns '' if there's less than one name. """ ec2 = get_ec2_resource() if hasattr(tags_or_inst...
def function[get_name, parameter[tags_or_instance_or_id]]: constant[Helper utility to extract name out of tags dictionary or intancce. [{'Key': 'Name', 'Value': 'nexus'}] -> 'nexus' Assert fails if there's more than one name. Returns '' if there's less than one name. ] variable[ec2] ...
keyword[def] identifier[get_name] ( identifier[tags_or_instance_or_id] ): literal[string] identifier[ec2] = identifier[get_ec2_resource] () keyword[if] identifier[hasattr] ( identifier[tags_or_instance_or_id] , literal[string] ): identifier[tags] = identifier[tags_or_instance_or_id] . identifier[tags...
def get_name(tags_or_instance_or_id): """Helper utility to extract name out of tags dictionary or intancce. [{'Key': 'Name', 'Value': 'nexus'}] -> 'nexus' Assert fails if there's more than one name. Returns '' if there's less than one name. """ ec2 = get_ec2_resource() if hasattr(tags_or...
def visitPrefixDecl(self, ctx: ShExDocParser.PrefixDeclContext): """ prefixDecl: KW_PREFIX PNAME_NS IRIREF """ iri = self.context.iriref_to_shexj_iriref(ctx.IRIREF()) prefix = ctx.PNAME_NS().getText() if iri not in self.context.ld_prefixes: self.context.prefixes.setdefault(pr...
def function[visitPrefixDecl, parameter[self, ctx]]: constant[ prefixDecl: KW_PREFIX PNAME_NS IRIREF ] variable[iri] assign[=] call[name[self].context.iriref_to_shexj_iriref, parameter[call[name[ctx].IRIREF, parameter[]]]] variable[prefix] assign[=] call[call[name[ctx].PNAME_NS, parameter[]].get...
keyword[def] identifier[visitPrefixDecl] ( identifier[self] , identifier[ctx] : identifier[ShExDocParser] . identifier[PrefixDeclContext] ): literal[string] identifier[iri] = identifier[self] . identifier[context] . identifier[iriref_to_shexj_iriref] ( identifier[ctx] . identifier[IRIREF] ()) ...
def visitPrefixDecl(self, ctx: ShExDocParser.PrefixDeclContext): """ prefixDecl: KW_PREFIX PNAME_NS IRIREF """ iri = self.context.iriref_to_shexj_iriref(ctx.IRIREF()) prefix = ctx.PNAME_NS().getText() if iri not in self.context.ld_prefixes: self.context.prefixes.setdefault(prefix, iri.val) # de...
async def sync_recent_conversations( self, sync_recent_conversations_request ): """Return info on recent conversations and their events.""" response = hangouts_pb2.SyncRecentConversationsResponse() await self._pb_request('conversations/syncrecentconversations', ...
<ast.AsyncFunctionDef object at 0x7da18f00dc90>
keyword[async] keyword[def] identifier[sync_recent_conversations] ( identifier[self] , identifier[sync_recent_conversations_request] ): literal[string] identifier[response] = identifier[hangouts_pb2] . identifier[SyncRecentConversationsResponse] () keyword[await] identifier[self] . ide...
async def sync_recent_conversations(self, sync_recent_conversations_request): """Return info on recent conversations and their events.""" response = hangouts_pb2.SyncRecentConversationsResponse() await self._pb_request('conversations/syncrecentconversations', sync_recent_conversations_request, response) ...
def wait_for_operation_completion(self, operation, timeout): """Waits until the given operation is done with a given timeout in milliseconds; specify -1 for an indefinite wait. See :py:func:`wait_for_completion` for event queue considerations. in operation of type int ...
def function[wait_for_operation_completion, parameter[self, operation, timeout]]: constant[Waits until the given operation is done with a given timeout in milliseconds; specify -1 for an indefinite wait. See :py:func:`wait_for_completion` for event queue considerations. in oper...
keyword[def] identifier[wait_for_operation_completion] ( identifier[self] , identifier[operation] , identifier[timeout] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[operation] , identifier[baseinteger] ): keyword[raise] identifier[TypeError] ( lite...
def wait_for_operation_completion(self, operation, timeout): """Waits until the given operation is done with a given timeout in milliseconds; specify -1 for an indefinite wait. See :py:func:`wait_for_completion` for event queue considerations. in operation of type int N...
def merge(self, other): # type: (TentativeType) -> None """ Merge two TentativeType instances """ for hashables in other.types_hashable: self.add(hashables) for non_hashbles in other.types: self.add(non_hashbles)
def function[merge, parameter[self, other]]: constant[ Merge two TentativeType instances ] for taget[name[hashables]] in starred[name[other].types_hashable] begin[:] call[name[self].add, parameter[name[hashables]]] for taget[name[non_hashbles]] in starred[name[oth...
keyword[def] identifier[merge] ( identifier[self] , identifier[other] ): literal[string] keyword[for] identifier[hashables] keyword[in] identifier[other] . identifier[types_hashable] : identifier[self] . identifier[add] ( identifier[hashables] ) keyword[for] identifier[no...
def merge(self, other): # type: (TentativeType) -> None '\n Merge two TentativeType instances\n ' for hashables in other.types_hashable: self.add(hashables) # depends on [control=['for'], data=['hashables']] for non_hashbles in other.types: self.add(non_hashbles) # depend...
def add_phenotype(self, ind_obj, phenotype_id): """Add a phenotype term to the case.""" if phenotype_id.startswith('HP:') or len(phenotype_id) == 7: logger.debug('querying on HPO term') hpo_results = phizz.query_hpo([phenotype_id]) else: logger.debug('querying...
def function[add_phenotype, parameter[self, ind_obj, phenotype_id]]: constant[Add a phenotype term to the case.] if <ast.BoolOp object at 0x7da18f811b40> begin[:] call[name[logger].debug, parameter[constant[querying on HPO term]]] variable[hpo_results] assign[=] call[name...
keyword[def] identifier[add_phenotype] ( identifier[self] , identifier[ind_obj] , identifier[phenotype_id] ): literal[string] keyword[if] identifier[phenotype_id] . identifier[startswith] ( literal[string] ) keyword[or] identifier[len] ( identifier[phenotype_id] )== literal[int] : id...
def add_phenotype(self, ind_obj, phenotype_id): """Add a phenotype term to the case.""" if phenotype_id.startswith('HP:') or len(phenotype_id) == 7: logger.debug('querying on HPO term') hpo_results = phizz.query_hpo([phenotype_id]) # depends on [control=['if'], data=[]] else: logger...
def broadcast_long(self): """ Broadcast address, as long. >>> localnet = Network('127.0.0.1/8') >>> print(localnet.broadcast_long()) 2147483647 """ if self.version() == 4: return self.network_long() | (MAX_IPV4 - self.netmask_long()) else: ...
def function[broadcast_long, parameter[self]]: constant[ Broadcast address, as long. >>> localnet = Network('127.0.0.1/8') >>> print(localnet.broadcast_long()) 2147483647 ] if compare[call[name[self].version, parameter[]] equal[==] constant[4]] begin[:] r...
keyword[def] identifier[broadcast_long] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[version] ()== literal[int] : keyword[return] identifier[self] . identifier[network_long] ()|( identifier[MAX_IPV4] - identifier[self] . identifier[netmask_long] ())...
def broadcast_long(self): """ Broadcast address, as long. >>> localnet = Network('127.0.0.1/8') >>> print(localnet.broadcast_long()) 2147483647 """ if self.version() == 4: return self.network_long() | MAX_IPV4 - self.netmask_long() # depends on [control=['if'], ...
def connect_outgoing(self, outgoing_task, outgoing_task_node, sequence_flow_node, is_default): """ Connects this task to the indicating outgoing task, with the details in the sequence flow. A subclass can override this method to get extra information from the nod...
def function[connect_outgoing, parameter[self, outgoing_task, outgoing_task_node, sequence_flow_node, is_default]]: constant[ Connects this task to the indicating outgoing task, with the details in the sequence flow. A subclass can override this method to get extra information from the n...
keyword[def] identifier[connect_outgoing] ( identifier[self] , identifier[outgoing_task] , identifier[outgoing_task_node] , identifier[sequence_flow_node] , identifier[is_default] ): literal[string] identifier[self] . identifier[task] . identifier[connect_outgoing] ( identifier[outgoing_t...
def connect_outgoing(self, outgoing_task, outgoing_task_node, sequence_flow_node, is_default): """ Connects this task to the indicating outgoing task, with the details in the sequence flow. A subclass can override this method to get extra information from the node. """ self.task....
def stats(self, node_id=None, params=None): """ The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/en/elasticsearch/r...
def function[stats, parameter[self, node_id, params]]: constant[ The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/e...
keyword[def] identifier[stats] ( identifier[self] , identifier[node_id] = keyword[None] , identifier[params] = keyword[None] ): literal[string] identifier[url] = literal[string] keyword[if] identifier[node_id] : identifier[url] = identifier[_make_path] ( literal[string] , id...
def stats(self, node_id=None, params=None): """ The Cluster Stats API allows to retrieve statistics from a cluster wide perspective. The API returns basic index metrics and information about the current nodes that form the cluster. `<http://www.elastic.co/guide/en/elasticsearch/refer...
def _get_struct_gradient(self, shape_number): """Get the values for the GRADIENT record.""" obj = _make_object("Gradient") bc = BitConsumer(self._src) obj.SpreadMode = bc.u_get(2) obj.InterpolationMode = bc.u_get(2) obj.NumGradients = bc.u_get(4) obj.GradientRecor...
def function[_get_struct_gradient, parameter[self, shape_number]]: constant[Get the values for the GRADIENT record.] variable[obj] assign[=] call[name[_make_object], parameter[constant[Gradient]]] variable[bc] assign[=] call[name[BitConsumer], parameter[name[self]._src]] name[obj].Spread...
keyword[def] identifier[_get_struct_gradient] ( identifier[self] , identifier[shape_number] ): literal[string] identifier[obj] = identifier[_make_object] ( literal[string] ) identifier[bc] = identifier[BitConsumer] ( identifier[self] . identifier[_src] ) identifier[obj] . identifi...
def _get_struct_gradient(self, shape_number): """Get the values for the GRADIENT record.""" obj = _make_object('Gradient') bc = BitConsumer(self._src) obj.SpreadMode = bc.u_get(2) obj.InterpolationMode = bc.u_get(2) obj.NumGradients = bc.u_get(4) obj.GradientRecords = gradient_records = [] ...
def insertBlock(self, businput): """ Input dictionary has to have the following keys: blockname It may have: open_for_writing, origin_site(name), block_size, file_count, creation_date, create_by, last_modification_date, last_modified_by it builds...
def function[insertBlock, parameter[self, businput]]: constant[ Input dictionary has to have the following keys: blockname It may have: open_for_writing, origin_site(name), block_size, file_count, creation_date, create_by, last_modification_date, last_modified_by...
keyword[def] identifier[insertBlock] ( identifier[self] , identifier[businput] ): literal[string] keyword[if] keyword[not] ( literal[string] keyword[in] identifier[businput] keyword[and] literal[string] keyword[in] identifier[businput] ): identifier[dbsExceptionHandler] ( litera...
def insertBlock(self, businput): """ Input dictionary has to have the following keys: blockname It may have: open_for_writing, origin_site(name), block_size, file_count, creation_date, create_by, last_modification_date, last_modified_by it builds the...
def convert_ensembl_to_entrez(self, ensembl): """Convert Ensembl Id to Entrez Gene Id""" if 'ENST' in ensembl: pass else: raise (IndexError) # Submit resquest to NCBI eutils/Gene database server = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?...
def function[convert_ensembl_to_entrez, parameter[self, ensembl]]: constant[Convert Ensembl Id to Entrez Gene Id] if compare[constant[ENST] in name[ensembl]] begin[:] pass variable[server] assign[=] binary_operation[binary_operation[constant[http://eutils.ncbi.nlm.nih.gov/entrez/eutils/e...
keyword[def] identifier[convert_ensembl_to_entrez] ( identifier[self] , identifier[ensembl] ): literal[string] keyword[if] literal[string] keyword[in] identifier[ensembl] : keyword[pass] keyword[else] : keyword[raise] ( identifier[IndexError] ) ...
def convert_ensembl_to_entrez(self, ensembl): """Convert Ensembl Id to Entrez Gene Id""" if 'ENST' in ensembl: pass # depends on [control=['if'], data=[]] else: raise IndexError # Submit resquest to NCBI eutils/Gene database server = 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/ese...
def complement(color): r"""Calculates polar opposite of color This isn't guaranteed to look good >_> (especially with brighter, higher intensity colors.) This will be replaced with a formula that produces better looking colors in the future. >>> complement('red') (0, 255, 76) >>> complemen...
def function[complement, parameter[color]]: constant[Calculates polar opposite of color This isn't guaranteed to look good >_> (especially with brighter, higher intensity colors.) This will be replaced with a formula that produces better looking colors in the future. >>> complement('red') ...
keyword[def] identifier[complement] ( identifier[color] ): literal[string] ( identifier[r] , identifier[g] , identifier[b] )= identifier[parse_color] ( identifier[color] ) identifier[gcolor] = identifier[grapefruit] . identifier[Color] (( identifier[r] / literal[int] , identifier[g] / literal[int] , id...
def complement(color): """Calculates polar opposite of color This isn't guaranteed to look good >_> (especially with brighter, higher intensity colors.) This will be replaced with a formula that produces better looking colors in the future. >>> complement('red') (0, 255, 76) >>> complement...
def _predict(self, X, method='fprop'): """ Get model predictions. See pylearn2.scripts.mlp.predict_csv and http://fastml.com/how-to-get-predictions-from-pylearn2/. Parameters ---------- X : array_like Test dataset. method : str Mo...
def function[_predict, parameter[self, X, method]]: constant[ Get model predictions. See pylearn2.scripts.mlp.predict_csv and http://fastml.com/how-to-get-predictions-from-pylearn2/. Parameters ---------- X : array_like Test dataset. method :...
keyword[def] identifier[_predict] ( identifier[self] , identifier[X] , identifier[method] = literal[string] ): literal[string] keyword[import] identifier[theano] identifier[X_sym] = identifier[self] . identifier[trainer] . identifier[model] . identifier[get_input_space] (). identifier[m...
def _predict(self, X, method='fprop'): """ Get model predictions. See pylearn2.scripts.mlp.predict_csv and http://fastml.com/how-to-get-predictions-from-pylearn2/. Parameters ---------- X : array_like Test dataset. method : str Model ...
def get_taf_remarks(txt: str) -> (str, str): # type: ignore """ Returns report and remarks separated if found """ remarks_start = find_first_in_list(txt, TAF_RMK) if remarks_start == -1: return txt, '' remarks = txt[remarks_start:] txt = txt[:remarks_start].strip() return txt, r...
def function[get_taf_remarks, parameter[txt]]: constant[ Returns report and remarks separated if found ] variable[remarks_start] assign[=] call[name[find_first_in_list], parameter[name[txt], name[TAF_RMK]]] if compare[name[remarks_start] equal[==] <ast.UnaryOp object at 0x7da207f021a0>] ...
keyword[def] identifier[get_taf_remarks] ( identifier[txt] : identifier[str] )->( identifier[str] , identifier[str] ): literal[string] identifier[remarks_start] = identifier[find_first_in_list] ( identifier[txt] , identifier[TAF_RMK] ) keyword[if] identifier[remarks_start] ==- literal[int] : ...
def get_taf_remarks(txt: str) -> (str, str): # type: ignore '\n Returns report and remarks separated if found\n ' remarks_start = find_first_in_list(txt, TAF_RMK) if remarks_start == -1: return (txt, '') # depends on [control=['if'], data=[]] remarks = txt[remarks_start:] txt = txt[:...
def _get_child_mock(self, **kw): """Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable mocks the callable var...
def function[_get_child_mock, parameter[self]]: constant[Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable m...
keyword[def] identifier[_get_child_mock] ( identifier[self] ,** identifier[kw] ): literal[string] identifier[_type] = identifier[type] ( identifier[self] ) keyword[if] keyword[not] identifier[issubclass] ( identifier[_type] , identifier[CallableMixin] ): keyword[if] identif...
def _get_child_mock(self, **kw): """Create the child mocks for attributes and return value. By default child mocks will be the same type as the parent. Subclasses of Mock may want to override this to customize the way child mocks are made. For non-callable mocks the callable variant...
def run_gmsh(self): """ Makes the mesh using gmsh. """ argiope.utils.run_gmsh(gmsh_path = self.gmsh_path, gmsh_space = self.gmsh_space, gmsh_options = self.gmsh_options, name = self.file_name + ".geo", ...
def function[run_gmsh, parameter[self]]: constant[ Makes the mesh using gmsh. ] call[name[argiope].utils.run_gmsh, parameter[]] name[self].mesh assign[=] call[name[argiope].mesh.read_msh, parameter[binary_operation[binary_operation[name[self].workdir + name[self].file_name] + constant[.m...
keyword[def] identifier[run_gmsh] ( identifier[self] ): literal[string] identifier[argiope] . identifier[utils] . identifier[run_gmsh] ( identifier[gmsh_path] = identifier[self] . identifier[gmsh_path] , identifier[gmsh_space] = identifier[self] . identifier[gmsh_space] , identifier[gmsh_options]...
def run_gmsh(self): """ Makes the mesh using gmsh. """ argiope.utils.run_gmsh(gmsh_path=self.gmsh_path, gmsh_space=self.gmsh_space, gmsh_options=self.gmsh_options, name=self.file_name + '.geo', workdir=self.workdir) self.mesh = argiope.mesh.read_msh(self.workdir + self.file_name + '.msh')
def parse_nodes_coords(osm_response): """ Parse node coordinates from OSM response. Some nodes are standalone points of interest, others are vertices in polygonal (areal) POIs. Parameters ---------- osm_response : string OSM response JSON string Returns ------- ...
def function[parse_nodes_coords, parameter[osm_response]]: constant[ Parse node coordinates from OSM response. Some nodes are standalone points of interest, others are vertices in polygonal (areal) POIs. Parameters ---------- osm_response : string OSM response JSON string ...
keyword[def] identifier[parse_nodes_coords] ( identifier[osm_response] ): literal[string] identifier[coords] ={} keyword[for] identifier[result] keyword[in] identifier[osm_response] [ literal[string] ]: keyword[if] literal[string] keyword[in] identifier[result] keyword[and] identifie...
def parse_nodes_coords(osm_response): """ Parse node coordinates from OSM response. Some nodes are standalone points of interest, others are vertices in polygonal (areal) POIs. Parameters ---------- osm_response : string OSM response JSON string Returns ------- ...
def preprocess(self): """Preprocessing. Removes repeated chars from firstName and lastName fields. Adds a 'name' field joining all names in to one string. """ super(MambuUser,self).preprocess() try: self['firstName'] = self['firstName'].strip() exce...
def function[preprocess, parameter[self]]: constant[Preprocessing. Removes repeated chars from firstName and lastName fields. Adds a 'name' field joining all names in to one string. ] call[call[name[super], parameter[name[MambuUser], name[self]]].preprocess, parameter[]] <a...
keyword[def] identifier[preprocess] ( identifier[self] ): literal[string] identifier[super] ( identifier[MambuUser] , identifier[self] ). identifier[preprocess] () keyword[try] : identifier[self] [ literal[string] ]= identifier[self] [ literal[string] ]. identifier[strip] () ...
def preprocess(self): """Preprocessing. Removes repeated chars from firstName and lastName fields. Adds a 'name' field joining all names in to one string. """ super(MambuUser, self).preprocess() try: self['firstName'] = self['firstName'].strip() # depends on [control=['try...
def rollback(awsclient, function_name, alias_name=ALIAS_NAME, version=None): """Rollback a lambda function to a given version. :param awsclient: :param function_name: :param alias_name: :param version: :return: exit_code """ if version: log.info('rolling back to version {}'.form...
def function[rollback, parameter[awsclient, function_name, alias_name, version]]: constant[Rollback a lambda function to a given version. :param awsclient: :param function_name: :param alias_name: :param version: :return: exit_code ] if name[version] begin[:] cal...
keyword[def] identifier[rollback] ( identifier[awsclient] , identifier[function_name] , identifier[alias_name] = identifier[ALIAS_NAME] , identifier[version] = keyword[None] ): literal[string] keyword[if] identifier[version] : identifier[log] . identifier[info] ( literal[string] . identifier[form...
def rollback(awsclient, function_name, alias_name=ALIAS_NAME, version=None): """Rollback a lambda function to a given version. :param awsclient: :param function_name: :param alias_name: :param version: :return: exit_code """ if version: log.info('rolling back to version {}'.form...
def from_dict(data, ctx): """ Instantiate a new ClientConfigureRejectTransaction from a dict (generally from loading a JSON response). The data used to instantiate the ClientConfigureRejectTransaction is a shallow copy of the dict passed in, with any complex child types instantia...
def function[from_dict, parameter[data, ctx]]: constant[ Instantiate a new ClientConfigureRejectTransaction from a dict (generally from loading a JSON response). The data used to instantiate the ClientConfigureRejectTransaction is a shallow copy of the dict passed in, with any co...
keyword[def] identifier[from_dict] ( identifier[data] , identifier[ctx] ): literal[string] identifier[data] = identifier[data] . identifier[copy] () keyword[if] identifier[data] . identifier[get] ( literal[string] ) keyword[is] keyword[not] keyword[None] : identifier[data...
def from_dict(data, ctx): """ Instantiate a new ClientConfigureRejectTransaction from a dict (generally from loading a JSON response). The data used to instantiate the ClientConfigureRejectTransaction is a shallow copy of the dict passed in, with any complex child types instantiated ...
def remove(self, option): """ Removes an option from a Config instance IN: option (type: Option) """ if option.__class__ == Option: if option in self.options: del self.options[self.options.index(option)] else: raise OptionNotFoundError(option.name) else: raise TypeError("invalid type suppli...
def function[remove, parameter[self, option]]: constant[ Removes an option from a Config instance IN: option (type: Option) ] if compare[name[option].__class__ equal[==] name[Option]] begin[:] if compare[name[option] in name[self].options] begin[:] <ast.Delete object at...
keyword[def] identifier[remove] ( identifier[self] , identifier[option] ): literal[string] keyword[if] identifier[option] . identifier[__class__] == identifier[Option] : keyword[if] identifier[option] keyword[in] identifier[self] . identifier[options] : keyword[del] identifier[self] . identifier[...
def remove(self, option): """ Removes an option from a Config instance IN: option (type: Option) """ if option.__class__ == Option: if option in self.options: del self.options[self.options.index(option)] # depends on [control=['if'], data=['option']] else: raise Op...
def h5fmem(**kwargs): """Create an in-memory HDF5 file.""" # need a file name even tho nothing is ever written fn = tempfile.mktemp() # file creation args kwargs['mode'] = 'w' kwargs['driver'] = 'core' kwargs['backing_store'] = False # open HDF5 file h5f = h5py.File(fn, **kwargs) ...
def function[h5fmem, parameter[]]: constant[Create an in-memory HDF5 file.] variable[fn] assign[=] call[name[tempfile].mktemp, parameter[]] call[name[kwargs]][constant[mode]] assign[=] constant[w] call[name[kwargs]][constant[driver]] assign[=] constant[core] call[name[kwargs]][co...
keyword[def] identifier[h5fmem] (** identifier[kwargs] ): literal[string] identifier[fn] = identifier[tempfile] . identifier[mktemp] () identifier[kwargs] [ literal[string] ]= literal[string] identifier[kwargs] [ literal[string] ]= literal[string] identifier[kwargs] [ literal[s...
def h5fmem(**kwargs): """Create an in-memory HDF5 file.""" # need a file name even tho nothing is ever written fn = tempfile.mktemp() # file creation args kwargs['mode'] = 'w' kwargs['driver'] = 'core' kwargs['backing_store'] = False # open HDF5 file h5f = h5py.File(fn, **kwargs) ...
def _fast_permalink(self): """Return the short permalink to the comment.""" if hasattr(self, 'link_id'): # from /r or /u comments page sid = self.link_id.split('_')[1] else: # from user's /message page sid = self.context.split('/')[4] return urljoin(self.reddit_...
def function[_fast_permalink, parameter[self]]: constant[Return the short permalink to the comment.] if call[name[hasattr], parameter[name[self], constant[link_id]]] begin[:] variable[sid] assign[=] call[call[name[self].link_id.split, parameter[constant[_]]]][constant[1]] return[call...
keyword[def] identifier[_fast_permalink] ( identifier[self] ): literal[string] keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ): identifier[sid] = identifier[self] . identifier[link_id] . identifier[split] ( literal[string] )[ literal[int] ] keyword[else...
def _fast_permalink(self): """Return the short permalink to the comment.""" if hasattr(self, 'link_id'): # from /r or /u comments page sid = self.link_id.split('_')[1] # depends on [control=['if'], data=[]] else: # from user's /message page sid = self.context.split('/')[4] return urlj...
def generate_numeric_range(items, lower_bound, upper_bound): """Generate postgresql numeric range and label for insertion. Parameters ---------- items: iterable labels for ranges. lower_bound: numeric lower bound upper_bound: numeric upper bound """ quantile_grid = create_quantiles(ite...
def function[generate_numeric_range, parameter[items, lower_bound, upper_bound]]: constant[Generate postgresql numeric range and label for insertion. Parameters ---------- items: iterable labels for ranges. lower_bound: numeric lower bound upper_bound: numeric upper bound ] vari...
keyword[def] identifier[generate_numeric_range] ( identifier[items] , identifier[lower_bound] , identifier[upper_bound] ): literal[string] identifier[quantile_grid] = identifier[create_quantiles] ( identifier[items] , identifier[lower_bound] , identifier[upper_bound] ) identifier[labels] , identifier...
def generate_numeric_range(items, lower_bound, upper_bound): """Generate postgresql numeric range and label for insertion. Parameters ---------- items: iterable labels for ranges. lower_bound: numeric lower bound upper_bound: numeric upper bound """ quantile_grid = create_quantiles(item...
def make_energies_hdu(self, extname="ENERGIES"): """ Builds and returns a FITs HDU with the energy bin boundries extname : The HDU extension name """ if self._evals is None: return None cols = [fits.Column("ENERGY", "1E", unit='MeV', ...
def function[make_energies_hdu, parameter[self, extname]]: constant[ Builds and returns a FITs HDU with the energy bin boundries extname : The HDU extension name ] if compare[name[self]._evals is constant[None]] begin[:] return[constant[None]] variable[cols...
keyword[def] identifier[make_energies_hdu] ( identifier[self] , identifier[extname] = literal[string] ): literal[string] keyword[if] identifier[self] . identifier[_evals] keyword[is] keyword[None] : keyword[return] keyword[None] identifier[cols] =[ identifier[fits] . iden...
def make_energies_hdu(self, extname='ENERGIES'): """ Builds and returns a FITs HDU with the energy bin boundries extname : The HDU extension name """ if self._evals is None: return None # depends on [control=['if'], data=[]] cols = [fits.Column('ENERGY', '1E', unit='M...
def add_upsert(self, action, meta_action, doc_source, update_spec): """ Function which stores sources for "insert" actions and decide if for "update" action has to add docs to get source buffer """ # Whenever update_spec is provided to this method # it means that...
def function[add_upsert, parameter[self, action, meta_action, doc_source, update_spec]]: constant[ Function which stores sources for "insert" actions and decide if for "update" action has to add docs to get source buffer ] if name[update_spec] begin[:] cal...
keyword[def] identifier[add_upsert] ( identifier[self] , identifier[action] , identifier[meta_action] , identifier[doc_source] , identifier[update_spec] ): literal[string] keyword[if] identifier[update_spec] : identifier[self] . identifier[bulk_ind...
def add_upsert(self, action, meta_action, doc_source, update_spec): """ Function which stores sources for "insert" actions and decide if for "update" action has to add docs to get source buffer """ # Whenever update_spec is provided to this method # it means that doc source n...
def _join_chemical(query, cas_rn, chemical_id, chemical_name, chemical_definition): """helper function to add a query join to Chemical model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param cas_rn: :param chemical_id: :param chemical_name: ...
def function[_join_chemical, parameter[query, cas_rn, chemical_id, chemical_name, chemical_definition]]: constant[helper function to add a query join to Chemical model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param cas_rn: :param chemical_id: :par...
keyword[def] identifier[_join_chemical] ( identifier[query] , identifier[cas_rn] , identifier[chemical_id] , identifier[chemical_name] , identifier[chemical_definition] ): literal[string] keyword[if] identifier[cas_rn] keyword[or] identifier[chemical_id] keyword[or] identifier[chemical_name] ...
def _join_chemical(query, cas_rn, chemical_id, chemical_name, chemical_definition): """helper function to add a query join to Chemical model :param `sqlalchemy.orm.query.Query` query: SQL Alchemy query :param cas_rn: :param chemical_id: :param chemical_name: :par...
def extend(dict_, *dicts, **kwargs): """Extend a dictionary with keys and values from other dictionaries. :param dict_: Dictionary to extend Optional keyword arguments allow to control the exact way in which ``dict_`` will be extended. :param overwrite: Whether repeated keys should have ...
def function[extend, parameter[dict_]]: constant[Extend a dictionary with keys and values from other dictionaries. :param dict_: Dictionary to extend Optional keyword arguments allow to control the exact way in which ``dict_`` will be extended. :param overwrite: Whether repeated keys...
keyword[def] identifier[extend] ( identifier[dict_] ,* identifier[dicts] ,** identifier[kwargs] ): literal[string] identifier[ensure_mapping] ( identifier[dict_] ) identifier[dicts] = identifier[list] ( identifier[imap] ( identifier[ensure_mapping] , identifier[dicts] )) identifier[ensure_keywor...
def extend(dict_, *dicts, **kwargs): """Extend a dictionary with keys and values from other dictionaries. :param dict_: Dictionary to extend Optional keyword arguments allow to control the exact way in which ``dict_`` will be extended. :param overwrite: Whether repeated keys should have ...
def Diguilio_Teja(T, xs, sigmas_Tb, Tbs, Tcs): r'''Calculates surface tension of a liquid mixture according to mixing rules in [1]_. .. math:: \sigma = 1.002855(T^*)^{1.118091} \frac{T}{T_b} \sigma_r T^* = \frac{(T_c/T)-1}{(T_c/T_b)-1} \sigma_r = \sum x_i \sigma_i T_b = ...
def function[Diguilio_Teja, parameter[T, xs, sigmas_Tb, Tbs, Tcs]]: constant[Calculates surface tension of a liquid mixture according to mixing rules in [1]_. .. math:: \sigma = 1.002855(T^*)^{1.118091} \frac{T}{T_b} \sigma_r T^* = \frac{(T_c/T)-1}{(T_c/T_b)-1} \sigma_r = \su...
keyword[def] identifier[Diguilio_Teja] ( identifier[T] , identifier[xs] , identifier[sigmas_Tb] , identifier[Tbs] , identifier[Tcs] ): literal[string] keyword[if] keyword[not] identifier[none_and_length_check] ([ identifier[xs] , identifier[sigmas_Tb] , identifier[Tbs] , identifier[Tcs] ]): keyw...
def Diguilio_Teja(T, xs, sigmas_Tb, Tbs, Tcs): """Calculates surface tension of a liquid mixture according to mixing rules in [1]_. .. math:: \\sigma = 1.002855(T^*)^{1.118091} \\frac{T}{T_b} \\sigma_r T^* = \\frac{(T_c/T)-1}{(T_c/T_b)-1} \\sigma_r = \\sum x_i \\sigma_i ...
def path(self, name): """ Look for files in subdirectory of MEDIA_ROOT using the tenant's domain_url value as the specifier. """ if name is None: name = '' try: location = safe_join(self.location, connection.tenant.domain_url) except Attrib...
def function[path, parameter[self, name]]: constant[ Look for files in subdirectory of MEDIA_ROOT using the tenant's domain_url value as the specifier. ] if compare[name[name] is constant[None]] begin[:] variable[name] assign[=] constant[] <ast.Try object at 0...
keyword[def] identifier[path] ( identifier[self] , identifier[name] ): literal[string] keyword[if] identifier[name] keyword[is] keyword[None] : identifier[name] = literal[string] keyword[try] : identifier[location] = identifier[safe_join] ( identifier[self] . ...
def path(self, name): """ Look for files in subdirectory of MEDIA_ROOT using the tenant's domain_url value as the specifier. """ if name is None: name = '' # depends on [control=['if'], data=['name']] try: location = safe_join(self.location, connection.tenant.domain_...
def convertStateToIndex(population, fire): """Convert state parameters to transition probability matrix index. Parameters ---------- population : int The population abundance class of the threatened species. fire : int The time in years since last fire. Returns ----...
def function[convertStateToIndex, parameter[population, fire]]: constant[Convert state parameters to transition probability matrix index. Parameters ---------- population : int The population abundance class of the threatened species. fire : int The time in years since last ...
keyword[def] identifier[convertStateToIndex] ( identifier[population] , identifier[fire] ): literal[string] keyword[assert] literal[int] <= identifier[population] < identifier[POPULATION_CLASSES] , literal[string] literal[string] % identifier[str] ( identifier[POPULATION_CLASSES] - literal[int] ) ke...
def convertStateToIndex(population, fire): """Convert state parameters to transition probability matrix index. Parameters ---------- population : int The population abundance class of the threatened species. fire : int The time in years since last fire. Returns ----...
def listdir_nohidden(path): """List not hidden files or directories under path""" for f in os.listdir(path): if isinstance(f, str): f = unicode(f, "utf-8") if not f.startswith('.'): yield f
def function[listdir_nohidden, parameter[path]]: constant[List not hidden files or directories under path] for taget[name[f]] in starred[call[name[os].listdir, parameter[name[path]]]] begin[:] if call[name[isinstance], parameter[name[f], name[str]]] begin[:] varia...
keyword[def] identifier[listdir_nohidden] ( identifier[path] ): literal[string] keyword[for] identifier[f] keyword[in] identifier[os] . identifier[listdir] ( identifier[path] ): keyword[if] identifier[isinstance] ( identifier[f] , identifier[str] ): identifier[f] = identifier[unic...
def listdir_nohidden(path): """List not hidden files or directories under path""" for f in os.listdir(path): if isinstance(f, str): f = unicode(f, 'utf-8') # depends on [control=['if'], data=[]] if not f.startswith('.'): yield f # depends on [control=['if'], data=[]] #...
def journey_options(origin: str, destination: str, via: t.Optional[str]=None, before: t.Optional[int]=None, after: t.Optional[int]=None, time: t.Optional[datetime]=None, ...
def function[journey_options, parameter[origin, destination, via, before, after, time, hsl, year_card]]: constant[journey recommendations from an origin to a destination station] return[call[name[snug].GET, parameter[constant[treinplanner]]]]
keyword[def] identifier[journey_options] ( identifier[origin] : identifier[str] , identifier[destination] : identifier[str] , identifier[via] : identifier[t] . identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[before] : identifier[t] . identifier[Optional] [ identifier[int] ]= keyword[None] , i...
def journey_options(origin: str, destination: str, via: t.Optional[str]=None, before: t.Optional[int]=None, after: t.Optional[int]=None, time: t.Optional[datetime]=None, hsl: t.Optional[bool]=None, year_card: t.Optional[bool]=None) -> snug.Query[t.List[Journey]]: """journey recommendations from an origin to a desti...
def convex_hull(labels, indexes=None, fast=True): """Given a labeled image, return a list of points per object ordered by angle from an interior point, representing the convex hull.s labels - the label matrix indexes - an array of label #s to be processed, defaults to all non-zero lab...
def function[convex_hull, parameter[labels, indexes, fast]]: constant[Given a labeled image, return a list of points per object ordered by angle from an interior point, representing the convex hull.s labels - the label matrix indexes - an array of label #s to be processed, defaults to all non-z...
keyword[def] identifier[convex_hull] ( identifier[labels] , identifier[indexes] = keyword[None] , identifier[fast] = keyword[True] ): literal[string] keyword[if] identifier[indexes] keyword[is] keyword[None] : identifier[indexes] = identifier[np] . identifier[unique] ( identifier[labels] ) ...
def convex_hull(labels, indexes=None, fast=True): """Given a labeled image, return a list of points per object ordered by angle from an interior point, representing the convex hull.s labels - the label matrix indexes - an array of label #s to be processed, defaults to all non-zero lab...
def markdown_single_text(self, catalog, cdli_number): """ Prints single text in file in markdown. :param catalog: text ingested by cdli_corpus :param cdli_number: text you wish to print :return: output in filename.md """ if cdli_number in catalog: pnum = c...
def function[markdown_single_text, parameter[self, catalog, cdli_number]]: constant[ Prints single text in file in markdown. :param catalog: text ingested by cdli_corpus :param cdli_number: text you wish to print :return: output in filename.md ] if compare[name[cdli_n...
keyword[def] identifier[markdown_single_text] ( identifier[self] , identifier[catalog] , identifier[cdli_number] ): literal[string] keyword[if] identifier[cdli_number] keyword[in] identifier[catalog] : identifier[pnum] = identifier[catalog] [ identifier[cdli_number] ][ literal[strin...
def markdown_single_text(self, catalog, cdli_number): """ Prints single text in file in markdown. :param catalog: text ingested by cdli_corpus :param cdli_number: text you wish to print :return: output in filename.md """ if cdli_number in catalog: pnum = catalog[cdli_...
def slamdunkUtrRatesPlot (self): """ Generate the UTR rates plot """ cats = OrderedDict() keys = ['T>C', 'A>T', 'A>G', 'A>C', 'T>A', 'T>G', 'G>A', 'G>T', 'G>C', 'C>A', 'C>T', 'C>G'] for i, v in enumerate(keys): cats[v] = { 'color': self.plot_cols[i] } pconfig = { ...
def function[slamdunkUtrRatesPlot, parameter[self]]: constant[ Generate the UTR rates plot ] variable[cats] assign[=] call[name[OrderedDict], parameter[]] variable[keys] assign[=] list[[<ast.Constant object at 0x7da204564a30>, <ast.Constant object at 0x7da204565990>, <ast.Constant object at 0x7d...
keyword[def] identifier[slamdunkUtrRatesPlot] ( identifier[self] ): literal[string] identifier[cats] = identifier[OrderedDict] () identifier[keys] =[ literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[string] , literal[strin...
def slamdunkUtrRatesPlot(self): """ Generate the UTR rates plot """ cats = OrderedDict() keys = ['T>C', 'A>T', 'A>G', 'A>C', 'T>A', 'T>G', 'G>A', 'G>T', 'G>C', 'C>A', 'C>T', 'C>G'] for (i, v) in enumerate(keys): cats[v] = {'color': self.plot_cols[i]} # depends on [control=['for'], data=[]] ...
def term(self): """ term: atom (('*' | '/' | '//') atom)* """ node = self.atom() while self.token.nature in (Nature.MUL, Nature.DIV, Nature.INT_DIV): token = self.token if token.nature == Nature.MUL: self._process(Nature.MUL) e...
def function[term, parameter[self]]: constant[ term: atom (('*' | '/' | '//') atom)* ] variable[node] assign[=] call[name[self].atom, parameter[]] while compare[name[self].token.nature in tuple[[<ast.Attribute object at 0x7da1b09eba60>, <ast.Attribute object at 0x7da1b09e87f0>, <...
keyword[def] identifier[term] ( identifier[self] ): literal[string] identifier[node] = identifier[self] . identifier[atom] () keyword[while] identifier[self] . identifier[token] . identifier[nature] keyword[in] ( identifier[Nature] . identifier[MUL] , identifier[Nature] . identifier[DIV...
def term(self): """ term: atom (('*' | '/' | '//') atom)* """ node = self.atom() while self.token.nature in (Nature.MUL, Nature.DIV, Nature.INT_DIV): token = self.token if token.nature == Nature.MUL: self._process(Nature.MUL) # depends on [control=['if'], data=[]...
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): ''' Ensure ...
def function[user_present, parameter[name, password, email, tenant, enabled, roles, profile, password_reset, project]]: constant[ Ensure that the keystone user is present with the specified properties. name The name of the user to manage password The password to use for this user. ...
keyword[def] identifier[user_present] ( identifier[name] , identifier[password] , identifier[email] , identifier[tenant] = keyword[None] , identifier[enabled] = keyword[True] , identifier[roles] = keyword[None] , identifier[profile] = keyword[None] , identifier[password_reset] = keyword[True] , identifier[pro...
def user_present(name, password, email, tenant=None, enabled=True, roles=None, profile=None, password_reset=True, project=None, **connection_args): """ Ensure that the keystone user is present with the specified properties. name The name of the user to manage password The password to u...
def command(*args, **kwargs): """Decorator to define a command. The arguments to this decorator are those of the `ArgumentParser <https://docs.python.org/3/library/argparse.html\ #argumentparser-objects>`_ object constructor. """ def decorator(f): if 'description' not in kwargs: ...
def function[command, parameter[]]: constant[Decorator to define a command. The arguments to this decorator are those of the `ArgumentParser <https://docs.python.org/3/library/argparse.html#argumentparser-objects>`_ object constructor. ] def function[decorator, parameter[f]]: ...
keyword[def] identifier[command] (* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[def] identifier[decorator] ( identifier[f] ): keyword[if] literal[string] keyword[not] keyword[in] identifier[kwargs] : identifier[kwargs] [ literal[string] ]= identifier[f] . i...
def command(*args, **kwargs): """Decorator to define a command. The arguments to this decorator are those of the `ArgumentParser <https://docs.python.org/3/library/argparse.html#argumentparser-objects>`_ object constructor. """ def decorator(f): if 'description' not in kwargs: ...
def cast_problem(problem): """ Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object """ # Optproblem if isinstance(problem,OptProblem): return problem # Other else: # Type Base if (not hasattr(...
def function[cast_problem, parameter[problem]]: constant[ Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object ] if call[name[isinstance], parameter[name[problem], name[OptProblem]]] begin[:] return[name[problem]]
keyword[def] identifier[cast_problem] ( identifier[problem] ): literal[string] keyword[if] identifier[isinstance] ( identifier[problem] , identifier[OptProblem] ): keyword[return] identifier[problem] keyword[else] : keyword[if] ( keyword[not] identifier[hasa...
def cast_problem(problem): """ Casts problem object with known interface as OptProblem. Parameters ---------- problem : Object """ # Optproblem if isinstance(problem, OptProblem): return problem # depends on [control=['if'], data=[]] # Other # Type Base elif not has...
def _partition_runs_by_day(self): """Split the runs by day, so we can display them grouped that way.""" run_infos = self._get_all_run_infos() for x in run_infos: ts = float(x['timestamp']) x['time_of_day_text'] = datetime.fromtimestamp(ts).strftime('%H:%M:%S') def date_text(dt): delta...
def function[_partition_runs_by_day, parameter[self]]: constant[Split the runs by day, so we can display them grouped that way.] variable[run_infos] assign[=] call[name[self]._get_all_run_infos, parameter[]] for taget[name[x]] in starred[name[run_infos]] begin[:] variable[ts] ass...
keyword[def] identifier[_partition_runs_by_day] ( identifier[self] ): literal[string] identifier[run_infos] = identifier[self] . identifier[_get_all_run_infos] () keyword[for] identifier[x] keyword[in] identifier[run_infos] : identifier[ts] = identifier[float] ( identifier[x] [ literal[strin...
def _partition_runs_by_day(self): """Split the runs by day, so we can display them grouped that way.""" run_infos = self._get_all_run_infos() for x in run_infos: ts = float(x['timestamp']) x['time_of_day_text'] = datetime.fromtimestamp(ts).strftime('%H:%M:%S') # depends on [control=['for'],...
def build(self): """Run the build command specified in index.yaml.""" for cmd in self.build_cmds: log.info('building command: {}'.format(cmd)) full_cmd = 'cd {}; {}'.format(self.analyses_path, cmd) log.debug('full command: {}'.format(full_cmd)) subprocess....
def function[build, parameter[self]]: constant[Run the build command specified in index.yaml.] for taget[name[cmd]] in starred[name[self].build_cmds] begin[:] call[name[log].info, parameter[call[constant[building command: {}].format, parameter[name[cmd]]]]] variable[full_...
keyword[def] identifier[build] ( identifier[self] ): literal[string] keyword[for] identifier[cmd] keyword[in] identifier[self] . identifier[build_cmds] : identifier[log] . identifier[info] ( literal[string] . identifier[format] ( identifier[cmd] )) identifier[full_cmd] ...
def build(self): """Run the build command specified in index.yaml.""" for cmd in self.build_cmds: log.info('building command: {}'.format(cmd)) full_cmd = 'cd {}; {}'.format(self.analyses_path, cmd) log.debug('full command: {}'.format(full_cmd)) subprocess.call(full_cmd, shell=Tru...
def to_textgrid(self, filtin=[], filtex=[], regex=False): """Convert the object to a :class:`pympi.Praat.TextGrid` object. :param list filtin: Include only tiers in this list, if empty all tiers are included. :param list filtex: Exclude all tiers in this list. :param bool re...
def function[to_textgrid, parameter[self, filtin, filtex, regex]]: constant[Convert the object to a :class:`pympi.Praat.TextGrid` object. :param list filtin: Include only tiers in this list, if empty all tiers are included. :param list filtex: Exclude all tiers in this list. ...
keyword[def] identifier[to_textgrid] ( identifier[self] , identifier[filtin] =[], identifier[filtex] =[], identifier[regex] = keyword[False] ): literal[string] keyword[from] identifier[pympi] . identifier[Praat] keyword[import] identifier[TextGrid] identifier[_] , identifier[end] = ide...
def to_textgrid(self, filtin=[], filtex=[], regex=False): """Convert the object to a :class:`pympi.Praat.TextGrid` object. :param list filtin: Include only tiers in this list, if empty all tiers are included. :param list filtex: Exclude all tiers in this list. :param bool regex:...
def parse_duration(string): ''' Parses duration/period stamp expressed in a subset of ISO8601 duration specification formats and returns a dictionary of time components (as integers). Accepted formats are: * ``PnYnMnDTnHnMnS`` Note: n is positive integer! Floats are NOT supported....
def function[parse_duration, parameter[string]]: constant[ Parses duration/period stamp expressed in a subset of ISO8601 duration specification formats and returns a dictionary of time components (as integers). Accepted formats are: * ``PnYnMnDTnHnMnS`` Note: n is positive int...
keyword[def] identifier[parse_duration] ( identifier[string] ): literal[string] identifier[string] = identifier[string] . identifier[replace] ( literal[string] , literal[string] ). identifier[upper] () identifier[match] = identifier[re] . identifier[match] ( literal[string] literal[string...
def parse_duration(string): """ Parses duration/period stamp expressed in a subset of ISO8601 duration specification formats and returns a dictionary of time components (as integers). Accepted formats are: * ``PnYnMnDTnHnMnS`` Note: n is positive integer! Floats are NOT supported....