code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def in_order(self) -> Iterator["BSP"]: """Iterate over this BSP's hierarchy in order. .. versionadded:: 8.3 """ if self.children: yield from self.children[0].in_order() yield self yield from self.children[1].in_order() else: yield ...
def function[in_order, parameter[self]]: constant[Iterate over this BSP's hierarchy in order. .. versionadded:: 8.3 ] if name[self].children begin[:] <ast.YieldFrom object at 0x7da18eb55b40> <ast.Yield object at 0x7da18eb55bd0> <ast.YieldF...
keyword[def] identifier[in_order] ( identifier[self] )-> identifier[Iterator] [ literal[string] ]: literal[string] keyword[if] identifier[self] . identifier[children] : keyword[yield] keyword[from] identifier[self] . identifier[children] [ literal[int] ]. identifier[in_order] () ...
def in_order(self) -> Iterator['BSP']: """Iterate over this BSP's hierarchy in order. .. versionadded:: 8.3 """ if self.children: yield from self.children[0].in_order() yield self yield from self.children[1].in_order() # depends on [control=['if'], data=[]] else: ...
def reset(self): """ Empties all internal storage containers """ self.X = [] self.Y = [] self.w = [] self.Xnorm = [] self.graph_rep = None
def function[reset, parameter[self]]: constant[ Empties all internal storage containers ] name[self].X assign[=] list[[]] name[self].Y assign[=] list[[]] name[self].w assign[=] list[[]] name[self].Xnorm assign[=] list[[]] name[self].graph_rep assign[=]...
keyword[def] identifier[reset] ( identifier[self] ): literal[string] identifier[self] . identifier[X] =[] identifier[self] . identifier[Y] =[] identifier[self] . identifier[w] =[] identifier[self] . identifier[Xnorm] =[] identifier[self] . identifier[graph_rep]...
def reset(self): """ Empties all internal storage containers """ self.X = [] self.Y = [] self.w = [] self.Xnorm = [] self.graph_rep = None
def stored_bind(self, instance): """Bind an instance to this Pangler, using the bound Pangler store. This method functions identically to `bind`, except that it might return a Pangler which was previously bound to the provided instance. """ if self.id is None: retu...
def function[stored_bind, parameter[self, instance]]: constant[Bind an instance to this Pangler, using the bound Pangler store. This method functions identically to `bind`, except that it might return a Pangler which was previously bound to the provided instance. ] if compare[n...
keyword[def] identifier[stored_bind] ( identifier[self] , identifier[instance] ): literal[string] keyword[if] identifier[self] . identifier[id] keyword[is] keyword[None] : keyword[return] identifier[self] . identifier[bind] ( identifier[instance] ) identifier[store] = id...
def stored_bind(self, instance): """Bind an instance to this Pangler, using the bound Pangler store. This method functions identically to `bind`, except that it might return a Pangler which was previously bound to the provided instance. """ if self.id is None: return self.bind(...
def get_section_data(self, name): """Get the data of the section.""" logging.debug(_('Obtaining PE section: %s'), name) for section in self.binary.sections: if section.Name.rstrip(b'\x00') == name: return section.get_data() return b''
def function[get_section_data, parameter[self, name]]: constant[Get the data of the section.] call[name[logging].debug, parameter[call[name[_], parameter[constant[Obtaining PE section: %s]]], name[name]]] for taget[name[section]] in starred[name[self].binary.sections] begin[:] if...
keyword[def] identifier[get_section_data] ( identifier[self] , identifier[name] ): literal[string] identifier[logging] . identifier[debug] ( identifier[_] ( literal[string] ), identifier[name] ) keyword[for] identifier[section] keyword[in] identifier[self] . identifier[binary] . identif...
def get_section_data(self, name): """Get the data of the section.""" logging.debug(_('Obtaining PE section: %s'), name) for section in self.binary.sections: if section.Name.rstrip(b'\x00') == name: return section.get_data() # depends on [control=['if'], data=[]] # depends on [control=[...
def download_object(self, object_name): """ Download an object. :param str object_name: The object to fetch. """ return self._client.download_object( self._instance, self.name, object_name)
def function[download_object, parameter[self, object_name]]: constant[ Download an object. :param str object_name: The object to fetch. ] return[call[name[self]._client.download_object, parameter[name[self]._instance, name[self].name, name[object_name]]]]
keyword[def] identifier[download_object] ( identifier[self] , identifier[object_name] ): literal[string] keyword[return] identifier[self] . identifier[_client] . identifier[download_object] ( identifier[self] . identifier[_instance] , identifier[self] . identifier[name] , identifier[objec...
def download_object(self, object_name): """ Download an object. :param str object_name: The object to fetch. """ return self._client.download_object(self._instance, self.name, object_name)
def remove(self, item): """Remove an item from the list :param item: The item to remove from the list. :raises ValueError: If the item is not present in the list. """ if item not in self: raise ValueError('objectlist.remove(item) failed, item not in list') it...
def function[remove, parameter[self, item]]: constant[Remove an item from the list :param item: The item to remove from the list. :raises ValueError: If the item is not present in the list. ] if compare[name[item] <ast.NotIn object at 0x7da2590d7190> name[self]] begin[:] ...
keyword[def] identifier[remove] ( identifier[self] , identifier[item] ): literal[string] keyword[if] identifier[item] keyword[not] keyword[in] identifier[self] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[item_id] = identifier[int] ( identifier[s...
def remove(self, item): """Remove an item from the list :param item: The item to remove from the list. :raises ValueError: If the item is not present in the list. """ if item not in self: raise ValueError('objectlist.remove(item) failed, item not in list') # depends on [control...
def check_compatibility(self, other, check_edges=False, precision=1E-7): """ Test whether two histograms are considered compatible by the number of dimensions, number of bins along each axis, and optionally the bin edges. Parameters ---------- other : histogram ...
def function[check_compatibility, parameter[self, other, check_edges, precision]]: constant[ Test whether two histograms are considered compatible by the number of dimensions, number of bins along each axis, and optionally the bin edges. Parameters ---------- ot...
keyword[def] identifier[check_compatibility] ( identifier[self] , identifier[other] , identifier[check_edges] = keyword[False] , identifier[precision] = literal[int] ): literal[string] keyword[if] identifier[self] . identifier[GetDimension] ()!= identifier[other] . identifier[GetDimension] (): ...
def check_compatibility(self, other, check_edges=False, precision=1e-07): """ Test whether two histograms are considered compatible by the number of dimensions, number of bins along each axis, and optionally the bin edges. Parameters ---------- other : histogram ...
def differing_constants(block_a, block_b): """ Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list of differing constants in the ...
def function[differing_constants, parameter[block_a, block_b]]: constant[ Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list...
keyword[def] identifier[differing_constants] ( identifier[block_a] , identifier[block_b] ): literal[string] identifier[statements_a] =[ identifier[s] keyword[for] identifier[s] keyword[in] identifier[block_a] . identifier[vex] . identifier[statements] keyword[if] identifier[s] . identifier[tag] != li...
def differing_constants(block_a, block_b): """ Compares two basic blocks and finds all the constants that differ from the first block to the second. :param block_a: The first block to compare. :param block_b: The second block to compare. :returns: Returns a list of differing constants in the ...
def create_delete_model(record): """Create a vpc model from a record.""" data = cloudwatch.get_historical_base_info(record) vpc_id = cloudwatch.filter_request_parameters('vpcId', record) arn = get_arn(vpc_id, cloudwatch.get_region(record), record['account']) LOG.debug(F'[-] Deleting Dynamodb Reco...
def function[create_delete_model, parameter[record]]: constant[Create a vpc model from a record.] variable[data] assign[=] call[name[cloudwatch].get_historical_base_info, parameter[name[record]]] variable[vpc_id] assign[=] call[name[cloudwatch].filter_request_parameters, parameter[constant[vpcId...
keyword[def] identifier[create_delete_model] ( identifier[record] ): literal[string] identifier[data] = identifier[cloudwatch] . identifier[get_historical_base_info] ( identifier[record] ) identifier[vpc_id] = identifier[cloudwatch] . identifier[filter_request_parameters] ( literal[string] , identifi...
def create_delete_model(record): """Create a vpc model from a record.""" data = cloudwatch.get_historical_base_info(record) vpc_id = cloudwatch.filter_request_parameters('vpcId', record) arn = get_arn(vpc_id, cloudwatch.get_region(record), record['account']) LOG.debug(f'[-] Deleting Dynamodb Records...
def get_types(json_type: StrOrList) -> typing.Tuple[str, str]: """Returns the json and native python type based on the json_type input. If json_type is a list of types it will return the first non 'null' value. :param json_type: A json type or a list of json types. :returns: A tuple containing the jso...
def function[get_types, parameter[json_type]]: constant[Returns the json and native python type based on the json_type input. If json_type is a list of types it will return the first non 'null' value. :param json_type: A json type or a list of json types. :returns: A tuple containing the json type...
keyword[def] identifier[get_types] ( identifier[json_type] : identifier[StrOrList] )-> identifier[typing] . identifier[Tuple] [ identifier[str] , identifier[str] ]: literal[string] keyword[if] identifier[isinstance] ( identifier[json_type] , identifier[list] ): keyword[for] identifier[j_typ...
def get_types(json_type: StrOrList) -> typing.Tuple[str, str]: """Returns the json and native python type based on the json_type input. If json_type is a list of types it will return the first non 'null' value. :param json_type: A json type or a list of json types. :returns: A tuple containing the jso...
def sample(self, n_samples, divs=1, visual=False, safe=False): """ Sample Sampling Inputs : n_samples : number of samples to generate Optional Inputs : divs : (1) number of divisions visual : show progress safe : ...
def function[sample, parameter[self, n_samples, divs, visual, safe]]: constant[ Sample Sampling Inputs : n_samples : number of samples to generate Optional Inputs : divs : (1) number of divisions visual : show progress ...
keyword[def] identifier[sample] ( identifier[self] , identifier[n_samples] , identifier[divs] = literal[int] , identifier[visual] = keyword[False] , identifier[safe] = keyword[False] ): literal[string] keyword[if] identifier[visual] : identifier[print] ( literal[string] ) key...
def sample(self, n_samples, divs=1, visual=False, safe=False): """ Sample Sampling Inputs : n_samples : number of samples to generate Optional Inputs : divs : (1) number of divisions visual : show progress safe : ...
def check_against_chunks(self, chunks): # type: (Iterator[bytes]) -> None """Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match. """ gots = {} for hash_name in iterkeys(self._allowed): try: ...
def function[check_against_chunks, parameter[self, chunks]]: constant[Check good hashes against ones built from iterable of chunks of data. Raise HashMismatch if none match. ] variable[gots] assign[=] dictionary[[], []] for taget[name[hash_name]] in starred[call[name[it...
keyword[def] identifier[check_against_chunks] ( identifier[self] , identifier[chunks] ): literal[string] identifier[gots] ={} keyword[for] identifier[hash_name] keyword[in] identifier[iterkeys] ( identifier[self] . identifier[_allowed] ): keyword[try] : id...
def check_against_chunks(self, chunks): # type: (Iterator[bytes]) -> None 'Check good hashes against ones built from iterable of chunks of\n data.\n\n Raise HashMismatch if none match.\n\n ' gots = {} for hash_name in iterkeys(self._allowed): try: gots[hash_name]...
def findFlippedSNPs(goldFrqFile1, sourceAlleles, outPrefix): """Find flipped SNPs and flip them in the data1.""" goldAlleles = {} with open(goldFrqFile1, "r") as inputFile: headerIndex = None for i, line in enumerate(inputFile): row = createRowFromPlinkSpacedOutput(line) ...
def function[findFlippedSNPs, parameter[goldFrqFile1, sourceAlleles, outPrefix]]: constant[Find flipped SNPs and flip them in the data1.] variable[goldAlleles] assign[=] dictionary[[], []] with call[name[open], parameter[name[goldFrqFile1], constant[r]]] begin[:] variable[headerI...
keyword[def] identifier[findFlippedSNPs] ( identifier[goldFrqFile1] , identifier[sourceAlleles] , identifier[outPrefix] ): literal[string] identifier[goldAlleles] ={} keyword[with] identifier[open] ( identifier[goldFrqFile1] , literal[string] ) keyword[as] identifier[inputFile] : identifier...
def findFlippedSNPs(goldFrqFile1, sourceAlleles, outPrefix): """Find flipped SNPs and flip them in the data1.""" goldAlleles = {} with open(goldFrqFile1, 'r') as inputFile: headerIndex = None for (i, line) in enumerate(inputFile): row = createRowFromPlinkSpacedOutput(line) ...
def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None, network_type='walk', timeout=180, memory=None, max_query_area_size=50*1000*50*1000, custom_osm_filter=None): """ Download OSM ways and nodes within a bounding box from the ...
def function[osm_net_download, parameter[lat_min, lng_min, lat_max, lng_max, network_type, timeout, memory, max_query_area_size, custom_osm_filter]]: constant[ Download OSM ways and nodes within a bounding box from the Overpass API. Parameters ---------- lat_min : float southern latitud...
keyword[def] identifier[osm_net_download] ( identifier[lat_min] = keyword[None] , identifier[lng_min] = keyword[None] , identifier[lat_max] = keyword[None] , identifier[lng_max] = keyword[None] , identifier[network_type] = literal[string] , identifier[timeout] = literal[int] , identifier[memory] = keyword[None] , i...
def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None, network_type='walk', timeout=180, memory=None, max_query_area_size=50 * 1000 * 50 * 1000, custom_osm_filter=None): """ Download OSM ways and nodes within a bounding box from the Overpass API. Parameters ---------- lat_min ...
def _get_path(): """Guarantee that /usr/local/bin and /usr/bin are in PATH""" if _path: return _path[0] environ_paths = set(os.environ['PATH'].split(':')) environ_paths.add('/usr/local/bin') environ_paths.add('/usr/bin') _path.append(':'.join(environ_paths)) logger.debug('PATH = %s',...
def function[_get_path, parameter[]]: constant[Guarantee that /usr/local/bin and /usr/bin are in PATH] if name[_path] begin[:] return[call[name[_path]][constant[0]]] variable[environ_paths] assign[=] call[name[set], parameter[call[call[name[os].environ][constant[PATH]].split, parameter[c...
keyword[def] identifier[_get_path] (): literal[string] keyword[if] identifier[_path] : keyword[return] identifier[_path] [ literal[int] ] identifier[environ_paths] = identifier[set] ( identifier[os] . identifier[environ] [ literal[string] ]. identifier[split] ( literal[string] )) ident...
def _get_path(): """Guarantee that /usr/local/bin and /usr/bin are in PATH""" if _path: return _path[0] # depends on [control=['if'], data=[]] environ_paths = set(os.environ['PATH'].split(':')) environ_paths.add('/usr/local/bin') environ_paths.add('/usr/bin') _path.append(':'.join(envir...
def _replace_constant_methods(self): """Replaces conventional distribution methods by its constant counterparts.""" self.cumulative_distribution = self._constant_cumulative_distribution self.percent_point = self._constant_percent_point self.probability_density = self._constant_probabilit...
def function[_replace_constant_methods, parameter[self]]: constant[Replaces conventional distribution methods by its constant counterparts.] name[self].cumulative_distribution assign[=] name[self]._constant_cumulative_distribution name[self].percent_point assign[=] name[self]._constant_percent_p...
keyword[def] identifier[_replace_constant_methods] ( identifier[self] ): literal[string] identifier[self] . identifier[cumulative_distribution] = identifier[self] . identifier[_constant_cumulative_distribution] identifier[self] . identifier[percent_point] = identifier[self] . identifier[_...
def _replace_constant_methods(self): """Replaces conventional distribution methods by its constant counterparts.""" self.cumulative_distribution = self._constant_cumulative_distribution self.percent_point = self._constant_percent_point self.probability_density = self._constant_probability_density se...
def load_locations(self, location_file=None): """Load locations into this resolver from the given *location_file*, which should contain one JSON object per line representing a location. If *location_file* is not specified, an internal location database is used.""" if location_fi...
def function[load_locations, parameter[self, location_file]]: constant[Load locations into this resolver from the given *location_file*, which should contain one JSON object per line representing a location. If *location_file* is not specified, an internal location database is used.] ...
keyword[def] identifier[load_locations] ( identifier[self] , identifier[location_file] = keyword[None] ): literal[string] keyword[if] identifier[location_file] keyword[is] keyword[None] : identifier[contents] = identifier[pkgutil] . identifier[get_data] ( identifier[__package__] , l...
def load_locations(self, location_file=None): """Load locations into this resolver from the given *location_file*, which should contain one JSON object per line representing a location. If *location_file* is not specified, an internal location database is used.""" if location_file is No...
def _restore_isolated(sampleset, bqm, isolated): """Return samples-like by adding isolated variables into sampleset in a way that minimizes the energy (relative to the other non-isolated variables). """ samples = sampleset.record.sample variables = sampleset.variables new_samples = np.empty((l...
def function[_restore_isolated, parameter[sampleset, bqm, isolated]]: constant[Return samples-like by adding isolated variables into sampleset in a way that minimizes the energy (relative to the other non-isolated variables). ] variable[samples] assign[=] name[sampleset].record.sample va...
keyword[def] identifier[_restore_isolated] ( identifier[sampleset] , identifier[bqm] , identifier[isolated] ): literal[string] identifier[samples] = identifier[sampleset] . identifier[record] . identifier[sample] identifier[variables] = identifier[sampleset] . identifier[variables] identifier...
def _restore_isolated(sampleset, bqm, isolated): """Return samples-like by adding isolated variables into sampleset in a way that minimizes the energy (relative to the other non-isolated variables). """ samples = sampleset.record.sample variables = sampleset.variables new_samples = np.empty((len...
def _generate_lastnames_variations(lastnames): """Generate variations for lastnames. Note: This method follows the assumption that the first last name is the main one. E.g. For 'Caro Estevez', this method generates: ['Caro', 'Caro Estevez']. In the case the lastnames are dashed, it spli...
def function[_generate_lastnames_variations, parameter[lastnames]]: constant[Generate variations for lastnames. Note: This method follows the assumption that the first last name is the main one. E.g. For 'Caro Estevez', this method generates: ['Caro', 'Caro Estevez']. In the case th...
keyword[def] identifier[_generate_lastnames_variations] ( identifier[lastnames] ): literal[string] keyword[if] keyword[not] identifier[lastnames] : keyword[return] [] identifier[split_lastnames] =[ identifier[split_lastname] keyword[for] identifier[lastname] keyword[in] identifier[last...
def _generate_lastnames_variations(lastnames): """Generate variations for lastnames. Note: This method follows the assumption that the first last name is the main one. E.g. For 'Caro Estevez', this method generates: ['Caro', 'Caro Estevez']. In the case the lastnames are dashed, it spli...
def setup_observations(self): """ main entry point for setting up observations """ obs_methods = [self.setup_water_budget_obs,self.setup_hyd, self.setup_smp,self.setup_hob,self.setup_hds, self.setup_sfr_obs] obs_types = ["mflist water budget...
def function[setup_observations, parameter[self]]: constant[ main entry point for setting up observations ] variable[obs_methods] assign[=] list[[<ast.Attribute object at 0x7da1b1d51630>, <ast.Attribute object at 0x7da1b1d51690>, <ast.Attribute object at 0x7da1b1d516f0>, <ast.Attribute object a...
keyword[def] identifier[setup_observations] ( identifier[self] ): literal[string] identifier[obs_methods] =[ identifier[self] . identifier[setup_water_budget_obs] , identifier[self] . identifier[setup_hyd] , identifier[self] . identifier[setup_smp] , identifier[self] . identifier[setup_hob...
def setup_observations(self): """ main entry point for setting up observations """ obs_methods = [self.setup_water_budget_obs, self.setup_hyd, self.setup_smp, self.setup_hob, self.setup_hds, self.setup_sfr_obs] obs_types = ['mflist water budget obs', 'hyd file', 'external obs-sim smp files', 'hob',...
def _clean_global_uninteresting_paths(self): """Marks paths that do not have any route targets of interest for withdrawal. Since global tables can have paths with route targets that are not interesting any more, we have to clean these paths so that appropriate withdraw are sent ...
def function[_clean_global_uninteresting_paths, parameter[self]]: constant[Marks paths that do not have any route targets of interest for withdrawal. Since global tables can have paths with route targets that are not interesting any more, we have to clean these paths so that appropriate...
keyword[def] identifier[_clean_global_uninteresting_paths] ( identifier[self] ): literal[string] identifier[uninteresting_dest_count] = literal[int] identifier[interested_rts] = identifier[self] . identifier[_rt_mgr] . identifier[global_interested_rts] identifier[LOG] . identifi...
def _clean_global_uninteresting_paths(self): """Marks paths that do not have any route targets of interest for withdrawal. Since global tables can have paths with route targets that are not interesting any more, we have to clean these paths so that appropriate withdraw are sent out ...
def build_calendar_etc(pfeed): """ Given a ProtoFeed, return a DataFrame representing ``calendar.txt`` and a dictionary of the form <service window ID> -> <service ID>, respectively. """ windows = pfeed.service_windows.copy() # Create a service ID for each distinct days_active field and map...
def function[build_calendar_etc, parameter[pfeed]]: constant[ Given a ProtoFeed, return a DataFrame representing ``calendar.txt`` and a dictionary of the form <service window ID> -> <service ID>, respectively. ] variable[windows] assign[=] call[name[pfeed].service_windows.copy, parameter...
keyword[def] identifier[build_calendar_etc] ( identifier[pfeed] ): literal[string] identifier[windows] = identifier[pfeed] . identifier[service_windows] . identifier[copy] () keyword[def] identifier[get_sid] ( identifier[bitlist] ): keyword[return] literal[string] + literal[strin...
def build_calendar_etc(pfeed): """ Given a ProtoFeed, return a DataFrame representing ``calendar.txt`` and a dictionary of the form <service window ID> -> <service ID>, respectively. """ windows = pfeed.service_windows.copy() # Create a service ID for each distinct days_active field and map ...
def resources(self, absolute_url=None): ''' Provide a :class:`~bokeh.resources.Resources` that specifies where Bokeh application sessions should load BokehJS resources from. Args: absolute_url (bool): An absolute URL prefix to use for locating resources. If None, ...
def function[resources, parameter[self, absolute_url]]: constant[ Provide a :class:`~bokeh.resources.Resources` that specifies where Bokeh application sessions should load BokehJS resources from. Args: absolute_url (bool): An absolute URL prefix to use for locating r...
keyword[def] identifier[resources] ( identifier[self] , identifier[absolute_url] = keyword[None] ): literal[string] keyword[if] identifier[absolute_url] : keyword[return] identifier[Resources] ( identifier[mode] = literal[string] , identifier[root_url] = identifier[absolute_url] + id...
def resources(self, absolute_url=None): """ Provide a :class:`~bokeh.resources.Resources` that specifies where Bokeh application sessions should load BokehJS resources from. Args: absolute_url (bool): An absolute URL prefix to use for locating resources. If None, ...
def get_serializer_class(self): """gets the class type of the serializer :return: `rest_framework.Serializer` """ klass = None lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field if lookup_url_kwarg in self.kwargs: # Looks like this is a detail... ...
def function[get_serializer_class, parameter[self]]: constant[gets the class type of the serializer :return: `rest_framework.Serializer` ] variable[klass] assign[=] constant[None] variable[lookup_url_kwarg] assign[=] <ast.BoolOp object at 0x7da1b0a873a0> if compare[name[...
keyword[def] identifier[get_serializer_class] ( identifier[self] ): literal[string] identifier[klass] = keyword[None] identifier[lookup_url_kwarg] = identifier[self] . identifier[lookup_url_kwarg] keyword[or] identifier[self] . identifier[lookup_field] keyword[if] identifier...
def get_serializer_class(self): """gets the class type of the serializer :return: `rest_framework.Serializer` """ klass = None lookup_url_kwarg = self.lookup_url_kwarg or self.lookup_field if lookup_url_kwarg in self.kwargs: # Looks like this is a detail... klass = self....
def express_route_gateways(self): """Instance depends on the API version: * 2018-08-01: :class:`ExpressRouteGatewaysOperations<azure.mgmt.network.v2018_08_01.operations.ExpressRouteGatewaysOperations>` """ api_version = self._get_api_version('express_route_gateways') if api_v...
def function[express_route_gateways, parameter[self]]: constant[Instance depends on the API version: * 2018-08-01: :class:`ExpressRouteGatewaysOperations<azure.mgmt.network.v2018_08_01.operations.ExpressRouteGatewaysOperations>` ] variable[api_version] assign[=] call[name[self]._get_...
keyword[def] identifier[express_route_gateways] ( identifier[self] ): literal[string] identifier[api_version] = identifier[self] . identifier[_get_api_version] ( literal[string] ) keyword[if] identifier[api_version] == literal[string] : keyword[from] . identifier[v2018_08_01]...
def express_route_gateways(self): """Instance depends on the API version: * 2018-08-01: :class:`ExpressRouteGatewaysOperations<azure.mgmt.network.v2018_08_01.operations.ExpressRouteGatewaysOperations>` """ api_version = self._get_api_version('express_route_gateways') if api_version == '2...
def get_hwclock(): ''' Get current hardware clock setting (UTC or localtime) CLI Example: .. code-block:: bash salt '*' timezone.get_hwclock ''' if salt.utils.path.which('timedatectl'): ret = _timedatectl() for line in (x.strip() for x in ret['stdout'].splitlines()): ...
def function[get_hwclock, parameter[]]: constant[ Get current hardware clock setting (UTC or localtime) CLI Example: .. code-block:: bash salt '*' timezone.get_hwclock ] if call[name[salt].utils.path.which, parameter[constant[timedatectl]]] begin[:] variable[re...
keyword[def] identifier[get_hwclock] (): literal[string] keyword[if] identifier[salt] . identifier[utils] . identifier[path] . identifier[which] ( literal[string] ): identifier[ret] = identifier[_timedatectl] () keyword[for] identifier[line] keyword[in] ( identifier[x] . identifier[str...
def get_hwclock(): """ Get current hardware clock setting (UTC or localtime) CLI Example: .. code-block:: bash salt '*' timezone.get_hwclock """ if salt.utils.path.which('timedatectl'): ret = _timedatectl() for line in (x.strip() for x in ret['stdout'].splitlines()): ...
def restore_collection(backup): """ Restore from a collection backup. Args: backup (dict): """ for k, v in six.iteritems(backup): del tf.get_collection_ref(k)[:] tf.get_collection_ref(k).extend(v)
def function[restore_collection, parameter[backup]]: constant[ Restore from a collection backup. Args: backup (dict): ] for taget[tuple[[<ast.Name object at 0x7da18f721d20>, <ast.Name object at 0x7da18f7234c0>]]] in starred[call[name[six].iteritems, parameter[name[backup]]]] begin[:...
keyword[def] identifier[restore_collection] ( identifier[backup] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[six] . identifier[iteritems] ( identifier[backup] ): keyword[del] identifier[tf] . identifier[get_collection_ref] ( identifier[k] )[:] ...
def restore_collection(backup): """ Restore from a collection backup. Args: backup (dict): """ for (k, v) in six.iteritems(backup): del tf.get_collection_ref(k)[:] tf.get_collection_ref(k).extend(v) # depends on [control=['for'], data=[]]
def handle_entityref(self, entity): ''' Internal for parsing ''' inTag = self._inTag if len(inTag) > 0: inTag[-1].appendText('&%s;' %(entity,)) else: raise MultipleRootNodeException()
def function[handle_entityref, parameter[self, entity]]: constant[ Internal for parsing ] variable[inTag] assign[=] name[self]._inTag if compare[call[name[len], parameter[name[inTag]]] greater[>] constant[0]] begin[:] call[call[name[inTag]][<ast.UnaryOp object...
keyword[def] identifier[handle_entityref] ( identifier[self] , identifier[entity] ): literal[string] identifier[inTag] = identifier[self] . identifier[_inTag] keyword[if] identifier[len] ( identifier[inTag] )> literal[int] : identifier[inTag] [- literal[int] ]. identifier[ap...
def handle_entityref(self, entity): """ Internal for parsing """ inTag = self._inTag if len(inTag) > 0: inTag[-1].appendText('&%s;' % (entity,)) # depends on [control=['if'], data=[]] else: raise MultipleRootNodeException()
def _setOptionValueAdvAudit(option, value): ''' Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows ...
def function[_setOptionValueAdvAudit, parameter[option, value]]: constant[ Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\Windows\Security\Audit\audit.csv C:\Windows\System32\GroupPolicy\Machi...
keyword[def] identifier[_setOptionValueAdvAudit] ( identifier[option] , identifier[value] ): literal[string] keyword[if] keyword[not] identifier[_set_audit_file_data] ( identifier[option] = identifier[option] , identifier[value] = identifier[value] ): keyword[raise] identifier[CommandExecu...
def _setOptionValueAdvAudit(option, value): """ Helper function to update the Advanced Audit policy on the machine. This function modifies the two ``audit.csv`` files in the following locations: C:\\Windows\\Security\\Audit\\audit.csv C:\\Windows\\System32\\GroupPolicy\\Machine\\Microsoft\\Windows ...
def main(): """Main entry-point for oz's cli""" # Hack to make user code available for import sys.path.append(".") # Run the specified action oz.initialize() retr = optfn.run(list(oz._actions.values())) if retr == optfn.ERROR_RETURN_CODE: sys.exit(-1) elif retr == None: ...
def function[main, parameter[]]: constant[Main entry-point for oz's cli] call[name[sys].path.append, parameter[constant[.]]] call[name[oz].initialize, parameter[]] variable[retr] assign[=] call[name[optfn].run, parameter[call[name[list], parameter[call[name[oz]._actions.values, parameter...
keyword[def] identifier[main] (): literal[string] identifier[sys] . identifier[path] . identifier[append] ( literal[string] ) identifier[oz] . identifier[initialize] () identifier[retr] = identifier[optfn] . identifier[run] ( identifier[list] ( identifier[oz] . identifier[_actions] . ...
def main(): """Main entry-point for oz's cli""" # Hack to make user code available for import sys.path.append('.') # Run the specified action oz.initialize() retr = optfn.run(list(oz._actions.values())) if retr == optfn.ERROR_RETURN_CODE: sys.exit(-1) # depends on [control=['if'], d...
def get_all_sources(self): """Returns all sources for all batches of this Executor.""" result = [] for batch in self.batches: result.extend(batch.sources) return result
def function[get_all_sources, parameter[self]]: constant[Returns all sources for all batches of this Executor.] variable[result] assign[=] list[[]] for taget[name[batch]] in starred[name[self].batches] begin[:] call[name[result].extend, parameter[name[batch].sources]] return[...
keyword[def] identifier[get_all_sources] ( identifier[self] ): literal[string] identifier[result] =[] keyword[for] identifier[batch] keyword[in] identifier[self] . identifier[batches] : identifier[result] . identifier[extend] ( identifier[batch] . identifier[sources] ) ...
def get_all_sources(self): """Returns all sources for all batches of this Executor.""" result = [] for batch in self.batches: result.extend(batch.sources) # depends on [control=['for'], data=['batch']] return result
def load(cli, yaml_filename): """Creates waybill shims from a given yaml file definiations""" """Expected Definition: - name: NAME docker_id: IMAGE - name: NAME docker_id: IMAGE """ with open(yaml_filename, 'rb') as filehandle: for waybill ...
def function[load, parameter[cli, yaml_filename]]: constant[Creates waybill shims from a given yaml file definiations] constant[Expected Definition: - name: NAME docker_id: IMAGE - name: NAME docker_id: IMAGE ] with call[name[open], parameter[name[yaml...
keyword[def] identifier[load] ( identifier[cli] , identifier[yaml_filename] ): literal[string] literal[string] keyword[with] identifier[open] ( identifier[yaml_filename] , literal[string] ) keyword[as] identifier[filehandle] : keyword[for] identifier[waybill] keyword[in] ...
def load(cli, yaml_filename): """Creates waybill shims from a given yaml file definiations""" 'Expected Definition:\n - name: NAME\n docker_id: IMAGE\n - name: NAME\n docker_id: IMAGE\n ' with open(yaml_filename, 'rb') as filehandle: for waybill in yaml.load(fi...
def incremental_neighbor_graph(X, precomputed=False, k=None, epsilon=None, weighting='none'): '''See neighbor_graph.''' assert ((k is not None) or (epsilon is not None) ), "Must provide `k` or `epsilon`" assert (_issequence(k) ^ _issequence(epsilon) ), "Exactly o...
def function[incremental_neighbor_graph, parameter[X, precomputed, k, epsilon, weighting]]: constant[See neighbor_graph.] assert[<ast.BoolOp object at 0x7da1b26adf90>] assert[binary_operation[call[name[_issequence], parameter[name[k]]] <ast.BitXor object at 0x7da2590d6b00> call[name[_issequence], parame...
keyword[def] identifier[incremental_neighbor_graph] ( identifier[X] , identifier[precomputed] = keyword[False] , identifier[k] = keyword[None] , identifier[epsilon] = keyword[None] , identifier[weighting] = literal[string] ): literal[string] keyword[assert] (( identifier[k] keyword[is] keyword[not] keyword...
def incremental_neighbor_graph(X, precomputed=False, k=None, epsilon=None, weighting='none'): """See neighbor_graph.""" assert k is not None or epsilon is not None, 'Must provide `k` or `epsilon`' assert _issequence(k) ^ _issequence(epsilon), 'Exactly one of `k` or `epsilon` must be a sequence.' assert ...
def handle_reply(self, msg): """Handle a reply message related to the current request. Reply messages not related to the current request go up to the base class method. Parameters ---------- msg : Message object The reply message to dispatch. """ ...
def function[handle_reply, parameter[self, msg]]: constant[Handle a reply message related to the current request. Reply messages not related to the current request go up to the base class method. Parameters ---------- msg : Message object The reply message t...
keyword[def] identifier[handle_reply] ( identifier[self] , identifier[msg] ): literal[string] keyword[if] identifier[msg] . identifier[mid] keyword[is] keyword[not] keyword[None] : identifier[_request] , identifier[reply_cb] , identifier[_inform_cb] , identifier[u...
def handle_reply(self, msg): """Handle a reply message related to the current request. Reply messages not related to the current request go up to the base class method. Parameters ---------- msg : Message object The reply message to dispatch. """ # ...
def SaveResourceUsage(self, client_id, status): """Update the resource usage of the hunt.""" # Per client stats. self.hunt_obj.ProcessClientResourcesStats(client_id, status) # Overall hunt resource usage. self.UpdateProtoResources(status)
def function[SaveResourceUsage, parameter[self, client_id, status]]: constant[Update the resource usage of the hunt.] call[name[self].hunt_obj.ProcessClientResourcesStats, parameter[name[client_id], name[status]]] call[name[self].UpdateProtoResources, parameter[name[status]]]
keyword[def] identifier[SaveResourceUsage] ( identifier[self] , identifier[client_id] , identifier[status] ): literal[string] identifier[self] . identifier[hunt_obj] . identifier[ProcessClientResourcesStats] ( identifier[client_id] , identifier[status] ) identifier[self] . identifier[UpdateP...
def SaveResourceUsage(self, client_id, status): """Update the resource usage of the hunt.""" # Per client stats. self.hunt_obj.ProcessClientResourcesStats(client_id, status) # Overall hunt resource usage. self.UpdateProtoResources(status)
def total_stored(self, wanted, slots=None): """ Calculates the total number of items of that type in the current window or given slot range. Args: wanted: function(Slot) or Slot or itemID or (itemID, metadata) """ if slots is None: slots = self.wi...
def function[total_stored, parameter[self, wanted, slots]]: constant[ Calculates the total number of items of that type in the current window or given slot range. Args: wanted: function(Slot) or Slot or itemID or (itemID, metadata) ] if compare[name[slots] is...
keyword[def] identifier[total_stored] ( identifier[self] , identifier[wanted] , identifier[slots] = keyword[None] ): literal[string] keyword[if] identifier[slots] keyword[is] keyword[None] : identifier[slots] = identifier[self] . identifier[window] . identifier[slots] iden...
def total_stored(self, wanted, slots=None): """ Calculates the total number of items of that type in the current window or given slot range. Args: wanted: function(Slot) or Slot or itemID or (itemID, metadata) """ if slots is None: slots = self.window.slots ...
async def create_and_store_my_did(wallet_handle: int, did_json: str) -> (str, str): """ Creates keys (signing and encryption keys) for a new DID (owned by the caller of the library). Identity's DID must be either explicitly provided, or taken as the first 16 bit of verk...
<ast.AsyncFunctionDef object at 0x7da18c4cf9a0>
keyword[async] keyword[def] identifier[create_and_store_my_did] ( identifier[wallet_handle] : identifier[int] , identifier[did_json] : identifier[str] )->( identifier[str] , identifier[str] ): literal[string] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[__name__] ) ...
async def create_and_store_my_did(wallet_handle: int, did_json: str) -> (str, str): """ Creates keys (signing and encryption keys) for a new DID (owned by the caller of the library). Identity's DID must be either explicitly provided, or taken as the first 16 bit of verkey. Saves the Identity DID wit...
def cut_microsoft_quote(html_message): ''' Cuts splitter block and all following blocks. ''' #use EXSLT extensions to have a regex match() function with lxml ns = {"re": "http://exslt.org/regular-expressions"} #general pattern: @style='border:none;border-top:solid <color> 1.0pt;padding:3.0pt 0<unit> 0<...
def function[cut_microsoft_quote, parameter[html_message]]: constant[ Cuts splitter block and all following blocks. ] variable[ns] assign[=] dictionary[[<ast.Constant object at 0x7da1b22e8c40>], [<ast.Constant object at 0x7da1b22ebfa0>]] variable[splitter] assign[=] call[name[html_message].xpath...
keyword[def] identifier[cut_microsoft_quote] ( identifier[html_message] ): literal[string] identifier[ns] ={ literal[string] : literal[string] } identifier[splitter] = identifier[html_message] . identifier[xpath] ( literal[string] literal[string] ...
def cut_microsoft_quote(html_message): """ Cuts splitter block and all following blocks. """ #use EXSLT extensions to have a regex match() function with lxml ns = {'re': 'http://exslt.org/regular-expressions'} #general pattern: @style='border:none;border-top:solid <color> 1.0pt;padding:3.0pt 0<unit> 0<u...
def setup(self): """ Do any setup work needed to run i3status modules """ for conf_name in self.py3_config["i3s_modules"]: module = I3statusModule(conf_name, self) self.i3modules[conf_name] = module if module.is_time_module: self.time_m...
def function[setup, parameter[self]]: constant[ Do any setup work needed to run i3status modules ] for taget[name[conf_name]] in starred[call[name[self].py3_config][constant[i3s_modules]]] begin[:] variable[module] assign[=] call[name[I3statusModule], parameter[name[conf_...
keyword[def] identifier[setup] ( identifier[self] ): literal[string] keyword[for] identifier[conf_name] keyword[in] identifier[self] . identifier[py3_config] [ literal[string] ]: identifier[module] = identifier[I3statusModule] ( identifier[conf_name] , identifier[self] ) ...
def setup(self): """ Do any setup work needed to run i3status modules """ for conf_name in self.py3_config['i3s_modules']: module = I3statusModule(conf_name, self) self.i3modules[conf_name] = module if module.is_time_module: self.time_modules.append(module) #...
def set_identities(self,identities): """Set identities in the disco#info object. Remove all existing identities from `self`. :Parameters: - `identities`: list of identities or identity properties (jid,node,category,type,name). :Types: - `identities...
def function[set_identities, parameter[self, identities]]: constant[Set identities in the disco#info object. Remove all existing identities from `self`. :Parameters: - `identities`: list of identities or identity properties (jid,node,category,type,name). :Type...
keyword[def] identifier[set_identities] ( identifier[self] , identifier[identities] ): literal[string] keyword[for] identifier[identity] keyword[in] identifier[self] . identifier[identities] : identifier[identity] . identifier[remove] () keyword[for] identifier[identity] ...
def set_identities(self, identities): """Set identities in the disco#info object. Remove all existing identities from `self`. :Parameters: - `identities`: list of identities or identity properties (jid,node,category,type,name). :Types: - `identities`: ...
def settimeout(self, timeout): """ Set the timeout to the websocket. timeout: timeout time(second). """ self.sock_opt.timeout = timeout if self.sock: self.sock.settimeout(timeout)
def function[settimeout, parameter[self, timeout]]: constant[ Set the timeout to the websocket. timeout: timeout time(second). ] name[self].sock_opt.timeout assign[=] name[timeout] if name[self].sock begin[:] call[name[self].sock.settimeout, parameter[nam...
keyword[def] identifier[settimeout] ( identifier[self] , identifier[timeout] ): literal[string] identifier[self] . identifier[sock_opt] . identifier[timeout] = identifier[timeout] keyword[if] identifier[self] . identifier[sock] : identifier[self] . identifier[sock] . identif...
def settimeout(self, timeout): """ Set the timeout to the websocket. timeout: timeout time(second). """ self.sock_opt.timeout = timeout if self.sock: self.sock.settimeout(timeout) # depends on [control=['if'], data=[]]
def set_mode(self, mode): """ :param mode: a str, one of [home, away, night] :return: nothing """ values = {"desired_state": {"mode": mode}} response = self.api_interface.set_device_state(self, values) self._update_state_from_response(response)
def function[set_mode, parameter[self, mode]]: constant[ :param mode: a str, one of [home, away, night] :return: nothing ] variable[values] assign[=] dictionary[[<ast.Constant object at 0x7da1b255e230>], [<ast.Dict object at 0x7da1b255e260>]] variable[response] assign[=]...
keyword[def] identifier[set_mode] ( identifier[self] , identifier[mode] ): literal[string] identifier[values] ={ literal[string] :{ literal[string] : identifier[mode] }} identifier[response] = identifier[self] . identifier[api_interface] . identifier[set_device_state] ( identifier[self] , ...
def set_mode(self, mode): """ :param mode: a str, one of [home, away, night] :return: nothing """ values = {'desired_state': {'mode': mode}} response = self.api_interface.set_device_state(self, values) self._update_state_from_response(response)
def make_multi_entry(plist, pkg_pyvers, ver_dict): """Generate Python interpreter version entries.""" for pyver in pkg_pyvers: pver = pyver[2] + "." + pyver[3:] plist.append("Python {0}: {1}".format(pver, ops_to_words(ver_dict[pyver])))
def function[make_multi_entry, parameter[plist, pkg_pyvers, ver_dict]]: constant[Generate Python interpreter version entries.] for taget[name[pyver]] in starred[name[pkg_pyvers]] begin[:] variable[pver] assign[=] binary_operation[binary_operation[call[name[pyver]][constant[2]] + constant...
keyword[def] identifier[make_multi_entry] ( identifier[plist] , identifier[pkg_pyvers] , identifier[ver_dict] ): literal[string] keyword[for] identifier[pyver] keyword[in] identifier[pkg_pyvers] : identifier[pver] = identifier[pyver] [ literal[int] ]+ literal[string] + identifier[pyver] [ liter...
def make_multi_entry(plist, pkg_pyvers, ver_dict): """Generate Python interpreter version entries.""" for pyver in pkg_pyvers: pver = pyver[2] + '.' + pyver[3:] plist.append('Python {0}: {1}'.format(pver, ops_to_words(ver_dict[pyver]))) # depends on [control=['for'], data=['pyver']]
def explode(self): """ Fill members with contactgroup_members :return:None """ # We do not want a same hg to be explode again and again # so we tag it for tmp_cg in list(self.items.values()): tmp_cg.already_exploded = False for contactgroup i...
def function[explode, parameter[self]]: constant[ Fill members with contactgroup_members :return:None ] for taget[name[tmp_cg]] in starred[call[name[list], parameter[call[name[self].items.values, parameter[]]]]] begin[:] name[tmp_cg].already_exploded assign[=] co...
keyword[def] identifier[explode] ( identifier[self] ): literal[string] keyword[for] identifier[tmp_cg] keyword[in] identifier[list] ( identifier[self] . identifier[items] . identifier[values] ()): identifier[tmp_cg] . identifier[already_exploded] = keyword[False] ...
def explode(self): """ Fill members with contactgroup_members :return:None """ # We do not want a same hg to be explode again and again # so we tag it for tmp_cg in list(self.items.values()): tmp_cg.already_exploded = False # depends on [control=['for'], data=['tmp_cg']...
def create_dir(self, params, delete=False): """ creates a subdirectory for the experiment, and deletes existing files, if the delete flag is true. then writes the current experiment.cfg file in the folder. """ # create experiment path and subdir fullpath = os.path...
def function[create_dir, parameter[self, params, delete]]: constant[ creates a subdirectory for the experiment, and deletes existing files, if the delete flag is true. then writes the current experiment.cfg file in the folder. ] variable[fullpath] assign[=] call[name[os]....
keyword[def] identifier[create_dir] ( identifier[self] , identifier[params] , identifier[delete] = keyword[False] ): literal[string] identifier[fullpath] = identifier[os] . identifier[path] . identifier[join] ( identifier[params] [ literal[string] ], identifier[params] [ literal[string] ])...
def create_dir(self, params, delete=False): """ creates a subdirectory for the experiment, and deletes existing files, if the delete flag is true. then writes the current experiment.cfg file in the folder. """ # create experiment path and subdir fullpath = os.path.join(params...
def get_timer_event_definition(self, timerEventDefinition): """ Parse the timerEventDefinition node and return an instance of TimerEventDefinition This currently only supports the timeDate node for specifying an expiry time for the timer. """ timeDate = first(sel...
def function[get_timer_event_definition, parameter[self, timerEventDefinition]]: constant[ Parse the timerEventDefinition node and return an instance of TimerEventDefinition This currently only supports the timeDate node for specifying an expiry time for the timer. ] ...
keyword[def] identifier[get_timer_event_definition] ( identifier[self] , identifier[timerEventDefinition] ): literal[string] identifier[timeDate] = identifier[first] ( identifier[self] . identifier[xpath] ( literal[string] )) keyword[return] identifier[TimerEventDefinition] ( ide...
def get_timer_event_definition(self, timerEventDefinition): """ Parse the timerEventDefinition node and return an instance of TimerEventDefinition This currently only supports the timeDate node for specifying an expiry time for the timer. """ timeDate = first(self.xpath(...
def has_symbol(self, symbol, as_of=None): """ Return True if the 'symbol' exists in this library AND the symbol isn't deleted in the specified as_of. It's possible for a deleted symbol to exist in older snapshots. Parameters ---------- symbol : `str` ...
def function[has_symbol, parameter[self, symbol, as_of]]: constant[ Return True if the 'symbol' exists in this library AND the symbol isn't deleted in the specified as_of. It's possible for a deleted symbol to exist in older snapshots. Parameters ---------- symb...
keyword[def] identifier[has_symbol] ( identifier[self] , identifier[symbol] , identifier[as_of] = keyword[None] ): literal[string] keyword[try] : identifier[self] . identifier[_read_metadata] ( identifier[symbol] , identifier[as_of] = identifier[as_of] , identifier[read_prefer...
def has_symbol(self, symbol, as_of=None): """ Return True if the 'symbol' exists in this library AND the symbol isn't deleted in the specified as_of. It's possible for a deleted symbol to exist in older snapshots. Parameters ---------- symbol : `str` sym...
def delete_user(self, user_id): """Delete user specified user. :param str user_id: the ID of the user to delete (Required) :returns: void """ api = self._get_api(iam.AccountAdminApi) api.delete_user(user_id) return
def function[delete_user, parameter[self, user_id]]: constant[Delete user specified user. :param str user_id: the ID of the user to delete (Required) :returns: void ] variable[api] assign[=] call[name[self]._get_api, parameter[name[iam].AccountAdminApi]] call[name[api].d...
keyword[def] identifier[delete_user] ( identifier[self] , identifier[user_id] ): literal[string] identifier[api] = identifier[self] . identifier[_get_api] ( identifier[iam] . identifier[AccountAdminApi] ) identifier[api] . identifier[delete_user] ( identifier[user_id] ) keyword[re...
def delete_user(self, user_id): """Delete user specified user. :param str user_id: the ID of the user to delete (Required) :returns: void """ api = self._get_api(iam.AccountAdminApi) api.delete_user(user_id) return
def filter_from_mapping(self, mapping, backend=None): """ Return mappings that either exactly correspond to the given `mapping` tuple, or, if the second item of `mapping` is `None`, include mappings that only match the first item of `mapping` (useful to show all mappings for a gi...
def function[filter_from_mapping, parameter[self, mapping, backend]]: constant[ Return mappings that either exactly correspond to the given `mapping` tuple, or, if the second item of `mapping` is `None`, include mappings that only match the first item of `mapping` (useful to show all ...
keyword[def] identifier[filter_from_mapping] ( identifier[self] , identifier[mapping] , identifier[backend] = keyword[None] ): literal[string] keyword[def] identifier[mapping_filter] ( identifier[key_item] ): identifier[key] , identifier[item] = identifier[key_item] key...
def filter_from_mapping(self, mapping, backend=None): """ Return mappings that either exactly correspond to the given `mapping` tuple, or, if the second item of `mapping` is `None`, include mappings that only match the first item of `mapping` (useful to show all mappings for a given ...
def staticfy(html_file, args=argparse.ArgumentParser()): """ Staticfy method. Loop through each line of the file and replaces the old links """ # unpack arguments static_endpoint = args.static_endpoint or 'static' framework = args.framework or os.getenv('STATICFY_FRAMEWORK', 'flask') ad...
def function[staticfy, parameter[html_file, args]]: constant[ Staticfy method. Loop through each line of the file and replaces the old links ] variable[static_endpoint] assign[=] <ast.BoolOp object at 0x7da18c4ccb50> variable[framework] assign[=] <ast.BoolOp object at 0x7da18c4cf9d0...
keyword[def] identifier[staticfy] ( identifier[html_file] , identifier[args] = identifier[argparse] . identifier[ArgumentParser] ()): literal[string] identifier[static_endpoint] = identifier[args] . identifier[static_endpoint] keyword[or] literal[string] identifier[framework] = identifier[args...
def staticfy(html_file, args=argparse.ArgumentParser()): """ Staticfy method. Loop through each line of the file and replaces the old links """ # unpack arguments static_endpoint = args.static_endpoint or 'static' framework = args.framework or os.getenv('STATICFY_FRAMEWORK', 'flask') ad...
def do_alias(self, args: argparse.Namespace) -> None: """Manage aliases""" func = getattr(args, 'func', None) if func is not None: # Call whatever sub-command function was selected func(self, args) else: # No sub-command was provided, so call help ...
def function[do_alias, parameter[self, args]]: constant[Manage aliases] variable[func] assign[=] call[name[getattr], parameter[name[args], constant[func], constant[None]]] if compare[name[func] is_not constant[None]] begin[:] call[name[func], parameter[name[self], name[args]]]
keyword[def] identifier[do_alias] ( identifier[self] , identifier[args] : identifier[argparse] . identifier[Namespace] )-> keyword[None] : literal[string] identifier[func] = identifier[getattr] ( identifier[args] , literal[string] , keyword[None] ) keyword[if] identifier[func] keyword[is...
def do_alias(self, args: argparse.Namespace) -> None: """Manage aliases""" func = getattr(args, 'func', None) if func is not None: # Call whatever sub-command function was selected func(self, args) # depends on [control=['if'], data=['func']] else: # No sub-command was provided,...
def methods(self): """Iterate over all of the method defined in this class and its parents. :returns: The methods defined on the class. :rtype: iterable(FunctionDef) """ done = {} for astroid in itertools.chain(iter((self,)), self.ancestors()): for meth in as...
def function[methods, parameter[self]]: constant[Iterate over all of the method defined in this class and its parents. :returns: The methods defined on the class. :rtype: iterable(FunctionDef) ] variable[done] assign[=] dictionary[[], []] for taget[name[astroid]] in star...
keyword[def] identifier[methods] ( identifier[self] ): literal[string] identifier[done] ={} keyword[for] identifier[astroid] keyword[in] identifier[itertools] . identifier[chain] ( identifier[iter] (( identifier[self] ,)), identifier[self] . identifier[ancestors] ()): keywo...
def methods(self): """Iterate over all of the method defined in this class and its parents. :returns: The methods defined on the class. :rtype: iterable(FunctionDef) """ done = {} for astroid in itertools.chain(iter((self,)), self.ancestors()): for meth in astroid.mymethods(...
def add_channel(self, channel_name, datatype, channel_type, data_url, file_format, file_type, exceptions=None, resolution=None, windowrange=None, readonly=None): """ Arguments: channel_name (str): Channel Name is the specific name of a ...
def function[add_channel, parameter[self, channel_name, datatype, channel_type, data_url, file_format, file_type, exceptions, resolution, windowrange, readonly]]: constant[ Arguments: channel_name (str): Channel Name is the specific name of a specific series of data. Standard...
keyword[def] identifier[add_channel] ( identifier[self] , identifier[channel_name] , identifier[datatype] , identifier[channel_type] , identifier[data_url] , identifier[file_format] , identifier[file_type] , identifier[exceptions] = keyword[None] , identifier[resolution] = keyword[None] , identifier[windowrange] = ...
def add_channel(self, channel_name, datatype, channel_type, data_url, file_format, file_type, exceptions=None, resolution=None, windowrange=None, readonly=None): """ Arguments: channel_name (str): Channel Name is the specific name of a specific series of data. Standard naming con...
def create_blueprint(endpoints): """Create Invenio-Deposit-UI blueprint. See: :data:`invenio_deposit.config.DEPOSIT_RECORDS_UI_ENDPOINTS`. :param endpoints: List of endpoints configuration. :returns: The configured blueprint. """ from invenio_records_ui.views import create_url_rule bluepr...
def function[create_blueprint, parameter[endpoints]]: constant[Create Invenio-Deposit-UI blueprint. See: :data:`invenio_deposit.config.DEPOSIT_RECORDS_UI_ENDPOINTS`. :param endpoints: List of endpoints configuration. :returns: The configured blueprint. ] from relative_module[invenio_record...
keyword[def] identifier[create_blueprint] ( identifier[endpoints] ): literal[string] keyword[from] identifier[invenio_records_ui] . identifier[views] keyword[import] identifier[create_url_rule] identifier[blueprint] = identifier[Blueprint] ( literal[string] , identifier[__name__] , ...
def create_blueprint(endpoints): """Create Invenio-Deposit-UI blueprint. See: :data:`invenio_deposit.config.DEPOSIT_RECORDS_UI_ENDPOINTS`. :param endpoints: List of endpoints configuration. :returns: The configured blueprint. """ from invenio_records_ui.views import create_url_rule bluepri...
def get_specidentitem_percolator_data(item, xmlns): """Loop through SpecIdentificationItem children. Find percolator data by matching to a dict lookup. Return a dict containing percolator data""" percomap = {'{0}userParam'.format(xmlns): PERCO_HEADERMAP, } percodata = {} for child in item: ...
def function[get_specidentitem_percolator_data, parameter[item, xmlns]]: constant[Loop through SpecIdentificationItem children. Find percolator data by matching to a dict lookup. Return a dict containing percolator data] variable[percomap] assign[=] dictionary[[<ast.Call object at 0x7da1b24ac160...
keyword[def] identifier[get_specidentitem_percolator_data] ( identifier[item] , identifier[xmlns] ): literal[string] identifier[percomap] ={ literal[string] . identifier[format] ( identifier[xmlns] ): identifier[PERCO_HEADERMAP] ,} identifier[percodata] ={} keyword[for] identifier[child] keywor...
def get_specidentitem_percolator_data(item, xmlns): """Loop through SpecIdentificationItem children. Find percolator data by matching to a dict lookup. Return a dict containing percolator data""" percomap = {'{0}userParam'.format(xmlns): PERCO_HEADERMAP} percodata = {} for child in item: ...
def parse_datetime(s: str) -> datetime.date: """Try to parse a datetime object from a standard datetime format or date format.""" for fmt in (CREATION_DATE_FMT, PUBLISHED_DATE_FMT, PUBLISHED_DATE_FMT_2): try: dt = datetime.strptime(s, fmt) except ValueError: pass ...
def function[parse_datetime, parameter[s]]: constant[Try to parse a datetime object from a standard datetime format or date format.] for taget[name[fmt]] in starred[tuple[[<ast.Name object at 0x7da207f99150>, <ast.Name object at 0x7da207f98fa0>, <ast.Name object at 0x7da207f9ac20>]]] begin[:] <a...
keyword[def] identifier[parse_datetime] ( identifier[s] : identifier[str] )-> identifier[datetime] . identifier[date] : literal[string] keyword[for] identifier[fmt] keyword[in] ( identifier[CREATION_DATE_FMT] , identifier[PUBLISHED_DATE_FMT] , identifier[PUBLISHED_DATE_FMT_2] ): keyword[try] : ...
def parse_datetime(s: str) -> datetime.date: """Try to parse a datetime object from a standard datetime format or date format.""" for fmt in (CREATION_DATE_FMT, PUBLISHED_DATE_FMT, PUBLISHED_DATE_FMT_2): try: dt = datetime.strptime(s, fmt) # depends on [control=['try'], data=[]] exc...
def getElementText(self, node, preserve_ws=None): """Return the text value of an xml element node. Leading and trailing whitespace is stripped from the value unless the preserve_ws flag is passed with a true value.""" result = [] for child in node.childNodes: no...
def function[getElementText, parameter[self, node, preserve_ws]]: constant[Return the text value of an xml element node. Leading and trailing whitespace is stripped from the value unless the preserve_ws flag is passed with a true value.] variable[result] assign[=] list[[]] ...
keyword[def] identifier[getElementText] ( identifier[self] , identifier[node] , identifier[preserve_ws] = keyword[None] ): literal[string] identifier[result] =[] keyword[for] identifier[child] keyword[in] identifier[node] . identifier[childNodes] : identifier[nodetype] = id...
def getElementText(self, node, preserve_ws=None): """Return the text value of an xml element node. Leading and trailing whitespace is stripped from the value unless the preserve_ws flag is passed with a true value.""" result = [] for child in node.childNodes: nodetype = child.n...
def _connectWithContextFactory(ctxFactory, workbench): """Connect using the given context factory. Notifications go to the given workbench. """ endpoint = SSL4ClientEndpoint(reactor, "localhost", 4430, ctxFactory) splash = _Splash(u"Connecting", u"Connecting...") workbench.display(splash) ...
def function[_connectWithContextFactory, parameter[ctxFactory, workbench]]: constant[Connect using the given context factory. Notifications go to the given workbench. ] variable[endpoint] assign[=] call[name[SSL4ClientEndpoint], parameter[name[reactor], constant[localhost], constant[4430], name...
keyword[def] identifier[_connectWithContextFactory] ( identifier[ctxFactory] , identifier[workbench] ): literal[string] identifier[endpoint] = identifier[SSL4ClientEndpoint] ( identifier[reactor] , literal[string] , literal[int] , identifier[ctxFactory] ) identifier[splash] = identifier[_Splash] ( li...
def _connectWithContextFactory(ctxFactory, workbench): """Connect using the given context factory. Notifications go to the given workbench. """ endpoint = SSL4ClientEndpoint(reactor, 'localhost', 4430, ctxFactory) splash = _Splash(u'Connecting', u'Connecting...') workbench.display(splash) d...
def double_percent_options_to_metadata(options): """Parse double percent options""" matches = _PERCENT_CELL.findall('# %%' + options) # Fail safe when regexp matching fails #116 # (occurs e.g. if square brackets are found in the title) if not matches: return {'title': options.strip()} ...
def function[double_percent_options_to_metadata, parameter[options]]: constant[Parse double percent options] variable[matches] assign[=] call[name[_PERCENT_CELL].findall, parameter[binary_operation[constant[# %%] + name[options]]]] if <ast.UnaryOp object at 0x7da2054a7640> begin[:] retur...
keyword[def] identifier[double_percent_options_to_metadata] ( identifier[options] ): literal[string] identifier[matches] = identifier[_PERCENT_CELL] . identifier[findall] ( literal[string] + identifier[options] ) keyword[if] keyword[not] identifier[matches] : keyword[return] { li...
def double_percent_options_to_metadata(options): """Parse double percent options""" matches = _PERCENT_CELL.findall('# %%' + options) # Fail safe when regexp matching fails #116 # (occurs e.g. if square brackets are found in the title) if not matches: return {'title': options.strip()} # dep...
def human2bytes(s: str) -> int: """ Modified from http://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/. Attempts to guess the string format based on default symbols set and return the corresponding bytes as an integer. When unable to recognize the format, :exc...
def function[human2bytes, parameter[s]]: constant[ Modified from http://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/. Attempts to guess the string format based on default symbols set and return the corresponding bytes as an integer. When unable to recogni...
keyword[def] identifier[human2bytes] ( identifier[s] : identifier[str] )-> identifier[int] : literal[string] keyword[if] keyword[not] identifier[s] : keyword[raise] identifier[ValueError] ( literal[string] . identifier[format] ( identifier[s] )) keyword[try] : keyword[return] ide...
def human2bytes(s: str) -> int: """ Modified from http://code.activestate.com/recipes/578019-bytes-to-human-human-to-bytes-converter/. Attempts to guess the string format based on default symbols set and return the corresponding bytes as an integer. When unable to recognize the format, :exc...
def _ostaunicode(src): # type: (str) -> bytes ''' Internal function to create an OSTA byte string from a source string. ''' if have_py_3: bytename = src else: bytename = src.decode('utf-8') # type: ignore try: enc = bytename.encode('latin-1') encbyte = b'\x0...
def function[_ostaunicode, parameter[src]]: constant[ Internal function to create an OSTA byte string from a source string. ] if name[have_py_3] begin[:] variable[bytename] assign[=] name[src] <ast.Try object at 0x7da1b0f0f790> return[binary_operation[name[encbyte] + name...
keyword[def] identifier[_ostaunicode] ( identifier[src] ): literal[string] keyword[if] identifier[have_py_3] : identifier[bytename] = identifier[src] keyword[else] : identifier[bytename] = identifier[src] . identifier[decode] ( literal[string] ) keyword[try] : ident...
def _ostaunicode(src): # type: (str) -> bytes '\n Internal function to create an OSTA byte string from a source string.\n ' if have_py_3: bytename = src # depends on [control=['if'], data=[]] else: bytename = src.decode('utf-8') # type: ignore try: enc = bytename.enco...
def is_credential_valid(self, credentialID): """ Check if this credential ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM credentials WHERE id=? LIMIT 1', [credentialID]) results = cur.fetchall() cur.close() return len(results) > 0
def function[is_credential_valid, parameter[self, credentialID]]: constant[ Check if this credential ID is valid. ] variable[cur] assign[=] call[name[self].conn.cursor, parameter[]] call[name[cur].execute, parameter[constant[SELECT * FROM credentials WHERE id=? LIMIT 1], list[[<a...
keyword[def] identifier[is_credential_valid] ( identifier[self] , identifier[credentialID] ): literal[string] identifier[cur] = identifier[self] . identifier[conn] . identifier[cursor] () identifier[cur] . identifier[execute] ( literal[string] ,[ identifier[credentialID] ]) identi...
def is_credential_valid(self, credentialID): """ Check if this credential ID is valid. """ cur = self.conn.cursor() cur.execute('SELECT * FROM credentials WHERE id=? LIMIT 1', [credentialID]) results = cur.fetchall() cur.close() return len(results) > 0
def _send_command_to_servers(self, head, body): """Sends a command to all server nodes. Sending command to a server node will cause that server node to invoke ``KVStoreServer.controller`` to execute the command. This function returns after the command has been executed on all server ...
def function[_send_command_to_servers, parameter[self, head, body]]: constant[Sends a command to all server nodes. Sending command to a server node will cause that server node to invoke ``KVStoreServer.controller`` to execute the command. This function returns after the command has bee...
keyword[def] identifier[_send_command_to_servers] ( identifier[self] , identifier[head] , identifier[body] ): literal[string] identifier[check_call] ( identifier[_LIB] . identifier[MXKVStoreSendCommmandToServers] ( identifier[self] . identifier[handle] , identifier[mx_uint] ( identifier[he...
def _send_command_to_servers(self, head, body): """Sends a command to all server nodes. Sending command to a server node will cause that server node to invoke ``KVStoreServer.controller`` to execute the command. This function returns after the command has been executed on all server ...
def is_tablet_pad(self): """Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`. """ if self in {type(self).TABLET_PAD_BUTTON, type(self).TABLET_PAD_RING, type(self).TABLET_PAD_STRIP}: return True else: return False
def function[is_tablet_pad, parameter[self]]: constant[Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`. ] if compare[name[self] in <ast.Set object at 0x7da1b184bdc0>] begin[:] return[constant[True]]
keyword[def] identifier[is_tablet_pad] ( identifier[self] ): literal[string] keyword[if] identifier[self] keyword[in] { identifier[type] ( identifier[self] ). identifier[TABLET_PAD_BUTTON] , identifier[type] ( identifier[self] ). identifier[TABLET_PAD_RING] , identifier[type] ( identifier[self] ). identi...
def is_tablet_pad(self): """Macro to check if this event is a :class:`~libinput.event.TabletPadEvent`. """ if self in {type(self).TABLET_PAD_BUTTON, type(self).TABLET_PAD_RING, type(self).TABLET_PAD_STRIP}: return True # depends on [control=['if'], data=[]] else: return False
def nextfreeip(self): """ Method searches for the next free ip address in the scope object and returns it as a str value. :return: """ allocated_ips = [ipaddress.ip_address(host['ip']) for host in self.hosts] for ip in self.netaddr: if str(ip).split('....
def function[nextfreeip, parameter[self]]: constant[ Method searches for the next free ip address in the scope object and returns it as a str value. :return: ] variable[allocated_ips] assign[=] <ast.ListComp object at 0x7da20c76ebc0> for taget[name[ip]] in starred...
keyword[def] identifier[nextfreeip] ( identifier[self] ): literal[string] identifier[allocated_ips] =[ identifier[ipaddress] . identifier[ip_address] ( identifier[host] [ literal[string] ]) keyword[for] identifier[host] keyword[in] identifier[self] . identifier[hosts] ] keyword[for] id...
def nextfreeip(self): """ Method searches for the next free ip address in the scope object and returns it as a str value. :return: """ allocated_ips = [ipaddress.ip_address(host['ip']) for host in self.hosts] for ip in self.netaddr: if str(ip).split('.')[-1] == '0': ...
def deny_assignments(self): """Instance depends on the API version: * 2018-07-01-preview: :class:`DenyAssignmentsOperations<azure.mgmt.authorization.v2018_07_01_preview.operations.DenyAssignmentsOperations>` """ api_version = self._get_api_version('deny_assignments') if api_v...
def function[deny_assignments, parameter[self]]: constant[Instance depends on the API version: * 2018-07-01-preview: :class:`DenyAssignmentsOperations<azure.mgmt.authorization.v2018_07_01_preview.operations.DenyAssignmentsOperations>` ] variable[api_version] assign[=] call[name[self]...
keyword[def] identifier[deny_assignments] ( identifier[self] ): literal[string] identifier[api_version] = identifier[self] . identifier[_get_api_version] ( literal[string] ) keyword[if] identifier[api_version] == literal[string] : keyword[from] . identifier[v2018_07_01_previe...
def deny_assignments(self): """Instance depends on the API version: * 2018-07-01-preview: :class:`DenyAssignmentsOperations<azure.mgmt.authorization.v2018_07_01_preview.operations.DenyAssignmentsOperations>` """ api_version = self._get_api_version('deny_assignments') if api_version == '2...
def make_tmp_name(name): """Generates a tmp name for a file or dir. This is a tempname that sits in the same dir as `name`. If it exists on disk at context exit time, it is deleted. """ path, base = os.path.split(name) tmp_base = ".tmp-%s-%s" % (base, uuid4().hex) tmp_name = os.path.join(pa...
def function[make_tmp_name, parameter[name]]: constant[Generates a tmp name for a file or dir. This is a tempname that sits in the same dir as `name`. If it exists on disk at context exit time, it is deleted. ] <ast.Tuple object at 0x7da18f813d00> assign[=] call[name[os].path.split, paramet...
keyword[def] identifier[make_tmp_name] ( identifier[name] ): literal[string] identifier[path] , identifier[base] = identifier[os] . identifier[path] . identifier[split] ( identifier[name] ) identifier[tmp_base] = literal[string] %( identifier[base] , identifier[uuid4] (). identifier[hex] ) identi...
def make_tmp_name(name): """Generates a tmp name for a file or dir. This is a tempname that sits in the same dir as `name`. If it exists on disk at context exit time, it is deleted. """ (path, base) = os.path.split(name) tmp_base = '.tmp-%s-%s' % (base, uuid4().hex) tmp_name = os.path.join(...
def makescacoldesc(columnname, value, datamanagertype='', datamanagergroup='', options=0, maxlen=0, comment='', valuetype='', keywords={}): """Create description of a scalar column. A description for a scalar column can be created from...
def function[makescacoldesc, parameter[columnname, value, datamanagertype, datamanagergroup, options, maxlen, comment, valuetype, keywords]]: constant[Create description of a scalar column. A description for a scalar column can be created from a name for the column and a data value, which is used only ...
keyword[def] identifier[makescacoldesc] ( identifier[columnname] , identifier[value] , identifier[datamanagertype] = literal[string] , identifier[datamanagergroup] = literal[string] , identifier[options] = literal[int] , identifier[maxlen] = literal[int] , identifier[comment] = literal[string] , identifier[valuet...
def makescacoldesc(columnname, value, datamanagertype='', datamanagergroup='', options=0, maxlen=0, comment='', valuetype='', keywords={}): """Create description of a scalar column. A description for a scalar column can be created from a name for the column and a data value, which is used only to determine...
def switch_to_output(self, value=False, **kwargs): """Switch the pin state to a digital output with the provided starting value (True/False for high or low, default is False/low). """ self.direction = digitalio.Direction.OUTPUT self.value = value
def function[switch_to_output, parameter[self, value]]: constant[Switch the pin state to a digital output with the provided starting value (True/False for high or low, default is False/low). ] name[self].direction assign[=] name[digitalio].Direction.OUTPUT name[self].value assign...
keyword[def] identifier[switch_to_output] ( identifier[self] , identifier[value] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[self] . identifier[direction] = identifier[digitalio] . identifier[Direction] . identifier[OUTPUT] identifier[self] . identifier[value] = ...
def switch_to_output(self, value=False, **kwargs): """Switch the pin state to a digital output with the provided starting value (True/False for high or low, default is False/low). """ self.direction = digitalio.Direction.OUTPUT self.value = value
def body_block_attribution(tag): "extract the attribution content for figures, tables, videos" attributions = [] if raw_parser.attrib(tag): for attrib_tag in raw_parser.attrib(tag): attributions.append(node_contents_str(attrib_tag)) if raw_parser.permissions(tag): # concatena...
def function[body_block_attribution, parameter[tag]]: constant[extract the attribution content for figures, tables, videos] variable[attributions] assign[=] list[[]] if call[name[raw_parser].attrib, parameter[name[tag]]] begin[:] for taget[name[attrib_tag]] in starred[call[name[r...
keyword[def] identifier[body_block_attribution] ( identifier[tag] ): literal[string] identifier[attributions] =[] keyword[if] identifier[raw_parser] . identifier[attrib] ( identifier[tag] ): keyword[for] identifier[attrib_tag] keyword[in] identifier[raw_parser] . identifier[attrib] ( iden...
def body_block_attribution(tag): """extract the attribution content for figures, tables, videos""" attributions = [] if raw_parser.attrib(tag): for attrib_tag in raw_parser.attrib(tag): attributions.append(node_contents_str(attrib_tag)) # depends on [control=['for'], data=['attrib_tag']...
def _init_idxs_strpat(self, usr_hdrs): """List of indexes whose values will be strings.""" strpat = self.strpat_hdrs.keys() self.idxs_strpat = [ Idx for Hdr, Idx in self.hdr2idx.items() if Hdr in usr_hdrs and Hdr in strpat]
def function[_init_idxs_strpat, parameter[self, usr_hdrs]]: constant[List of indexes whose values will be strings.] variable[strpat] assign[=] call[name[self].strpat_hdrs.keys, parameter[]] name[self].idxs_strpat assign[=] <ast.ListComp object at 0x7da18f811c90>
keyword[def] identifier[_init_idxs_strpat] ( identifier[self] , identifier[usr_hdrs] ): literal[string] identifier[strpat] = identifier[self] . identifier[strpat_hdrs] . identifier[keys] () identifier[self] . identifier[idxs_strpat] =[ identifier[Idx] keyword[for] identifier[Hdr...
def _init_idxs_strpat(self, usr_hdrs): """List of indexes whose values will be strings.""" strpat = self.strpat_hdrs.keys() self.idxs_strpat = [Idx for (Hdr, Idx) in self.hdr2idx.items() if Hdr in usr_hdrs and Hdr in strpat]
def AddAdapter(self, device_name, system_name): '''Convenience method to add a Bluetooth adapter You have to specify a device name which must be a valid part of an object path, e. g. "hci0", and an arbitrary system name (pretty hostname). Returns the new object path. ''' path = '/org/bluez/' +...
def function[AddAdapter, parameter[self, device_name, system_name]]: constant[Convenience method to add a Bluetooth adapter You have to specify a device name which must be a valid part of an object path, e. g. "hci0", and an arbitrary system name (pretty hostname). Returns the new object path. ...
keyword[def] identifier[AddAdapter] ( identifier[self] , identifier[device_name] , identifier[system_name] ): literal[string] identifier[path] = literal[string] + identifier[device_name] identifier[adapter_properties] ={ literal[string] : identifier[dbus] . identifier[Array] ([ ...
def AddAdapter(self, device_name, system_name): """Convenience method to add a Bluetooth adapter You have to specify a device name which must be a valid part of an object path, e. g. "hci0", and an arbitrary system name (pretty hostname). Returns the new object path. """ path = '/org/bluez/' +...
def convert_double_to_two_registers(doubleValue): """ Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted return: 16 Bit Register values int[] """ myList = list() myList.append(int(doubleValue & 0x0000FFFF)) #Append Least Signific...
def function[convert_double_to_two_registers, parameter[doubleValue]]: constant[ Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted return: 16 Bit Register values int[] ] variable[myList] assign[=] call[name[list], parameter[]] ...
keyword[def] identifier[convert_double_to_two_registers] ( identifier[doubleValue] ): literal[string] identifier[myList] = identifier[list] () identifier[myList] . identifier[append] ( identifier[int] ( identifier[doubleValue] & literal[int] )) identifier[myList] . identifier[append] ( identifier...
def convert_double_to_two_registers(doubleValue): """ Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted return: 16 Bit Register values int[] """ myList = list() myList.append(int(doubleValue & 65535)) #Append Least Significant Word ...
def download(self, *ids): """ Downloads the subtitles with the given ids. :param ids: The subtitles to download :return: Result instances :raises NotOKException """ bundles = sublists_of(ids, 20) # 20 files at once is an API restriction for bundle in bun...
def function[download, parameter[self]]: constant[ Downloads the subtitles with the given ids. :param ids: The subtitles to download :return: Result instances :raises NotOKException ] variable[bundles] assign[=] call[name[sublists_of], parameter[name[ids], constan...
keyword[def] identifier[download] ( identifier[self] ,* identifier[ids] ): literal[string] identifier[bundles] = identifier[sublists_of] ( identifier[ids] , literal[int] ) keyword[for] identifier[bundle] keyword[in] identifier[bundles] : identifier[download_response] = ide...
def download(self, *ids): """ Downloads the subtitles with the given ids. :param ids: The subtitles to download :return: Result instances :raises NotOKException """ bundles = sublists_of(ids, 20) # 20 files at once is an API restriction for bundle in bundles: ...
def server_inspect_exception(self, req_event, rep_event, task_ctx, exc_info): """ Called when an exception has been raised in the code run by ZeroRPC """ # Hide the zerorpc internal frames for readability, for a REQ/REP or # REQ/STREAM server the frames to hide are: # - c...
def function[server_inspect_exception, parameter[self, req_event, rep_event, task_ctx, exc_info]]: constant[ Called when an exception has been raised in the code run by ZeroRPC ] if name[self]._hide_zerorpc_frames begin[:] variable[traceback] assign[=] call[name[exc_info]...
keyword[def] identifier[server_inspect_exception] ( identifier[self] , identifier[req_event] , identifier[rep_event] , identifier[task_ctx] , identifier[exc_info] ): literal[string] keyword[if] identifier[self] . identifier[_h...
def server_inspect_exception(self, req_event, rep_event, task_ctx, exc_info): """ Called when an exception has been raised in the code run by ZeroRPC """ # Hide the zerorpc internal frames for readability, for a REQ/REP or # REQ/STREAM server the frames to hide are: # - core.ServerBase._...
def webui_data_stores_saved_query_key(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") webui = ET.SubElement(config, "webui", xmlns="http://tail-f.com/ns/webui") data_stores = ET.SubElement(webui, "data-stores") saved_query = ET.SubElement(data_st...
def function[webui_data_stores_saved_query_key, parameter[self]]: constant[Auto Generated Code ] variable[config] assign[=] call[name[ET].Element, parameter[constant[config]]] variable[webui] assign[=] call[name[ET].SubElement, parameter[name[config], constant[webui]]] variable[d...
keyword[def] identifier[webui_data_stores_saved_query_key] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[config] = identifier[ET] . identifier[Element] ( literal[string] ) identifier[webui] = identifier[ET] . identifier[SubElement] ( identifier[config] , literal[s...
def webui_data_stores_saved_query_key(self, **kwargs): """Auto Generated Code """ config = ET.Element('config') webui = ET.SubElement(config, 'webui', xmlns='http://tail-f.com/ns/webui') data_stores = ET.SubElement(webui, 'data-stores') saved_query = ET.SubElement(data_stores, 'saved-query')...
def get_content(path): """Get content of file.""" with codecs.open(abs_path(path), encoding='utf-8') as f: return f.read()
def function[get_content, parameter[path]]: constant[Get content of file.] with call[name[codecs].open, parameter[call[name[abs_path], parameter[name[path]]]]] begin[:] return[call[name[f].read, parameter[]]]
keyword[def] identifier[get_content] ( identifier[path] ): literal[string] keyword[with] identifier[codecs] . identifier[open] ( identifier[abs_path] ( identifier[path] ), identifier[encoding] = literal[string] ) keyword[as] identifier[f] : keyword[return] identifier[f] . identifier[read] ()
def get_content(path): """Get content of file.""" with codecs.open(abs_path(path), encoding='utf-8') as f: return f.read() # depends on [control=['with'], data=['f']]
def load(self, path, name): """Imports the specified ``fgic`` file from the hard disk. :param path: filedirectory to which the ``fgic`` file is written. :param name: filename, without file extension """ filename = name + '.fgic' filepath = aux.joinpath(path, filename) ...
def function[load, parameter[self, path, name]]: constant[Imports the specified ``fgic`` file from the hard disk. :param path: filedirectory to which the ``fgic`` file is written. :param name: filename, without file extension ] variable[filename] assign[=] binary_operation[name[...
keyword[def] identifier[load] ( identifier[self] , identifier[path] , identifier[name] ): literal[string] identifier[filename] = identifier[name] + literal[string] identifier[filepath] = identifier[aux] . identifier[joinpath] ( identifier[path] , identifier[filename] ) keyword[w...
def load(self, path, name): """Imports the specified ``fgic`` file from the hard disk. :param path: filedirectory to which the ``fgic`` file is written. :param name: filename, without file extension """ filename = name + '.fgic' filepath = aux.joinpath(path, filename) with zipfi...
def tar_files(self, path: Path) -> bytes: """ Returns a tar with the git repository. """ tarstream = BytesIO() tar = tarfile.TarFile(fileobj=tarstream, mode='w') tar.add(str(path), arcname="data", recursive=True) tar.close() return tarstream.getvalue()
def function[tar_files, parameter[self, path]]: constant[ Returns a tar with the git repository. ] variable[tarstream] assign[=] call[name[BytesIO], parameter[]] variable[tar] assign[=] call[name[tarfile].TarFile, parameter[]] call[name[tar].add, parameter[call[name[str], paramet...
keyword[def] identifier[tar_files] ( identifier[self] , identifier[path] : identifier[Path] )-> identifier[bytes] : literal[string] identifier[tarstream] = identifier[BytesIO] () identifier[tar] = identifier[tarfile] . identifier[TarFile] ( identifier[fileobj] = identifier[tarstream] , ide...
def tar_files(self, path: Path) -> bytes: """ Returns a tar with the git repository. """ tarstream = BytesIO() tar = tarfile.TarFile(fileobj=tarstream, mode='w') tar.add(str(path), arcname='data', recursive=True) tar.close() return tarstream.getvalue()
def undeploy_lambda_alb(self, lambda_name): """ The `zappa undeploy` functionality for ALB infrastructure. """ print("Undeploying ALB infrastructure...") # Locate and delete alb/lambda permissions try: # https://boto3.amazonaws.com/v1/documentation/api/latest...
def function[undeploy_lambda_alb, parameter[self, lambda_name]]: constant[ The `zappa undeploy` functionality for ALB infrastructure. ] call[name[print], parameter[constant[Undeploying ALB infrastructure...]]] <ast.Try object at 0x7da1b1fe5180> <ast.Try object at 0x7da1b1fe5690> ...
keyword[def] identifier[undeploy_lambda_alb] ( identifier[self] , identifier[lambda_name] ): literal[string] identifier[print] ( literal[string] ) keyword[try] : identifier[self] . identifier[lambda_client] . identifier[remove_permission] ( iden...
def undeploy_lambda_alb(self, lambda_name): """ The `zappa undeploy` functionality for ALB infrastructure. """ print('Undeploying ALB infrastructure...') # Locate and delete alb/lambda permissions try: # https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/l...
def dumpsItem(self, item, contentType=None, version=None): ''' [OPTIONAL] Identical to :meth:`dump`, except the serialized form is returned as a string representation. As documented in :meth:`dump`, the return value can optionally be a three-element tuple of (contentType, version, data) if the provi...
def function[dumpsItem, parameter[self, item, contentType, version]]: constant[ [OPTIONAL] Identical to :meth:`dump`, except the serialized form is returned as a string representation. As documented in :meth:`dump`, the return value can optionally be a three-element tuple of (contentType, versio...
keyword[def] identifier[dumpsItem] ( identifier[self] , identifier[item] , identifier[contentType] = keyword[None] , identifier[version] = keyword[None] ): literal[string] identifier[buf] = identifier[six] . identifier[StringIO] () identifier[ret] = identifier[self] . identifier[dumpItem] ( identifier...
def dumpsItem(self, item, contentType=None, version=None): """ [OPTIONAL] Identical to :meth:`dump`, except the serialized form is returned as a string representation. As documented in :meth:`dump`, the return value can optionally be a three-element tuple of (contentType, version, data) if the provi...
def get_cluster(self, name): """Get cluster from kubeconfig.""" clusters = self.data['clusters'] for cluster in clusters: if cluster['name'] == name: return cluster raise KubeConfError("Cluster name not found.")
def function[get_cluster, parameter[self, name]]: constant[Get cluster from kubeconfig.] variable[clusters] assign[=] call[name[self].data][constant[clusters]] for taget[name[cluster]] in starred[name[clusters]] begin[:] if compare[call[name[cluster]][constant[name]] equal[==] na...
keyword[def] identifier[get_cluster] ( identifier[self] , identifier[name] ): literal[string] identifier[clusters] = identifier[self] . identifier[data] [ literal[string] ] keyword[for] identifier[cluster] keyword[in] identifier[clusters] : keyword[if] identifier[cluster] ...
def get_cluster(self, name): """Get cluster from kubeconfig.""" clusters = self.data['clusters'] for cluster in clusters: if cluster['name'] == name: return cluster # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['cluster']] raise KubeConfError('Cluster ...
def on_bar_min1(self, tiny_bar): """每一分钟触发一次回调""" bar = tiny_bar symbol = bar.symbol str_dt = bar.datetime.strftime("%Y%m%d %H:%M:%S") # 得到分k数据的ArrayManager(vnpy)对象 am = self.get_kl_min1_am(symbol) array_high = am.high array_low = am.low array_ope...
def function[on_bar_min1, parameter[self, tiny_bar]]: constant[每一分钟触发一次回调] variable[bar] assign[=] name[tiny_bar] variable[symbol] assign[=] name[bar].symbol variable[str_dt] assign[=] call[name[bar].datetime.strftime, parameter[constant[%Y%m%d %H:%M:%S]]] variable[am] assign[=] ...
keyword[def] identifier[on_bar_min1] ( identifier[self] , identifier[tiny_bar] ): literal[string] identifier[bar] = identifier[tiny_bar] identifier[symbol] = identifier[bar] . identifier[symbol] identifier[str_dt] = identifier[bar] . identifier[datetime] . identifier[strftime] (...
def on_bar_min1(self, tiny_bar): """每一分钟触发一次回调""" bar = tiny_bar symbol = bar.symbol str_dt = bar.datetime.strftime('%Y%m%d %H:%M:%S') # 得到分k数据的ArrayManager(vnpy)对象 am = self.get_kl_min1_am(symbol) array_high = am.high array_low = am.low array_open = am.open array_close = am.clos...
def format_modified(self, modified, sep=" "): """Format modification date in UTC if it's not None. @param modified: modification date in UTC @ptype modified: datetime or None @return: formatted date or empty string @rtype: unicode """ if modified is not None: ...
def function[format_modified, parameter[self, modified, sep]]: constant[Format modification date in UTC if it's not None. @param modified: modification date in UTC @ptype modified: datetime or None @return: formatted date or empty string @rtype: unicode ] if compa...
keyword[def] identifier[format_modified] ( identifier[self] , identifier[modified] , identifier[sep] = literal[string] ): literal[string] keyword[if] identifier[modified] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[modified] . identifier[strftime] ( literal...
def format_modified(self, modified, sep=' '): """Format modification date in UTC if it's not None. @param modified: modification date in UTC @ptype modified: datetime or None @return: formatted date or empty string @rtype: unicode """ if modified is not None: retu...
def write_dicts_to_csv(self, dicts): """Saves .csv file with posts data :param dicts: Dictionaries with same values """ csv_headers = sorted(dicts[0].keys()) with open(self.path, "w") as out_file: # write to file dict_writer = csv.DictWriter( out_fil...
def function[write_dicts_to_csv, parameter[self, dicts]]: constant[Saves .csv file with posts data :param dicts: Dictionaries with same values ] variable[csv_headers] assign[=] call[name[sorted], parameter[call[call[name[dicts]][constant[0]].keys, parameter[]]]] with call[name[o...
keyword[def] identifier[write_dicts_to_csv] ( identifier[self] , identifier[dicts] ): literal[string] identifier[csv_headers] = identifier[sorted] ( identifier[dicts] [ literal[int] ]. identifier[keys] ()) keyword[with] identifier[open] ( identifier[self] . identifier[path] , literal[stri...
def write_dicts_to_csv(self, dicts): """Saves .csv file with posts data :param dicts: Dictionaries with same values """ csv_headers = sorted(dicts[0].keys()) with open(self.path, 'w') as out_file: # write to file dict_writer = csv.DictWriter(out_file, csv_headers, delimiter=',', qu...
def _submit(self): '''submit a uservoice ticket. When we get here we should have: {'user_prompt_issue': 'I want to do the thing.', 'record_asciinema': '/tmp/helpme.93o__nt5.json', 'record_environment': ((1,1),(2,2)...(N,N))} Required Client Variables ...
def function[_submit, parameter[self]]: constant[submit a uservoice ticket. When we get here we should have: {'user_prompt_issue': 'I want to do the thing.', 'record_asciinema': '/tmp/helpme.93o__nt5.json', 'record_environment': ((1,1),(2,2)...(N,N))} ...
keyword[def] identifier[_submit] ( identifier[self] ): literal[string] identifier[self] . identifier[authenticate] () identifier[title] = literal[string] %( identifier[self] . identifier[run_id] ) identifier[body] = identifier[self] . identifier[data] [ literal[string] ...
def _submit(self): """submit a uservoice ticket. When we get here we should have: {'user_prompt_issue': 'I want to do the thing.', 'record_asciinema': '/tmp/helpme.93o__nt5.json', 'record_environment': ((1,1),(2,2)...(N,N))} Required Client Variables ...
def scan_system(): """ Scans /sys/class/leds looking for entries, then examining their .../device/uevent file to obtain unique hardware IDs corresponding to the associated hardware. This then allows us to associate InputDevice based controllers with sets of zero or more LEDs. The result is a dict from h...
def function[scan_system, parameter[]]: constant[ Scans /sys/class/leds looking for entries, then examining their .../device/uevent file to obtain unique hardware IDs corresponding to the associated hardware. This then allows us to associate InputDevice based controllers with sets of zero or more LE...
keyword[def] identifier[scan_system] (): literal[string] keyword[def] identifier[find_device_hardware_id] ( identifier[uevent_file_path] ): identifier[hid_uniq] = keyword[None] identifier[phys] = keyword[None] keyword[for] identifier[line] keyword[in] identifier[open] ( id...
def scan_system(): """ Scans /sys/class/leds looking for entries, then examining their .../device/uevent file to obtain unique hardware IDs corresponding to the associated hardware. This then allows us to associate InputDevice based controllers with sets of zero or more LEDs. The result is a dict from h...
def followers(self, blogname, **kwargs): """ Gets the followers of the given blog :param limit: an int, the number of followers you want returned :param offset: an int, the follower to start at, for pagination. # Start at the 20th blog and get 20 more blogs. clie...
def function[followers, parameter[self, blogname]]: constant[ Gets the followers of the given blog :param limit: an int, the number of followers you want returned :param offset: an int, the follower to start at, for pagination. # Start at the 20th blog and get 20 more blogs....
keyword[def] identifier[followers] ( identifier[self] , identifier[blogname] ,** identifier[kwargs] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[blogname] ) keyword[return] identifier[self] . identifier[send_api_request] ( literal[string] , identi...
def followers(self, blogname, **kwargs): """ Gets the followers of the given blog :param limit: an int, the number of followers you want returned :param offset: an int, the follower to start at, for pagination. # Start at the 20th blog and get 20 more blogs. client.f...
def rule(self, text): """rule = identifier , "=" , expression , ";" ;""" self._attempting(text) return concatenation([ self.identifier, "=", self.expression, ";", ], ignore_whitespace=True)(text).retyped(TokenType.rule)
def function[rule, parameter[self, text]]: constant[rule = identifier , "=" , expression , ";" ;] call[name[self]._attempting, parameter[name[text]]] return[call[call[call[name[concatenation], parameter[list[[<ast.Attribute object at 0x7da1b013dcc0>, <ast.Constant object at 0x7da1b013fd00>, <ast.Att...
keyword[def] identifier[rule] ( identifier[self] , identifier[text] ): literal[string] identifier[self] . identifier[_attempting] ( identifier[text] ) keyword[return] identifier[concatenation] ([ identifier[self] . identifier[identifier] , literal[string] , identifier[self] . identifie...
def rule(self, text): """rule = identifier , "=" , expression , ";" ;""" self._attempting(text) return concatenation([self.identifier, '=', self.expression, ';'], ignore_whitespace=True)(text).retyped(TokenType.rule)
def to_markdown(self): """Converts to markdown :return: item in markdown format """ if self.type == "text": return self.text elif self.type == "url" or self.type == "image": return "[" + self.text + "](" + self.attributes["ref"] + ")" elif self.typ...
def function[to_markdown, parameter[self]]: constant[Converts to markdown :return: item in markdown format ] if compare[name[self].type equal[==] constant[text]] begin[:] return[name[self].text] return[constant[None]]
keyword[def] identifier[to_markdown] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[type] == literal[string] : keyword[return] identifier[self] . identifier[text] keyword[elif] identifier[self] . identifier[type] == literal[string] keyword...
def to_markdown(self): """Converts to markdown :return: item in markdown format """ if self.type == 'text': return self.text # depends on [control=['if'], data=[]] elif self.type == 'url' or self.type == 'image': return '[' + self.text + '](' + self.attributes['ref'] + ')' ...
def run_command(self, args=None, node_paths=None): """Returns a command that when executed will run an arbitury command via package manager.""" return command_gen( self.tool_installations, self.name, args=args, node_paths=node_paths )
def function[run_command, parameter[self, args, node_paths]]: constant[Returns a command that when executed will run an arbitury command via package manager.] return[call[name[command_gen], parameter[name[self].tool_installations, name[self].name]]]
keyword[def] identifier[run_command] ( identifier[self] , identifier[args] = keyword[None] , identifier[node_paths] = keyword[None] ): literal[string] keyword[return] identifier[command_gen] ( identifier[self] . identifier[tool_installations] , identifier[self] . identifier[name] , identifi...
def run_command(self, args=None, node_paths=None): """Returns a command that when executed will run an arbitury command via package manager.""" return command_gen(self.tool_installations, self.name, args=args, node_paths=node_paths)
def set_parallel_value_for_key(self, key, value): """ Set a globally available key and value that can be accessed from all the pabot processes. """ if self._remotelib: self._remotelib.run_keyword('set_parallel_value_for_key', [k...
def function[set_parallel_value_for_key, parameter[self, key, value]]: constant[ Set a globally available key and value that can be accessed from all the pabot processes. ] if name[self]._remotelib begin[:] call[name[self]._remotelib.run_keyword, parameter[constan...
keyword[def] identifier[set_parallel_value_for_key] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] keyword[if] identifier[self] . identifier[_remotelib] : identifier[self] . identifier[_remotelib] . identifier[run_keyword] ( literal[string] , [...
def set_parallel_value_for_key(self, key, value): """ Set a globally available key and value that can be accessed from all the pabot processes. """ if self._remotelib: self._remotelib.run_keyword('set_parallel_value_for_key', [key, value], {}) # depends on [control=['if'], data=...
def encode(self, message): '''Encode a message when publishing.''' if not isinstance(message, dict): message = {'message': message} message['time'] = time.time() return json.dumps(message)
def function[encode, parameter[self, message]]: constant[Encode a message when publishing.] if <ast.UnaryOp object at 0x7da18c4cc370> begin[:] variable[message] assign[=] dictionary[[<ast.Constant object at 0x7da18c4cf850>], [<ast.Name object at 0x7da18c4cfca0>]] call[name[messag...
keyword[def] identifier[encode] ( identifier[self] , identifier[message] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[message] , identifier[dict] ): identifier[message] ={ literal[string] : identifier[message] } identifier[message] [ litera...
def encode(self, message): """Encode a message when publishing.""" if not isinstance(message, dict): message = {'message': message} # depends on [control=['if'], data=[]] message['time'] = time.time() return json.dumps(message)
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the ProtocolVersion struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read...
def function[read, parameter[self, input_stream, kmip_version]]: constant[ Read the data encoding the ProtocolVersion struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read...
keyword[def] identifier[read] ( identifier[self] , identifier[input_stream] , identifier[kmip_version] = identifier[enums] . identifier[KMIPVersion] . identifier[KMIP_1_0] ): literal[string] identifier[super] ( identifier[ProtocolVersion] , identifier[self] ). identifier[read] ( identifier...
def read(self, input_stream, kmip_version=enums.KMIPVersion.KMIP_1_0): """ Read the data encoding the ProtocolVersion struct and decode it into its constituent parts. Args: input_stream (stream): A data stream containing encoded object data, supporting a read met...
def from_string(cls, constraint): """ :param str constraint: The string representation of a constraint :rtype: :class:`MarathonConstraint` """ obj = constraint.split(':') marathon_constraint = cls.from_json(obj) if marathon_constraint: return maratho...
def function[from_string, parameter[cls, constraint]]: constant[ :param str constraint: The string representation of a constraint :rtype: :class:`MarathonConstraint` ] variable[obj] assign[=] call[name[constraint].split, parameter[constant[:]]] variable[marathon_constrai...
keyword[def] identifier[from_string] ( identifier[cls] , identifier[constraint] ): literal[string] identifier[obj] = identifier[constraint] . identifier[split] ( literal[string] ) identifier[marathon_constraint] = identifier[cls] . identifier[from_json] ( identifier[obj] ) keywor...
def from_string(cls, constraint): """ :param str constraint: The string representation of a constraint :rtype: :class:`MarathonConstraint` """ obj = constraint.split(':') marathon_constraint = cls.from_json(obj) if marathon_constraint: return marathon_constraint # depen...
def absent(self, name, rdtype=None): """Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.""" if isinstance(name, (str, unicode)): name = dns.name.from_text(name, None) if rdtype is None: rrs...
def function[absent, parameter[self, name, rdtype]]: constant[Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.] if call[name[isinstance], parameter[name[name], tuple[[<ast.Name object at 0x7da1b0805030>, <ast.Name object a...
keyword[def] identifier[absent] ( identifier[self] , identifier[name] , identifier[rdtype] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[name] ,( identifier[str] , identifier[unicode] )): identifier[name] = identifier[dns] . identifier[name] . ide...
def absent(self, name, rdtype=None): """Require that an owner name (and optionally an rdata type) does not exist as a prerequisite to the execution of the update.""" if isinstance(name, (str, unicode)): name = dns.name.from_text(name, None) # depends on [control=['if'], data=[]] if rdtype i...
def login(request, template="accounts/account_login.html", form_class=LoginForm, extra_context=None): """ Login form. """ form = form_class(request.POST or None) if request.method == "POST" and form.is_valid(): authenticated_user = form.save() info(request, _("Successfully ...
def function[login, parameter[request, template, form_class, extra_context]]: constant[ Login form. ] variable[form] assign[=] call[name[form_class], parameter[<ast.BoolOp object at 0x7da18f09edd0>]] if <ast.BoolOp object at 0x7da18f09c9a0> begin[:] variable[authenticated...
keyword[def] identifier[login] ( identifier[request] , identifier[template] = literal[string] , identifier[form_class] = identifier[LoginForm] , identifier[extra_context] = keyword[None] ): literal[string] identifier[form] = identifier[form_class] ( identifier[request] . identifier[POST] keyword[or] key...
def login(request, template='accounts/account_login.html', form_class=LoginForm, extra_context=None): """ Login form. """ form = form_class(request.POST or None) if request.method == 'POST' and form.is_valid(): authenticated_user = form.save() info(request, _('Successfully logged in'...
def _load( self, fn ): """Retrieve the notebook from the given file. :param fn: the file name""" # if file is empty, create an empty notebook if os.path.getsize(fn) == 0: self._description = None self._results = dict() self._pending = dict() ...
def function[_load, parameter[self, fn]]: constant[Retrieve the notebook from the given file. :param fn: the file name] if compare[call[name[os].path.getsize, parameter[name[fn]]] equal[==] constant[0]] begin[:] name[self]._description assign[=] constant[None] na...
keyword[def] identifier[_load] ( identifier[self] , identifier[fn] ): literal[string] keyword[if] identifier[os] . identifier[path] . identifier[getsize] ( identifier[fn] )== literal[int] : identifier[self] . identifier[_description] = keyword[None] identifier[...
def _load(self, fn): """Retrieve the notebook from the given file. :param fn: the file name""" # if file is empty, create an empty notebook if os.path.getsize(fn) == 0: self._description = None self._results = dict() self._pending = dict() # depends on [control=['if'], data...
def from_pubkey(cls, pubkey, compressed=True, version=56, prefix=None): # Ensure this is a public key pubkey = PublicKey(pubkey, prefix=prefix or Prefix.prefix) if compressed: pubkey_plain = pubkey.compressed() else: pubkey_plain = pubkey.uncompressed() "...
def function[from_pubkey, parameter[cls, pubkey, compressed, version, prefix]]: variable[pubkey] assign[=] call[name[PublicKey], parameter[name[pubkey]]] if name[compressed] begin[:] variable[pubkey_plain] assign[=] call[name[pubkey].compressed, parameter[]] constant[ Derive addr...
keyword[def] identifier[from_pubkey] ( identifier[cls] , identifier[pubkey] , identifier[compressed] = keyword[True] , identifier[version] = literal[int] , identifier[prefix] = keyword[None] ): identifier[pubkey] = identifier[PublicKey] ( identifier[pubkey] , identifier[prefix] = identifier[prefix] keyword...
def from_pubkey(cls, pubkey, compressed=True, version=56, prefix=None): # Ensure this is a public key pubkey = PublicKey(pubkey, prefix=prefix or Prefix.prefix) if compressed: pubkey_plain = pubkey.compressed() # depends on [control=['if'], data=[]] else: pubkey_plain = pubkey.uncompres...
def locate_package_json(): """ Find and return the location of package.json. """ directory = settings.SYSTEMJS_PACKAGE_JSON_DIR if not directory: raise ImproperlyConfigured( "Could not locate 'package.json'. Set SYSTEMJS_PACKAGE_JSON_DIR " "to the directory that holds...
def function[locate_package_json, parameter[]]: constant[ Find and return the location of package.json. ] variable[directory] assign[=] name[settings].SYSTEMJS_PACKAGE_JSON_DIR if <ast.UnaryOp object at 0x7da1b025fd30> begin[:] <ast.Raise object at 0x7da1b025d8d0> variabl...
keyword[def] identifier[locate_package_json] (): literal[string] identifier[directory] = identifier[settings] . identifier[SYSTEMJS_PACKAGE_JSON_DIR] keyword[if] keyword[not] identifier[directory] : keyword[raise] identifier[ImproperlyConfigured] ( literal[string] liter...
def locate_package_json(): """ Find and return the location of package.json. """ directory = settings.SYSTEMJS_PACKAGE_JSON_DIR if not directory: raise ImproperlyConfigured("Could not locate 'package.json'. Set SYSTEMJS_PACKAGE_JSON_DIR to the directory that holds 'package.json'.") # depend...