code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def atq(tag=None): ''' List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ''' jobs = [] # Shim to produce output similar to what __virtual_...
def function[atq, parameter[tag]]: constant[ List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] ] variable[jobs] assign[=] list[[]] ...
keyword[def] identifier[atq] ( identifier[tag] = keyword[None] ): literal[string] identifier[jobs] =[] keyword[if] identifier[__grains__] [ literal[string] ]== literal[string] : identifier[output] = identifier[_cmd] ( literal[string] , literal[string] ) keyword[else] : ...
def atq(tag=None): """ List all queued and running jobs or only those with an optional 'tag'. CLI Example: .. code-block:: bash salt '*' at.atq salt '*' at.atq [tag] salt '*' at.atq [job number] """ jobs = [] # Shim to produce output similar to what __virtual__...
def _find_by_id(self, resource, _id, parent=None): """Find the document by Id. If parent is not provided then on routing exception try to find using search. """ def is_found(hit): if 'exists' in hit: hit['found'] = hit['exists'] return hit.get('fou...
def function[_find_by_id, parameter[self, resource, _id, parent]]: constant[Find the document by Id. If parent is not provided then on routing exception try to find using search. ] def function[is_found, parameter[hit]]: if compare[constant[exists] in name[hit]] begin[:] ...
keyword[def] identifier[_find_by_id] ( identifier[self] , identifier[resource] , identifier[_id] , identifier[parent] = keyword[None] ): literal[string] keyword[def] identifier[is_found] ( identifier[hit] ): keyword[if] literal[string] keyword[in] identifier[hit] : ...
def _find_by_id(self, resource, _id, parent=None): """Find the document by Id. If parent is not provided then on routing exception try to find using search. """ def is_found(hit): if 'exists' in hit: hit['found'] = hit['exists'] # depends on [control=['if'], data=['hit']] ...
def main(args): """first we need sorted genepreds""" cmd = ['sort',args.reference,'--gpd','--tempdir',args.tempdir,'--threads', str(args.threads),'-o',args.tempdir+'/ref.sorted.gpd'] sys.stderr.write(cmd+"\n") gpd_sort(cmd) cmd = ['sort',args.gpd,'--gpd','--tempdir',args.tempdir,'--threads', ...
def function[main, parameter[args]]: constant[first we need sorted genepreds] variable[cmd] assign[=] list[[<ast.Constant object at 0x7da18dc05f30>, <ast.Attribute object at 0x7da18dc05db0>, <ast.Constant object at 0x7da18dc07be0>, <ast.Constant object at 0x7da18dc07370>, <ast.Attribute object at 0x7da1...
keyword[def] identifier[main] ( identifier[args] ): literal[string] identifier[cmd] =[ literal[string] , identifier[args] . identifier[reference] , literal[string] , literal[string] , identifier[args] . identifier[tempdir] , literal[string] , identifier[str] ( identifier[args] . identifier[threads] ), liter...
def main(args): """first we need sorted genepreds""" cmd = ['sort', args.reference, '--gpd', '--tempdir', args.tempdir, '--threads', str(args.threads), '-o', args.tempdir + '/ref.sorted.gpd'] sys.stderr.write(cmd + '\n') gpd_sort(cmd) cmd = ['sort', args.gpd, '--gpd', '--tempdir', args.tempdir, '--t...
def read(self, response): """ Reads the current state of the entity from the server. """ results = self._load_state(response) # In lower layers of the SDK, we end up trying to URL encode # text to be dispatched via HTTP. However, these links are already # URL encoded when they ar...
def function[read, parameter[self, response]]: constant[ Reads the current state of the entity from the server. ] variable[results] assign[=] call[name[self]._load_state, parameter[name[response]]] variable[unquoted_links] assign[=] call[name[dict], parameter[<ast.ListComp object at 0x7da1b179ce...
keyword[def] identifier[read] ( identifier[self] , identifier[response] ): literal[string] identifier[results] = identifier[self] . identifier[_load_state] ( identifier[response] ) identifier[unquoted_links] = identifier[dict] ([( identifier[k] , identifier[UrlEn...
def read(self, response): """ Reads the current state of the entity from the server. """ results = self._load_state(response) # In lower layers of the SDK, we end up trying to URL encode # text to be dispatched via HTTP. However, these links are already # URL encoded when they arrive, and we need to...
def create_public_ip(access_token, subscription_id, resource_group, public_ip_name, dns_label, location): '''Create a public ip address. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str):...
def function[create_public_ip, parameter[access_token, subscription_id, resource_group, public_ip_name, dns_label, location]]: constant[Create a public ip address. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_gr...
keyword[def] identifier[create_public_ip] ( identifier[access_token] , identifier[subscription_id] , identifier[resource_group] , identifier[public_ip_name] , identifier[dns_label] , identifier[location] ): literal[string] identifier[endpoint] = literal[string] . identifier[join] ([ identifier[get_rm_endp...
def create_public_ip(access_token, subscription_id, resource_group, public_ip_name, dns_label, location): """Create a public ip address. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure resource group...
def replaceable(decorator): """A descriptor modifier which allows a setattr to succeed even if __get__ is defined. Formally, this turns a data descriptor into a non-data descriptor. Discards the implementation of __set__ and __delete__ if it exists, so be wary when not using with ``property``. ...
def function[replaceable, parameter[decorator]]: constant[A descriptor modifier which allows a setattr to succeed even if __get__ is defined. Formally, this turns a data descriptor into a non-data descriptor. Discards the implementation of __set__ and __delete__ if it exists, so be wary when no...
keyword[def] identifier[replaceable] ( identifier[decorator] ): literal[string] keyword[def] identifier[decorate] ( identifier[fn] ,* identifier[args] ,** identifier[kwargs] ): identifier[parent] = identifier[decorator] ( identifier[fn] ,* identifier[args] ,** identifier[kwargs] ) ...
def replaceable(decorator): """A descriptor modifier which allows a setattr to succeed even if __get__ is defined. Formally, this turns a data descriptor into a non-data descriptor. Discards the implementation of __set__ and __delete__ if it exists, so be wary when not using with ``property``. ...
def query_closest(self, query_item): """ closest = store.query_closest({"type": "...", "item_1": "...", "timestamp": "..."}) # returns a list of the closest items to a given thing """ if not isinstance(query_item, dict): raise TypeError("The query query_item isn't a dict...
def function[query_closest, parameter[self, query_item]]: constant[ closest = store.query_closest({"type": "...", "item_1": "...", "timestamp": "..."}) # returns a list of the closest items to a given thing ] if <ast.UnaryOp object at 0x7da1b09bdfc0> begin[:] <ast.Raise objec...
keyword[def] identifier[query_closest] ( identifier[self] , identifier[query_item] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[query_item] , identifier[dict] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[_type] ...
def query_closest(self, query_item): """ closest = store.query_closest({"type": "...", "item_1": "...", "timestamp": "..."}) # returns a list of the closest items to a given thing """ if not isinstance(query_item, dict): raise TypeError("The query query_item isn't a dictionary") # d...
def validate_known_curve(): """Validate on a sin function.""" plt.figure() N = 100 x = numpy.linspace(-1, 1, N) y = numpy.sin(4 * x) smoother.DEFAULT_BASIC_SMOOTHER = smoother.BasicFixedSpanSmootherSlowUpdate smooth = smoother.perform_smooth(x, y, smoother_cls=supersmoother.SuperSmoother) ...
def function[validate_known_curve, parameter[]]: constant[Validate on a sin function.] call[name[plt].figure, parameter[]] variable[N] assign[=] constant[100] variable[x] assign[=] call[name[numpy].linspace, parameter[<ast.UnaryOp object at 0x7da1b19cb7f0>, constant[1], name[N]]] ...
keyword[def] identifier[validate_known_curve] (): literal[string] identifier[plt] . identifier[figure] () identifier[N] = literal[int] identifier[x] = identifier[numpy] . identifier[linspace] (- literal[int] , literal[int] , identifier[N] ) identifier[y] = identifier[numpy] . identifier[sin...
def validate_known_curve(): """Validate on a sin function.""" plt.figure() N = 100 x = numpy.linspace(-1, 1, N) y = numpy.sin(4 * x) smoother.DEFAULT_BASIC_SMOOTHER = smoother.BasicFixedSpanSmootherSlowUpdate smooth = smoother.perform_smooth(x, y, smoother_cls=supersmoother.SuperSmoother) ...
def drdgeo(lon, lat, alt, re, f): """ This routine computes the Jacobian of the transformation from geodetic to rectangular coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdgeo_c.html :param lon: Geodetic longitude of point (radians). :type lon: float :param lat: Geo...
def function[drdgeo, parameter[lon, lat, alt, re, f]]: constant[ This routine computes the Jacobian of the transformation from geodetic to rectangular coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdgeo_c.html :param lon: Geodetic longitude of point (radians). :type...
keyword[def] identifier[drdgeo] ( identifier[lon] , identifier[lat] , identifier[alt] , identifier[re] , identifier[f] ): literal[string] identifier[lon] = identifier[ctypes] . identifier[c_double] ( identifier[lon] ) identifier[lat] = identifier[ctypes] . identifier[c_double] ( identifier[lat] ) ...
def drdgeo(lon, lat, alt, re, f): """ This routine computes the Jacobian of the transformation from geodetic to rectangular coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/drdgeo_c.html :param lon: Geodetic longitude of point (radians). :type lon: float :param lat: Geo...
def get_namespace(fn: Callable, namespace: Optional[str]) -> str: """ Returns a representation of a function's name (perhaps within a namespace), like .. code-block:: none mymodule:MyClass.myclassfunc # with no namespace mymodule:MyClass.myclassfunc|somenamespace # with a namespace ...
def function[get_namespace, parameter[fn, namespace]]: constant[ Returns a representation of a function's name (perhaps within a namespace), like .. code-block:: none mymodule:MyClass.myclassfunc # with no namespace mymodule:MyClass.myclassfunc|somenamespace # with a namespace ...
keyword[def] identifier[get_namespace] ( identifier[fn] : identifier[Callable] , identifier[namespace] : identifier[Optional] [ identifier[str] ])-> identifier[str] : literal[string] keyword[return] literal[string] . identifier[format] ( identifier[module] = identifier[fn] . identifier[__mo...
def get_namespace(fn: Callable, namespace: Optional[str]) -> str: """ Returns a representation of a function's name (perhaps within a namespace), like .. code-block:: none mymodule:MyClass.myclassfunc # with no namespace mymodule:MyClass.myclassfunc|somenamespace # with a namespace ...
def median(values): """Return median value for the list of values. @param values: list of values for processing. @return: median value. """ values.sort() n = int(len(values) / 2) return values[n]
def function[median, parameter[values]]: constant[Return median value for the list of values. @param values: list of values for processing. @return: median value. ] call[name[values].sort, parameter[]] variable[n] assign[=] call[name[int], parameter[binary_operation[c...
keyword[def] identifier[median] ( identifier[values] ): literal[string] identifier[values] . identifier[sort] () identifier[n] = identifier[int] ( identifier[len] ( identifier[values] )/ literal[int] ) keyword[return] identifier[values] [ identifier[n] ]
def median(values): """Return median value for the list of values. @param values: list of values for processing. @return: median value. """ values.sort() n = int(len(values) / 2) return values[n]
def remove_interference_line(img): """ 去除干扰线 :param img: :return: """ pixdata = img.load() w,h = img.size for y in range(1,h-1): for x in range(1,w-1): count = 0 if pixdata[x,y-1] > 245: count = count + 1 if pixdata[x,y+1] > 245...
def function[remove_interference_line, parameter[img]]: constant[ 去除干扰线 :param img: :return: ] variable[pixdata] assign[=] call[name[img].load, parameter[]] <ast.Tuple object at 0x7da1b162b910> assign[=] name[img].size for taget[name[y]] in starred[call[name[range], param...
keyword[def] identifier[remove_interference_line] ( identifier[img] ): literal[string] identifier[pixdata] = identifier[img] . identifier[load] () identifier[w] , identifier[h] = identifier[img] . identifier[size] keyword[for] identifier[y] keyword[in] identifier[range] ( literal[int] , ident...
def remove_interference_line(img): """ 去除干扰线 :param img: :return: """ pixdata = img.load() (w, h) = img.size for y in range(1, h - 1): for x in range(1, w - 1): count = 0 if pixdata[x, y - 1] > 245: count = count + 1 # depends on [control=...
def get_keys_from_shelve(file_name, file_location): """ Function to retreive all keys in a shelve Args: file_name: Shelve storage file name file_location: The location of the file, derive from the os module Returns: a list of the keys """ temp_list = list() file = _...
def function[get_keys_from_shelve, parameter[file_name, file_location]]: constant[ Function to retreive all keys in a shelve Args: file_name: Shelve storage file name file_location: The location of the file, derive from the os module Returns: a list of the keys ] ...
keyword[def] identifier[get_keys_from_shelve] ( identifier[file_name] , identifier[file_location] ): literal[string] identifier[temp_list] = identifier[list] () identifier[file] = identifier[__os] . identifier[path] . identifier[join] ( identifier[file_location] , identifier[file_name] ) identifi...
def get_keys_from_shelve(file_name, file_location): """ Function to retreive all keys in a shelve Args: file_name: Shelve storage file name file_location: The location of the file, derive from the os module Returns: a list of the keys """ temp_list = list() file = _...
def _make_txn_selector(self): """Helper for :meth:`read`.""" if self._transaction_id is not None: return TransactionSelector(id=self._transaction_id) if self._read_timestamp: key = "read_timestamp" value = _datetime_to_pb_timestamp(self._read_timestamp) ...
def function[_make_txn_selector, parameter[self]]: constant[Helper for :meth:`read`.] if compare[name[self]._transaction_id is_not constant[None]] begin[:] return[call[name[TransactionSelector], parameter[]]] if name[self]._read_timestamp begin[:] variable[key] assign[=] ...
keyword[def] identifier[_make_txn_selector] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_transaction_id] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[TransactionSelector] ( identifier[id] = identifier[self] . identifier[_t...
def _make_txn_selector(self): """Helper for :meth:`read`.""" if self._transaction_id is not None: return TransactionSelector(id=self._transaction_id) # depends on [control=['if'], data=[]] if self._read_timestamp: key = 'read_timestamp' value = _datetime_to_pb_timestamp(self._read_t...
def calldataload(computation: BaseComputation) -> None: """ Load call data into memory. """ start_position = computation.stack_pop(type_hint=constants.UINT256) value = computation.msg.data_as_bytes[start_position:start_position + 32] padded_value = value.ljust(32, b'\x00') normalized_value ...
def function[calldataload, parameter[computation]]: constant[ Load call data into memory. ] variable[start_position] assign[=] call[name[computation].stack_pop, parameter[]] variable[value] assign[=] call[name[computation].msg.data_as_bytes][<ast.Slice object at 0x7da1b1647760>] ...
keyword[def] identifier[calldataload] ( identifier[computation] : identifier[BaseComputation] )-> keyword[None] : literal[string] identifier[start_position] = identifier[computation] . identifier[stack_pop] ( identifier[type_hint] = identifier[constants] . identifier[UINT256] ) identifier[value] = id...
def calldataload(computation: BaseComputation) -> None: """ Load call data into memory. """ start_position = computation.stack_pop(type_hint=constants.UINT256) value = computation.msg.data_as_bytes[start_position:start_position + 32] padded_value = value.ljust(32, b'\x00') normalized_value =...
def pole_from_endpoints(coord1, coord2): """Compute the pole from a great circle that connects the two specified coordinates. This assumes a right-handed rule from coord1 to coord2: the pole is the north pole under that assumption. Parameters ---------- coord1 : `~astropy.coordinates.SkyCo...
def function[pole_from_endpoints, parameter[coord1, coord2]]: constant[Compute the pole from a great circle that connects the two specified coordinates. This assumes a right-handed rule from coord1 to coord2: the pole is the north pole under that assumption. Parameters ---------- coord...
keyword[def] identifier[pole_from_endpoints] ( identifier[coord1] , identifier[coord2] ): literal[string] identifier[c1] = identifier[coord1] . identifier[cartesian] / identifier[coord1] . identifier[cartesian] . identifier[norm] () identifier[coord2] = identifier[coord2] . identifier[transform_to] (...
def pole_from_endpoints(coord1, coord2): """Compute the pole from a great circle that connects the two specified coordinates. This assumes a right-handed rule from coord1 to coord2: the pole is the north pole under that assumption. Parameters ---------- coord1 : `~astropy.coordinates.SkyCo...
def _query(self, action, qobj): """ returns WPToolsQuery string from action """ return qobj.restbase(self.params['rest_endpoint'], self.params.get('title'))
def function[_query, parameter[self, action, qobj]]: constant[ returns WPToolsQuery string from action ] return[call[name[qobj].restbase, parameter[call[name[self].params][constant[rest_endpoint]], call[name[self].params.get, parameter[constant[title]]]]]]
keyword[def] identifier[_query] ( identifier[self] , identifier[action] , identifier[qobj] ): literal[string] keyword[return] identifier[qobj] . identifier[restbase] ( identifier[self] . identifier[params] [ literal[string] ], identifier[self] . identifier[params] . identifier[get] ( lite...
def _query(self, action, qobj): """ returns WPToolsQuery string from action """ return qobj.restbase(self.params['rest_endpoint'], self.params.get('title'))
def meters(self): """Gets the XY meters in Spherical Mercator EPSG:900913, converted from lat/lon in WGS84""" latitude, longitude = self.latitude_longitude meter_x = longitude * ORIGIN_SHIFT / 180.0 meter_y = math.log(math.tan((90.0 + latitude) * math.pi / 360.0)) / (math.pi / 180.0) ...
def function[meters, parameter[self]]: constant[Gets the XY meters in Spherical Mercator EPSG:900913, converted from lat/lon in WGS84] <ast.Tuple object at 0x7da2044c0370> assign[=] name[self].latitude_longitude variable[meter_x] assign[=] binary_operation[binary_operation[name[longitude] * name...
keyword[def] identifier[meters] ( identifier[self] ): literal[string] identifier[latitude] , identifier[longitude] = identifier[self] . identifier[latitude_longitude] identifier[meter_x] = identifier[longitude] * identifier[ORIGIN_SHIFT] / literal[int] identifier[meter_y] = iden...
def meters(self): """Gets the XY meters in Spherical Mercator EPSG:900913, converted from lat/lon in WGS84""" (latitude, longitude) = self.latitude_longitude meter_x = longitude * ORIGIN_SHIFT / 180.0 meter_y = math.log(math.tan((90.0 + latitude) * math.pi / 360.0)) / (math.pi / 180.0) meter_y = met...
def cp(src, dst, overwrite=False): """ Copy files to a new location. :param src: list (or string) of paths of files to copy :param dst: file or folder to copy item(s) to :param overwrite: IF the file already exists, should I overwrite it? """ if not isinstance(src, list): src = [sr...
def function[cp, parameter[src, dst, overwrite]]: constant[ Copy files to a new location. :param src: list (or string) of paths of files to copy :param dst: file or folder to copy item(s) to :param overwrite: IF the file already exists, should I overwrite it? ] if <ast.UnaryOp objec...
keyword[def] identifier[cp] ( identifier[src] , identifier[dst] , identifier[overwrite] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[src] , identifier[list] ): identifier[src] =[ identifier[src] ] identifier[dst] = identifier[os] . ident...
def cp(src, dst, overwrite=False): """ Copy files to a new location. :param src: list (or string) of paths of files to copy :param dst: file or folder to copy item(s) to :param overwrite: IF the file already exists, should I overwrite it? """ if not isinstance(src, list): src = [src...
def _random_mutation_operator(self, individual, allow_shrink=True): """Perform a replacement, insertion, or shrink mutation on an individual. Parameters ---------- individual: DEAP individual A list of pipeline operators and model parameters that can be compiled ...
def function[_random_mutation_operator, parameter[self, individual, allow_shrink]]: constant[Perform a replacement, insertion, or shrink mutation on an individual. Parameters ---------- individual: DEAP individual A list of pipeline operators and model parameters that can be...
keyword[def] identifier[_random_mutation_operator] ( identifier[self] , identifier[individual] , identifier[allow_shrink] = keyword[True] ): literal[string] keyword[if] identifier[self] . identifier[tree_structure] : identifier[mutation_techniques] =[ identifier[partial] ...
def _random_mutation_operator(self, individual, allow_shrink=True): """Perform a replacement, insertion, or shrink mutation on an individual. Parameters ---------- individual: DEAP individual A list of pipeline operators and model parameters that can be compiled by D...
def _ctypes_indices(parameter): """Returns code for parameter variable declarations specifying the size of each dimension in the specified parameter. """ if (parameter.dimension is not None and ":" in parameter.dimension): splice = _ctypes_splice(parameter) if "out" in parameter.directio...
def function[_ctypes_indices, parameter[parameter]]: constant[Returns code for parameter variable declarations specifying the size of each dimension in the specified parameter. ] if <ast.BoolOp object at 0x7da20e9572e0> begin[:] variable[splice] assign[=] call[name[_ctypes_splice...
keyword[def] identifier[_ctypes_indices] ( identifier[parameter] ): literal[string] keyword[if] ( identifier[parameter] . identifier[dimension] keyword[is] keyword[not] keyword[None] keyword[and] literal[string] keyword[in] identifier[parameter] . identifier[dimension] ): identifier[splice]...
def _ctypes_indices(parameter): """Returns code for parameter variable declarations specifying the size of each dimension in the specified parameter. """ if parameter.dimension is not None and ':' in parameter.dimension: splice = _ctypes_splice(parameter) if 'out' in parameter.direction:...
def to_abivars(self): """Returns a dictionary with the abinit variables.""" abivars = dict( bs_calctype=1, bs_loband=self.bs_loband, #nband=self.nband, mbpt_sciss=self.mbpt_sciss, ecuteps=self.ecuteps, bs_algorithm=self._ALGO2VAR[se...
def function[to_abivars, parameter[self]]: constant[Returns a dictionary with the abinit variables.] variable[abivars] assign[=] call[name[dict], parameter[]] if name[self].use_haydock begin[:] call[name[abivars].update, parameter[]] call[name[abivars].update, parameter[n...
keyword[def] identifier[to_abivars] ( identifier[self] ): literal[string] identifier[abivars] = identifier[dict] ( identifier[bs_calctype] = literal[int] , identifier[bs_loband] = identifier[self] . identifier[bs_loband] , identifier[mbpt_sciss] = identifier[self...
def to_abivars(self): """Returns a dictionary with the abinit variables.""" #nband=self.nband, abivars = dict(bs_calctype=1, bs_loband=self.bs_loband, mbpt_sciss=self.mbpt_sciss, ecuteps=self.ecuteps, bs_algorithm=self._ALGO2VAR[self.algo], bs_coulomb_term=21, mdf_epsinf=self.mdf_epsinf, bs_exchange_term=1 ...
def iterate_nodes(self, string_key, distinct=True): """Given a string key it returns the nodes as a generator that can hold the key. The generator iterates one time through the ring starting at the correct position. if `distinct` is set, then the nodes returned will be unique, ...
def function[iterate_nodes, parameter[self, string_key, distinct]]: constant[Given a string key it returns the nodes as a generator that can hold the key. The generator iterates one time through the ring starting at the correct position. if `distinct` is set, then the nodes returned wi...
keyword[def] identifier[iterate_nodes] ( identifier[self] , identifier[string_key] , identifier[distinct] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[ring] : keyword[yield] keyword[None] , keyword[None] identifier[returned_val...
def iterate_nodes(self, string_key, distinct=True): """Given a string key it returns the nodes as a generator that can hold the key. The generator iterates one time through the ring starting at the correct position. if `distinct` is set, then the nodes returned will be unique, i.e....
def prep_system(run_info_yaml, bcbio_system=None): """Prepare system configuration information from an input configuration file. This does the work of parsing the system input file and setting up directories for use in 'organize'. """ work_dir = os.getcwd() config, config_file = config_utils.lo...
def function[prep_system, parameter[run_info_yaml, bcbio_system]]: constant[Prepare system configuration information from an input configuration file. This does the work of parsing the system input file and setting up directories for use in 'organize'. ] variable[work_dir] assign[=] call[na...
keyword[def] identifier[prep_system] ( identifier[run_info_yaml] , identifier[bcbio_system] = keyword[None] ): literal[string] identifier[work_dir] = identifier[os] . identifier[getcwd] () identifier[config] , identifier[config_file] = identifier[config_utils] . identifier[load_system_config] ( identi...
def prep_system(run_info_yaml, bcbio_system=None): """Prepare system configuration information from an input configuration file. This does the work of parsing the system input file and setting up directories for use in 'organize'. """ work_dir = os.getcwd() (config, config_file) = config_utils....
def normalize(self): """ Convert times to midnight. The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected. This method is available on Series ...
def function[normalize, parameter[self]]: constant[ Convert times to midnight. The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected. This met...
keyword[def] identifier[normalize] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[tz] keyword[is] keyword[None] keyword[or] identifier[timezones] . identifier[is_utc] ( identifier[self] . identifier[tz] ): identifier[not_null] =~ identifier[self] ....
def normalize(self): """ Convert times to midnight. The time component of the date-time is converted to midnight i.e. 00:00:00. This is useful in cases, when the time does not matter. Length is unaltered. The timezones are unaffected. This method is available on Series with...
def env(self): """ Dict of all environment variables that will be run with this command. """ env_vars = os.environ.copy() env_vars.update(self._env) new_path = ":".join( self._paths + [env_vars["PATH"]] if "PATH" in env_vars else [] + self._paths ) ...
def function[env, parameter[self]]: constant[ Dict of all environment variables that will be run with this command. ] variable[env_vars] assign[=] call[name[os].environ.copy, parameter[]] call[name[env_vars].update, parameter[name[self]._env]] variable[new_path] assign[=]...
keyword[def] identifier[env] ( identifier[self] ): literal[string] identifier[env_vars] = identifier[os] . identifier[environ] . identifier[copy] () identifier[env_vars] . identifier[update] ( identifier[self] . identifier[_env] ) identifier[new_path] = literal[string] . identifie...
def env(self): """ Dict of all environment variables that will be run with this command. """ env_vars = os.environ.copy() env_vars.update(self._env) new_path = ':'.join(self._paths + [env_vars['PATH']] if 'PATH' in env_vars else [] + self._paths) env_vars['PATH'] = new_path for e...
def get_stats(self): ''' Get kitty stats as a dictionary ''' resp = requests.get('%s/api/stats.json' % self.url) assert(resp.status_code == 200) return resp.json()
def function[get_stats, parameter[self]]: constant[ Get kitty stats as a dictionary ] variable[resp] assign[=] call[name[requests].get, parameter[binary_operation[constant[%s/api/stats.json] <ast.Mod object at 0x7da2590d6920> name[self].url]]] assert[compare[name[resp].status_code eq...
keyword[def] identifier[get_stats] ( identifier[self] ): literal[string] identifier[resp] = identifier[requests] . identifier[get] ( literal[string] % identifier[self] . identifier[url] ) keyword[assert] ( identifier[resp] . identifier[status_code] == literal[int] ) keyword[return...
def get_stats(self): """ Get kitty stats as a dictionary """ resp = requests.get('%s/api/stats.json' % self.url) assert resp.status_code == 200 return resp.json()
def obj_to_str(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use ...
def function[obj_to_str, parameter[self, file_path, deliminator, tab, quote_numbers, quote_empty_str]]: constant[ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use :param tab: ...
keyword[def] identifier[obj_to_str] ( identifier[self] , identifier[file_path] = keyword[None] , identifier[deliminator] = keyword[None] , identifier[tab] = keyword[None] , identifier[quote_numbers] = keyword[True] , identifier[quote_empty_str] = keyword[False] ): literal[string] identifier[delimi...
def obj_to_str(self, file_path=None, deliminator=None, tab=None, quote_numbers=True, quote_empty_str=False): """ This will return a simple str table. :param file_path: str of the path to the file :param keys: list of str of the order of keys to use :param tab: ...
def set_api_from_config_path(self): """Set the RPC mode based on a given config file.""" config = ConfigParser(allow_no_value=False) config.optionxform = str config.read(self.config_path, "utf-8") if config.has_option("defaults", "dynamic_loading"): dynamic_loading = ...
def function[set_api_from_config_path, parameter[self]]: constant[Set the RPC mode based on a given config file.] variable[config] assign[=] call[name[ConfigParser], parameter[]] name[config].optionxform assign[=] name[str] call[name[config].read, parameter[name[self].config_path, consta...
keyword[def] identifier[set_api_from_config_path] ( identifier[self] ): literal[string] identifier[config] = identifier[ConfigParser] ( identifier[allow_no_value] = keyword[False] ) identifier[config] . identifier[optionxform] = identifier[str] identifier[config] . identifier[rea...
def set_api_from_config_path(self): """Set the RPC mode based on a given config file.""" config = ConfigParser(allow_no_value=False) config.optionxform = str config.read(self.config_path, 'utf-8') if config.has_option('defaults', 'dynamic_loading'): dynamic_loading = config.get('defaults', '...
def split(self, delimiter=None): """Same as string.split(), but retains literal/expandable structure. Returns: List of `EscapedString`. """ result = [] strings = self.strings[:] current = None while strings: is_literal, value = strings[0]...
def function[split, parameter[self, delimiter]]: constant[Same as string.split(), but retains literal/expandable structure. Returns: List of `EscapedString`. ] variable[result] assign[=] list[[]] variable[strings] assign[=] call[name[self].strings][<ast.Slice object ...
keyword[def] identifier[split] ( identifier[self] , identifier[delimiter] = keyword[None] ): literal[string] identifier[result] =[] identifier[strings] = identifier[self] . identifier[strings] [:] identifier[current] = keyword[None] keyword[while] identifier[strings] :...
def split(self, delimiter=None): """Same as string.split(), but retains literal/expandable structure. Returns: List of `EscapedString`. """ result = [] strings = self.strings[:] current = None while strings: (is_literal, value) = strings[0] parts = value....
def _del_controller(self, uid): """ Remove controller from internal list and tell the game. :param uid: Unique id of the controller :type uid: str """ try: self.controllers.pop(uid) e = Event(uid, E_DISCONNECT) self.queue.put_nowait(e)...
def function[_del_controller, parameter[self, uid]]: constant[ Remove controller from internal list and tell the game. :param uid: Unique id of the controller :type uid: str ] <ast.Try object at 0x7da18bc705b0>
keyword[def] identifier[_del_controller] ( identifier[self] , identifier[uid] ): literal[string] keyword[try] : identifier[self] . identifier[controllers] . identifier[pop] ( identifier[uid] ) identifier[e] = identifier[Event] ( identifier[uid] , identifier[E_DISCONNECT] )...
def _del_controller(self, uid): """ Remove controller from internal list and tell the game. :param uid: Unique id of the controller :type uid: str """ try: self.controllers.pop(uid) e = Event(uid, E_DISCONNECT) self.queue.put_nowait(e) # depends on [cont...
def get_scaffold_objective_ids(self): """Assumes that a scaffold objective id is available""" section = self._assessment_section item_id = self.get_my_item_id_from_section(section) return section.get_confused_learning_objective_ids(item_id)
def function[get_scaffold_objective_ids, parameter[self]]: constant[Assumes that a scaffold objective id is available] variable[section] assign[=] name[self]._assessment_section variable[item_id] assign[=] call[name[self].get_my_item_id_from_section, parameter[name[section]]] return[call[nam...
keyword[def] identifier[get_scaffold_objective_ids] ( identifier[self] ): literal[string] identifier[section] = identifier[self] . identifier[_assessment_section] identifier[item_id] = identifier[self] . identifier[get_my_item_id_from_section] ( identifier[section] ) keyword[retu...
def get_scaffold_objective_ids(self): """Assumes that a scaffold objective id is available""" section = self._assessment_section item_id = self.get_my_item_id_from_section(section) return section.get_confused_learning_objective_ids(item_id)
def create(self): """ Creates the directory and all its parent directories if it does not exist yet """ if self.dirname and not os.path.exists(self.dirname): os.makedirs(self.dirname)
def function[create, parameter[self]]: constant[ Creates the directory and all its parent directories if it does not exist yet ] if <ast.BoolOp object at 0x7da18f721d50> begin[:] call[name[os].makedirs, parameter[name[self].dirname]]
keyword[def] identifier[create] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[dirname] keyword[and] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[self] . identifier[dirname] ): identifier[os] . identifier[makedirs...
def create(self): """ Creates the directory and all its parent directories if it does not exist yet """ if self.dirname and (not os.path.exists(self.dirname)): os.makedirs(self.dirname) # depends on [control=['if'], data=[]]
def _render_dataframe(dataframe): """Helper to render a dataframe as an HTML table.""" data = dataframe.to_dict(orient='records') fields = dataframe.columns.tolist() return IPython.core.display.HTML( datalab.utils.commands.HtmlBuilder.render_table(data, fields))
def function[_render_dataframe, parameter[dataframe]]: constant[Helper to render a dataframe as an HTML table.] variable[data] assign[=] call[name[dataframe].to_dict, parameter[]] variable[fields] assign[=] call[name[dataframe].columns.tolist, parameter[]] return[call[name[IPython].core.disp...
keyword[def] identifier[_render_dataframe] ( identifier[dataframe] ): literal[string] identifier[data] = identifier[dataframe] . identifier[to_dict] ( identifier[orient] = literal[string] ) identifier[fields] = identifier[dataframe] . identifier[columns] . identifier[tolist] () keyword[return] identifie...
def _render_dataframe(dataframe): """Helper to render a dataframe as an HTML table.""" data = dataframe.to_dict(orient='records') fields = dataframe.columns.tolist() return IPython.core.display.HTML(datalab.utils.commands.HtmlBuilder.render_table(data, fields))
def _linux_stp(br, state): ''' Internal, sets STP state ''' brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state), python_shell=False)
def function[_linux_stp, parameter[br, state]]: constant[ Internal, sets STP state ] variable[brctl] assign[=] call[name[_tool_path], parameter[constant[brctl]]] return[call[call[name[__salt__]][constant[cmd.run]], parameter[call[constant[{0} stp {1} {2}].format, parameter[name[brctl], name[...
keyword[def] identifier[_linux_stp] ( identifier[br] , identifier[state] ): literal[string] identifier[brctl] = identifier[_tool_path] ( literal[string] ) keyword[return] identifier[__salt__] [ literal[string] ]( literal[string] . identifier[format] ( identifier[brctl] , identifier[br] , identifier[s...
def _linux_stp(br, state): """ Internal, sets STP state """ brctl = _tool_path('brctl') return __salt__['cmd.run']('{0} stp {1} {2}'.format(brctl, br, state), python_shell=False)
def make_list(obj, cast=True): """ Converts an object *obj* to a list and returns it. Objects of types *tuple* and *set* are converted if *cast* is *True*. Otherwise, and for all other types, *obj* is put in a new list. """ if isinstance(obj, list): return list(obj) elif is_lazy_iterable...
def function[make_list, parameter[obj, cast]]: constant[ Converts an object *obj* to a list and returns it. Objects of types *tuple* and *set* are converted if *cast* is *True*. Otherwise, and for all other types, *obj* is put in a new list. ] if call[name[isinstance], parameter[name[obj], n...
keyword[def] identifier[make_list] ( identifier[obj] , identifier[cast] = keyword[True] ): literal[string] keyword[if] identifier[isinstance] ( identifier[obj] , identifier[list] ): keyword[return] identifier[list] ( identifier[obj] ) keyword[elif] identifier[is_lazy_iterable] ( identifier...
def make_list(obj, cast=True): """ Converts an object *obj* to a list and returns it. Objects of types *tuple* and *set* are converted if *cast* is *True*. Otherwise, and for all other types, *obj* is put in a new list. """ if isinstance(obj, list): return list(obj) # depends on [control=['...
def getHeader(filename, handle=None): """ Return a copy of the PRIMARY header, along with any group/extension header for this filename specification. """ _fname, _extn = parseFilename(filename) # Allow the user to provide an already opened PyFITS object # to derive the header from... # ...
def function[getHeader, parameter[filename, handle]]: constant[ Return a copy of the PRIMARY header, along with any group/extension header for this filename specification. ] <ast.Tuple object at 0x7da1b26aeb60> assign[=] call[name[parseFilename], parameter[name[filename]]] if <ast.Un...
keyword[def] identifier[getHeader] ( identifier[filename] , identifier[handle] = keyword[None] ): literal[string] identifier[_fname] , identifier[_extn] = identifier[parseFilename] ( identifier[filename] ) keyword[if] keyword[not] identifier[handle] : identifier[_fimg] ...
def getHeader(filename, handle=None): """ Return a copy of the PRIMARY header, along with any group/extension header for this filename specification. """ (_fname, _extn) = parseFilename(filename) # Allow the user to provide an already opened PyFITS object # to derive the header from... #...
def download_fundflow(self, bill_date, account_type='Basic', tar_type=None): """ 下载资金账单 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_18&index=7 :param bill_date: 下载对账单的日期 :param account_type: 账单的资金来源账户 Basic 基...
def function[download_fundflow, parameter[self, bill_date, account_type, tar_type]]: constant[ 下载资金账单 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_18&index=7 :param bill_date: 下载对账单的日期 :param account_type: 账单的资金来源账户 Basic 基本账户 ...
keyword[def] identifier[download_fundflow] ( identifier[self] , identifier[bill_date] , identifier[account_type] = literal[string] , identifier[tar_type] = keyword[None] ): literal[string] keyword[if] identifier[isinstance] ( identifier[bill_date] ,( identifier[datetime] , identifier[date] )): ...
def download_fundflow(self, bill_date, account_type='Basic', tar_type=None): """ 下载资金账单 https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_18&index=7 :param bill_date: 下载对账单的日期 :param account_type: 账单的资金来源账户 Basic 基本账户 ...
def invoke_ssh_shell(cls, *args, **kwargs): """invoke_ssh(arguments..., pty=False, echo=False) Star a new shell on a remote server. It first calls :meth:`Flow.connect_ssh` using all positional and keyword arguments, then calls :meth:`SSHClient.invoke_shell` with the pty / echo o...
def function[invoke_ssh_shell, parameter[cls]]: constant[invoke_ssh(arguments..., pty=False, echo=False) Star a new shell on a remote server. It first calls :meth:`Flow.connect_ssh` using all positional and keyword arguments, then calls :meth:`SSHClient.invoke_shell` with the pt...
keyword[def] identifier[invoke_ssh_shell] ( identifier[cls] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[pty] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[True] ) identifier[echo] = identifier[kwargs] . identifier[pop] ( literal[string] , ...
def invoke_ssh_shell(cls, *args, **kwargs): """invoke_ssh(arguments..., pty=False, echo=False) Star a new shell on a remote server. It first calls :meth:`Flow.connect_ssh` using all positional and keyword arguments, then calls :meth:`SSHClient.invoke_shell` with the pty / echo optio...
def associate(self, queue): """Merge this queue with another. Both queues will use a shared command list and either one can be used to fill or flush the shared queue. """ assert isinstance(queue, GlirQueue) if queue._shared is self._shared: return # ...
def function[associate, parameter[self, queue]]: constant[Merge this queue with another. Both queues will use a shared command list and either one can be used to fill or flush the shared queue. ] assert[call[name[isinstance], parameter[name[queue], name[GlirQueue]]]] if comp...
keyword[def] identifier[associate] ( identifier[self] , identifier[queue] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[queue] , identifier[GlirQueue] ) keyword[if] identifier[queue] . identifier[_shared] keyword[is] identifier[self] . identifier[_shared] : ...
def associate(self, queue): """Merge this queue with another. Both queues will use a shared command list and either one can be used to fill or flush the shared queue. """ assert isinstance(queue, GlirQueue) if queue._shared is self._shared: return # depends on [control=['if...
def join(chord_root, quality='', extensions=None, bass=''): r"""Join the parts of a chord into a complete chord label. Parameters ---------- chord_root : str Root pitch class of the chord, e.g. 'C', 'Eb' quality : str Quality of the chord, e.g. 'maj', 'hdim7' (Default value ...
def function[join, parameter[chord_root, quality, extensions, bass]]: constant[Join the parts of a chord into a complete chord label. Parameters ---------- chord_root : str Root pitch class of the chord, e.g. 'C', 'Eb' quality : str Quality of the chord, e.g. 'maj', 'hdim7' ...
keyword[def] identifier[join] ( identifier[chord_root] , identifier[quality] = literal[string] , identifier[extensions] = keyword[None] , identifier[bass] = literal[string] ): literal[string] identifier[chord_label] = identifier[chord_root] keyword[if] identifier[quality] keyword[or] identifier[ex...
def join(chord_root, quality='', extensions=None, bass=''): """Join the parts of a chord into a complete chord label. Parameters ---------- chord_root : str Root pitch class of the chord, e.g. 'C', 'Eb' quality : str Quality of the chord, e.g. 'maj', 'hdim7' (Default value =...
def _add_column(self, column): """ Add a new column to the DataFrame :param column: column name :return: nothing """ self._columns.append(column) if self._blist: self._data.append(blist([None] * len(self._index))) else: self._data....
def function[_add_column, parameter[self, column]]: constant[ Add a new column to the DataFrame :param column: column name :return: nothing ] call[name[self]._columns.append, parameter[name[column]]] if name[self]._blist begin[:] call[name[self]._...
keyword[def] identifier[_add_column] ( identifier[self] , identifier[column] ): literal[string] identifier[self] . identifier[_columns] . identifier[append] ( identifier[column] ) keyword[if] identifier[self] . identifier[_blist] : identifier[self] . identifier[_data] . ident...
def _add_column(self, column): """ Add a new column to the DataFrame :param column: column name :return: nothing """ self._columns.append(column) if self._blist: self._data.append(blist([None] * len(self._index))) # depends on [control=['if'], data=[]] else: ...
def export(self, file_obj=None, file_type=None, **kwargs): """ Export the path to a file object or return data. Parameters --------------- file_obj : None, str, or file object File object or string to export to file_...
def function[export, parameter[self, file_obj, file_type]]: constant[ Export the path to a file object or return data. Parameters --------------- file_obj : None, str, or file object File object or string to export to file_type : None or str Type of f...
keyword[def] identifier[export] ( identifier[self] , identifier[file_obj] = keyword[None] , identifier[file_type] = keyword[None] , ** identifier[kwargs] ): literal[string] keyword[return] identifier[export_path] ( identifier[self] , identifier[file_type] = identifier[file_type] , ...
def export(self, file_obj=None, file_type=None, **kwargs): """ Export the path to a file object or return data. Parameters --------------- file_obj : None, str, or file object File object or string to export to file_type : None or str Type of file: dxf, d...
def is_sub_to_all(self, *super_entities): """ Given a list of super entities, return the entities that have those as a subset of their super entities. """ if super_entities: if len(super_entities) == 1: # Optimize for the case of just one super entity since th...
def function[is_sub_to_all, parameter[self]]: constant[ Given a list of super entities, return the entities that have those as a subset of their super entities. ] if name[super_entities] begin[:] if compare[call[name[len], parameter[name[super_entities]]] equal[==] consta...
keyword[def] identifier[is_sub_to_all] ( identifier[self] ,* identifier[super_entities] ): literal[string] keyword[if] identifier[super_entities] : keyword[if] identifier[len] ( identifier[super_entities] )== literal[int] : identifier[has_subset] = ident...
def is_sub_to_all(self, *super_entities): """ Given a list of super entities, return the entities that have those as a subset of their super entities. """ if super_entities: if len(super_entities) == 1: # Optimize for the case of just one super entity since this is a much les...
def restore_original_dimensions(obs, obs_space, tensorlib=tf): """Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into Dicts or Tuples of tensors...
def function[restore_original_dimensions, parameter[obs, obs_space, tensorlib]]: constant[Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into ...
keyword[def] identifier[restore_original_dimensions] ( identifier[obs] , identifier[obs_space] , identifier[tensorlib] = identifier[tf] ): literal[string] keyword[if] identifier[hasattr] ( identifier[obs_space] , literal[string] ): keyword[return] identifier[_unpack_obs] ( identifier[obs] , ide...
def restore_original_dimensions(obs, obs_space, tensorlib=tf): """Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into Dicts or Tuples of tensors...
def findall_operations_with_gate_type( self, gate_type: Type[T_DESIRED_GATE_TYPE] ) -> Iterable[Tuple[int, ops.GateOperation, T_DESIRED_GATE_TYPE]]: """Find the locations of all gate operations of a given type. Args: ...
def function[findall_operations_with_gate_type, parameter[self, gate_type]]: constant[Find the locations of all gate operations of a given type. Args: gate_type: The type of gate to find, e.g. XPowGate or MeasurementGate. Returns: An iterator (index, ope...
keyword[def] identifier[findall_operations_with_gate_type] ( identifier[self] , identifier[gate_type] : identifier[Type] [ identifier[T_DESIRED_GATE_TYPE] ] )-> identifier[Iterable] [ identifier[Tuple] [ identifier[int] , identifier[ops] . identifier[GateOperation] , identifier[T_DESIRED_GATE_TYPE] ]]: l...
def findall_operations_with_gate_type(self, gate_type: Type[T_DESIRED_GATE_TYPE]) -> Iterable[Tuple[int, ops.GateOperation, T_DESIRED_GATE_TYPE]]: """Find the locations of all gate operations of a given type. Args: gate_type: The type of gate to find, e.g. XPowGate or Measuremen...
def add_timeline_callback(self, timeline_events, callback): """Register a callback for a specific timeline event.""" if not timeline_events: return False if not isinstance(timeline_events, (tuple, list)): timeline_events = [timeline_events] for timeline_event in...
def function[add_timeline_callback, parameter[self, timeline_events, callback]]: constant[Register a callback for a specific timeline event.] if <ast.UnaryOp object at 0x7da1b0cf69b0> begin[:] return[constant[False]] if <ast.UnaryOp object at 0x7da1b0cf68f0> begin[:] vari...
keyword[def] identifier[add_timeline_callback] ( identifier[self] , identifier[timeline_events] , identifier[callback] ): literal[string] keyword[if] keyword[not] identifier[timeline_events] : keyword[return] keyword[False] keyword[if] keyword[not] identifier[isinstance...
def add_timeline_callback(self, timeline_events, callback): """Register a callback for a specific timeline event.""" if not timeline_events: return False # depends on [control=['if'], data=[]] if not isinstance(timeline_events, (tuple, list)): timeline_events = [timeline_events] # depends ...
def progress(self): """\ Report progress to the Java side. This needs to flush the uplink stream, but too many flushes can disrupt performance, so we actually talk to upstream once per second. """ now = time() if now - self.last_progress_t > 1: self.l...
def function[progress, parameter[self]]: constant[ Report progress to the Java side. This needs to flush the uplink stream, but too many flushes can disrupt performance, so we actually talk to upstream once per second. ] variable[now] assign[=] call[name[time], parameter[...
keyword[def] identifier[progress] ( identifier[self] ): literal[string] identifier[now] = identifier[time] () keyword[if] identifier[now] - identifier[self] . identifier[last_progress_t] > literal[int] : identifier[self] . identifier[last_progress_t] = identifier[now] ...
def progress(self): """ Report progress to the Java side. This needs to flush the uplink stream, but too many flushes can disrupt performance, so we actually talk to upstream once per second. """ now = time() if now - self.last_progress_t > 1: self.last_progress_t = n...
def set_hosts_file_entry_for_role(self, role_name, network_name='user-net', fqdn=None, domain_name=None): """Adds an entry to the hosts file for a scenario host given the role name and network name :param role_name: (str) role name of the host to add :param network_name: (str) Name of t...
def function[set_hosts_file_entry_for_role, parameter[self, role_name, network_name, fqdn, domain_name]]: constant[Adds an entry to the hosts file for a scenario host given the role name and network name :param role_name: (str) role name of the host to add :param network_name: (str) Nam...
keyword[def] identifier[set_hosts_file_entry_for_role] ( identifier[self] , identifier[role_name] , identifier[network_name] = literal[string] , identifier[fqdn] = keyword[None] , identifier[domain_name] = keyword[None] ): literal[string] identifier[log] = identifier[logging] . identifier[getLogger...
def set_hosts_file_entry_for_role(self, role_name, network_name='user-net', fqdn=None, domain_name=None): """Adds an entry to the hosts file for a scenario host given the role name and network name :param role_name: (str) role name of the host to add :param network_name: (str) Name of the n...
def reset(self, align=8, clip=80, code=False, derive=False, detail=0, ignored=True, infer=False, limit=100, stats=0, stream=None): '''Reset options, state, etc. The available options and default values are: *align=8* -- size alignment ...
def function[reset, parameter[self, align, clip, code, derive, detail, ignored, infer, limit, stats, stream]]: constant[Reset options, state, etc. The available options and default values are: *align=8* -- size alignment *clip=80* -- clip repr() strings ...
keyword[def] identifier[reset] ( identifier[self] , identifier[align] = literal[int] , identifier[clip] = literal[int] , identifier[code] = keyword[False] , identifier[derive] = keyword[False] , identifier[detail] = literal[int] , identifier[ignored] = keyword[True] , identifier[infer] = keyword[False] , identifier[...
def reset(self, align=8, clip=80, code=False, derive=False, detail=0, ignored=True, infer=False, limit=100, stats=0, stream=None): """Reset options, state, etc. The available options and default values are: *align=8* -- size alignment *clip=80* -- clip repr() strings...
def get_unread_topics(context, topics, user): """ This will return a list of unread topics for the given user from a given set of topics. Usage:: {% get_unread_topics topics request.user as unread_topics %} """ request = context.get('request', None) return TrackingHandler(request=request)...
def function[get_unread_topics, parameter[context, topics, user]]: constant[ This will return a list of unread topics for the given user from a given set of topics. Usage:: {% get_unread_topics topics request.user as unread_topics %} ] variable[request] assign[=] call[name[context].ge...
keyword[def] identifier[get_unread_topics] ( identifier[context] , identifier[topics] , identifier[user] ): literal[string] identifier[request] = identifier[context] . identifier[get] ( literal[string] , keyword[None] ) keyword[return] identifier[TrackingHandler] ( identifier[request] = identifier[re...
def get_unread_topics(context, topics, user): """ This will return a list of unread topics for the given user from a given set of topics. Usage:: {% get_unread_topics topics request.user as unread_topics %} """ request = context.get('request', None) return TrackingHandler(request=request)...
def file_url(self): """ Manage the case that we have to test a file .. note:: 1 URL per line. """ # We get, format, clean the list of URL to test. list_to_test = self._file_list_to_test_filtering() # We initiate a local variable which will save the ...
def function[file_url, parameter[self]]: constant[ Manage the case that we have to test a file .. note:: 1 URL per line. ] variable[list_to_test] assign[=] call[name[self]._file_list_to_test_filtering, parameter[]] variable[not_filtered] assign[=] name[list_t...
keyword[def] identifier[file_url] ( identifier[self] ): literal[string] identifier[list_to_test] = identifier[self] . identifier[_file_list_to_test_filtering] () identifier[not_filtered] = identifier[list_to_test] keyword[try] : ...
def file_url(self): """ Manage the case that we have to test a file .. note:: 1 URL per line. """ # We get, format, clean the list of URL to test. list_to_test = self._file_list_to_test_filtering() # We initiate a local variable which will save the current state of t...
def prefix_lines(lines, prefix): """Add the prefix to each of the lines. >>> prefix_lines(['foo', 'bar'], ' ') [' foo', ' bar'] >>> prefix_lines('foo\\nbar', ' ') [' foo', ' bar'] :param list or str lines: A string or a list of strings. If a string is passed, the string is split ...
def function[prefix_lines, parameter[lines, prefix]]: constant[Add the prefix to each of the lines. >>> prefix_lines(['foo', 'bar'], ' ') [' foo', ' bar'] >>> prefix_lines('foo\nbar', ' ') [' foo', ' bar'] :param list or str lines: A string or a list of strings. If a string is ...
keyword[def] identifier[prefix_lines] ( identifier[lines] , identifier[prefix] ): literal[string] keyword[if] identifier[isinstance] ( identifier[lines] , identifier[bytes] ): identifier[lines] = identifier[lines] . identifier[decode] ( literal[string] ) keyword[if] identifier[isinstance] (...
def prefix_lines(lines, prefix): """Add the prefix to each of the lines. >>> prefix_lines(['foo', 'bar'], ' ') [' foo', ' bar'] >>> prefix_lines('foo\\nbar', ' ') [' foo', ' bar'] :param list or str lines: A string or a list of strings. If a string is passed, the string is split ...
def get_turbine_data_from_oedb(turbine_type, fetch_curve, overwrite=False): r""" Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded from oedb in :py:func...
def function[get_turbine_data_from_oedb, parameter[turbine_type, fetch_curve, overwrite]]: constant[ Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded f...
keyword[def] identifier[get_turbine_data_from_oedb] ( identifier[turbine_type] , identifier[fetch_curve] , identifier[overwrite] = keyword[False] ): literal[string] identifier[filename] = identifier[os] . identifier[path] . identifier[join] ( identifier[os] . identifier[path] . identifier[dirname] ( i...
def get_turbine_data_from_oedb(turbine_type, fetch_curve, overwrite=False): """ Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded from oedb in :py:func:...
def create_shot_model(self, project, releasetype): """Create and return a new tree model that represents shots til descriptors The tree will include sequences, shots, tasks and descriptors of the given releaetype. :param releasetype: the releasetype for the model :type releasetype: :da...
def function[create_shot_model, parameter[self, project, releasetype]]: constant[Create and return a new tree model that represents shots til descriptors The tree will include sequences, shots, tasks and descriptors of the given releaetype. :param releasetype: the releasetype for the model ...
keyword[def] identifier[create_shot_model] ( identifier[self] , identifier[project] , identifier[releasetype] ): literal[string] identifier[rootdata] = identifier[treemodel] . identifier[ListItemData] ([ literal[string] ]) identifier[rootitem] = identifier[treemodel] . identifier[TreeItem]...
def create_shot_model(self, project, releasetype): """Create and return a new tree model that represents shots til descriptors The tree will include sequences, shots, tasks and descriptors of the given releaetype. :param releasetype: the releasetype for the model :type releasetype: :data:`...
def parse(self, filename): """ Parses a file into an AstromData structure. Args: filename: str The name of the file whose contents will be parsed. Returns: data: AstromData The file contents extracted into a data structure for programmatic ...
def function[parse, parameter[self, filename]]: constant[ Parses a file into an AstromData structure. Args: filename: str The name of the file whose contents will be parsed. Returns: data: AstromData The file contents extracted into a data st...
keyword[def] identifier[parse] ( identifier[self] , identifier[filename] ): literal[string] identifier[filehandle] = identifier[storage] . identifier[open_vos_or_local] ( identifier[filename] , literal[string] ) keyword[assert] identifier[filehandle] keyword[is] keyword[not] keyword[No...
def parse(self, filename): """ Parses a file into an AstromData structure. Args: filename: str The name of the file whose contents will be parsed. Returns: data: AstromData The file contents extracted into a data structure for programmatic ...
def dump_parent(self, obj): """Dump the parent of a PID.""" if not self._is_parent(obj): return self._dump_relative(obj.pid) return None
def function[dump_parent, parameter[self, obj]]: constant[Dump the parent of a PID.] if <ast.UnaryOp object at 0x7da1b229a200> begin[:] return[call[name[self]._dump_relative, parameter[name[obj].pid]]] return[constant[None]]
keyword[def] identifier[dump_parent] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_is_parent] ( identifier[obj] ): keyword[return] identifier[self] . identifier[_dump_relative] ( identifier[obj] . identifier[pid] ) ...
def dump_parent(self, obj): """Dump the parent of a PID.""" if not self._is_parent(obj): return self._dump_relative(obj.pid) # depends on [control=['if'], data=[]] return None
def _string_generator(descriptor, max_length=0, limit=0): 'Helper to create a string generator' vals = list(values.get_strings(max_length, limit)) return gen.IterValueGenerator(descriptor.name, vals)
def function[_string_generator, parameter[descriptor, max_length, limit]]: constant[Helper to create a string generator] variable[vals] assign[=] call[name[list], parameter[call[name[values].get_strings, parameter[name[max_length], name[limit]]]]] return[call[name[gen].IterValueGenerator, parameter[...
keyword[def] identifier[_string_generator] ( identifier[descriptor] , identifier[max_length] = literal[int] , identifier[limit] = literal[int] ): literal[string] identifier[vals] = identifier[list] ( identifier[values] . identifier[get_strings] ( identifier[max_length] , identifier[limit] )) keyword[r...
def _string_generator(descriptor, max_length=0, limit=0): """Helper to create a string generator""" vals = list(values.get_strings(max_length, limit)) return gen.IterValueGenerator(descriptor.name, vals)
def online_help(param=None): """ Open online document in web browser. :param param: input parameter :type param : int or str :return: None """ try: PARAMS_LINK_KEYS = sorted(PARAMS_LINK.keys()) if param in PARAMS_LINK_KEYS: webbrowser.open_new_tab(DOCUMENT_ADR + ...
def function[online_help, parameter[param]]: constant[ Open online document in web browser. :param param: input parameter :type param : int or str :return: None ] <ast.Try object at 0x7da1b160a1a0>
keyword[def] identifier[online_help] ( identifier[param] = keyword[None] ): literal[string] keyword[try] : identifier[PARAMS_LINK_KEYS] = identifier[sorted] ( identifier[PARAMS_LINK] . identifier[keys] ()) keyword[if] identifier[param] keyword[in] identifier[PARAMS_LINK_KEYS] : ...
def online_help(param=None): """ Open online document in web browser. :param param: input parameter :type param : int or str :return: None """ try: PARAMS_LINK_KEYS = sorted(PARAMS_LINK.keys()) if param in PARAMS_LINK_KEYS: webbrowser.open_new_tab(DOCUMENT_ADR + ...
def list_blobs(self, prefix=''): """Lists names of all blobs by their prefix.""" return [b.name for b in self.bucket.list_blobs(prefix=prefix)]
def function[list_blobs, parameter[self, prefix]]: constant[Lists names of all blobs by their prefix.] return[<ast.ListComp object at 0x7da2047e87f0>]
keyword[def] identifier[list_blobs] ( identifier[self] , identifier[prefix] = literal[string] ): literal[string] keyword[return] [ identifier[b] . identifier[name] keyword[for] identifier[b] keyword[in] identifier[self] . identifier[bucket] . identifier[list_blobs] ( identifier[prefix] = identifier[pre...
def list_blobs(self, prefix=''): """Lists names of all blobs by their prefix.""" return [b.name for b in self.bucket.list_blobs(prefix=prefix)]
def make_wsgi_app(registry=REGISTRY): """Create a WSGI app which serves the metrics from a registry.""" def prometheus_app(environ, start_response): params = parse_qs(environ.get('QUERY_STRING', '')) r = registry encoder, content_type = choose_encoder(environ.get('HTTP_ACCEPT')) ...
def function[make_wsgi_app, parameter[registry]]: constant[Create a WSGI app which serves the metrics from a registry.] def function[prometheus_app, parameter[environ, start_response]]: variable[params] assign[=] call[name[parse_qs], parameter[call[name[environ].get, parameter[constant[Q...
keyword[def] identifier[make_wsgi_app] ( identifier[registry] = identifier[REGISTRY] ): literal[string] keyword[def] identifier[prometheus_app] ( identifier[environ] , identifier[start_response] ): identifier[params] = identifier[parse_qs] ( identifier[environ] . identifier[get] ( literal[string...
def make_wsgi_app(registry=REGISTRY): """Create a WSGI app which serves the metrics from a registry.""" def prometheus_app(environ, start_response): params = parse_qs(environ.get('QUERY_STRING', '')) r = registry (encoder, content_type) = choose_encoder(environ.get('HTTP_ACCEPT')) ...
def doit(self, classes=None, recursive=True, **kwargs): """Rewrite (sub-)expressions in a more explicit form Return a modified expression that is more explicit than the original expression. The definition of "more explicit" is decided by the relevant subclass, e.g. a :meth:`Commutator <...
def function[doit, parameter[self, classes, recursive]]: constant[Rewrite (sub-)expressions in a more explicit form Return a modified expression that is more explicit than the original expression. The definition of "more explicit" is decided by the relevant subclass, e.g. a :meth:`Commu...
keyword[def] identifier[doit] ( identifier[self] , identifier[classes] = keyword[None] , identifier[recursive] = keyword[True] ,** identifier[kwargs] ): literal[string] identifier[in_classes] =( ( identifier[classes] keyword[is] keyword[None] ) keyword[or] identifier[any] ([ ide...
def doit(self, classes=None, recursive=True, **kwargs): """Rewrite (sub-)expressions in a more explicit form Return a modified expression that is more explicit than the original expression. The definition of "more explicit" is decided by the relevant subclass, e.g. a :meth:`Commutator <.Com...
def set_locale(ln): """Set Babel localization in request context. :param ln: Language identifier. """ ctx = _request_ctx_stack.top if ctx is None: raise RuntimeError('Working outside of request context.') new_locale = current_app.extensions['babel'].load_locale(ln) old_locale = geta...
def function[set_locale, parameter[ln]]: constant[Set Babel localization in request context. :param ln: Language identifier. ] variable[ctx] assign[=] name[_request_ctx_stack].top if compare[name[ctx] is constant[None]] begin[:] <ast.Raise object at 0x7da18fe91990> varia...
keyword[def] identifier[set_locale] ( identifier[ln] ): literal[string] identifier[ctx] = identifier[_request_ctx_stack] . identifier[top] keyword[if] identifier[ctx] keyword[is] keyword[None] : keyword[raise] identifier[RuntimeError] ( literal[string] ) identifier[new_locale] = ide...
def set_locale(ln): """Set Babel localization in request context. :param ln: Language identifier. """ ctx = _request_ctx_stack.top if ctx is None: raise RuntimeError('Working outside of request context.') # depends on [control=['if'], data=[]] new_locale = current_app.extensions['babel...
def avail_images(call=None, location='local'): ''' Return a list of the images that are on the provider CLI Example: .. code-block:: bash salt-cloud --list-images my-proxmox-config ''' if call == 'action': raise SaltCloudSystemExit( 'The avail_images function must ...
def function[avail_images, parameter[call, location]]: constant[ Return a list of the images that are on the provider CLI Example: .. code-block:: bash salt-cloud --list-images my-proxmox-config ] if compare[name[call] equal[==] constant[action]] begin[:] <ast.Raise ob...
keyword[def] identifier[avail_images] ( identifier[call] = keyword[None] , identifier[location] = literal[string] ): literal[string] keyword[if] identifier[call] == literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] literal[string] ) ...
def avail_images(call=None, location='local'): """ Return a list of the images that are on the provider CLI Example: .. code-block:: bash salt-cloud --list-images my-proxmox-config """ if call == 'action': raise SaltCloudSystemExit('The avail_images function must be called wit...
def maintenance_mode(self, **kwargs): """Configures maintenance mode on the device Args: rbridge_id (str): The rbridge ID of the device on which Maintenance mode will be configured in a VCS fabric. get (bool): Get config instead of editing config. (T...
def function[maintenance_mode, parameter[self]]: constant[Configures maintenance mode on the device Args: rbridge_id (str): The rbridge ID of the device on which Maintenance mode will be configured in a VCS fabric. get (bool): Get config instead of e...
keyword[def] identifier[maintenance_mode] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[is_get_config] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[False] ) identifier[delete] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword...
def maintenance_mode(self, **kwargs): """Configures maintenance mode on the device Args: rbridge_id (str): The rbridge ID of the device on which Maintenance mode will be configured in a VCS fabric. get (bool): Get config instead of editing config. (True,...
def apply(self, template, context={}): context.update(self.context) """Return the rendered text of a template instance""" return self.env.from_string(template).render(context)
def function[apply, parameter[self, template, context]]: call[name[context].update, parameter[name[self].context]] constant[Return the rendered text of a template instance] return[call[call[name[self].env.from_string, parameter[name[template]]].render, parameter[name[context]]]]
keyword[def] identifier[apply] ( identifier[self] , identifier[template] , identifier[context] ={}): identifier[context] . identifier[update] ( identifier[self] . identifier[context] ) literal[string] keyword[return] identifier[self] . identifier[env] . identifier[from_string] ( identifie...
def apply(self, template, context={}): context.update(self.context) 'Return the rendered text of a template instance' return self.env.from_string(template).render(context)
def rmse(params1, params2): r"""Compute the root-mean-squared error between two models. Parameters ---------- params1 : array_like Parameters of the first model. params2 : array_like Parameters of the second model. Returns ------- error : float Root-mean-squared...
def function[rmse, parameter[params1, params2]]: constant[Compute the root-mean-squared error between two models. Parameters ---------- params1 : array_like Parameters of the first model. params2 : array_like Parameters of the second model. Returns ------- error : f...
keyword[def] identifier[rmse] ( identifier[params1] , identifier[params2] ): literal[string] keyword[assert] identifier[len] ( identifier[params1] )== identifier[len] ( identifier[params2] ) identifier[params1] = identifier[np] . identifier[asarray] ( identifier[params1] )- identifier[np] . identifie...
def rmse(params1, params2): """Compute the root-mean-squared error between two models. Parameters ---------- params1 : array_like Parameters of the first model. params2 : array_like Parameters of the second model. Returns ------- error : float Root-mean-squared ...
def _run_query(client, query, job_config=None): """Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defaults to the standard SQL d...
def function[_run_query, parameter[client, query, job_config]]: constant[Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defa...
keyword[def] identifier[_run_query] ( identifier[client] , identifier[query] , identifier[job_config] = keyword[None] ): literal[string] identifier[start_time] = identifier[time] . identifier[time] () identifier[query_job] = identifier[client] . identifier[query] ( identifier[query] , identifier[job_c...
def _run_query(client, query, job_config=None): """Runs a query while printing status updates Args: client (google.cloud.bigquery.client.Client): Client to bundle configuration needed for API requests. query (str): SQL query to be executed. Defaults to the standard SQL d...
def parse_date(value): """Attempts to parse `value` into an instance of ``datetime.date``. If `value` is ``None``, this function will return ``None``. Args: value: A timestamp. This can be a string, datetime.date, or datetime.datetime value. """ if not value: return Non...
def function[parse_date, parameter[value]]: constant[Attempts to parse `value` into an instance of ``datetime.date``. If `value` is ``None``, this function will return ``None``. Args: value: A timestamp. This can be a string, datetime.date, or datetime.datetime value. ] ...
keyword[def] identifier[parse_date] ( identifier[value] ): literal[string] keyword[if] keyword[not] identifier[value] : keyword[return] keyword[None] keyword[if] identifier[isinstance] ( identifier[value] , identifier[datetime] . identifier[date] ): keyword[return] identifier[...
def parse_date(value): """Attempts to parse `value` into an instance of ``datetime.date``. If `value` is ``None``, this function will return ``None``. Args: value: A timestamp. This can be a string, datetime.date, or datetime.datetime value. """ if not value: return Non...
def get_schema(url, typename, version='1.0.0', timeout=30, username=None, password=None): """Parses DescribeFeatureType response and creates schema compatible with :class:`fiona` :param str url: url of the service :param str version: version of the service :param str typename: name of the layer ...
def function[get_schema, parameter[url, typename, version, timeout, username, password]]: constant[Parses DescribeFeatureType response and creates schema compatible with :class:`fiona` :param str url: url of the service :param str version: version of the service :param str typename: name of the...
keyword[def] identifier[get_schema] ( identifier[url] , identifier[typename] , identifier[version] = literal[string] , identifier[timeout] = literal[int] , identifier[username] = keyword[None] , identifier[password] = keyword[None] ): literal[string] identifier[url] = identifier[_get_describefeaturetype_u...
def get_schema(url, typename, version='1.0.0', timeout=30, username=None, password=None): """Parses DescribeFeatureType response and creates schema compatible with :class:`fiona` :param str url: url of the service :param str version: version of the service :param str typename: name of the layer ...
def match(self, el): """Match.""" return not self.is_doc(el) and self.is_tag(el) and self.match_selectors(el, self.selectors)
def function[match, parameter[self, el]]: constant[Match.] return[<ast.BoolOp object at 0x7da204961db0>]
keyword[def] identifier[match] ( identifier[self] , identifier[el] ): literal[string] keyword[return] keyword[not] identifier[self] . identifier[is_doc] ( identifier[el] ) keyword[and] identifier[self] . identifier[is_tag] ( identifier[el] ) keyword[and] identifier[self] . identifier[match_sel...
def match(self, el): """Match.""" return not self.is_doc(el) and self.is_tag(el) and self.match_selectors(el, self.selectors)
def install_translator(qapp): """Install Qt translator to the QApplication instance""" global QT_TRANSLATOR if QT_TRANSLATOR is None: qt_translator = QTranslator() if qt_translator.load("qt_"+QLocale.system().name(), QLibraryInfo.location(QLibraryInfo.Translations...
def function[install_translator, parameter[qapp]]: constant[Install Qt translator to the QApplication instance] <ast.Global object at 0x7da18ede4be0> if compare[name[QT_TRANSLATOR] is constant[None]] begin[:] variable[qt_translator] assign[=] call[name[QTranslator], parameter[]] ...
keyword[def] identifier[install_translator] ( identifier[qapp] ): literal[string] keyword[global] identifier[QT_TRANSLATOR] keyword[if] identifier[QT_TRANSLATOR] keyword[is] keyword[None] : identifier[qt_translator] = identifier[QTranslator] () keyword[if] identifier[qt_tr...
def install_translator(qapp): """Install Qt translator to the QApplication instance""" global QT_TRANSLATOR if QT_TRANSLATOR is None: qt_translator = QTranslator() if qt_translator.load('qt_' + QLocale.system().name(), QLibraryInfo.location(QLibraryInfo.TranslationsPath)): QT_TRA...
def advance(self, inputs, advance_time, time_step=None): """ Advance the simulation by the given amount of time, assuming that inputs are constant at the given values during the simulated time. """ final_time_seconds = self.time_seconds + advance_time # Use half of the m...
def function[advance, parameter[self, inputs, advance_time, time_step]]: constant[ Advance the simulation by the given amount of time, assuming that inputs are constant at the given values during the simulated time. ] variable[final_time_seconds] assign[=] binary_operation[name[s...
keyword[def] identifier[advance] ( identifier[self] , identifier[inputs] , identifier[advance_time] , identifier[time_step] = keyword[None] ): literal[string] identifier[final_time_seconds] = identifier[self] . identifier[time_seconds] + identifier[advance_time] keyword[if] ide...
def advance(self, inputs, advance_time, time_step=None): """ Advance the simulation by the given amount of time, assuming that inputs are constant at the given values during the simulated time. """ final_time_seconds = self.time_seconds + advance_time # Use half of the max allowed ti...
def add(self, start, end): """ Add the start and end offsets of a matching read. @param start: The C{int} start offset of the read match in the subject. @param end: The C{int} end offset of the read match in the subject. This is Python-style: the end offset is not included i...
def function[add, parameter[self, start, end]]: constant[ Add the start and end offsets of a matching read. @param start: The C{int} start offset of the read match in the subject. @param end: The C{int} end offset of the read match in the subject. This is Python-style: the e...
keyword[def] identifier[add] ( identifier[self] , identifier[start] , identifier[end] ): literal[string] keyword[assert] identifier[start] <= identifier[end] identifier[self] . identifier[_intervals] . identifier[append] (( identifier[start] , identifier[end] ))
def add(self, start, end): """ Add the start and end offsets of a matching read. @param start: The C{int} start offset of the read match in the subject. @param end: The C{int} end offset of the read match in the subject. This is Python-style: the end offset is not included in th...
def local_id(personal): """ Executor for `globus endpoint local-id` """ if personal: try: ep_id = LocalGlobusConnectPersonal().endpoint_id except IOError as e: safeprint(e, write_to_stderr=True) click.get_current_context().exit(1) if ep_id is ...
def function[local_id, parameter[personal]]: constant[ Executor for `globus endpoint local-id` ] if name[personal] begin[:] <ast.Try object at 0x7da18ede5540> if compare[name[ep_id] is_not constant[None]] begin[:] call[name[safeprint], parameter[na...
keyword[def] identifier[local_id] ( identifier[personal] ): literal[string] keyword[if] identifier[personal] : keyword[try] : identifier[ep_id] = identifier[LocalGlobusConnectPersonal] (). identifier[endpoint_id] keyword[except] identifier[IOError] keyword[as] identifier...
def local_id(personal): """ Executor for `globus endpoint local-id` """ if personal: try: ep_id = LocalGlobusConnectPersonal().endpoint_id # depends on [control=['try'], data=[]] except IOError as e: safeprint(e, write_to_stderr=True) click.get_curren...
def _compare_keys(element1, element2, key, compare_func, *args): """ Compares a specific key between two elements of a basis set If the key exists in one element but not the other, False is returned. If the key exists in neither element, True is returned. Parameters ---------- element1 : ...
def function[_compare_keys, parameter[element1, element2, key, compare_func]]: constant[ Compares a specific key between two elements of a basis set If the key exists in one element but not the other, False is returned. If the key exists in neither element, True is returned. Parameters --...
keyword[def] identifier[_compare_keys] ( identifier[element1] , identifier[element2] , identifier[key] , identifier[compare_func] ,* identifier[args] ): literal[string] keyword[if] identifier[key] keyword[in] identifier[element1] keyword[and] identifier[key] keyword[in] identifier[element2] : ...
def _compare_keys(element1, element2, key, compare_func, *args): """ Compares a specific key between two elements of a basis set If the key exists in one element but not the other, False is returned. If the key exists in neither element, True is returned. Parameters ---------- element1 : ...
def siret(self, max_sequential_digits=2): """ Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential_digits is invalid, it is...
def function[siret, parameter[self, max_sequential_digits]]: constant[ Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential...
keyword[def] identifier[siret] ( identifier[self] , identifier[max_sequential_digits] = literal[int] ): literal[string] keyword[if] identifier[max_sequential_digits] > literal[int] keyword[or] identifier[max_sequential_digits] <= literal[int] : identifier[max_sequential_digits] = li...
def siret(self, max_sequential_digits=2): """ Generates a siret number (14 digits). It is in fact the result of the concatenation of a siren number (9 digits), a sequential number (4 digits) and a control number (1 digit) concatenation. If $max_sequential_digits is invalid, it is set...
def _cc(self): """ implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting") """ g=self.layout.grx P=[] for v in self: P.extend(sorted([g[x].pos for x in self._neighbo...
def function[_cc, parameter[self]]: constant[ implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting") ] variable[g] assign[=] name[self].layout.grx variable[P] assign[=] list[[]] ...
keyword[def] identifier[_cc] ( identifier[self] ): literal[string] identifier[g] = identifier[self] . identifier[layout] . identifier[grx] identifier[P] =[] keyword[for] identifier[v] keyword[in] identifier[self] : identifier[P] . identifier[extend] ( identifier[s...
def _cc(self): """ implementation of the efficient bilayer cross counting by insert-sort (see Barth & Mutzel paper "Simple and Efficient Bilayer Cross Counting") """ g = self.layout.grx P = [] for v in self: P.extend(sorted([g[x].pos for x in self._neighbors(v)])) # depe...
def list_streams(self, session_id): """ Returns a list of Stream objects that contains information of all the streams in a OpenTok session, with the following attributes: -count: An integer that indicates the number of streams in the session -items: List of the Stream objects ...
def function[list_streams, parameter[self, session_id]]: constant[ Returns a list of Stream objects that contains information of all the streams in a OpenTok session, with the following attributes: -count: An integer that indicates the number of streams in the session -items: Li...
keyword[def] identifier[list_streams] ( identifier[self] , identifier[session_id] ): literal[string] identifier[endpoint] = identifier[self] . identifier[endpoints] . identifier[get_stream_url] ( identifier[session_id] ) identifier[response] = identifier[requests] . identifier[get] ( ...
def list_streams(self, session_id): """ Returns a list of Stream objects that contains information of all the streams in a OpenTok session, with the following attributes: -count: An integer that indicates the number of streams in the session -items: List of the Stream objects ...
def get_hashhash(self, username): """ Generate a digest of the htpasswd hash """ return hashlib.sha256( self.users.get_hash(username) ).hexdigest()
def function[get_hashhash, parameter[self, username]]: constant[ Generate a digest of the htpasswd hash ] return[call[call[name[hashlib].sha256, parameter[call[name[self].users.get_hash, parameter[name[username]]]]].hexdigest, parameter[]]]
keyword[def] identifier[get_hashhash] ( identifier[self] , identifier[username] ): literal[string] keyword[return] identifier[hashlib] . identifier[sha256] ( identifier[self] . identifier[users] . identifier[get_hash] ( identifier[username] ) ). identifier[hexdigest] ()
def get_hashhash(self, username): """ Generate a digest of the htpasswd hash """ return hashlib.sha256(self.users.get_hash(username)).hexdigest()
def output(self) -> None: """Pretty print travel times.""" print("%s - %s" % (self.station, self.now)) print(self.products_filter) for j in sorted(self.journeys, key=lambda k: k.real_departure)[ : self.max_journeys ]: print("-------------") pr...
def function[output, parameter[self]]: constant[Pretty print travel times.] call[name[print], parameter[binary_operation[constant[%s - %s] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Attribute object at 0x7da1b11a8b80>, <ast.Attribute object at 0x7da1b11a81c0>]]]]] call[name[print], parameter...
keyword[def] identifier[output] ( identifier[self] )-> keyword[None] : literal[string] identifier[print] ( literal[string] %( identifier[self] . identifier[station] , identifier[self] . identifier[now] )) identifier[print] ( identifier[self] . identifier[products_filter] ) keywor...
def output(self) -> None: """Pretty print travel times.""" print('%s - %s' % (self.station, self.now)) print(self.products_filter) for j in sorted(self.journeys, key=lambda k: k.real_departure)[:self.max_journeys]: print('-------------') print(f'{j.product}: {j.number} ({j.train_id})') ...
def from_binary_string(self, notification): """Unpack the notification from binary string.""" command = struct.unpack('>B', notification[0])[0] if command != self.COMMAND: raise NotificationInvalidCommandError() length = struct.unpack('>I', notification[1:5])[0] not...
def function[from_binary_string, parameter[self, notification]]: constant[Unpack the notification from binary string.] variable[command] assign[=] call[call[name[struct].unpack, parameter[constant[>B], call[name[notification]][constant[0]]]]][constant[0]] if compare[name[command] not_equal[!=] n...
keyword[def] identifier[from_binary_string] ( identifier[self] , identifier[notification] ): literal[string] identifier[command] = identifier[struct] . identifier[unpack] ( literal[string] , identifier[notification] [ literal[int] ])[ literal[int] ] keyword[if] identifier[command] != ide...
def from_binary_string(self, notification): """Unpack the notification from binary string.""" command = struct.unpack('>B', notification[0])[0] if command != self.COMMAND: raise NotificationInvalidCommandError() # depends on [control=['if'], data=[]] length = struct.unpack('>I', notification[1:...
def medium(self, medium): """Get or set the constraints on the model exchanges. `model.medium` returns a dictionary of the bounds for each of the boundary reactions, in the form of `{rxn_id: bound}`, where `bound` specifies the absolute value of the bound in direction of metabolite ...
def function[medium, parameter[self, medium]]: constant[Get or set the constraints on the model exchanges. `model.medium` returns a dictionary of the bounds for each of the boundary reactions, in the form of `{rxn_id: bound}`, where `bound` specifies the absolute value of the bound in d...
keyword[def] identifier[medium] ( identifier[self] , identifier[medium] ): literal[string] keyword[def] identifier[set_active_bound] ( identifier[reaction] , identifier[bound] ): keyword[if] identifier[reaction] . identifier[reactants] : identifier[reaction] . ident...
def medium(self, medium): """Get or set the constraints on the model exchanges. `model.medium` returns a dictionary of the bounds for each of the boundary reactions, in the form of `{rxn_id: bound}`, where `bound` specifies the absolute value of the bound in direction of metabolite ...
def absent(name, auth=None): ''' Ensure a subnet does not exists name Name of the subnet ''' ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['neutronng.setup_clouds'](auth) subnet = __salt__['neutronng.subnet_get'](name...
def function[absent, parameter[name, auth]]: constant[ Ensure a subnet does not exists name Name of the subnet ] variable[ret] assign[=] dictionary[[<ast.Constant object at 0x7da1b21345e0>, <ast.Constant object at 0x7da1b2136320>, <ast.Constant object at 0x7da1b2136fb0>, <ast.Const...
keyword[def] identifier[absent] ( identifier[name] , identifier[auth] = keyword[None] ): literal[string] identifier[ret] ={ literal[string] : identifier[name] , literal[string] :{}, literal[string] : keyword[True] , literal[string] : literal[string] } identifier[__salt__] [ literal[str...
def absent(name, auth=None): """ Ensure a subnet does not exists name Name of the subnet """ ret = {'name': name, 'changes': {}, 'result': True, 'comment': ''} __salt__['neutronng.setup_clouds'](auth) subnet = __salt__['neutronng.subnet_get'](name=name) if subnet: if __...
def linspace(start, stop, num, decimals=18): """ Returns a list of evenly spaced numbers over a specified interval. Inspired from Numpy's linspace function: https://github.com/numpy/numpy/blob/master/numpy/core/function_base.py :param start: starting value :type start: float :param stop: end value...
def function[linspace, parameter[start, stop, num, decimals]]: constant[ Returns a list of evenly spaced numbers over a specified interval. Inspired from Numpy's linspace function: https://github.com/numpy/numpy/blob/master/numpy/core/function_base.py :param start: starting value :type start: floa...
keyword[def] identifier[linspace] ( identifier[start] , identifier[stop] , identifier[num] , identifier[decimals] = literal[int] ): literal[string] identifier[start] = identifier[float] ( identifier[start] ) identifier[stop] = identifier[float] ( identifier[stop] ) keyword[if] identifier[abs] ( ...
def linspace(start, stop, num, decimals=18): """ Returns a list of evenly spaced numbers over a specified interval. Inspired from Numpy's linspace function: https://github.com/numpy/numpy/blob/master/numpy/core/function_base.py :param start: starting value :type start: float :param stop: end value...
def _unpack_edition(cls, value): """ Unpack its elements and set the attributes in wfn accordingly. Parse out the five elements: ~ edition ~ software edition ~ target sw ~ target hw ~ other :param string value: Value of edition attribute :returns: Dictionary with parts ...
def function[_unpack_edition, parameter[cls, value]]: constant[ Unpack its elements and set the attributes in wfn accordingly. Parse out the five elements: ~ edition ~ software edition ~ target sw ~ target hw ~ other :param string value: Value of edition attribute :retu...
keyword[def] identifier[_unpack_edition] ( identifier[cls] , identifier[value] ): literal[string] identifier[components] = identifier[value] . identifier[split] ( identifier[CPEComponent2_3_URI] . identifier[SEPARATOR_PACKED_EDITION] ) identifier[d] = identifier[dict] () identif...
def _unpack_edition(cls, value): """ Unpack its elements and set the attributes in wfn accordingly. Parse out the five elements: ~ edition ~ software edition ~ target sw ~ target hw ~ other :param string value: Value of edition attribute :returns: Dictionary with parts of e...
def url(self, **kwargs): """ Returns a formatted URL for the asset's File with serialized parameters. Usage: >>> my_asset.url() "//images.contentful.com/spaces/foobar/..." >>> my_asset.url(w=120, h=160) "//images.contentful.com/spaces/foob...
def function[url, parameter[self]]: constant[ Returns a formatted URL for the asset's File with serialized parameters. Usage: >>> my_asset.url() "//images.contentful.com/spaces/foobar/..." >>> my_asset.url(w=120, h=160) "//images.contentfu...
keyword[def] identifier[url] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[url] = identifier[self] . identifier[fields] ( identifier[self] . identifier[_locale] ()). identifier[get] ( literal[string] ,{}). identifier[get] ( literal[string] , literal[string] ) ide...
def url(self, **kwargs): """ Returns a formatted URL for the asset's File with serialized parameters. Usage: >>> my_asset.url() "//images.contentful.com/spaces/foobar/..." >>> my_asset.url(w=120, h=160) "//images.contentful.com/spaces/foobar/....
def parse_environs(name, parse_class=ParseResult, **defaults): """ same as parse_environ() but will also check name_1, name_2, ..., name_N and return all the found dsn strings from the environment this will look for name, and name_N (where N is 1 through infinity) in the environment, if it finds th...
def function[parse_environs, parameter[name, parse_class]]: constant[ same as parse_environ() but will also check name_1, name_2, ..., name_N and return all the found dsn strings from the environment this will look for name, and name_N (where N is 1 through infinity) in the environment, if it f...
keyword[def] identifier[parse_environs] ( identifier[name] , identifier[parse_class] = identifier[ParseResult] ,** identifier[defaults] ): literal[string] identifier[ret] =[] keyword[if] identifier[name] keyword[in] identifier[os] . identifier[environ] : identifier[ret] . identifier[append...
def parse_environs(name, parse_class=ParseResult, **defaults): """ same as parse_environ() but will also check name_1, name_2, ..., name_N and return all the found dsn strings from the environment this will look for name, and name_N (where N is 1 through infinity) in the environment, if it finds th...
def context(names): """Show JSON-LD context for repository objects.""" import json contexts = [_context_json(name) for name in set(names)] if contexts: click.echo( json.dumps( contexts[0] if len(contexts) == 1 else contexts, indent=2, ) ...
def function[context, parameter[names]]: constant[Show JSON-LD context for repository objects.] import module[json] variable[contexts] assign[=] <ast.ListComp object at 0x7da1b26af460> if name[contexts] begin[:] call[name[click].echo, parameter[call[name[json].dumps, paramete...
keyword[def] identifier[context] ( identifier[names] ): literal[string] keyword[import] identifier[json] identifier[contexts] =[ identifier[_context_json] ( identifier[name] ) keyword[for] identifier[name] keyword[in] identifier[set] ( identifier[names] )] keyword[if] identifier[contexts] ...
def context(names): """Show JSON-LD context for repository objects.""" import json contexts = [_context_json(name) for name in set(names)] if contexts: click.echo(json.dumps(contexts[0] if len(contexts) == 1 else contexts, indent=2)) # depends on [control=['if'], data=[]]
def create_autoclassify_job_note(self, job, user=None): """ Create a JobNote, possibly via auto-classification. Create mappings from the given Job to Bugs via verified Classifications of this Job. Also creates a JobNote. """ # Only insert bugs for verified failu...
def function[create_autoclassify_job_note, parameter[self, job, user]]: constant[ Create a JobNote, possibly via auto-classification. Create mappings from the given Job to Bugs via verified Classifications of this Job. Also creates a JobNote. ] variable[bug_numb...
keyword[def] identifier[create_autoclassify_job_note] ( identifier[self] , identifier[job] , identifier[user] = keyword[None] ): literal[string] identifier[bug_numbers] = identifier[set] ( identifier[ClassifiedFailure] . identifier[objects] . identifier[filter] (...
def create_autoclassify_job_note(self, job, user=None): """ Create a JobNote, possibly via auto-classification. Create mappings from the given Job to Bugs via verified Classifications of this Job. Also creates a JobNote. """ # Only insert bugs for verified failures sinc...
def as_dictionary(self): """ Return the parameter as a dictionary. :return: dict """ return { "name": self.name, "type": self.type, "value": remove_0x_prefix(self.value) if self.type == 'bytes32' else self.value }
def function[as_dictionary, parameter[self]]: constant[ Return the parameter as a dictionary. :return: dict ] return[dictionary[[<ast.Constant object at 0x7da18f09d090>, <ast.Constant object at 0x7da18f09fd30>, <ast.Constant object at 0x7da18f09d0f0>], [<ast.Attribute object at 0x7d...
keyword[def] identifier[as_dictionary] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[name] , literal[string] : identifier[self] . identifier[type] , literal[string] : identifier[remove_0x_prefix] ( identifier[self]...
def as_dictionary(self): """ Return the parameter as a dictionary. :return: dict """ return {'name': self.name, 'type': self.type, 'value': remove_0x_prefix(self.value) if self.type == 'bytes32' else self.value}
def delete_all_policies(self): '''**Description** Delete all existing policies. The falco rules file is unchanged. **Arguments** - None **Success Return Value** The string "Policies Deleted" **Example** `examples/delete_all_policies.py <...
def function[delete_all_policies, parameter[self]]: constant[**Description** Delete all existing policies. The falco rules file is unchanged. **Arguments** - None **Success Return Value** The string "Policies Deleted" **Example** `exampl...
keyword[def] identifier[delete_all_policies] ( identifier[self] ): literal[string] identifier[res] = identifier[requests] . identifier[post] ( identifier[self] . identifier[url] + literal[string] , identifier[headers] = identifier[self] . identifier[hdrs] , identifier[verify] = identifier[self] . i...
def delete_all_policies(self): """**Description** Delete all existing policies. The falco rules file is unchanged. **Arguments** - None **Success Return Value** The string "Policies Deleted" **Example** `examples/delete_all_policies.py <http...
def crt_prf_ftr_tc(aryMdlRsp, aryTmpExpInf, varNumVol, varTr, varTmpOvsmpl, switchHrfSet, tplPngSize, varPar, dctPrm=None, lgcPrint=True): """Create all spatial x feature prf time courses. Parameters ---------- aryMdlRsp : 2d numpy array, shape [n_x_pos * n_y_pos *...
def function[crt_prf_ftr_tc, parameter[aryMdlRsp, aryTmpExpInf, varNumVol, varTr, varTmpOvsmpl, switchHrfSet, tplPngSize, varPar, dctPrm, lgcPrint]]: constant[Create all spatial x feature prf time courses. Parameters ---------- aryMdlRsp : 2d numpy array, shape [n_x_pos * n_y_pos * n_sd, n_cond] ...
keyword[def] identifier[crt_prf_ftr_tc] ( identifier[aryMdlRsp] , identifier[aryTmpExpInf] , identifier[varNumVol] , identifier[varTr] , identifier[varTmpOvsmpl] , identifier[switchHrfSet] , identifier[tplPngSize] , identifier[varPar] , identifier[dctPrm] = keyword[None] , identifier[lgcPrint] = keyword[True] ): ...
def crt_prf_ftr_tc(aryMdlRsp, aryTmpExpInf, varNumVol, varTr, varTmpOvsmpl, switchHrfSet, tplPngSize, varPar, dctPrm=None, lgcPrint=True): """Create all spatial x feature prf time courses. Parameters ---------- aryMdlRsp : 2d numpy array, shape [n_x_pos * n_y_pos * n_sd, n_cond] Responses of 2D...
def pipe(maxsize=0, *, loop=None) -> Pipe: """\ A bidirectional pipe of Python objects. >>> async def example1(): ... a, b = pipe() ... a.send_nowait('foo') ... print(await b.recv()) >>> asyncio.run(example1()) foo >>> async def example2(): ... a, b = pipe() ...
def function[pipe, parameter[maxsize]]: constant[ A bidirectional pipe of Python objects. >>> async def example1(): ... a, b = pipe() ... a.send_nowait('foo') ... print(await b.recv()) >>> asyncio.run(example1()) foo >>> async def example2(): ... a, b = pipe()...
keyword[def] identifier[pipe] ( identifier[maxsize] = literal[int] ,*, identifier[loop] = keyword[None] )-> identifier[Pipe] : literal[string] keyword[class] identifier[QueueStream] : keyword[def] identifier[__init__] ( identifier[self] , identifier[maxsize] = literal[int] ,*, identifier[loop] ...
def pipe(maxsize=0, *, loop=None) -> Pipe: """ A bidirectional pipe of Python objects. >>> async def example1(): ... a, b = pipe() ... a.send_nowait('foo') ... print(await b.recv()) >>> asyncio.run(example1()) foo >>> async def example2(): ... a, b = pipe() .....
def LoadSNPs(self, snps=[]): """Define the SNP inclusions (by RSID). This overrides true boundary \ definition. :param snps: array of RSIDs :return: None This doesn't define RSID ranges, so it throws InvalidBoundarySpec if it encounters what appears to be a range (S...
def function[LoadSNPs, parameter[self, snps]]: constant[Define the SNP inclusions (by RSID). This overrides true boundary definition. :param snps: array of RSIDs :return: None This doesn't define RSID ranges, so it throws InvalidBoundarySpec if it encounters what ap...
keyword[def] identifier[LoadSNPs] ( identifier[self] , identifier[snps] =[]): literal[string] keyword[for] identifier[snp] keyword[in] identifier[snps] : identifier[bounds] = identifier[snp] . identifier[split] ( literal[string] ) keyword[if] identifier[len] ( identif...
def LoadSNPs(self, snps=[]): """Define the SNP inclusions (by RSID). This overrides true boundary definition. :param snps: array of RSIDs :return: None This doesn't define RSID ranges, so it throws InvalidBoundarySpec if it encounters what appears to be a range (SNP con...
def snapshot(*snapshot, **kwargs): ''' Creates snapshots with the given names. snapshot : string name of snapshot(s) recursive : boolean recursively create snapshots of all descendent datasets. properties : dict additional zfs properties (-o) .. note:: ZFS prop...
def function[snapshot, parameter[]]: constant[ Creates snapshots with the given names. snapshot : string name of snapshot(s) recursive : boolean recursively create snapshots of all descendent datasets. properties : dict additional zfs properties (-o) .. note:: ...
keyword[def] identifier[snapshot] (* identifier[snapshot] ,** identifier[kwargs] ): literal[string] identifier[flags] =[] identifier[filesystem_properties] = identifier[kwargs] . identifier[get] ( literal[string] ,{}) keyword[if] identifier[kwargs] . identifier[get] ( liter...
def snapshot(*snapshot, **kwargs): """ Creates snapshots with the given names. snapshot : string name of snapshot(s) recursive : boolean recursively create snapshots of all descendent datasets. properties : dict additional zfs properties (-o) .. note:: ZFS prop...
def get_uids(self, project=None): """Return a list of UIDs project -- the Project to filter for """ self._update() if not project or project.endswith('all_projects'): return [self._gen_uid(task['uuid']) for project in self._tasks for task in self._tasks[project].valu...
def function[get_uids, parameter[self, project]]: constant[Return a list of UIDs project -- the Project to filter for ] call[name[self]._update, parameter[]] if <ast.BoolOp object at 0x7da204344dc0> begin[:] return[<ast.ListComp object at 0x7da204344130>] if compa...
keyword[def] identifier[get_uids] ( identifier[self] , identifier[project] = keyword[None] ): literal[string] identifier[self] . identifier[_update] () keyword[if] keyword[not] identifier[project] keyword[or] identifier[project] . identifier[endswith] ( literal[string] ): ...
def get_uids(self, project=None): """Return a list of UIDs project -- the Project to filter for """ self._update() if not project or project.endswith('all_projects'): return [self._gen_uid(task['uuid']) for project in self._tasks for task in self._tasks[project].values()] # depends ...
def load_layer_without_provider(layer_uri, layer_name='tmp'): """Helper to load a layer when don't know the driver. Don't use it, it's an empiric function to try each provider one per one. OGR/GDAL is printing a lot of error saying that the layer is not valid. :param layer_uri: Layer URI that will be...
def function[load_layer_without_provider, parameter[layer_uri, layer_name]]: constant[Helper to load a layer when don't know the driver. Don't use it, it's an empiric function to try each provider one per one. OGR/GDAL is printing a lot of error saying that the layer is not valid. :param layer_ur...
keyword[def] identifier[load_layer_without_provider] ( identifier[layer_uri] , identifier[layer_name] = literal[string] ): literal[string] identifier[layer] = identifier[QgsVectorLayer] ( identifier[layer_uri] , identifier[layer_name] , identifier[VECTOR_DRIVERS] [ literal[int] ]) keyword[if] id...
def load_layer_without_provider(layer_uri, layer_name='tmp'): """Helper to load a layer when don't know the driver. Don't use it, it's an empiric function to try each provider one per one. OGR/GDAL is printing a lot of error saying that the layer is not valid. :param layer_uri: Layer URI that will be...
def _make_class_unpicklable(cls): """Make the given class un-picklable.""" def _break_on_call_reduce(self, protocol=None): raise TypeError('%r cannot be pickled' % self) cls.__reduce_ex__ = _break_on_call_reduce cls.__module__ = '<unknown>'
def function[_make_class_unpicklable, parameter[cls]]: constant[Make the given class un-picklable.] def function[_break_on_call_reduce, parameter[self, protocol]]: <ast.Raise object at 0x7da1b1e74520> name[cls].__reduce_ex__ assign[=] name[_break_on_call_reduce] name[cls].__modul...
keyword[def] identifier[_make_class_unpicklable] ( identifier[cls] ): literal[string] keyword[def] identifier[_break_on_call_reduce] ( identifier[self] , identifier[protocol] = keyword[None] ): keyword[raise] identifier[TypeError] ( literal[string] % identifier[self] ) identifier[cls] . ide...
def _make_class_unpicklable(cls): """Make the given class un-picklable.""" def _break_on_call_reduce(self, protocol=None): raise TypeError('%r cannot be pickled' % self) cls.__reduce_ex__ = _break_on_call_reduce cls.__module__ = '<unknown>'
def parse_table(table_string, header, remove_rows=1): '''parse a table to json from a string, where a header is expected by default. Return a jsonified table. Parameters ========== table_string: the string table, ideally with a header header: header of expected table, must match ...
def function[parse_table, parameter[table_string, header, remove_rows]]: constant[parse a table to json from a string, where a header is expected by default. Return a jsonified table. Parameters ========== table_string: the string table, ideally with a header header: header o...
keyword[def] identifier[parse_table] ( identifier[table_string] , identifier[header] , identifier[remove_rows] = literal[int] ): literal[string] identifier[rows] =[ identifier[x] keyword[for] identifier[x] keyword[in] identifier[table_string] . identifier[split] ( literal[string] ) keyword[if] identif...
def parse_table(table_string, header, remove_rows=1): """parse a table to json from a string, where a header is expected by default. Return a jsonified table. Parameters ========== table_string: the string table, ideally with a header header: header of expected table, must match ...