code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def saveCertPem(self, cert, path): ''' Save a certificate in PEM format to a file outside the certdir. ''' with s_common.genfile(path) as fd: fd.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert))
def function[saveCertPem, parameter[self, cert, path]]: constant[ Save a certificate in PEM format to a file outside the certdir. ] with call[name[s_common].genfile, parameter[name[path]]] begin[:] call[name[fd].write, parameter[call[name[crypto].dump_certificate, paramet...
keyword[def] identifier[saveCertPem] ( identifier[self] , identifier[cert] , identifier[path] ): literal[string] keyword[with] identifier[s_common] . identifier[genfile] ( identifier[path] ) keyword[as] identifier[fd] : identifier[fd] . identifier[write] ( identifier[crypto] . identi...
def saveCertPem(self, cert, path): """ Save a certificate in PEM format to a file outside the certdir. """ with s_common.genfile(path) as fd: fd.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert)) # depends on [control=['with'], data=['fd']]
def DbGetHostList(self, argin): """ Get host list with name matching the specified filter :param argin: The filter :type: tango.DevString :return: Host name list :rtype: tango.DevVarStringArray """ self._log.debug("In DbGetHostList()") argin = replace_wildcard(ar...
def function[DbGetHostList, parameter[self, argin]]: constant[ Get host list with name matching the specified filter :param argin: The filter :type: tango.DevString :return: Host name list :rtype: tango.DevVarStringArray ] call[name[self]._log.debug, parameter[constant[I...
keyword[def] identifier[DbGetHostList] ( identifier[self] , identifier[argin] ): literal[string] identifier[self] . identifier[_log] . identifier[debug] ( literal[string] ) identifier[argin] = identifier[replace_wildcard] ( identifier[argin] ) keyword[return] identifier[self] . i...
def DbGetHostList(self, argin): """ Get host list with name matching the specified filter :param argin: The filter :type: tango.DevString :return: Host name list :rtype: tango.DevVarStringArray """ self._log.debug('In DbGetHostList()') argin = replace_wildcard(argin) ret...
def get_nameserver_detail_output_show_nameserver_nameserver_real(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_nameserver_detail = ET.Element("get_nameserver_detail") config = get_nameserver_detail output = ET.SubElement(get_nameserver_deta...
def function[get_nameserver_detail_output_show_nameserver_nameserver_real, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[get_nameserver_detail] assign[=] call[name[ET].Element, parameter[constant[g...
keyword[def] identifier[get_nameserver_detail_output_show_nameserver_nameserver_real] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[get_nameserver_detail] = identifier[ET] . identifier[E...
def get_nameserver_detail_output_show_nameserver_nameserver_real(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') get_nameserver_detail = ET.Element('get_nameserver_detail') config = get_nameserver_detail output = ET.SubElement(get_nameserver_detail, 'output') sh...
def makeSer(segID, N, CA, C, O, geo): '''Creates a Serine residue''' ##R-Group CA_CB_length=geo.CA_CB_length C_CA_CB_angle=geo.C_CA_CB_angle N_C_CA_CB_diangle=geo.N_C_CA_CB_diangle CB_OG_length=geo.CB_OG_length CA_CB_OG_angle=geo.CA_CB_OG_angle N_CA_CB_OG_diangle=geo.N_CA_CB_OG_diangle ...
def function[makeSer, parameter[segID, N, CA, C, O, geo]]: constant[Creates a Serine residue] variable[CA_CB_length] assign[=] name[geo].CA_CB_length variable[C_CA_CB_angle] assign[=] name[geo].C_CA_CB_angle variable[N_C_CA_CB_diangle] assign[=] name[geo].N_C_CA_CB_diangle variab...
keyword[def] identifier[makeSer] ( identifier[segID] , identifier[N] , identifier[CA] , identifier[C] , identifier[O] , identifier[geo] ): literal[string] identifier[CA_CB_length] = identifier[geo] . identifier[CA_CB_length] identifier[C_CA_CB_angle] = identifier[geo] . identifier[C_CA_CB_angle]...
def makeSer(segID, N, CA, C, O, geo): """Creates a Serine residue""" ##R-Group CA_CB_length = geo.CA_CB_length C_CA_CB_angle = geo.C_CA_CB_angle N_C_CA_CB_diangle = geo.N_C_CA_CB_diangle CB_OG_length = geo.CB_OG_length CA_CB_OG_angle = geo.CA_CB_OG_angle N_CA_CB_OG_diangle = geo.N_CA_CB_...
def operation_recorder_stage_result(self, ret, exc): """ **Experimental:** Low-level method used by the operation-specific methods of this class. *New in pywbem 0.9 as experimental.* It forwards the operation results including exceptions that were raised, to all recorde...
def function[operation_recorder_stage_result, parameter[self, ret, exc]]: constant[ **Experimental:** Low-level method used by the operation-specific methods of this class. *New in pywbem 0.9 as experimental.* It forwards the operation results including exceptions that were ...
keyword[def] identifier[operation_recorder_stage_result] ( identifier[self] , identifier[ret] , identifier[exc] ): literal[string] keyword[for] identifier[recorder] keyword[in] identifier[self] . identifier[_operation_recorders] : identifier[recorder] . identifier[stage_pywbem_resul...
def operation_recorder_stage_result(self, ret, exc): """ **Experimental:** Low-level method used by the operation-specific methods of this class. *New in pywbem 0.9 as experimental.* It forwards the operation results including exceptions that were raised, to all recorders o...
def angsep(lon1, lat1, lon2, lat2): """ Angular separation (deg) between two sky coordinates. Borrowed from astropy (www.astropy.org) Notes ----- The angular separation is calculated using the Vincenty formula [1], which is slighly more complex and computationally expensive than some alt...
def function[angsep, parameter[lon1, lat1, lon2, lat2]]: constant[ Angular separation (deg) between two sky coordinates. Borrowed from astropy (www.astropy.org) Notes ----- The angular separation is calculated using the Vincenty formula [1], which is slighly more complex and computationa...
keyword[def] identifier[angsep] ( identifier[lon1] , identifier[lat1] , identifier[lon2] , identifier[lat2] ): literal[string] identifier[lon1] , identifier[lat1] = identifier[np] . identifier[radians] ([ identifier[lon1] , identifier[lat1] ]) identifier[lon2] , identifier[lat2] = identifier[np] . ide...
def angsep(lon1, lat1, lon2, lat2): """ Angular separation (deg) between two sky coordinates. Borrowed from astropy (www.astropy.org) Notes ----- The angular separation is calculated using the Vincenty formula [1], which is slighly more complex and computationally expensive than some alt...
def init_app(self, app): """Initialize Flask application.""" if self.module: app.config.from_object(self.module)
def function[init_app, parameter[self, app]]: constant[Initialize Flask application.] if name[self].module begin[:] call[name[app].config.from_object, parameter[name[self].module]]
keyword[def] identifier[init_app] ( identifier[self] , identifier[app] ): literal[string] keyword[if] identifier[self] . identifier[module] : identifier[app] . identifier[config] . identifier[from_object] ( identifier[self] . identifier[module] )
def init_app(self, app): """Initialize Flask application.""" if self.module: app.config.from_object(self.module) # depends on [control=['if'], data=[]]
def __clear_bp(self, aThread): """ Clears this breakpoint from the debug registers. @type aThread: L{Thread} @param aThread: Thread object. """ if self.__slot is not None: aThread.suspend() try: ctx = aThread.get_context(win32.CON...
def function[__clear_bp, parameter[self, aThread]]: constant[ Clears this breakpoint from the debug registers. @type aThread: L{Thread} @param aThread: Thread object. ] if compare[name[self].__slot is_not constant[None]] begin[:] call[name[aThread].suspe...
keyword[def] identifier[__clear_bp] ( identifier[self] , identifier[aThread] ): literal[string] keyword[if] identifier[self] . identifier[__slot] keyword[is] keyword[not] keyword[None] : identifier[aThread] . identifier[suspend] () keyword[try] : ident...
def __clear_bp(self, aThread): """ Clears this breakpoint from the debug registers. @type aThread: L{Thread} @param aThread: Thread object. """ if self.__slot is not None: aThread.suspend() try: ctx = aThread.get_context(win32.CONTEXT_DEBUG_REGISTERS...
def setup(self): """Method runs the plugin""" if self.dry_run is not True: self.client = self._get_client() self._disable_access_key()
def function[setup, parameter[self]]: constant[Method runs the plugin] if compare[name[self].dry_run is_not constant[True]] begin[:] name[self].client assign[=] call[name[self]._get_client, parameter[]] call[name[self]._disable_access_key, parameter[]]
keyword[def] identifier[setup] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[dry_run] keyword[is] keyword[not] keyword[True] : identifier[self] . identifier[client] = identifier[self] . identifier[_get_client] () identifier[self] . ide...
def setup(self): """Method runs the plugin""" if self.dry_run is not True: self.client = self._get_client() self._disable_access_key() # depends on [control=['if'], data=[]]
def _set_enum_list_local_type(self, specifications): """ This method is needed until get_type_name() is enhanced to include specification subtype and local_name """ for rest_name, specification in specifications.items(): for attribute in specification.attributes: if a...
def function[_set_enum_list_local_type, parameter[self, specifications]]: constant[ This method is needed until get_type_name() is enhanced to include specification subtype and local_name ] for taget[tuple[[<ast.Name object at 0x7da1b04080d0>, <ast.Name object at 0x7da1b0408a60>]]] in starred[ca...
keyword[def] identifier[_set_enum_list_local_type] ( identifier[self] , identifier[specifications] ): literal[string] keyword[for] identifier[rest_name] , identifier[specification] keyword[in] identifier[specifications] . identifier[items] (): keyword[for] identifier[attribute] ke...
def _set_enum_list_local_type(self, specifications): """ This method is needed until get_type_name() is enhanced to include specification subtype and local_name """ for (rest_name, specification) in specifications.items(): for attribute in specification.attributes: if attribute.type ...
def group(self, indent: int = DEFAULT_INDENT, add_line: bool = True) -> _TextGroup: """ Returns a context manager which adds an indentation before each line. :param indent: Number of spaces to print. :param add_line: If True, a new line will be printed after the group. :return: ...
def function[group, parameter[self, indent, add_line]]: constant[ Returns a context manager which adds an indentation before each line. :param indent: Number of spaces to print. :param add_line: If True, a new line will be printed after the group. :return: A TextGroup context ma...
keyword[def] identifier[group] ( identifier[self] , identifier[indent] : identifier[int] = identifier[DEFAULT_INDENT] , identifier[add_line] : identifier[bool] = keyword[True] )-> identifier[_TextGroup] : literal[string] keyword[return] identifier[_TextGroup] ( identifier[self] , identifier[indent...
def group(self, indent: int=DEFAULT_INDENT, add_line: bool=True) -> _TextGroup: """ Returns a context manager which adds an indentation before each line. :param indent: Number of spaces to print. :param add_line: If True, a new line will be printed after the group. :return: A TextGr...
def _tasks_to_reinsert(tasks, transactional): """Return a list containing the tasks that should be reinserted based on the was_enqueued property and whether the insert is transactional or not. """ if transactional: return tasks return [task for task in tasks if not task.was_enqueued]
def function[_tasks_to_reinsert, parameter[tasks, transactional]]: constant[Return a list containing the tasks that should be reinserted based on the was_enqueued property and whether the insert is transactional or not. ] if name[transactional] begin[:] return[name[tasks]] return[<as...
keyword[def] identifier[_tasks_to_reinsert] ( identifier[tasks] , identifier[transactional] ): literal[string] keyword[if] identifier[transactional] : keyword[return] identifier[tasks] keyword[return] [ identifier[task] keyword[for] identifier[task] keyword[in] identifier[tasks] keyw...
def _tasks_to_reinsert(tasks, transactional): """Return a list containing the tasks that should be reinserted based on the was_enqueued property and whether the insert is transactional or not. """ if transactional: return tasks # depends on [control=['if'], data=[]] return [task for task in...
def items(self): """Get an iter of VenvDirs and VenvFiles within the directory.""" contents = self.paths contents = ( VenvFile(path.path) if path.is_file else VenvDir(path.path) for path in contents ) return contents
def function[items, parameter[self]]: constant[Get an iter of VenvDirs and VenvFiles within the directory.] variable[contents] assign[=] name[self].paths variable[contents] assign[=] <ast.GeneratorExp object at 0x7da2044c1870> return[name[contents]]
keyword[def] identifier[items] ( identifier[self] ): literal[string] identifier[contents] = identifier[self] . identifier[paths] identifier[contents] =( identifier[VenvFile] ( identifier[path] . identifier[path] ) keyword[if] identifier[path] . identifier[is_file] keyword[else]...
def items(self): """Get an iter of VenvDirs and VenvFiles within the directory.""" contents = self.paths contents = (VenvFile(path.path) if path.is_file else VenvDir(path.path) for path in contents) return contents
def import_json(): ''' Import a json module, starting with the quick ones and going down the list) ''' for fast_json in ('ujson', 'yajl', 'json'): try: mod = __import__(fast_json) log.trace('loaded %s json lib', fast_json) return mod except ImportError...
def function[import_json, parameter[]]: constant[ Import a json module, starting with the quick ones and going down the list) ] for taget[name[fast_json]] in starred[tuple[[<ast.Constant object at 0x7da18ede7f70>, <ast.Constant object at 0x7da18ede7bb0>, <ast.Constant object at 0x7da18ede5390>]]...
keyword[def] identifier[import_json] (): literal[string] keyword[for] identifier[fast_json] keyword[in] ( literal[string] , literal[string] , literal[string] ): keyword[try] : identifier[mod] = identifier[__import__] ( identifier[fast_json] ) identifier[log] . identifie...
def import_json(): """ Import a json module, starting with the quick ones and going down the list) """ for fast_json in ('ujson', 'yajl', 'json'): try: mod = __import__(fast_json) log.trace('loaded %s json lib', fast_json) return mod # depends on [control=['t...
def get_voltage(self, channel, unit='V'): '''Reading voltage ''' adc_ch = self._ch_map[channel]['ADCV']['adc_ch'] address = self._ch_map[channel]['ADCV']['address'] raw = self._get_adc_value(address=address)[adc_ch] dac_offset = self._ch_cal[channel]['ADCV']['offset'] ...
def function[get_voltage, parameter[self, channel, unit]]: constant[Reading voltage ] variable[adc_ch] assign[=] call[call[call[name[self]._ch_map][name[channel]]][constant[ADCV]]][constant[adc_ch]] variable[address] assign[=] call[call[call[name[self]._ch_map][name[channel]]][constant[A...
keyword[def] identifier[get_voltage] ( identifier[self] , identifier[channel] , identifier[unit] = literal[string] ): literal[string] identifier[adc_ch] = identifier[self] . identifier[_ch_map] [ identifier[channel] ][ literal[string] ][ literal[string] ] identifier[address] = identifier[s...
def get_voltage(self, channel, unit='V'): """Reading voltage """ adc_ch = self._ch_map[channel]['ADCV']['adc_ch'] address = self._ch_map[channel]['ADCV']['address'] raw = self._get_adc_value(address=address)[adc_ch] dac_offset = self._ch_cal[channel]['ADCV']['offset'] dac_gain = self._ch...
def set_parameters(self): """Setup all the parameters for the binaries to be evaluated. Grid values and store necessary parameters for input into the SNR function. """ # declare 1D arrays of both paramters if self.xscale != 'lin': self.xvals = np.logspace(np.log10(...
def function[set_parameters, parameter[self]]: constant[Setup all the parameters for the binaries to be evaluated. Grid values and store necessary parameters for input into the SNR function. ] if compare[name[self].xscale not_equal[!=] constant[lin]] begin[:] name[self]...
keyword[def] identifier[set_parameters] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[xscale] != literal[string] : identifier[self] . identifier[xvals] = identifier[np] . identifier[logspace] ( identifier[np] . identifier[log10] ( identifier...
def set_parameters(self): """Setup all the parameters for the binaries to be evaluated. Grid values and store necessary parameters for input into the SNR function. """ # declare 1D arrays of both paramters if self.xscale != 'lin': self.xvals = np.logspace(np.log10(float(self.x_low)...
def popitem(self): """Remove and return an arbitrary ``(key, value)`` pair from the dictionary. :func:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :func:`popitem` raises a :exc:`KeyEr...
def function[popitem, parameter[self]]: constant[Remove and return an arbitrary ``(key, value)`` pair from the dictionary. :func:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :func:`popitem` r...
keyword[def] identifier[popitem] ( identifier[self] ): literal[string] keyword[def] identifier[popitem_trans] ( identifier[pipe] ): keyword[try] : identifier[pickled_key] = identifier[pipe] . identifier[hkeys] ( identifier[self] . identifier[key] )[ literal[int] ] ...
def popitem(self): """Remove and return an arbitrary ``(key, value)`` pair from the dictionary. :func:`popitem` is useful to destructively iterate over a dictionary, as often used in set algorithms. If the dictionary is empty, calling :func:`popitem` raises a :exc:`KeyError`...
def setup_lookup(apps, lookup_class=TemplateLookup): """ Registering template directories of apps to Lookup. Lookups will be set up as dictionary, app name as key and lookup for this app will be it's value. Each lookups is correspond to each template directories of apps._lookups. The directory shou...
def function[setup_lookup, parameter[apps, lookup_class]]: constant[ Registering template directories of apps to Lookup. Lookups will be set up as dictionary, app name as key and lookup for this app will be it's value. Each lookups is correspond to each template directories of apps._lookups. Th...
keyword[def] identifier[setup_lookup] ( identifier[apps] , identifier[lookup_class] = identifier[TemplateLookup] ): literal[string] keyword[global] identifier[_lookups] identifier[_lookups] ={} keyword[for] identifier[app] keyword[in] identifier[apps] : identifier[app_template_dir]...
def setup_lookup(apps, lookup_class=TemplateLookup): """ Registering template directories of apps to Lookup. Lookups will be set up as dictionary, app name as key and lookup for this app will be it's value. Each lookups is correspond to each template directories of apps._lookups. The directory shou...
def hide_virtual_ip_holder_chassis_virtual_ip(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") hide_virtual_ip_holder = ET.SubElement(config, "hide-virtual-ip-holder", xmlns="urn:brocade.com:mgmt:brocade-chassis") chassis = ET.SubElement(hide_virtual_ip_h...
def function[hide_virtual_ip_holder_chassis_virtual_ip, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[hide_virtual_ip_holder] assign[=] call[name[ET].SubElement, parameter[name[config], constant[hi...
keyword[def] identifier[hide_virtual_ip_holder_chassis_virtual_ip] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[hide_virtual_ip_holder] = identifier[ET] . identifier[SubElement] ( ident...
def hide_virtual_ip_holder_chassis_virtual_ip(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') hide_virtual_ip_holder = ET.SubElement(config, 'hide-virtual-ip-holder', xmlns='urn:brocade.com:mgmt:brocade-chassis') chassis = ET.SubElement(hide_virtual_ip_holder, 'chassis'...
def add_connection(self, addr, **kwargs): """Add an agent with given address to current :attr:`connections` with given information. Does nothing if address is already in :attr:`connections`. Given ``**kwargs`` are stored as key-value pairs to ``connections[addr]`` dictionary. ...
def function[add_connection, parameter[self, addr]]: constant[Add an agent with given address to current :attr:`connections` with given information. Does nothing if address is already in :attr:`connections`. Given ``**kwargs`` are stored as key-value pairs to ``connections[addr]`` ...
keyword[def] identifier[add_connection] ( identifier[self] , identifier[addr] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[addr] keyword[not] keyword[in] identifier[self] . identifier[_connections] : identifier[self] . identifier[connections] [ identifier[addr] ...
def add_connection(self, addr, **kwargs): """Add an agent with given address to current :attr:`connections` with given information. Does nothing if address is already in :attr:`connections`. Given ``**kwargs`` are stored as key-value pairs to ``connections[addr]`` dictionary. ...
def move_file(source_file_pathname, destination_file_pathname): """ Move the the specified file to another location. If the destination already exists, it is replaced silently. This function is an alternative to ``shutil.move(src, dst)``, which might raise ``OSError`` if the destination already ex...
def function[move_file, parameter[source_file_pathname, destination_file_pathname]]: constant[ Move the the specified file to another location. If the destination already exists, it is replaced silently. This function is an alternative to ``shutil.move(src, dst)``, which might raise ``OSError`...
keyword[def] identifier[move_file] ( identifier[source_file_pathname] , identifier[destination_file_pathname] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[destination_file_pathname] ): identifier[os] . identifier[remove] ( identifier[destinati...
def move_file(source_file_pathname, destination_file_pathname): """ Move the the specified file to another location. If the destination already exists, it is replaced silently. This function is an alternative to ``shutil.move(src, dst)``, which might raise ``OSError`` if the destination already ex...
def match_score(self, supported: 'Language') -> int: """ Suppose that `self` is the language that the user desires, and `supported` is a language that is actually supported. This method returns a number from 0 to 100 indicating how similar the supported language is (higher number...
def function[match_score, parameter[self, supported]]: constant[ Suppose that `self` is the language that the user desires, and `supported` is a language that is actually supported. This method returns a number from 0 to 100 indicating how similar the supported language is (highe...
keyword[def] identifier[match_score] ( identifier[self] , identifier[supported] : literal[string] )-> identifier[int] : literal[string] keyword[if] identifier[supported] == identifier[self] : keyword[return] literal[int] identifier[desired_complete] = identifier[self] . id...
def match_score(self, supported: 'Language') -> int: """ Suppose that `self` is the language that the user desires, and `supported` is a language that is actually supported. This method returns a number from 0 to 100 indicating how similar the supported language is (higher numbers ar...
def delete(self, name): ''' Delete all the data in a named timeseries. ''' keys = self._client.keys('%s%s:*'%(self._prefix,name)) pipe = self._client.pipeline(transaction=False) for key in keys: pipe.delete( key ) pipe.execute() # Could be not technically the exact number of keys...
def function[delete, parameter[self, name]]: constant[ Delete all the data in a named timeseries. ] variable[keys] assign[=] call[name[self]._client.keys, parameter[binary_operation[constant[%s%s:*] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x7da1b02e4520>, <ast.Name obj...
keyword[def] identifier[delete] ( identifier[self] , identifier[name] ): literal[string] identifier[keys] = identifier[self] . identifier[_client] . identifier[keys] ( literal[string] %( identifier[self] . identifier[_prefix] , identifier[name] )) identifier[pipe] = identifier[self] . identifier[_cli...
def delete(self, name): """ Delete all the data in a named timeseries. """ keys = self._client.keys('%s%s:*' % (self._prefix, name)) pipe = self._client.pipeline(transaction=False) for key in keys: pipe.delete(key) # depends on [control=['for'], data=['key']] pipe.execute() # Co...
def extract_and_process(path_in, path_out): """Run Eidos on a set of text files and process output with INDRA. The output is produced in the specified output folder but the output files aren't processed by this function. Parameters ---------- path_in : str Path to an input folder with ...
def function[extract_and_process, parameter[path_in, path_out]]: constant[Run Eidos on a set of text files and process output with INDRA. The output is produced in the specified output folder but the output files aren't processed by this function. Parameters ---------- path_in : str ...
keyword[def] identifier[extract_and_process] ( identifier[path_in] , identifier[path_out] ): literal[string] identifier[path_in] = identifier[os] . identifier[path] . identifier[realpath] ( identifier[os] . identifier[path] . identifier[expanduser] ( identifier[path_in] )) identifier[path_out] = ident...
def extract_and_process(path_in, path_out): """Run Eidos on a set of text files and process output with INDRA. The output is produced in the specified output folder but the output files aren't processed by this function. Parameters ---------- path_in : str Path to an input folder with ...
def set_config_file(self, path): """ Set the config file. The contents must be valid YAML and there must be a top-level element 'tasks'. The listed tasks will be started according to their configuration, and the file will be watched for future changes. The changes will be acti...
def function[set_config_file, parameter[self, path]]: constant[ Set the config file. The contents must be valid YAML and there must be a top-level element 'tasks'. The listed tasks will be started according to their configuration, and the file will be watched for future changes...
keyword[def] identifier[set_config_file] ( identifier[self] , identifier[path] ): literal[string] identifier[log] = identifier[self] . identifier[_params] . identifier[get] ( literal[string] , identifier[self] . identifier[_discard] ) keyword[if] identifier[path] != identifier[self] . ide...
def set_config_file(self, path): """ Set the config file. The contents must be valid YAML and there must be a top-level element 'tasks'. The listed tasks will be started according to their configuration, and the file will be watched for future changes. The changes will be activate...
def _input_to_dict(i, records, remapped=None): """Convert CWL input into dictionary required for a cwl2wdl Input object. """ if not remapped: remapped = {} var_type, records = _to_variable_type(i["type"], records) if var_type.startswith("Array") and "inputBinding" in i.get("type", {}): ib = ...
def function[_input_to_dict, parameter[i, records, remapped]]: constant[Convert CWL input into dictionary required for a cwl2wdl Input object. ] if <ast.UnaryOp object at 0x7da1b19d9720> begin[:] variable[remapped] assign[=] dictionary[[], []] <ast.Tuple object at 0x7da1b19d8...
keyword[def] identifier[_input_to_dict] ( identifier[i] , identifier[records] , identifier[remapped] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[remapped] : identifier[remapped] ={} identifier[var_type] , identifier[records] = identifier[_to_variable_type] ( identifier[i] ...
def _input_to_dict(i, records, remapped=None): """Convert CWL input into dictionary required for a cwl2wdl Input object. """ if not remapped: remapped = {} # depends on [control=['if'], data=[]] (var_type, records) = _to_variable_type(i['type'], records) if var_type.startswith('Array') and ...
def r_date_num(obj, multiple=False): """Read date-value table.""" if isinstance(obj, (list, tuple)): it = iter else: it = LinesIterator if multiple: datasets = {} for line in it(obj): label = line[2] if label not in datasets: datase...
def function[r_date_num, parameter[obj, multiple]]: constant[Read date-value table.] if call[name[isinstance], parameter[name[obj], tuple[[<ast.Name object at 0x7da207f00c70>, <ast.Name object at 0x7da207f03610>]]]] begin[:] variable[it] assign[=] name[iter] if name[multiple] beg...
keyword[def] identifier[r_date_num] ( identifier[obj] , identifier[multiple] = keyword[False] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] ,( identifier[list] , identifier[tuple] )): identifier[it] = identifier[iter] keyword[else] : identifier[it] = ident...
def r_date_num(obj, multiple=False): """Read date-value table.""" if isinstance(obj, (list, tuple)): it = iter # depends on [control=['if'], data=[]] else: it = LinesIterator if multiple: datasets = {} for line in it(obj): label = line[2] if label...
def memory_objects_for_hash(self, n): """ Returns a set of :class:`SimMemoryObjects` that contain expressions that contain a variable with the hash `h`. """ return set([self[i] for i in self.addrs_for_hash(n)])
def function[memory_objects_for_hash, parameter[self, n]]: constant[ Returns a set of :class:`SimMemoryObjects` that contain expressions that contain a variable with the hash `h`. ] return[call[name[set], parameter[<ast.ListComp object at 0x7da18c4cdae0>]]]
keyword[def] identifier[memory_objects_for_hash] ( identifier[self] , identifier[n] ): literal[string] keyword[return] identifier[set] ([ identifier[self] [ identifier[i] ] keyword[for] identifier[i] keyword[in] identifier[self] . identifier[addrs_for_hash] ( identifier[n] )])
def memory_objects_for_hash(self, n): """ Returns a set of :class:`SimMemoryObjects` that contain expressions that contain a variable with the hash `h`. """ return set([self[i] for i in self.addrs_for_hash(n)])
def ip_address(address): """Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An...
def function[ip_address, parameter[address]]: constant[Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by de...
keyword[def] identifier[ip_address] ( identifier[address] ): literal[string] keyword[try] : keyword[return] identifier[IPv4Address] ( identifier[address] ) keyword[except] ( identifier[AddressValueError] , identifier[NetmaskValueError] ): keyword[pass] keyword[try] : ...
def ip_address(address): """Take an IP string/int and return an object of the correct type. Args: address: A string or integer, the IP address. Either IPv4 or IPv6 addresses may be supplied; integers less than 2**32 will be considered to be IPv4 by default. Returns: An...
def department_delete(self, department_id, **kwargs): "https://developer.zendesk.com/rest_api/docs/chat/departments#delete-department-by-id" api_path = "/api/v2/departments/{department_id}" api_path = api_path.format(department_id=department_id) return self.call(api_path, method="DELETE"...
def function[department_delete, parameter[self, department_id]]: constant[https://developer.zendesk.com/rest_api/docs/chat/departments#delete-department-by-id] variable[api_path] assign[=] constant[/api/v2/departments/{department_id}] variable[api_path] assign[=] call[name[api_path].format, para...
keyword[def] identifier[department_delete] ( identifier[self] , identifier[department_id] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_path] = identifier[api_path] . identifier[format] ( identifier[department_id] = identifier[department_i...
def department_delete(self, department_id, **kwargs): """https://developer.zendesk.com/rest_api/docs/chat/departments#delete-department-by-id""" api_path = '/api/v2/departments/{department_id}' api_path = api_path.format(department_id=department_id) return self.call(api_path, method='DELETE', **kwargs)
def get_active_terms_ids(): """Returns a list of the IDs of of all terms and conditions""" active_terms_ids = cache.get('tandc.active_terms_ids') if active_terms_ids is None: active_terms_dict = {} active_terms_ids = [] active_terms_set = TermsAndConditions....
def function[get_active_terms_ids, parameter[]]: constant[Returns a list of the IDs of of all terms and conditions] variable[active_terms_ids] assign[=] call[name[cache].get, parameter[constant[tandc.active_terms_ids]]] if compare[name[active_terms_ids] is constant[None]] begin[:] ...
keyword[def] identifier[get_active_terms_ids] (): literal[string] identifier[active_terms_ids] = identifier[cache] . identifier[get] ( literal[string] ) keyword[if] identifier[active_terms_ids] keyword[is] keyword[None] : identifier[active_terms_dict] ={} iden...
def get_active_terms_ids(): """Returns a list of the IDs of of all terms and conditions""" active_terms_ids = cache.get('tandc.active_terms_ids') if active_terms_ids is None: active_terms_dict = {} active_terms_ids = [] active_terms_set = TermsAndConditions.objects.filter(date_active...
def getValue(words): """Computes the sum of the values of the words.""" value = 0 for word in words: for letter in word: # shared.getConst will evaluate to the dictionary broadcasted by # the root Future value += shared.getConst('lettersValue')[letter] return ...
def function[getValue, parameter[words]]: constant[Computes the sum of the values of the words.] variable[value] assign[=] constant[0] for taget[name[word]] in starred[name[words]] begin[:] for taget[name[letter]] in starred[name[word]] begin[:] <ast.AugAssign object ...
keyword[def] identifier[getValue] ( identifier[words] ): literal[string] identifier[value] = literal[int] keyword[for] identifier[word] keyword[in] identifier[words] : keyword[for] identifier[letter] keyword[in] identifier[word] : identifier[value] += ide...
def getValue(words): """Computes the sum of the values of the words.""" value = 0 for word in words: for letter in word: # shared.getConst will evaluate to the dictionary broadcasted by # the root Future value += shared.getConst('lettersValue')[letter] # depends ...
def _rnd_datetime(self, start, end): """Internal random datetime generator. """ return self.from_utctimestamp( random.randint( int(self.to_utctimestamp(start)), int(self.to_utctimestamp(end)), ) )
def function[_rnd_datetime, parameter[self, start, end]]: constant[Internal random datetime generator. ] return[call[name[self].from_utctimestamp, parameter[call[name[random].randint, parameter[call[name[int], parameter[call[name[self].to_utctimestamp, parameter[name[start]]]]], call[name[int], para...
keyword[def] identifier[_rnd_datetime] ( identifier[self] , identifier[start] , identifier[end] ): literal[string] keyword[return] identifier[self] . identifier[from_utctimestamp] ( identifier[random] . identifier[randint] ( identifier[int] ( identifier[self] . identifier[to_utct...
def _rnd_datetime(self, start, end): """Internal random datetime generator. """ return self.from_utctimestamp(random.randint(int(self.to_utctimestamp(start)), int(self.to_utctimestamp(end))))
def median(self, **kwargs): """ Compute median of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex """ try: return self._cython_agg_general('median', **kwargs) except GroupByError: raise excep...
def function[median, parameter[self]]: constant[ Compute median of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex ] <ast.Try object at 0x7da1b2068bb0>
keyword[def] identifier[median] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[_cython_agg_general] ( literal[string] ,** identifier[kwargs] ) keyword[except] identifier[GroupByError] : k...
def median(self, **kwargs): """ Compute median of groups, excluding missing values. For multiple groupings, the result index will be a MultiIndex """ try: return self._cython_agg_general('median', **kwargs) # depends on [control=['try'], data=[]] except GroupByError: ...
def _is_valid_dataset(config_value): '''Datasets must be of form "project.dataset" or "dataset" ''' return re.match( # regex matches: project.table -- OR -- table r'^' + RE_PROJECT + r'\.' + RE_DS_TABLE + r'$|^' + RE_DS_TABLE + r'$', config_value, )
def function[_is_valid_dataset, parameter[config_value]]: constant[Datasets must be of form "project.dataset" or "dataset" ] return[call[name[re].match, parameter[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[binary_operation[constant[^] + name[RE_PROJECT]] + const...
keyword[def] identifier[_is_valid_dataset] ( identifier[config_value] ): literal[string] keyword[return] identifier[re] . identifier[match] ( literal[string] + identifier[RE_PROJECT] + literal[string] + identifier[RE_DS_TABLE] + literal[string] + identifier[RE_DS_TABLE] + literal[string] , ...
def _is_valid_dataset(config_value): """Datasets must be of form "project.dataset" or "dataset" """ # regex matches: project.table -- OR -- table return re.match('^' + RE_PROJECT + '\\.' + RE_DS_TABLE + '$|^' + RE_DS_TABLE + '$', config_value)
def load(overlay, path=""): """ load - Load a DTB Overlay Inputs: overlay - Overlay Key: SPI2, PWM0, CUST path - Full Path to where the custom overlay is stored Returns: 0 - Successful Load 1 - Unsuccessful Load 2 - Overlay was previously set """ global DEBU...
def function[load, parameter[overlay, path]]: constant[ load - Load a DTB Overlay Inputs: overlay - Overlay Key: SPI2, PWM0, CUST path - Full Path to where the custom overlay is stored Returns: 0 - Successful Load 1 - Unsuccessful Load 2 - Overlay was previously...
keyword[def] identifier[load] ( identifier[overlay] , identifier[path] = literal[string] ): literal[string] keyword[global] identifier[DEBUG] keyword[global] identifier[_LOADED] keyword[if] identifier[DEBUG] : identifier[print] ( literal[string] . identifier[format] ( identifier[ove...
def load(overlay, path=''): """ load - Load a DTB Overlay Inputs: overlay - Overlay Key: SPI2, PWM0, CUST path - Full Path to where the custom overlay is stored Returns: 0 - Successful Load 1 - Unsuccessful Load 2 - Overlay was previously set """ global DEBU...
def sens_from_spec(spec, labels, scores, *args, **kwargs): r"""Find the sensitivity that corresponds to the indicated specificity (ROC function) sensitivity = Num_True_Positive / (Num_True_Postive + Num_False_Negative) specificity = Num_True_Negative / (Num_True_Negative + Num_False_Positive) """ th...
def function[sens_from_spec, parameter[spec, labels, scores]]: constant[Find the sensitivity that corresponds to the indicated specificity (ROC function) sensitivity = Num_True_Positive / (Num_True_Postive + Num_False_Negative) specificity = Num_True_Negative / (Num_True_Negative + Num_False_Positive) ...
keyword[def] identifier[sens_from_spec] ( identifier[spec] , identifier[labels] , identifier[scores] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[thresh] = identifier[thresh_from_spec] ( identifier[spec] , identifier[labels] , identifier[scores] ) identifier[df] = identifie...
def sens_from_spec(spec, labels, scores, *args, **kwargs): """Find the sensitivity that corresponds to the indicated specificity (ROC function) sensitivity = Num_True_Positive / (Num_True_Postive + Num_False_Negative) specificity = Num_True_Negative / (Num_True_Negative + Num_False_Positive) """ thr...
def cmd_show(docid): """ Arguments: <doc_id> Show document information (but not its content, see 'dump'). See 'search' for the document id. Possible JSON replies: -- { "status": "error", "exception": "yyy", "reason": "xxxx", "args": "(xxxx, )" } ...
def function[cmd_show, parameter[docid]]: constant[ Arguments: <doc_id> Show document information (but not its content, see 'dump'). See 'search' for the document id. Possible JSON replies: -- { "status": "error", "exception": "yyy", "reason": "xxxx", "a...
keyword[def] identifier[cmd_show] ( identifier[docid] ): literal[string] identifier[dsearch] = identifier[get_docsearch] () identifier[doc] = identifier[dsearch] . identifier[get] ( identifier[docid] ) identifier[r] ={ literal[string] : identifier[str] ( identifier[type] ( identifier[doc] ))...
def cmd_show(docid): """ Arguments: <doc_id> Show document information (but not its content, see 'dump'). See 'search' for the document id. Possible JSON replies: -- { "status": "error", "exception": "yyy", "reason": "xxxx", "args": "(xxxx, )" } ...
def sample_N(a, N): """ When size of N is >= size of a, random.sample() will emit an error: ValueError: sample larger than population This method handles such restrictions by repeatedly sampling when that happens. Examples: >>> sample_N([1, 2, 3], 2) >>> sample_N([1, 2, 3], 3) >>> samp...
def function[sample_N, parameter[a, N]]: constant[ When size of N is >= size of a, random.sample() will emit an error: ValueError: sample larger than population This method handles such restrictions by repeatedly sampling when that happens. Examples: >>> sample_N([1, 2, 3], 2) >>> samp...
keyword[def] identifier[sample_N] ( identifier[a] , identifier[N] ): literal[string] keyword[import] identifier[random] keyword[if] identifier[N] < identifier[len] ( identifier[a] ): keyword[return] identifier[random] . identifier[sample] ( identifier[a] , identifier[N] ) keyword[r...
def sample_N(a, N): """ When size of N is >= size of a, random.sample() will emit an error: ValueError: sample larger than population This method handles such restrictions by repeatedly sampling when that happens. Examples: >>> sample_N([1, 2, 3], 2) >>> sample_N([1, 2, 3], 3) >>> samp...
def search_packages_info(query): """ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. """ installed = {} for p in pkg_re...
def function[search_packages_info, parameter[query]]: constant[ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. ] v...
keyword[def] identifier[search_packages_info] ( identifier[query] ): literal[string] identifier[installed] ={} keyword[for] identifier[p] keyword[in] identifier[pkg_resources] . identifier[working_set] : identifier[installed] [ identifier[canonicalize_name] ( identifier[p] . identifier[pro...
def search_packages_info(query): """ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. """ installed = {} for p in pkg_re...
def sync(self): """ Send and fetch all outstanding messages. :return: 2-tuple of number of detail messages and number of summary messages fetched """ self.send() detail_count = summary_count = 0 while self.responses: response = self.responses[0] w...
def function[sync, parameter[self]]: constant[ Send and fetch all outstanding messages. :return: 2-tuple of number of detail messages and number of summary messages fetched ] call[name[self].send, parameter[]] variable[detail_count] assign[=] constant[0] while name[self]...
keyword[def] identifier[sync] ( identifier[self] ): literal[string] identifier[self] . identifier[send] () identifier[detail_count] = identifier[summary_count] = literal[int] keyword[while] identifier[self] . identifier[responses] : identifier[response] = identifier...
def sync(self): """ Send and fetch all outstanding messages. :return: 2-tuple of number of detail messages and number of summary messages fetched """ self.send() detail_count = summary_count = 0 while self.responses: response = self.responses[0] while not response.comple...
def replay_bundle( self, transaction, depth=3, min_weight_magnitude=None, ): # type: (TransactionHash, int, Optional[int]) -> dict """ Takes a tail transaction hash as input, gets the bundle associated with the transaction and then repl...
def function[replay_bundle, parameter[self, transaction, depth, min_weight_magnitude]]: constant[ Takes a tail transaction hash as input, gets the bundle associated with the transaction and then replays the bundle by attaching it to the Tangle. :param transaction: Tr...
keyword[def] identifier[replay_bundle] ( identifier[self] , identifier[transaction] , identifier[depth] = literal[int] , identifier[min_weight_magnitude] = keyword[None] , ): literal[string] keyword[if] identifier[min_weight_magnitude] keyword[is] keyword[None] : identifier[min...
def replay_bundle(self, transaction, depth=3, min_weight_magnitude=None): # type: (TransactionHash, int, Optional[int]) -> dict "\n Takes a tail transaction hash as input, gets the bundle\n associated with the transaction and then replays the bundle by\n attaching it to the Tangle.\n\n ...
def add_job(): """Adds a new job.""" data = request.get_json(force=True) try: job = current_app.apscheduler.add_job(**data) return jsonify(job) except ConflictingIdError: return jsonify(dict(error_message='Job %s already exists.' % data.get('id')), status=409) except Except...
def function[add_job, parameter[]]: constant[Adds a new job.] variable[data] assign[=] call[name[request].get_json, parameter[]] <ast.Try object at 0x7da18eb569e0>
keyword[def] identifier[add_job] (): literal[string] identifier[data] = identifier[request] . identifier[get_json] ( identifier[force] = keyword[True] ) keyword[try] : identifier[job] = identifier[current_app] . identifier[apscheduler] . identifier[add_job] (** identifier[data] ) k...
def add_job(): """Adds a new job.""" data = request.get_json(force=True) try: job = current_app.apscheduler.add_job(**data) return jsonify(job) # depends on [control=['try'], data=[]] except ConflictingIdError: return jsonify(dict(error_message='Job %s already exists.' % data.ge...
def load(self, options): """ Load the schema objects for the root nodes. - de-references schemas - merge schemas @param options: An options dictionary. @type options: L{options.Options} @return: The merged schema. @rtype: L{Schema} """ ...
def function[load, parameter[self, options]]: constant[ Load the schema objects for the root nodes. - de-references schemas - merge schemas @param options: An options dictionary. @type options: L{options.Options} @return: The merged schema. @rtype:...
keyword[def] identifier[load] ( identifier[self] , identifier[options] ): literal[string] keyword[if] identifier[options] . identifier[autoblend] : identifier[self] . identifier[autoblend] () keyword[for] identifier[child] keyword[in] identifier[self] . identifier[children...
def load(self, options): """ Load the schema objects for the root nodes. - de-references schemas - merge schemas @param options: An options dictionary. @type options: L{options.Options} @return: The merged schema. @rtype: L{Schema} """ if o...
def withdraw(self, amount): """Extends withdraw method to make sure enough funds are in the account, then call withdraw from superclass""" if amount > self.balance: raise ValueError('Insufficient Funds') super().withdraw(amount)
def function[withdraw, parameter[self, amount]]: constant[Extends withdraw method to make sure enough funds are in the account, then call withdraw from superclass] if compare[name[amount] greater[>] name[self].balance] begin[:] <ast.Raise object at 0x7da20c7cb460> call[call[name[super], ...
keyword[def] identifier[withdraw] ( identifier[self] , identifier[amount] ): literal[string] keyword[if] identifier[amount] > identifier[self] . identifier[balance] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[super] (). identifier[withdraw] ( ident...
def withdraw(self, amount): """Extends withdraw method to make sure enough funds are in the account, then call withdraw from superclass""" if amount > self.balance: raise ValueError('Insufficient Funds') # depends on [control=['if'], data=[]] super().withdraw(amount)
def scopes(self, scopes): """Set scopes. :param scopes: The list of scopes. """ validate_scopes(scopes) self._scopes = " ".join(set(scopes)) if scopes else ""
def function[scopes, parameter[self, scopes]]: constant[Set scopes. :param scopes: The list of scopes. ] call[name[validate_scopes], parameter[name[scopes]]] name[self]._scopes assign[=] <ast.IfExp object at 0x7da1b253ee60>
keyword[def] identifier[scopes] ( identifier[self] , identifier[scopes] ): literal[string] identifier[validate_scopes] ( identifier[scopes] ) identifier[self] . identifier[_scopes] = literal[string] . identifier[join] ( identifier[set] ( identifier[scopes] )) keyword[if] identifier[scopes...
def scopes(self, scopes): """Set scopes. :param scopes: The list of scopes. """ validate_scopes(scopes) self._scopes = ' '.join(set(scopes)) if scopes else ''
def getTextWords(page): """Return the text words as a list with the bbox for each word. """ CheckParent(page) dl = page.getDisplayList() tp = dl.getTextPage() l = tp._extractTextWords_AsList() del dl del tp return l
def function[getTextWords, parameter[page]]: constant[Return the text words as a list with the bbox for each word. ] call[name[CheckParent], parameter[name[page]]] variable[dl] assign[=] call[name[page].getDisplayList, parameter[]] variable[tp] assign[=] call[name[dl].getTextPage, pa...
keyword[def] identifier[getTextWords] ( identifier[page] ): literal[string] identifier[CheckParent] ( identifier[page] ) identifier[dl] = identifier[page] . identifier[getDisplayList] () identifier[tp] = identifier[dl] . identifier[getTextPage] () identifier[l] = identifier[tp] . identifier[...
def getTextWords(page): """Return the text words as a list with the bbox for each word. """ CheckParent(page) dl = page.getDisplayList() tp = dl.getTextPage() l = tp._extractTextWords_AsList() del dl del tp return l
def list(self, master=True): """List current reminders. """ params = {} params.update(self.static_params) if master: params.update({ "recurrenceOptions": { "collapseMode": "MASTER_ONLY", }, "includeA...
def function[list, parameter[self, master]]: constant[List current reminders. ] variable[params] assign[=] dictionary[[], []] call[name[params].update, parameter[name[self].static_params]] if name[master] begin[:] call[name[params].update, parameter[dictionary[[<a...
keyword[def] identifier[list] ( identifier[self] , identifier[master] = keyword[True] ): literal[string] identifier[params] ={} identifier[params] . identifier[update] ( identifier[self] . identifier[static_params] ) keyword[if] identifier[master] : identifier[param...
def list(self, master=True): """List current reminders. """ params = {} params.update(self.static_params) if master: params.update({'recurrenceOptions': {'collapseMode': 'MASTER_ONLY'}, 'includeArchived': True, 'includeDeleted': False}) # depends on [control=['if'], data=[]] else: ...
def ovsdb_server_ip_address(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") ovsdb_server = ET.SubElement(config, "ovsdb-server", xmlns="urn:brocade.com:mgmt:brocade-tunnels") name_key = ET.SubElement(ovsdb_server, "name") name_key.text = kwargs.p...
def function[ovsdb_server_ip_address, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[ovsdb_server] assign[=] call[name[ET].SubElement, parameter[name[config], constant[ovsdb-server]]] variab...
keyword[def] identifier[ovsdb_server_ip_address] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[ovsdb_server] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal[stri...
def ovsdb_server_ip_address(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') ovsdb_server = ET.SubElement(config, 'ovsdb-server', xmlns='urn:brocade.com:mgmt:brocade-tunnels') name_key = ET.SubElement(ovsdb_server, 'name') name_key.text = kwargs.pop('name') ip = ...
def fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_tx_disc_unsol_adv(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") fcoe_get_interface = ET.Element("fcoe_get_interface") config = fcoe_get_interface output = ET.SubElement(fcoe_get_interface, ...
def function[fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_tx_disc_unsol_adv, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[fcoe_get_interface] assign[=] call[name[ET].Element, parameter[const...
keyword[def] identifier[fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_tx_disc_unsol_adv] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[fcoe_get_interface] = identifier[ET] . identif...
def fcoe_get_interface_output_fcoe_intf_list_fcoe_intf_tx_disc_unsol_adv(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') fcoe_get_interface = ET.Element('fcoe_get_interface') config = fcoe_get_interface output = ET.SubElement(fcoe_get_interface, 'output') fcoe_i...
def add_contact(self, contact_id, scope='contact/invite'): """ Add a contact contact_id can either be the mxit ID of a service or a Mxit user User authentication required with the following scope: 'contact/invite' """ return _put( token=self.oauth.get_user_tok...
def function[add_contact, parameter[self, contact_id, scope]]: constant[ Add a contact contact_id can either be the mxit ID of a service or a Mxit user User authentication required with the following scope: 'contact/invite' ] return[call[name[_put], parameter[]]]
keyword[def] identifier[add_contact] ( identifier[self] , identifier[contact_id] , identifier[scope] = literal[string] ): literal[string] keyword[return] identifier[_put] ( identifier[token] = identifier[self] . identifier[oauth] . identifier[get_user_token] ( identifier[scope] ), ...
def add_contact(self, contact_id, scope='contact/invite'): """ Add a contact contact_id can either be the mxit ID of a service or a Mxit user User authentication required with the following scope: 'contact/invite' """ return _put(token=self.oauth.get_user_token(scope), uri='/user...
def make_update(cls, table, set_query, where=None): """ Make UPDATE query. :param str table: Table name of executing the query. :param str set_query: SET part of the UPDATE query. :param str where: Add a WHERE clause to execute query, if the value is not ...
def function[make_update, parameter[cls, table, set_query, where]]: constant[ Make UPDATE query. :param str table: Table name of executing the query. :param str set_query: SET part of the UPDATE query. :param str where: Add a WHERE clause to execute query, ...
keyword[def] identifier[make_update] ( identifier[cls] , identifier[table] , identifier[set_query] , identifier[where] = keyword[None] ): literal[string] identifier[validate_table_name] ( identifier[table] ) keyword[if] identifier[typepy] . identifier[is_null_string] ( identifier[set_que...
def make_update(cls, table, set_query, where=None): """ Make UPDATE query. :param str table: Table name of executing the query. :param str set_query: SET part of the UPDATE query. :param str where: Add a WHERE clause to execute query, if the value is not |Non...
def main(input_filename, format): """ Calculate the fingerprint hashses of the referenced audio file and save to disk as a pickle file """ # open the file & convert to wav song_data = AudioSegment.from_file(input_filename, format=format) song_data = song_data.set_channels(1) # convert to m...
def function[main, parameter[input_filename, format]]: constant[ Calculate the fingerprint hashses of the referenced audio file and save to disk as a pickle file ] variable[song_data] assign[=] call[name[AudioSegment].from_file, parameter[name[input_filename]]] variable[song_data] as...
keyword[def] identifier[main] ( identifier[input_filename] , identifier[format] ): literal[string] identifier[song_data] = identifier[AudioSegment] . identifier[from_file] ( identifier[input_filename] , identifier[format] = identifier[format] ) identifier[song_data] = identifier[song_data] . ide...
def main(input_filename, format): """ Calculate the fingerprint hashses of the referenced audio file and save to disk as a pickle file """ # open the file & convert to wav song_data = AudioSegment.from_file(input_filename, format=format) song_data = song_data.set_channels(1) # convert to mo...
def list_healthchecks(self, service_id, version_number): """List all of the healthchecks for a particular service and version.""" content = self._fetch("/service/%s/version/%d/healthcheck" % (service_id, version_number)) return map(lambda x: FastlyHealthCheck(self, x), content)
def function[list_healthchecks, parameter[self, service_id, version_number]]: constant[List all of the healthchecks for a particular service and version.] variable[content] assign[=] call[name[self]._fetch, parameter[binary_operation[constant[/service/%s/version/%d/healthcheck] <ast.Mod object at 0x7da2...
keyword[def] identifier[list_healthchecks] ( identifier[self] , identifier[service_id] , identifier[version_number] ): literal[string] identifier[content] = identifier[self] . identifier[_fetch] ( literal[string] %( identifier[service_id] , identifier[version_number] )) keyword[return] identifier[map] ( ke...
def list_healthchecks(self, service_id, version_number): """List all of the healthchecks for a particular service and version.""" content = self._fetch('/service/%s/version/%d/healthcheck' % (service_id, version_number)) return map(lambda x: FastlyHealthCheck(self, x), content)
def plural_adj(self, text, count=None): """ Return the plural of text, where text is an adjective. If count supplied, then return text if count is one of: 1, a, an, one, each, every, this, that otherwise return the plural. Whitespace at the start and end is preserve...
def function[plural_adj, parameter[self, text, count]]: constant[ Return the plural of text, where text is an adjective. If count supplied, then return text if count is one of: 1, a, an, one, each, every, this, that otherwise return the plural. Whitespace at the sta...
keyword[def] identifier[plural_adj] ( identifier[self] , identifier[text] , identifier[count] = keyword[None] ): literal[string] identifier[pre] , identifier[word] , identifier[post] = identifier[self] . identifier[partition_word] ( identifier[text] ) keyword[if] keyword[not] identifier[...
def plural_adj(self, text, count=None): """ Return the plural of text, where text is an adjective. If count supplied, then return text if count is one of: 1, a, an, one, each, every, this, that otherwise return the plural. Whitespace at the start and end is preserved. ...
def _validate_build_target(self, spec, target): """ Essentially validate that the target is inside the build_dir. """ if not realpath(target).startswith(spec[BUILD_DIR]): raise ValueError('build_target %s is outside build_dir' % target)
def function[_validate_build_target, parameter[self, spec, target]]: constant[ Essentially validate that the target is inside the build_dir. ] if <ast.UnaryOp object at 0x7da1b19b5540> begin[:] <ast.Raise object at 0x7da1b19b68c0>
keyword[def] identifier[_validate_build_target] ( identifier[self] , identifier[spec] , identifier[target] ): literal[string] keyword[if] keyword[not] identifier[realpath] ( identifier[target] ). identifier[startswith] ( identifier[spec] [ identifier[BUILD_DIR] ]): keyword[raise] i...
def _validate_build_target(self, spec, target): """ Essentially validate that the target is inside the build_dir. """ if not realpath(target).startswith(spec[BUILD_DIR]): raise ValueError('build_target %s is outside build_dir' % target) # depends on [control=['if'], data=[]]
def schedule_servicegroup_svc_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_...
def function[schedule_servicegroup_svc_downtime, parameter[self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment]]: constant[Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_SERVICEGROUP_SVC...
keyword[def] identifier[schedule_servicegroup_svc_downtime] ( identifier[self] , identifier[servicegroup] , identifier[start_time] , identifier[end_time] , identifier[fixed] , identifier[trigger_id] , identifier[duration] , identifier[author] , identifier[comment] ): literal[string] keyword[for] ...
def schedule_servicegroup_svc_downtime(self, servicegroup, start_time, end_time, fixed, trigger_id, duration, author, comment): """Schedule a service downtime for each service of a servicegroup Format of the line that triggers function call:: SCHEDULE_SERVICEGROUP_SVC_DOWNTIME;<servicegroup_name>;<...
def prior_names(self): """ get the prior information names Returns ------- prior_names : list a list of prior information names """ return list(self.prior_information.groupby( self.prior_information.index).groups.keys())
def function[prior_names, parameter[self]]: constant[ get the prior information names Returns ------- prior_names : list a list of prior information names ] return[call[name[list], parameter[call[call[name[self].prior_information.groupby, parameter[name[self].pr...
keyword[def] identifier[prior_names] ( identifier[self] ): literal[string] keyword[return] identifier[list] ( identifier[self] . identifier[prior_information] . identifier[groupby] ( identifier[self] . identifier[prior_information] . identifier[index] ). identifier[groups] . identifier[ke...
def prior_names(self): """ get the prior information names Returns ------- prior_names : list a list of prior information names """ return list(self.prior_information.groupby(self.prior_information.index).groups.keys())
def get_frequencies(self, q): """Calculate phonon frequencies at a given q-point Parameters ---------- q: array_like A q-vector. shape=(3,), dtype='double' Returns ------- frequencies: ndarray Phonon frequencies. s...
def function[get_frequencies, parameter[self, q]]: constant[Calculate phonon frequencies at a given q-point Parameters ---------- q: array_like A q-vector. shape=(3,), dtype='double' Returns ------- frequencies: ndarray Phonon...
keyword[def] identifier[get_frequencies] ( identifier[self] , identifier[q] ): literal[string] identifier[self] . identifier[_set_dynamical_matrix] () keyword[if] identifier[self] . identifier[_dynamical_matrix] keyword[is] keyword[None] : identifier[msg] =( literal[string]...
def get_frequencies(self, q): """Calculate phonon frequencies at a given q-point Parameters ---------- q: array_like A q-vector. shape=(3,), dtype='double' Returns ------- frequencies: ndarray Phonon frequencies. shape...
def _on_connection(self, data, unique_id): """Called on collection operation :param data: Received data """ if unique_id is None: unique_id = self.stream_unique_id self.connection_id = data.get('connectionId') logger.info('[Connect: %s]: connection_id: %s' % ...
def function[_on_connection, parameter[self, data, unique_id]]: constant[Called on collection operation :param data: Received data ] if compare[name[unique_id] is constant[None]] begin[:] variable[unique_id] assign[=] name[self].stream_unique_id name[self].connec...
keyword[def] identifier[_on_connection] ( identifier[self] , identifier[data] , identifier[unique_id] ): literal[string] keyword[if] identifier[unique_id] keyword[is] keyword[None] : identifier[unique_id] = identifier[self] . identifier[stream_unique_id] identifier[self] ....
def _on_connection(self, data, unique_id): """Called on collection operation :param data: Received data """ if unique_id is None: unique_id = self.stream_unique_id # depends on [control=['if'], data=['unique_id']] self.connection_id = data.get('connectionId') logger.info('[Conn...
def _unpickle_collection(self, collection): """Unpickles all members of the specified dictionary.""" for mkey in collection: if isinstance(collection[mkey], list): for item in collection[mkey]: item.unpickle(self) else: collecti...
def function[_unpickle_collection, parameter[self, collection]]: constant[Unpickles all members of the specified dictionary.] for taget[name[mkey]] in starred[name[collection]] begin[:] if call[name[isinstance], parameter[call[name[collection]][name[mkey]], name[list]]] begin[:] ...
keyword[def] identifier[_unpickle_collection] ( identifier[self] , identifier[collection] ): literal[string] keyword[for] identifier[mkey] keyword[in] identifier[collection] : keyword[if] identifier[isinstance] ( identifier[collection] [ identifier[mkey] ], identifier[list] ): ...
def _unpickle_collection(self, collection): """Unpickles all members of the specified dictionary.""" for mkey in collection: if isinstance(collection[mkey], list): for item in collection[mkey]: item.unpickle(self) # depends on [control=['for'], data=['item']] # depends on [...
def html(self, page, version=None): """Returns HTML content of *page*. The HTML content of the last version of the page is returned if *version* is not set. """ return (self._dokuwiki.send('wiki.getPageHTMLVersion', page, version) if version is not None el...
def function[html, parameter[self, page, version]]: constant[Returns HTML content of *page*. The HTML content of the last version of the page is returned if *version* is not set. ] return[<ast.IfExp object at 0x7da20c76fa00>]
keyword[def] identifier[html] ( identifier[self] , identifier[page] , identifier[version] = keyword[None] ): literal[string] keyword[return] ( identifier[self] . identifier[_dokuwiki] . identifier[send] ( literal[string] , identifier[page] , identifier[version] ) keyword[if] identifier[ve...
def html(self, page, version=None): """Returns HTML content of *page*. The HTML content of the last version of the page is returned if *version* is not set. """ return self._dokuwiki.send('wiki.getPageHTMLVersion', page, version) if version is not None else self._dokuwiki.send('wiki.getPageHTML'...
def find_package(find_pkg, directory): """Find packages """ pkgs = [] if os.path.isdir(directory): installed = sorted(os.listdir(directory)) blacklist = BlackList().packages(pkgs=installed, repo="local") if os.path.exists(directory): for pkg in installed: ...
def function[find_package, parameter[find_pkg, directory]]: constant[Find packages ] variable[pkgs] assign[=] list[[]] if call[name[os].path.isdir, parameter[name[directory]]] begin[:] variable[installed] assign[=] call[name[sorted], parameter[call[name[os].listdir, parameter...
keyword[def] identifier[find_package] ( identifier[find_pkg] , identifier[directory] ): literal[string] identifier[pkgs] =[] keyword[if] identifier[os] . identifier[path] . identifier[isdir] ( identifier[directory] ): identifier[installed] = identifier[sorted] ( identifier[os] . identifier[l...
def find_package(find_pkg, directory): """Find packages """ pkgs = [] if os.path.isdir(directory): installed = sorted(os.listdir(directory)) blacklist = BlackList().packages(pkgs=installed, repo='local') if os.path.exists(directory): for pkg in installed: ...
def uploader(func): """This method only used for CKEditor under version 4.5, in newer version, you should use ``upload_success()`` and ``upload_fail()`` instead. Decorated the view function that handle the file upload. The upload view must return the uploaded image's url. For example:: ...
def function[uploader, parameter[func]]: constant[This method only used for CKEditor under version 4.5, in newer version, you should use ``upload_success()`` and ``upload_fail()`` instead. Decorated the view function that handle the file upload. The upload view must return the uploaded ...
keyword[def] identifier[uploader] ( identifier[func] ): literal[string] @ identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapper] (* identifier[args] ,** identifier[kwargs] ): identifier[func_num] = identifier[request] . identifier[args] . identifier[get] ( li...
def uploader(func): """This method only used for CKEditor under version 4.5, in newer version, you should use ``upload_success()`` and ``upload_fail()`` instead. Decorated the view function that handle the file upload. The upload view must return the uploaded image's url. For example:: ...
async def send_files_preconf(filepaths, config_path=CONFIG_PATH): """Send files using the config.ini settings. Args: filepaths (list(str)): A list of filepaths. """ config = read_config(config_path) subject = "PDF files from pdfebc" message = "" await send_with_attachments(subject, ...
<ast.AsyncFunctionDef object at 0x7da18c4cfbe0>
keyword[async] keyword[def] identifier[send_files_preconf] ( identifier[filepaths] , identifier[config_path] = identifier[CONFIG_PATH] ): literal[string] identifier[config] = identifier[read_config] ( identifier[config_path] ) identifier[subject] = literal[string] identifier[message] = literal[...
async def send_files_preconf(filepaths, config_path=CONFIG_PATH): """Send files using the config.ini settings. Args: filepaths (list(str)): A list of filepaths. """ config = read_config(config_path) subject = 'PDF files from pdfebc' message = '' await send_with_attachments(subject, ...
def _multiplex(self, target_gate, list_of_angles): """ Return a recursive implementation of a multiplexor circuit, where each instruction itself has a decomposition based on smaller multiplexors. The LSB is the multiplexor "data" and the other bits are multiplexor "select". ...
def function[_multiplex, parameter[self, target_gate, list_of_angles]]: constant[ Return a recursive implementation of a multiplexor circuit, where each instruction itself has a decomposition based on smaller multiplexors. The LSB is the multiplexor "data" and the other bits are...
keyword[def] identifier[_multiplex] ( identifier[self] , identifier[target_gate] , identifier[list_of_angles] ): literal[string] identifier[list_len] = identifier[len] ( identifier[list_of_angles] ) identifier[local_num_qubits] = identifier[int] ( identifier[math] . identifier[log2] ( iden...
def _multiplex(self, target_gate, list_of_angles): """ Return a recursive implementation of a multiplexor circuit, where each instruction itself has a decomposition based on smaller multiplexors. The LSB is the multiplexor "data" and the other bits are multiplexor "select". ...
def parse_enum_values_definition(lexer: Lexer) -> List[EnumValueDefinitionNode]: """EnumValuesDefinition: {EnumValueDefinition+}""" return ( cast( List[EnumValueDefinitionNode], many_nodes( lexer, TokenKind.BRACE_L, parse_enum_value_definition, TokenKind.BRACE_R ...
def function[parse_enum_values_definition, parameter[lexer]]: constant[EnumValuesDefinition: {EnumValueDefinition+}] return[<ast.IfExp object at 0x7da1b1d80760>]
keyword[def] identifier[parse_enum_values_definition] ( identifier[lexer] : identifier[Lexer] )-> identifier[List] [ identifier[EnumValueDefinitionNode] ]: literal[string] keyword[return] ( identifier[cast] ( identifier[List] [ identifier[EnumValueDefinitionNode] ], identifier[many_nodes] ( ...
def parse_enum_values_definition(lexer: Lexer) -> List[EnumValueDefinitionNode]: """EnumValuesDefinition: {EnumValueDefinition+}""" return cast(List[EnumValueDefinitionNode], many_nodes(lexer, TokenKind.BRACE_L, parse_enum_value_definition, TokenKind.BRACE_R)) if peek(lexer, TokenKind.BRACE_L) else []
def search_packages_info(query): """ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. """ installed = {} for p in pkg_re...
def function[search_packages_info, parameter[query]]: constant[ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. ] v...
keyword[def] identifier[search_packages_info] ( identifier[query] ): literal[string] identifier[installed] ={} keyword[for] identifier[p] keyword[in] identifier[pkg_resources] . identifier[working_set] : identifier[installed] [ identifier[canonicalize_name] ( identifier[p] . identifier[pro...
def search_packages_info(query): """ Gather details from installed distributions. Print distribution name, version, location, and installed files. Installed files requires a pip generated 'installed-files.txt' in the distributions '.egg-info' directory. """ installed = {} for p in pkg_re...
def image_export(self, image_name, dest_url, remote_host=None): """Export the specific image to remote host or local file system :param image_name: image name that can be uniquely identify an image :param dest_path: the location to store exported image, eg. /opt/images, the image will be...
def function[image_export, parameter[self, image_name, dest_url, remote_host]]: constant[Export the specific image to remote host or local file system :param image_name: image name that can be uniquely identify an image :param dest_path: the location to store exported image, eg. /opt/ima...
keyword[def] identifier[image_export] ( identifier[self] , identifier[image_name] , identifier[dest_url] , identifier[remote_host] = keyword[None] ): literal[string] identifier[image_info] = identifier[self] . identifier[_ImageDbOperator] . identifier[image_query_record] ( identifier[image_name] ) ...
def image_export(self, image_name, dest_url, remote_host=None): """Export the specific image to remote host or local file system :param image_name: image name that can be uniquely identify an image :param dest_path: the location to store exported image, eg. /opt/images, the image will be sto...
def simxGetInMessageInfo(clientID, infoType): ''' Please have a look at the function description/documentation in the V-REP user manual ''' info = ct.c_int() return c_GetInMessageInfo(clientID, infoType, ct.byref(info)), info.value
def function[simxGetInMessageInfo, parameter[clientID, infoType]]: constant[ Please have a look at the function description/documentation in the V-REP user manual ] variable[info] assign[=] call[name[ct].c_int, parameter[]] return[tuple[[<ast.Call object at 0x7da18dc04a30>, <ast.Attribute ob...
keyword[def] identifier[simxGetInMessageInfo] ( identifier[clientID] , identifier[infoType] ): literal[string] identifier[info] = identifier[ct] . identifier[c_int] () keyword[return] identifier[c_GetInMessageInfo] ( identifier[clientID] , identifier[infoType] , identifier[ct] . identifier[byref] ( i...
def simxGetInMessageInfo(clientID, infoType): """ Please have a look at the function description/documentation in the V-REP user manual """ info = ct.c_int() return (c_GetInMessageInfo(clientID, infoType, ct.byref(info)), info.value)
def cat(self, paths, check_crc=False): ''' Fetch all files that match the source file pattern and display their content on stdout. :param paths: Paths to display :type paths: list of strings :param check_crc: Check for checksum errors :type check_crc: boolean :re...
def function[cat, parameter[self, paths, check_crc]]: constant[ Fetch all files that match the source file pattern and display their content on stdout. :param paths: Paths to display :type paths: list of strings :param check_crc: Check for checksum errors :type check_crc...
keyword[def] identifier[cat] ( identifier[self] , identifier[paths] , identifier[check_crc] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[paths] , identifier[list] ): keyword[raise] identifier[InvalidInputException] ( literal[string...
def cat(self, paths, check_crc=False): """ Fetch all files that match the source file pattern and display their content on stdout. :param paths: Paths to display :type paths: list of strings :param check_crc: Check for checksum errors :type check_crc: boolean :return...
def set_string(self, string): """Set the working string and its length then reset positions.""" self.string = string self.length = len(string) self.reset_position()
def function[set_string, parameter[self, string]]: constant[Set the working string and its length then reset positions.] name[self].string assign[=] name[string] name[self].length assign[=] call[name[len], parameter[name[string]]] call[name[self].reset_position, parameter[]]
keyword[def] identifier[set_string] ( identifier[self] , identifier[string] ): literal[string] identifier[self] . identifier[string] = identifier[string] identifier[self] . identifier[length] = identifier[len] ( identifier[string] ) identifier[self] . identifier[reset_position] (...
def set_string(self, string): """Set the working string and its length then reset positions.""" self.string = string self.length = len(string) self.reset_position()
def is_valid_uuid(id): """Return True if id is a valid UUID, False otherwise.""" if not isinstance(id, basestring): return False try: val = UUID(id, version=4) except ValueError: return False return True
def function[is_valid_uuid, parameter[id]]: constant[Return True if id is a valid UUID, False otherwise.] if <ast.UnaryOp object at 0x7da1b025d840> begin[:] return[constant[False]] <ast.Try object at 0x7da1b025fdc0> return[constant[True]]
keyword[def] identifier[is_valid_uuid] ( identifier[id] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[id] , identifier[basestring] ): keyword[return] keyword[False] keyword[try] : identifier[val] = identifier[UUID] ( identifier[id] , identifier[...
def is_valid_uuid(id): """Return True if id is a valid UUID, False otherwise.""" if not isinstance(id, basestring): return False # depends on [control=['if'], data=[]] try: val = UUID(id, version=4) # depends on [control=['try'], data=[]] except ValueError: return False # depe...
def env_int(name: str, required: bool=False, default: Union[Type[empty], int]=empty) -> int: """Pulls an environment variable out of the environment and casts it to an integer. If the name is not present in the environment and no default is specified then a ``ValueError`` will be raised. Similarly, if the ...
def function[env_int, parameter[name, required, default]]: constant[Pulls an environment variable out of the environment and casts it to an integer. If the name is not present in the environment and no default is specified then a ``ValueError`` will be raised. Similarly, if the environment value is ...
keyword[def] identifier[env_int] ( identifier[name] : identifier[str] , identifier[required] : identifier[bool] = keyword[False] , identifier[default] : identifier[Union] [ identifier[Type] [ identifier[empty] ], identifier[int] ]= identifier[empty] )-> identifier[int] : literal[string] identifier[value] =...
def env_int(name: str, required: bool=False, default: Union[Type[empty], int]=empty) -> int: """Pulls an environment variable out of the environment and casts it to an integer. If the name is not present in the environment and no default is specified then a ``ValueError`` will be raised. Similarly, if the ...
def get_extr_license_text(self, extr_lic): """ Return extracted text from an ExtractedLicense or None. """ text_tripples = list(self.graph.triples((extr_lic, self.spdx_namespace['extractedText'], None))) if not text_tripples: self.error = True msg = 'Extr...
def function[get_extr_license_text, parameter[self, extr_lic]]: constant[ Return extracted text from an ExtractedLicense or None. ] variable[text_tripples] assign[=] call[name[list], parameter[call[name[self].graph.triples, parameter[tuple[[<ast.Name object at 0x7da18dc9a860>, <ast.Subs...
keyword[def] identifier[get_extr_license_text] ( identifier[self] , identifier[extr_lic] ): literal[string] identifier[text_tripples] = identifier[list] ( identifier[self] . identifier[graph] . identifier[triples] (( identifier[extr_lic] , identifier[self] . identifier[spdx_namespace] [ literal[str...
def get_extr_license_text(self, extr_lic): """ Return extracted text from an ExtractedLicense or None. """ text_tripples = list(self.graph.triples((extr_lic, self.spdx_namespace['extractedText'], None))) if not text_tripples: self.error = True msg = 'Extracted license must h...
def push(self, lines): """Push one or more lines of input. This stores the given lines and returns a status code indicating whether the code forms a complete Python block or not. Any exceptions generated in compilation are swallowed, but if an exception was produced, the method...
def function[push, parameter[self, lines]]: constant[Push one or more lines of input. This stores the given lines and returns a status code indicating whether the code forms a complete Python block or not. Any exceptions generated in compilation are swallowed, but if an excepti...
keyword[def] identifier[push] ( identifier[self] , identifier[lines] ): literal[string] keyword[if] identifier[self] . identifier[input_mode] == literal[string] : identifier[self] . identifier[reset] () identifier[self] . identifier[_store] ( identifier[lines] ) ide...
def push(self, lines): """Push one or more lines of input. This stores the given lines and returns a status code indicating whether the code forms a complete Python block or not. Any exceptions generated in compilation are swallowed, but if an exception was produced, the method ret...
def _getEventsOnDay(self, request, day): """Return my child events for a given day.""" return getAllEventsByDay(request, day, day, home=self)[0]
def function[_getEventsOnDay, parameter[self, request, day]]: constant[Return my child events for a given day.] return[call[call[name[getAllEventsByDay], parameter[name[request], name[day], name[day]]]][constant[0]]]
keyword[def] identifier[_getEventsOnDay] ( identifier[self] , identifier[request] , identifier[day] ): literal[string] keyword[return] identifier[getAllEventsByDay] ( identifier[request] , identifier[day] , identifier[day] , identifier[home] = identifier[self] )[ literal[int] ]
def _getEventsOnDay(self, request, day): """Return my child events for a given day.""" return getAllEventsByDay(request, day, day, home=self)[0]
def track(context, file_names): """Keep track of each file in list file_names. Tracking does not create or delete the actual file, it only tells the version control system whether to maintain versions (to keep track) of the file. """ context.obj.find_repo_type() for fn in file_names: ...
def function[track, parameter[context, file_names]]: constant[Keep track of each file in list file_names. Tracking does not create or delete the actual file, it only tells the version control system whether to maintain versions (to keep track) of the file. ] call[name[context].obj.find_...
keyword[def] identifier[track] ( identifier[context] , identifier[file_names] ): literal[string] identifier[context] . identifier[obj] . identifier[find_repo_type] () keyword[for] identifier[fn] keyword[in] identifier[file_names] : identifier[context] . identifier[obj] . identifier[call] (...
def track(context, file_names): """Keep track of each file in list file_names. Tracking does not create or delete the actual file, it only tells the version control system whether to maintain versions (to keep track) of the file. """ context.obj.find_repo_type() for fn in file_names: ...
def save_config(self, cmd="save force", confirm=False, confirm_response=""): """Save Config.""" return super(HPComwareBase, self).save_config( cmd=cmd, confirm=confirm, confirm_response=confirm_response )
def function[save_config, parameter[self, cmd, confirm, confirm_response]]: constant[Save Config.] return[call[call[name[super], parameter[name[HPComwareBase], name[self]]].save_config, parameter[]]]
keyword[def] identifier[save_config] ( identifier[self] , identifier[cmd] = literal[string] , identifier[confirm] = keyword[False] , identifier[confirm_response] = literal[string] ): literal[string] keyword[return] identifier[super] ( identifier[HPComwareBase] , identifier[self] ). identifier[save...
def save_config(self, cmd='save force', confirm=False, confirm_response=''): """Save Config.""" return super(HPComwareBase, self).save_config(cmd=cmd, confirm=confirm, confirm_response=confirm_response)
def get_alias(self, index=None, name=None, params=None): """ Retrieve a specified alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-separated list...
def function[get_alias, parameter[self, index, name, params]]: constant[ Retrieve a specified alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-se...
keyword[def] identifier[get_alias] ( identifier[self] , identifier[index] = keyword[None] , identifier[name] = keyword[None] , identifier[params] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[transport] . identifier[perform_request] ( literal[string] , i...
def get_alias(self, index=None, name=None, params=None): """ Retrieve a specified alias. `<http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html>`_ :arg index: A comma-separated list of index names to filter aliases :arg name: A comma-separated list of ...
def _paload8(ins): ''' Loads an 8 bit value from a memory address If 2nd arg. start with '*', it is always treated as an indirect value. ''' output = _paddr(ins.quad[2]) output.append('ld a, (hl)') output.append('push af') return output
def function[_paload8, parameter[ins]]: constant[ Loads an 8 bit value from a memory address If 2nd arg. start with '*', it is always treated as an indirect value. ] variable[output] assign[=] call[name[_paddr], parameter[call[name[ins].quad][constant[2]]]] call[name[output].append, ...
keyword[def] identifier[_paload8] ( identifier[ins] ): literal[string] identifier[output] = identifier[_paddr] ( identifier[ins] . identifier[quad] [ literal[int] ]) identifier[output] . identifier[append] ( literal[string] ) identifier[output] . identifier[append] ( literal[string] ) keywo...
def _paload8(ins): """ Loads an 8 bit value from a memory address If 2nd arg. start with '*', it is always treated as an indirect value. """ output = _paddr(ins.quad[2]) output.append('ld a, (hl)') output.append('push af') return output
def pre_attention(self, segment_number, query_antecedent, memory_antecedent, bias): """Called prior to self-attention, to incorporate memory items. Args: segment_number: an integer Tensor with shape [batch] query_antecedent: a Tensor with shape [batch, length_q, channels] ...
def function[pre_attention, parameter[self, segment_number, query_antecedent, memory_antecedent, bias]]: constant[Called prior to self-attention, to incorporate memory items. Args: segment_number: an integer Tensor with shape [batch] query_antecedent: a Tensor with shape [batch, length_q, chann...
keyword[def] identifier[pre_attention] ( identifier[self] , identifier[segment_number] , identifier[query_antecedent] , identifier[memory_antecedent] , identifier[bias] ): literal[string] keyword[with] identifier[tf] . identifier[variable_scope] ( identifier[self] . identifier[name] + literal[string] , i...
def pre_attention(self, segment_number, query_antecedent, memory_antecedent, bias): """Called prior to self-attention, to incorporate memory items. Args: segment_number: an integer Tensor with shape [batch] query_antecedent: a Tensor with shape [batch, length_q, channels] memory_antecedent: m...
def all_origins(m): ''' Generate all unique statement origins in the given model ''' seen = set() for link in m.match(): origin = link[ORIGIN] if origin not in seen: seen.add(origin) yield origin
def function[all_origins, parameter[m]]: constant[ Generate all unique statement origins in the given model ] variable[seen] assign[=] call[name[set], parameter[]] for taget[name[link]] in starred[call[name[m].match, parameter[]]] begin[:] variable[origin] assign[=] call[...
keyword[def] identifier[all_origins] ( identifier[m] ): literal[string] identifier[seen] = identifier[set] () keyword[for] identifier[link] keyword[in] identifier[m] . identifier[match] (): identifier[origin] = identifier[link] [ identifier[ORIGIN] ] keyword[if] identifier[origin...
def all_origins(m): """ Generate all unique statement origins in the given model """ seen = set() for link in m.match(): origin = link[ORIGIN] if origin not in seen: seen.add(origin) yield origin # depends on [control=['if'], data=['origin', 'seen']] # depen...
def lint(): "report pylint results" # report according to file extension report_formats = { ".html": "html", ".log": "parseable", ".txt": "text", } lint_build_dir = easy.path("build/lint") lint_build_dir.exists() or lint_build_dir.makedirs() # pylint: disable=expression...
def function[lint, parameter[]]: constant[report pylint results] variable[report_formats] assign[=] dictionary[[<ast.Constant object at 0x7da18f58d9c0>, <ast.Constant object at 0x7da18f58c520>, <ast.Constant object at 0x7da18f58d0c0>], [<ast.Constant object at 0x7da18f58d2d0>, <ast.Constant object at 0x...
keyword[def] identifier[lint] (): literal[string] identifier[report_formats] ={ literal[string] : literal[string] , literal[string] : literal[string] , literal[string] : literal[string] , } identifier[lint_build_dir] = identifier[easy] . identifier[path] ( literal[string] ) ...
def lint(): """report pylint results""" # report according to file extension report_formats = {'.html': 'html', '.log': 'parseable', '.txt': 'text'} lint_build_dir = easy.path('build/lint') lint_build_dir.exists() or lint_build_dir.makedirs() # pylint: disable=expression-not-assigned argv = [] ...
def create_logger(app): """Creates a logger for the given application. This logger works similar to a regular Python logger but changes the effective logging level based on the application's debug flag. Furthermore this function also removes all attached handlers in case there was a logger with th...
def function[create_logger, parameter[app]]: constant[Creates a logger for the given application. This logger works similar to a regular Python logger but changes the effective logging level based on the application's debug flag. Furthermore this function also removes all attached handlers in case...
keyword[def] identifier[create_logger] ( identifier[app] ): literal[string] identifier[Logger] = identifier[getLoggerClass] () keyword[class] identifier[DebugLogger] ( identifier[Logger] ): keyword[def] identifier[getEffectiveLevel] ( identifier[x] ): keyword[if] identifier[x...
def create_logger(app): """Creates a logger for the given application. This logger works similar to a regular Python logger but changes the effective logging level based on the application's debug flag. Furthermore this function also removes all attached handlers in case there was a logger with th...
def get_asset_query_session(self): """Gets an asset query session. return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_asset_query()`` is ``false`` *complia...
def function[get_asset_query_session, parameter[self]]: constant[Gets an asset query session. return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_asset_query()`` is...
keyword[def] identifier[get_asset_query_session] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[supports_asset_query] (): keyword[raise] identifier[errors] . identifier[Unimplemented] () keyword[return] identifier[...
def get_asset_query_session(self): """Gets an asset query session. return: (osid.repository.AssetQuerySession) - an ``AssetQuerySession`` raise: OperationFailed - unable to complete request raise: Unimplemented - ``supports_asset_query()`` is ``false`` *compliance:...
def _GetHWInfos(client_list, batch_size=10000, token=None): """Opens the given clients in batches and returns hardware information.""" # This function returns a dict mapping each client_id to a set of reported # hardware serial numbers reported by this client. hw_infos = {} logging.info("%d clients to proce...
def function[_GetHWInfos, parameter[client_list, batch_size, token]]: constant[Opens the given clients in batches and returns hardware information.] variable[hw_infos] assign[=] dictionary[[], []] call[name[logging].info, parameter[constant[%d clients to process.], call[name[len], parameter[name...
keyword[def] identifier[_GetHWInfos] ( identifier[client_list] , identifier[batch_size] = literal[int] , identifier[token] = keyword[None] ): literal[string] identifier[hw_infos] ={} identifier[logging] . identifier[info] ( literal[string] , identifier[len] ( identifier[client_list] )) identifie...
def _GetHWInfos(client_list, batch_size=10000, token=None): """Opens the given clients in batches and returns hardware information.""" # This function returns a dict mapping each client_id to a set of reported # hardware serial numbers reported by this client. hw_infos = {} logging.info('%d clients ...
def process_form(request, form_class, form_dict=None, save_kwargs=None, *a, **kw): ''' Optional: ========= You can pass kwargs to the form save function in a 'save_kwargs' dict. Example Usage: ============== success, form = process_form(request, DiscussionForm, in...
def function[process_form, parameter[request, form_class, form_dict, save_kwargs]]: constant[ Optional: ========= You can pass kwargs to the form save function in a 'save_kwargs' dict. Example Usage: ============== success, form = process_form(request, Discuss...
keyword[def] identifier[process_form] ( identifier[request] , identifier[form_class] , identifier[form_dict] = keyword[None] , identifier[save_kwargs] = keyword[None] ,* identifier[a] ,** identifier[kw] ): literal[string] identifier[form] = identifier[form_class] ( identifier[form_dict] keyword[or] iden...
def process_form(request, form_class, form_dict=None, save_kwargs=None, *a, **kw): """ Optional: ========= You can pass kwargs to the form save function in a 'save_kwargs' dict. Example Usage: ============== success, form = process_form(request, DiscussionForm, in...
def safe_division(dividend, divisor): """ :return: nan: invalid arguments :rtype: float """ try: divisor = float(divisor) dividend = float(dividend) except (TypeError, ValueError, AssertionError): return float("nan") try: return dividend / divisor ...
def function[safe_division, parameter[dividend, divisor]]: constant[ :return: nan: invalid arguments :rtype: float ] <ast.Try object at 0x7da20e954910> <ast.Try object at 0x7da20e954cd0>
keyword[def] identifier[safe_division] ( identifier[dividend] , identifier[divisor] ): literal[string] keyword[try] : identifier[divisor] = identifier[float] ( identifier[divisor] ) identifier[dividend] = identifier[float] ( identifier[dividend] ) keyword[except] ( identifier[TypeEr...
def safe_division(dividend, divisor): """ :return: nan: invalid arguments :rtype: float """ try: divisor = float(divisor) dividend = float(dividend) # depends on [control=['try'], data=[]] except (TypeError, ValueError, AssertionError): return float('nan') # dep...
def interface_list(env, securitygroup_id, sortby): """List interfaces associated with security groups.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby mask = ( '''networkComponentBindings[ networkComponentId, net...
def function[interface_list, parameter[env, securitygroup_id, sortby]]: constant[List interfaces associated with security groups.] variable[mgr] assign[=] call[name[SoftLayer].NetworkManager, parameter[name[env].client]] variable[table] assign[=] call[name[formatting].Table, parameter[name[COLUM...
keyword[def] identifier[interface_list] ( identifier[env] , identifier[securitygroup_id] , identifier[sortby] ): literal[string] identifier[mgr] = identifier[SoftLayer] . identifier[NetworkManager] ( identifier[env] . identifier[client] ) identifier[table] = identifier[formatting] . identifier[Table]...
def interface_list(env, securitygroup_id, sortby): """List interfaces associated with security groups.""" mgr = SoftLayer.NetworkManager(env.client) table = formatting.Table(COLUMNS) table.sortby = sortby mask = 'networkComponentBindings[\n networkComponentId,\n networkComponen...
def on_play_speed(self, *args): """Change the interval at which ``self.play`` is called to match my current ``play_speed``. """ Clock.unschedule(self.play) Clock.schedule_interval(self.play, 1.0 / self.play_speed)
def function[on_play_speed, parameter[self]]: constant[Change the interval at which ``self.play`` is called to match my current ``play_speed``. ] call[name[Clock].unschedule, parameter[name[self].play]] call[name[Clock].schedule_interval, parameter[name[self].play, binary_operat...
keyword[def] identifier[on_play_speed] ( identifier[self] ,* identifier[args] ): literal[string] identifier[Clock] . identifier[unschedule] ( identifier[self] . identifier[play] ) identifier[Clock] . identifier[schedule_interval] ( identifier[self] . identifier[play] , literal[int] / ident...
def on_play_speed(self, *args): """Change the interval at which ``self.play`` is called to match my current ``play_speed``. """ Clock.unschedule(self.play) Clock.schedule_interval(self.play, 1.0 / self.play_speed)
def generate_jid(name, append_date=None): """Generates a v alid JID based on the room name. :param append_date: appends the given date to the JID """ if not append_date: return sanitize_jid(name) return '{}-{}'.format(sanitize_jid(name), append_date.strftime('%Y-%m-%d'))
def function[generate_jid, parameter[name, append_date]]: constant[Generates a v alid JID based on the room name. :param append_date: appends the given date to the JID ] if <ast.UnaryOp object at 0x7da18fe90e20> begin[:] return[call[name[sanitize_jid], parameter[name[name]]]] return...
keyword[def] identifier[generate_jid] ( identifier[name] , identifier[append_date] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[append_date] : keyword[return] identifier[sanitize_jid] ( identifier[name] ) keyword[return] literal[string] . identifier[format] ( ide...
def generate_jid(name, append_date=None): """Generates a v alid JID based on the room name. :param append_date: appends the given date to the JID """ if not append_date: return sanitize_jid(name) # depends on [control=['if'], data=[]] return '{}-{}'.format(sanitize_jid(name), append_date.s...
def main(argv=None): """Main entry point for the cdstar CLI.""" args = docopt(__doc__, version=pycdstar.__version__, argv=argv, options_first=True) subargs = [args['<command>']] + args['<args>'] if args['<command>'] in ['help', None]: cmd = None if len(subargs) > 1: cmd = CO...
def function[main, parameter[argv]]: constant[Main entry point for the cdstar CLI.] variable[args] assign[=] call[name[docopt], parameter[name[__doc__]]] variable[subargs] assign[=] binary_operation[list[[<ast.Subscript object at 0x7da1b0a82410>]] + call[name[args]][constant[<args>]]] if...
keyword[def] identifier[main] ( identifier[argv] = keyword[None] ): literal[string] identifier[args] = identifier[docopt] ( identifier[__doc__] , identifier[version] = identifier[pycdstar] . identifier[__version__] , identifier[argv] = identifier[argv] , identifier[options_first] = keyword[True] ) ide...
def main(argv=None): """Main entry point for the cdstar CLI.""" args = docopt(__doc__, version=pycdstar.__version__, argv=argv, options_first=True) subargs = [args['<command>']] + args['<args>'] if args['<command>'] in ['help', None]: cmd = None if len(subargs) > 1: cmd = COM...
def _exec_check_pointers(executable): """Checks the specified executable for the pointer condition that not all members of the derived type have had their values set. Returns (list of offending members, parameter name). """ oparams = [] pmembers = {} xassigns = map(lambda x: x.lower().strip...
def function[_exec_check_pointers, parameter[executable]]: constant[Checks the specified executable for the pointer condition that not all members of the derived type have had their values set. Returns (list of offending members, parameter name). ] variable[oparams] assign[=] list[[]] ...
keyword[def] identifier[_exec_check_pointers] ( identifier[executable] ): literal[string] identifier[oparams] =[] identifier[pmembers] ={} identifier[xassigns] = identifier[map] ( keyword[lambda] identifier[x] : identifier[x] . identifier[lower] (). identifier[strip] (), identifier[executable] ....
def _exec_check_pointers(executable): """Checks the specified executable for the pointer condition that not all members of the derived type have had their values set. Returns (list of offending members, parameter name). """ oparams = [] pmembers = {} xassigns = map(lambda x: x.lower().strip...
def class_space(classlevel=3): "returns the calling class' name and dictionary" frame = sys._getframe(classlevel) classname = frame.f_code.co_name classdict = frame.f_locals return classname, classdict
def function[class_space, parameter[classlevel]]: constant[returns the calling class' name and dictionary] variable[frame] assign[=] call[name[sys]._getframe, parameter[name[classlevel]]] variable[classname] assign[=] name[frame].f_code.co_name variable[classdict] assign[=] name[frame].f...
keyword[def] identifier[class_space] ( identifier[classlevel] = literal[int] ): literal[string] identifier[frame] = identifier[sys] . identifier[_getframe] ( identifier[classlevel] ) identifier[classname] = identifier[frame] . identifier[f_code] . identifier[co_name] identifier[classdict] = iden...
def class_space(classlevel=3): """returns the calling class' name and dictionary""" frame = sys._getframe(classlevel) classname = frame.f_code.co_name classdict = frame.f_locals return (classname, classdict)
def _format_and_write(self, level, correlation_id, error, message, *args, **kwargs): """ Formats the log message and writes it to the logger destination. :param level: a log level. :param correlation_id: (optional) transaction id to trace execution through call chain. :param e...
def function[_format_and_write, parameter[self, level, correlation_id, error, message]]: constant[ Formats the log message and writes it to the logger destination. :param level: a log level. :param correlation_id: (optional) transaction id to trace execution through call chain. ...
keyword[def] identifier[_format_and_write] ( identifier[self] , identifier[level] , identifier[correlation_id] , identifier[error] , identifier[message] ,* identifier[args] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[message] != keyword[None] keyword[and] identifier[len] ( i...
def _format_and_write(self, level, correlation_id, error, message, *args, **kwargs): """ Formats the log message and writes it to the logger destination. :param level: a log level. :param correlation_id: (optional) transaction id to trace execution through call chain. :param error...
def prettymetrics(self) -> str: """ Pretty printing for metrics """ rendered = ["{}: {}".format(*m) for m in self.metrics()] return "\n ".join(rendered)
def function[prettymetrics, parameter[self]]: constant[ Pretty printing for metrics ] variable[rendered] assign[=] <ast.ListComp object at 0x7da18dc9a920> return[call[constant[ ].join, parameter[name[rendered]]]]
keyword[def] identifier[prettymetrics] ( identifier[self] )-> identifier[str] : literal[string] identifier[rendered] =[ literal[string] . identifier[format] (* identifier[m] ) keyword[for] identifier[m] keyword[in] identifier[self] . identifier[metrics] ()] keyword[return] literal[stri...
def prettymetrics(self) -> str: """ Pretty printing for metrics """ rendered = ['{}: {}'.format(*m) for m in self.metrics()] return '\n '.join(rendered)
def _restart_stream(self): """Restart the stream as needed after SASL and StartTLS negotiation.""" self._input_state = "restart" self._output_state = "restart" self.features = None self.transport.restart() if self.initiator: self._send_stream_start(self.stream...
def function[_restart_stream, parameter[self]]: constant[Restart the stream as needed after SASL and StartTLS negotiation.] name[self]._input_state assign[=] constant[restart] name[self]._output_state assign[=] constant[restart] name[self].features assign[=] constant[None] call[n...
keyword[def] identifier[_restart_stream] ( identifier[self] ): literal[string] identifier[self] . identifier[_input_state] = literal[string] identifier[self] . identifier[_output_state] = literal[string] identifier[self] . identifier[features] = keyword[None] identifie...
def _restart_stream(self): """Restart the stream as needed after SASL and StartTLS negotiation.""" self._input_state = 'restart' self._output_state = 'restart' self.features = None self.transport.restart() if self.initiator: self._send_stream_start(self.stream_id) # depends on [control=...
def compute_skew_stats(intra, inter): """Returns two dictionaries reporting (skew, skew_pval) for all groups""" # Intra (within a group) stats intra_skew = {} for k, v in intra.items(): skew = st.skew(v) try: skew_zstat, skew_pval = st.skewtest(v) except ValueError: ...
def function[compute_skew_stats, parameter[intra, inter]]: constant[Returns two dictionaries reporting (skew, skew_pval) for all groups] variable[intra_skew] assign[=] dictionary[[], []] for taget[tuple[[<ast.Name object at 0x7da18eb57130>, <ast.Name object at 0x7da18eb552a0>]]] in starred[call[...
keyword[def] identifier[compute_skew_stats] ( identifier[intra] , identifier[inter] ): literal[string] identifier[intra_skew] ={} keyword[for] identifier[k] , identifier[v] keyword[in] identifier[intra] . identifier[items] (): identifier[skew] = identifier[st] . identifier[skew] ( ide...
def compute_skew_stats(intra, inter): """Returns two dictionaries reporting (skew, skew_pval) for all groups""" # Intra (within a group) stats intra_skew = {} for (k, v) in intra.items(): skew = st.skew(v) try: (skew_zstat, skew_pval) = st.skewtest(v) # depends on [control=[...
def tree_analysisOutput(self, *args, **kwargs): """ An optional method for looping over the <outputTree> and calling an outputcallback on the analysis results at each path. Only call this if self.b_persisAnalysisResults is True. """ fn_outputcallback = ...
def function[tree_analysisOutput, parameter[self]]: constant[ An optional method for looping over the <outputTree> and calling an outputcallback on the analysis results at each path. Only call this if self.b_persisAnalysisResults is True. ] variable[fn_outputcall...
keyword[def] identifier[tree_analysisOutput] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[fn_outputcallback] = keyword[None] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[kwargs] . identifier[items] (): key...
def tree_analysisOutput(self, *args, **kwargs): """ An optional method for looping over the <outputTree> and calling an outputcallback on the analysis results at each path. Only call this if self.b_persisAnalysisResults is True. """ fn_outputcallback = None for (k, v...