code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def dbname(self, value): """ Set the connection's database name property. Args: value: New name of the database. String. Returns: Nothing. """ self._dbname = value self._connectionXML.set('dbname', value)
def function[dbname, parameter[self, value]]: constant[ Set the connection's database name property. Args: value: New name of the database. String. Returns: Nothing. ] name[self]._dbname assign[=] name[value] call[name[self]._connection...
keyword[def] identifier[dbname] ( identifier[self] , identifier[value] ): literal[string] identifier[self] . identifier[_dbname] = identifier[value] identifier[self] . identifier[_connectionXML] . identifier[set] ( literal[string] , identifier[value] )
def dbname(self, value): """ Set the connection's database name property. Args: value: New name of the database. String. Returns: Nothing. """ self._dbname = value self._connectionXML.set('dbname', value)
def get(cls, group_id, db_session=None): """ Fetch row using primary key - will use existing object in session if already present :param group_id: :param db_session: :return: """ db_session = get_db_session(db_session) return db_session.query(cls....
def function[get, parameter[cls, group_id, db_session]]: constant[ Fetch row using primary key - will use existing object in session if already present :param group_id: :param db_session: :return: ] variable[db_session] assign[=] call[name[get_db_session]...
keyword[def] identifier[get] ( identifier[cls] , identifier[group_id] , identifier[db_session] = keyword[None] ): literal[string] identifier[db_session] = identifier[get_db_session] ( identifier[db_session] ) keyword[return] identifier[db_session] . identifier[query] ( identifier[cls] . i...
def get(cls, group_id, db_session=None): """ Fetch row using primary key - will use existing object in session if already present :param group_id: :param db_session: :return: """ db_session = get_db_session(db_session) return db_session.query(cls.model).get(g...
def get_vulnerability_functions_04(fname): """ Parse the vulnerability model in NRML 0.4 format. :param fname: path of the vulnerability file :returns: a dictionary imt, taxonomy -> vulnerability function + vset """ categories = dict(assetCategory=set(), lossCategory=set(), ...
def function[get_vulnerability_functions_04, parameter[fname]]: constant[ Parse the vulnerability model in NRML 0.4 format. :param fname: path of the vulnerability file :returns: a dictionary imt, taxonomy -> vulnerability function + vset ] variable[categories] assign[=]...
keyword[def] identifier[get_vulnerability_functions_04] ( identifier[fname] ): literal[string] identifier[categories] = identifier[dict] ( identifier[assetCategory] = identifier[set] (), identifier[lossCategory] = identifier[set] (), identifier[vulnerabilitySetID] = identifier[set] ()) identifier...
def get_vulnerability_functions_04(fname): """ Parse the vulnerability model in NRML 0.4 format. :param fname: path of the vulnerability file :returns: a dictionary imt, taxonomy -> vulnerability function + vset """ categories = dict(assetCategory=set(), lossCategory=set(), vuln...
def _confused_state(self, request: Request) -> Type[BaseState]: """ If we're confused, find which state to call. """ origin = request.register.get(Register.STATE) if origin in self._allowed_states: try: return import_class(origin) except ...
def function[_confused_state, parameter[self, request]]: constant[ If we're confused, find which state to call. ] variable[origin] assign[=] call[name[request].register.get, parameter[name[Register].STATE]] if compare[name[origin] in name[self]._allowed_states] begin[:] <...
keyword[def] identifier[_confused_state] ( identifier[self] , identifier[request] : identifier[Request] )-> identifier[Type] [ identifier[BaseState] ]: literal[string] identifier[origin] = identifier[request] . identifier[register] . identifier[get] ( identifier[Register] . identifier[STATE] ) ...
def _confused_state(self, request: Request) -> Type[BaseState]: """ If we're confused, find which state to call. """ origin = request.register.get(Register.STATE) if origin in self._allowed_states: try: return import_class(origin) # depends on [control=['try'], data=[]] ...
def getTopRight(self): """ Retrieves a tuple with the x,y coordinates of the upper right point of the rect. Requires the coordinates, width, height to be numbers """ return (float(self.get_x()) + float(self.get_width()), float(self.get_y()) + float(self.get_height()))
def function[getTopRight, parameter[self]]: constant[ Retrieves a tuple with the x,y coordinates of the upper right point of the rect. Requires the coordinates, width, height to be numbers ] return[tuple[[<ast.BinOp object at 0x7da18c4ccfd0>, <ast.BinOp object at 0x7da18c4cd6c0>]]]
keyword[def] identifier[getTopRight] ( identifier[self] ): literal[string] keyword[return] ( identifier[float] ( identifier[self] . identifier[get_x] ())+ identifier[float] ( identifier[self] . identifier[get_width] ()), identifier[float] ( identifier[self] . identifier[get_y] ())+ identifier[float...
def getTopRight(self): """ Retrieves a tuple with the x,y coordinates of the upper right point of the rect. Requires the coordinates, width, height to be numbers """ return (float(self.get_x()) + float(self.get_width()), float(self.get_y()) + float(self.get_height()))
def __create_grid_four_connections(self): """! @brief Creates network with connections that make up four grid structure. @details Each oscillator may be connected with four neighbors in line with 'grid' structure: right, upper, left, lower. """ side_size ...
def function[__create_grid_four_connections, parameter[self]]: constant[! @brief Creates network with connections that make up four grid structure. @details Each oscillator may be connected with four neighbors in line with 'grid' structure: right, upper, left, lower. ] v...
keyword[def] identifier[__create_grid_four_connections] ( identifier[self] ): literal[string] identifier[side_size] = identifier[self] . identifier[__width] ; keyword[if] ( identifier[self] . identifier[_conn_represent] == identifier[conn_represent] . identifier[MATRIX] ): ...
def __create_grid_four_connections(self): """! @brief Creates network with connections that make up four grid structure. @details Each oscillator may be connected with four neighbors in line with 'grid' structure: right, upper, left, lower. """ side_size = self.__width if se...
def display_lookback_returns(self): """ Displays the current lookback returns for each series. """ return self.lookback_returns.apply( lambda x: x.map('{:,.2%}'.format), axis=1)
def function[display_lookback_returns, parameter[self]]: constant[ Displays the current lookback returns for each series. ] return[call[name[self].lookback_returns.apply, parameter[<ast.Lambda object at 0x7da204567d30>]]]
keyword[def] identifier[display_lookback_returns] ( identifier[self] ): literal[string] keyword[return] identifier[self] . identifier[lookback_returns] . identifier[apply] ( keyword[lambda] identifier[x] : identifier[x] . identifier[map] ( literal[string] . identifier[format] ), identifi...
def display_lookback_returns(self): """ Displays the current lookback returns for each series. """ return self.lookback_returns.apply(lambda x: x.map('{:,.2%}'.format), axis=1)
def do_GET(self, ): """Handle GET requests If the path is '/', a site which extracts the token will be generated. This will redirect the user to the '/sucess' page, which shows a success message. :returns: None :rtype: None :raises: None """ urld...
def function[do_GET, parameter[self]]: constant[Handle GET requests If the path is '/', a site which extracts the token will be generated. This will redirect the user to the '/sucess' page, which shows a success message. :returns: None :rtype: None :raises: None...
keyword[def] identifier[do_GET] ( identifier[self] ,): literal[string] identifier[urld] ={ identifier[self] . identifier[extract_site_url] : literal[string] , identifier[self] . identifier[success_site_url] : literal[string] } identifier[site] = identifier[urld] . identifier[get] ...
def do_GET(self): """Handle GET requests If the path is '/', a site which extracts the token will be generated. This will redirect the user to the '/sucess' page, which shows a success message. :returns: None :rtype: None :raises: None """ urld = {self.e...
def delete(self): """Deletes the local marker file and also any data in the Fuseki server. """ MetadataCache.delete(self) try: self.graph.query('DELETE WHERE { ?s ?p ?o . }') except ResultException: # this is often just a false positive since Jena...
def function[delete, parameter[self]]: constant[Deletes the local marker file and also any data in the Fuseki server. ] call[name[MetadataCache].delete, parameter[name[self]]] <ast.Try object at 0x7da18f09e2c0>
keyword[def] identifier[delete] ( identifier[self] ): literal[string] identifier[MetadataCache] . identifier[delete] ( identifier[self] ) keyword[try] : identifier[self] . identifier[graph] . identifier[query] ( literal[string] ) keyword[except] identifier[ResultExce...
def delete(self): """Deletes the local marker file and also any data in the Fuseki server. """ MetadataCache.delete(self) try: self.graph.query('DELETE WHERE { ?s ?p ?o . }') # depends on [control=['try'], data=[]] except ResultException: # this is often just a false po...
def get_command_response_from_cache(self, device_id, command, command2): """Gets response""" key = self.create_key_from_command(command, command2) command_cache = self.get_cache_from_file(device_id) if device_id not in command_cache: command_cache[device_id] = {} ...
def function[get_command_response_from_cache, parameter[self, device_id, command, command2]]: constant[Gets response] variable[key] assign[=] call[name[self].create_key_from_command, parameter[name[command], name[command2]]] variable[command_cache] assign[=] call[name[self].get_cache_from_file, ...
keyword[def] identifier[get_command_response_from_cache] ( identifier[self] , identifier[device_id] , identifier[command] , identifier[command2] ): literal[string] identifier[key] = identifier[self] . identifier[create_key_from_command] ( identifier[command] , identifier[command2] ) identi...
def get_command_response_from_cache(self, device_id, command, command2): """Gets response""" key = self.create_key_from_command(command, command2) command_cache = self.get_cache_from_file(device_id) if device_id not in command_cache: command_cache[device_id] = {} return False # depends ...
def create_group_groups(self, description=None, is_public=None, join_level=None, name=None, storage_quota_mb=None): """ Create a group. Creates a new group. Groups created using the "/api/v1/groups/" endpoint will be community groups. """ path = {} data =...
def function[create_group_groups, parameter[self, description, is_public, join_level, name, storage_quota_mb]]: constant[ Create a group. Creates a new group. Groups created using the "/api/v1/groups/" endpoint will be community groups. ] variable[path] assign[=] diction...
keyword[def] identifier[create_group_groups] ( identifier[self] , identifier[description] = keyword[None] , identifier[is_public] = keyword[None] , identifier[join_level] = keyword[None] , identifier[name] = keyword[None] , identifier[storage_quota_mb] = keyword[None] ): literal[string] identifie...
def create_group_groups(self, description=None, is_public=None, join_level=None, name=None, storage_quota_mb=None): """ Create a group. Creates a new group. Groups created using the "/api/v1/groups/" endpoint will be community groups. """ path = {} data = {} params = {} ...
def convert_all(folder, dest_path='.', force_all=False): "Convert modified notebooks in `folder` to html pages in `dest_path`." path = Path(folder) changed_cnt = 0 for fname in path.glob("*.ipynb"): # only rebuild modified files fname_out = Path(dest_path)/fname.with_suffix('.html').nam...
def function[convert_all, parameter[folder, dest_path, force_all]]: constant[Convert modified notebooks in `folder` to html pages in `dest_path`.] variable[path] assign[=] call[name[Path], parameter[name[folder]]] variable[changed_cnt] assign[=] constant[0] for taget[name[fname]] in star...
keyword[def] identifier[convert_all] ( identifier[folder] , identifier[dest_path] = literal[string] , identifier[force_all] = keyword[False] ): literal[string] identifier[path] = identifier[Path] ( identifier[folder] ) identifier[changed_cnt] = literal[int] keyword[for] identifier[fname] keyw...
def convert_all(folder, dest_path='.', force_all=False): """Convert modified notebooks in `folder` to html pages in `dest_path`.""" path = Path(folder) changed_cnt = 0 for fname in path.glob('*.ipynb'): # only rebuild modified files fname_out = Path(dest_path) / fname.with_suffix('.html'...
def _ellipsoid_phantom_3d(space, ellipsoids): """Create an ellipsoid phantom in 3d space. Parameters ---------- space : `DiscreteLp` Space in which the phantom should be generated. If ``space.shape`` is 1 in an axis, a corresponding slice of the phantom is created (instead of sq...
def function[_ellipsoid_phantom_3d, parameter[space, ellipsoids]]: constant[Create an ellipsoid phantom in 3d space. Parameters ---------- space : `DiscreteLp` Space in which the phantom should be generated. If ``space.shape`` is 1 in an axis, a corresponding slice of the phantom is...
keyword[def] identifier[_ellipsoid_phantom_3d] ( identifier[space] , identifier[ellipsoids] ): literal[string] identifier[p] = identifier[np] . identifier[zeros] ( identifier[space] . identifier[shape] , identifier[dtype] = identifier[space] . identifier[dtype] ) identifier[minp] = identifier[sp...
def _ellipsoid_phantom_3d(space, ellipsoids): """Create an ellipsoid phantom in 3d space. Parameters ---------- space : `DiscreteLp` Space in which the phantom should be generated. If ``space.shape`` is 1 in an axis, a corresponding slice of the phantom is created (instead of sq...
def select(self, *column_or_columns): """Return a table with only the columns in ``column_or_columns``. Args: ``column_or_columns``: Columns to select from the ``Table`` as either column labels (``str``) or column indices (``int``). Returns: A new instance o...
def function[select, parameter[self]]: constant[Return a table with only the columns in ``column_or_columns``. Args: ``column_or_columns``: Columns to select from the ``Table`` as either column labels (``str``) or column indices (``int``). Returns: A new ins...
keyword[def] identifier[select] ( identifier[self] ,* identifier[column_or_columns] ): literal[string] identifier[labels] = identifier[self] . identifier[_varargs_as_labels] ( identifier[column_or_columns] ) identifier[table] = identifier[type] ( identifier[self] )() keyword[for] ...
def select(self, *column_or_columns): """Return a table with only the columns in ``column_or_columns``. Args: ``column_or_columns``: Columns to select from the ``Table`` as either column labels (``str``) or column indices (``int``). Returns: A new instance of ``...
def context(self): """ Provides request context """ type = "client_associate" if self.key is None else "client_update" data = { "type": type, "application_type": self.type, } # is this an update? if self.key: data["client_id"] = self.k...
def function[context, parameter[self]]: constant[ Provides request context ] variable[type] assign[=] <ast.IfExp object at 0x7da1b2851630> variable[data] assign[=] dictionary[[<ast.Constant object at 0x7da1b2850220>, <ast.Constant object at 0x7da1b28517e0>], [<ast.Name object at 0x7da1b28506d0>,...
keyword[def] identifier[context] ( identifier[self] ): literal[string] identifier[type] = literal[string] keyword[if] identifier[self] . identifier[key] keyword[is] keyword[None] keyword[else] literal[string] identifier[data] ={ literal[string] : identifier[type] , ...
def context(self): """ Provides request context """ type = 'client_associate' if self.key is None else 'client_update' data = {'type': type, 'application_type': self.type} # is this an update? if self.key: data['client_id'] = self.key data['client_secret'] = self.secret # depends on...
def _get_field_method(self, tp): """Returns a reference to the form element's constructor method.""" method = self.field_constructor.get(tp) if method and hasattr(self, method.__name__): return getattr(self, method.__name__) return method
def function[_get_field_method, parameter[self, tp]]: constant[Returns a reference to the form element's constructor method.] variable[method] assign[=] call[name[self].field_constructor.get, parameter[name[tp]]] if <ast.BoolOp object at 0x7da18f813d60> begin[:] return[call[name[getattr]...
keyword[def] identifier[_get_field_method] ( identifier[self] , identifier[tp] ): literal[string] identifier[method] = identifier[self] . identifier[field_constructor] . identifier[get] ( identifier[tp] ) keyword[if] identifier[method] keyword[and] identifier[hasattr] ( identifier[self]...
def _get_field_method(self, tp): """Returns a reference to the form element's constructor method.""" method = self.field_constructor.get(tp) if method and hasattr(self, method.__name__): return getattr(self, method.__name__) # depends on [control=['if'], data=[]] return method
def get_collection(self, **kwargs): """ Establish a connection with the database. Returns MongoDb collection """ from pymongo import MongoClient if self.host and self.port: client = MongoClient(host=config.host, port=config.port) else: cl...
def function[get_collection, parameter[self]]: constant[ Establish a connection with the database. Returns MongoDb collection ] from relative_module[pymongo] import module[MongoClient] if <ast.BoolOp object at 0x7da18eb56440> begin[:] variable[client] assign[...
keyword[def] identifier[get_collection] ( identifier[self] ,** identifier[kwargs] ): literal[string] keyword[from] identifier[pymongo] keyword[import] identifier[MongoClient] keyword[if] identifier[self] . identifier[host] keyword[and] identifier[self] . identifier[port] : ...
def get_collection(self, **kwargs): """ Establish a connection with the database. Returns MongoDb collection """ from pymongo import MongoClient if self.host and self.port: client = MongoClient(host=config.host, port=config.port) # depends on [control=['if'], data=[]] e...
def is_deleted(self, record=None): """Check if record is deleted.""" record = record or self.revisions[-1][1] return any( col == 'deleted' for col in record.get('collections', []) )
def function[is_deleted, parameter[self, record]]: constant[Check if record is deleted.] variable[record] assign[=] <ast.BoolOp object at 0x7da1b016a9b0> return[call[name[any], parameter[<ast.GeneratorExp object at 0x7da1b01695a0>]]]
keyword[def] identifier[is_deleted] ( identifier[self] , identifier[record] = keyword[None] ): literal[string] identifier[record] = identifier[record] keyword[or] identifier[self] . identifier[revisions] [- literal[int] ][ literal[int] ] keyword[return] identifier[any] ( identi...
def is_deleted(self, record=None): """Check if record is deleted.""" record = record or self.revisions[-1][1] return any((col == 'deleted' for col in record.get('collections', [])))
def detach_popen(**kwargs): """ Use :class:`subprocess.Popen` to construct a child process, then hack the Popen so that it forgets the child it created, allowing it to survive a call to Popen.__del__. If the child process is not detached, there is a race between it exitting and __del__ being ca...
def function[detach_popen, parameter[]]: constant[ Use :class:`subprocess.Popen` to construct a child process, then hack the Popen so that it forgets the child it created, allowing it to survive a call to Popen.__del__. If the child process is not detached, there is a race between it exitting ...
keyword[def] identifier[detach_popen] (** identifier[kwargs] ): literal[string] identifier[real_preexec_fn] = identifier[kwargs] . identifier[pop] ( literal[string] , keyword[None] ) keyword[def] identifier[preexec_fn] (): keyword[if] identifier[_preexec_hook] : ...
def detach_popen(**kwargs): """ Use :class:`subprocess.Popen` to construct a child process, then hack the Popen so that it forgets the child it created, allowing it to survive a call to Popen.__del__. If the child process is not detached, there is a race between it exitting and __del__ being ca...
def bans_list(self, limit=None, max_id=None, since_id=None, **kwargs): "https://developer.zendesk.com/rest_api/docs/chat/bans#get-all-bans" api_path = "/api/v2/bans" api_query = {} if "query" in kwargs.keys(): api_query.update(kwargs["query"]) del kwargs["query"] ...
def function[bans_list, parameter[self, limit, max_id, since_id]]: constant[https://developer.zendesk.com/rest_api/docs/chat/bans#get-all-bans] variable[api_path] assign[=] constant[/api/v2/bans] variable[api_query] assign[=] dictionary[[], []] if compare[constant[query] in call[name[kwa...
keyword[def] identifier[bans_list] ( identifier[self] , identifier[limit] = keyword[None] , identifier[max_id] = keyword[None] , identifier[since_id] = keyword[None] ,** identifier[kwargs] ): literal[string] identifier[api_path] = literal[string] identifier[api_query] ={} keyword...
def bans_list(self, limit=None, max_id=None, since_id=None, **kwargs): """https://developer.zendesk.com/rest_api/docs/chat/bans#get-all-bans""" api_path = '/api/v2/bans' api_query = {} if 'query' in kwargs.keys(): api_query.update(kwargs['query']) del kwargs['query'] # depends on [contr...
def print_config(): # pragma: no cover """Print config entry function.""" description = """\ Print the deployment settings for a Pyramid application. Example: 'psettings deployment.ini' """ parser = argparse.ArgumentParser( description=textwrap.dedent(description) ) par...
def function[print_config, parameter[]]: constant[Print config entry function.] variable[description] assign[=] constant[ Print the deployment settings for a Pyramid application. Example: 'psettings deployment.ini' ] variable[parser] assign[=] call[name[argparse].ArgumentPars...
keyword[def] identifier[print_config] (): literal[string] identifier[description] = literal[string] identifier[parser] = identifier[argparse] . identifier[ArgumentParser] ( identifier[description] = identifier[textwrap] . identifier[dedent] ( identifier[description] ) ) identifier[parse...
def print_config(): # pragma: no cover 'Print config entry function.' description = " Print the deployment settings for a Pyramid application. Example:\n 'psettings deployment.ini'\n " parser = argparse.ArgumentParser(description=textwrap.dedent(description)) parser.add_argument('conf...
def get_submodules(mod): """Get all submodules of a given module""" def catch_exceptions(module): pass try: m = __import__(mod) submodules = [mod] submods = pkgutil.walk_packages(m.__path__, m.__name__ + '.', catch_exceptions) ...
def function[get_submodules, parameter[mod]]: constant[Get all submodules of a given module] def function[catch_exceptions, parameter[module]]: pass <ast.Try object at 0x7da20e9b2cb0> return[name[submodules]]
keyword[def] identifier[get_submodules] ( identifier[mod] ): literal[string] keyword[def] identifier[catch_exceptions] ( identifier[module] ): keyword[pass] keyword[try] : identifier[m] = identifier[__import__] ( identifier[mod] ) identifier[submodules] =[ identifier...
def get_submodules(mod): """Get all submodules of a given module""" def catch_exceptions(module): pass try: m = __import__(mod) submodules = [mod] submods = pkgutil.walk_packages(m.__path__, m.__name__ + '.', catch_exceptions) for sm in submods: sm_name =...
def create_class(self, name: str) -> ConstantClass: """ Creates a new :class:`ConstantClass`, adding it to the pool and returning it. :param name: The name of the new class. """ self.append(( 7, self.create_utf8(name).index )) retu...
def function[create_class, parameter[self, name]]: constant[ Creates a new :class:`ConstantClass`, adding it to the pool and returning it. :param name: The name of the new class. ] call[name[self].append, parameter[tuple[[<ast.Constant object at 0x7da1b259d510>, <ast.Att...
keyword[def] identifier[create_class] ( identifier[self] , identifier[name] : identifier[str] )-> identifier[ConstantClass] : literal[string] identifier[self] . identifier[append] (( literal[int] , identifier[self] . identifier[create_utf8] ( identifier[name] ). identifier[index] ...
def create_class(self, name: str) -> ConstantClass: """ Creates a new :class:`ConstantClass`, adding it to the pool and returning it. :param name: The name of the new class. """ self.append((7, self.create_utf8(name).index)) return self.get(self.raw_count - 1)
def _maybe_extract(compressed_filename, directory, extension=None): """ Extract a compressed file to ``directory``. Args: compressed_filename (str): Compressed file. directory (str): Extract to directory. extension (str, optional): Extension of the file; Otherwise, attempts to extract e...
def function[_maybe_extract, parameter[compressed_filename, directory, extension]]: constant[ Extract a compressed file to ``directory``. Args: compressed_filename (str): Compressed file. directory (str): Extract to directory. extension (str, optional): Extension of the file; Otherw...
keyword[def] identifier[_maybe_extract] ( identifier[compressed_filename] , identifier[directory] , identifier[extension] = keyword[None] ): literal[string] identifier[logger] . identifier[info] ( literal[string] . identifier[format] ( identifier[compressed_filename] )) keyword[if] identifier[extens...
def _maybe_extract(compressed_filename, directory, extension=None): """ Extract a compressed file to ``directory``. Args: compressed_filename (str): Compressed file. directory (str): Extract to directory. extension (str, optional): Extension of the file; Otherwise, attempts to extract e...
def compare_registries(fs0, fs1, concurrent=False): """Compares the Windows Registry contained within the two File Systems. If the concurrent flag is True, two processes will be used speeding up the comparison on multiple CPUs. Returns a dictionary. {'created_keys': {'\\Reg\\Key': (('Key', 'T...
def function[compare_registries, parameter[fs0, fs1, concurrent]]: constant[Compares the Windows Registry contained within the two File Systems. If the concurrent flag is True, two processes will be used speeding up the comparison on multiple CPUs. Returns a dictionary. {'created_keys': {...
keyword[def] identifier[compare_registries] ( identifier[fs0] , identifier[fs1] , identifier[concurrent] = keyword[False] ): literal[string] identifier[hives] = identifier[compare_hives] ( identifier[fs0] , identifier[fs1] ) keyword[if] identifier[concurrent] : identifier[future0] = identif...
def compare_registries(fs0, fs1, concurrent=False): """Compares the Windows Registry contained within the two File Systems. If the concurrent flag is True, two processes will be used speeding up the comparison on multiple CPUs. Returns a dictionary. {'created_keys': {'\\Reg\\Key': (('Key', 'T...
def main(): """Ideally we shouldn't lose the first second of events""" with Input() as input_generator: def extra_bytes_callback(string): print('got extra bytes', repr(string)) print('type:', type(string)) input_generator.unget_bytes(string) time.sleep(1) ...
def function[main, parameter[]]: constant[Ideally we shouldn't lose the first second of events] with call[name[Input], parameter[]] begin[:] def function[extra_bytes_callback, parameter[string]]: call[name[print], parameter[constant[got extra bytes], call[name[rep...
keyword[def] identifier[main] (): literal[string] keyword[with] identifier[Input] () keyword[as] identifier[input_generator] : keyword[def] identifier[extra_bytes_callback] ( identifier[string] ): identifier[print] ( literal[string] , identifier[repr] ( identifier[string] )) ...
def main(): """Ideally we shouldn't lose the first second of events""" with Input() as input_generator: def extra_bytes_callback(string): print('got extra bytes', repr(string)) print('type:', type(string)) input_generator.unget_bytes(string) time.sleep(1) ...
def _set_bgp_state(self, v, load=False): """ Setter method for bgp_state, mapped from YANG variable /bgp_state (container) If this variable is read-only (config: false) in the source YANG file, then _set_bgp_state is considered as a private method. Backends looking to populate this variable should ...
def function[_set_bgp_state, parameter[self, v, load]]: constant[ Setter method for bgp_state, mapped from YANG variable /bgp_state (container) If this variable is read-only (config: false) in the source YANG file, then _set_bgp_state is considered as a private method. Backends looking to popula...
keyword[def] identifier[_set_bgp_state] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : iden...
def _set_bgp_state(self, v, load=False): """ Setter method for bgp_state, mapped from YANG variable /bgp_state (container) If this variable is read-only (config: false) in the source YANG file, then _set_bgp_state is considered as a private method. Backends looking to populate this variable should ...
def cor(y_true, y_pred): """Compute Pearson correlation coefficient. """ y_true, y_pred = _mask_nan(y_true, y_pred) return np.corrcoef(y_true, y_pred)[0, 1]
def function[cor, parameter[y_true, y_pred]]: constant[Compute Pearson correlation coefficient. ] <ast.Tuple object at 0x7da20e955120> assign[=] call[name[_mask_nan], parameter[name[y_true], name[y_pred]]] return[call[call[name[np].corrcoef, parameter[name[y_true], name[y_pred]]]][tuple[[<ast.Co...
keyword[def] identifier[cor] ( identifier[y_true] , identifier[y_pred] ): literal[string] identifier[y_true] , identifier[y_pred] = identifier[_mask_nan] ( identifier[y_true] , identifier[y_pred] ) keyword[return] identifier[np] . identifier[corrcoef] ( identifier[y_true] , identifier[y_pred] )[ lite...
def cor(y_true, y_pred): """Compute Pearson correlation coefficient. """ (y_true, y_pred) = _mask_nan(y_true, y_pred) return np.corrcoef(y_true, y_pred)[0, 1]
def LogContrast(gain=1, per_channel=False, name=None, deterministic=False, random_state=None): """ Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``. dtype support:: See :func:`imgaug.augmenters.contrast.adjust_contrast_log`. Parameters ---------- gai...
def function[LogContrast, parameter[gain, per_channel, name, deterministic, random_state]]: constant[ Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``. dtype support:: See :func:`imgaug.augmenters.contrast.adjust_contrast_log`. Parameters ---------- ...
keyword[def] identifier[LogContrast] ( identifier[gain] = literal[int] , identifier[per_channel] = keyword[False] , identifier[name] = keyword[None] , identifier[deterministic] = keyword[False] , identifier[random_state] = keyword[None] ): literal[string] identifier[params1d] =[ identifier[iap] . iden...
def LogContrast(gain=1, per_channel=False, name=None, deterministic=False, random_state=None): """ Adjust contrast by scaling each pixel value to ``255 * gain * log_2(1 + I_ij/255)``. dtype support:: See :func:`imgaug.augmenters.contrast.adjust_contrast_log`. Parameters ---------- gai...
def variance_inflation_factors(df): ''' Computes the variance inflation factor (VIF) for each column in the df. Returns a pandas Series of VIFs Args: df: pandas DataFrame with columns to run diagnostics on ''' corr = np.corrcoef(df, rowvar=0) corr_inv = np.linalg.inv(corr) vifs ...
def function[variance_inflation_factors, parameter[df]]: constant[ Computes the variance inflation factor (VIF) for each column in the df. Returns a pandas Series of VIFs Args: df: pandas DataFrame with columns to run diagnostics on ] variable[corr] assign[=] call[name[np].corrc...
keyword[def] identifier[variance_inflation_factors] ( identifier[df] ): literal[string] identifier[corr] = identifier[np] . identifier[corrcoef] ( identifier[df] , identifier[rowvar] = literal[int] ) identifier[corr_inv] = identifier[np] . identifier[linalg] . identifier[inv] ( identifier[corr] ) ...
def variance_inflation_factors(df): """ Computes the variance inflation factor (VIF) for each column in the df. Returns a pandas Series of VIFs Args: df: pandas DataFrame with columns to run diagnostics on """ corr = np.corrcoef(df, rowvar=0) corr_inv = np.linalg.inv(corr) vifs ...
def watch_log_for(self, exprs, from_mark=None, timeout=600, process=None, verbose=False, filename='system.log'): """ Watch the log until one or more (regular) expression are found. This methods when all the expressions have been found or the method timeouts (a TimeoutError is then raised...
def function[watch_log_for, parameter[self, exprs, from_mark, timeout, process, verbose, filename]]: constant[ Watch the log until one or more (regular) expression are found. This methods when all the expressions have been found or the method timeouts (a TimeoutError is then raised). On ...
keyword[def] identifier[watch_log_for] ( identifier[self] , identifier[exprs] , identifier[from_mark] = keyword[None] , identifier[timeout] = literal[int] , identifier[process] = keyword[None] , identifier[verbose] = keyword[False] , identifier[filename] = literal[string] ): literal[string] identif...
def watch_log_for(self, exprs, from_mark=None, timeout=600, process=None, verbose=False, filename='system.log'): """ Watch the log until one or more (regular) expression are found. This methods when all the expressions have been found or the method timeouts (a TimeoutError is then raised). O...
def getField(self, fld_name): """ Return :class:`~ekmmeters.Field` content, scaled and formatted. Args: fld_name (str): A :class:`~ekmmeters.Field` value which is on your meter. Returns: str: String value (scaled if numeric) for the field. """ result = "...
def function[getField, parameter[self, fld_name]]: constant[ Return :class:`~ekmmeters.Field` content, scaled and formatted. Args: fld_name (str): A :class:`~ekmmeters.Field` value which is on your meter. Returns: str: String value (scaled if numeric) for the field. ...
keyword[def] identifier[getField] ( identifier[self] , identifier[fld_name] ): literal[string] identifier[result] = literal[string] keyword[if] identifier[fld_name] keyword[in] identifier[self] . identifier[m_req] : identifier[result] = identifier[self] . identifier[m_req]...
def getField(self, fld_name): """ Return :class:`~ekmmeters.Field` content, scaled and formatted. Args: fld_name (str): A :class:`~ekmmeters.Field` value which is on your meter. Returns: str: String value (scaled if numeric) for the field. """ result = '' if...
def walk_files_info(self, relativePath=""): """ Walk the repository and yield tuples as the following:\n (relative path to relativePath joined with file name, file info dict). :parameters: #. relativePath (str): The relative path from which start the walk. """ ...
def function[walk_files_info, parameter[self, relativePath]]: constant[ Walk the repository and yield tuples as the following: (relative path to relativePath joined with file name, file info dict). :parameters: #. relativePath (str): The relative path from which start the w...
keyword[def] identifier[walk_files_info] ( identifier[self] , identifier[relativePath] = literal[string] ): literal[string] keyword[def] identifier[walk_files] ( identifier[directory] , identifier[relativePath] ): identifier[directories] = identifier[dict] . identifier[__getitem__] ( ...
def walk_files_info(self, relativePath=''): """ Walk the repository and yield tuples as the following: (relative path to relativePath joined with file name, file info dict). :parameters: #. relativePath (str): The relative path from which start the walk. """ def wa...
def extract_endpoints(api_module): """Return the endpoints from an API implementation module. The results returned by this are used to populate your HTTP layer's route handler, as well as by the documentation generator. """ if not hasattr(api_module, 'endpoints'): raise ValueError(("pale.ex...
def function[extract_endpoints, parameter[api_module]]: constant[Return the endpoints from an API implementation module. The results returned by this are used to populate your HTTP layer's route handler, as well as by the documentation generator. ] if <ast.UnaryOp object at 0x7da204962bf0> ...
keyword[def] identifier[extract_endpoints] ( identifier[api_module] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[api_module] , literal[string] ): keyword[raise] identifier[ValueError] (( literal[string] literal[string] )) identifier[endpoints] = i...
def extract_endpoints(api_module): """Return the endpoints from an API implementation module. The results returned by this are used to populate your HTTP layer's route handler, as well as by the documentation generator. """ if not hasattr(api_module, 'endpoints'): raise ValueError("pale.ext...
def _parseSymbols(self, sections): """Sets a list of symbols in each DYNSYM and SYMTAB section""" for section in sections: strtab = sections[section.header.sh_link] if section.header.sh_type in (int(SHT.DYNSYM), int(SHT.SYMTAB)): section.symbols = self.__parseSymb...
def function[_parseSymbols, parameter[self, sections]]: constant[Sets a list of symbols in each DYNSYM and SYMTAB section] for taget[name[section]] in starred[name[sections]] begin[:] variable[strtab] assign[=] call[name[sections]][name[section].header.sh_link] if compare...
keyword[def] identifier[_parseSymbols] ( identifier[self] , identifier[sections] ): literal[string] keyword[for] identifier[section] keyword[in] identifier[sections] : identifier[strtab] = identifier[sections] [ identifier[section] . identifier[header] . identifier[sh_link] ] ...
def _parseSymbols(self, sections): """Sets a list of symbols in each DYNSYM and SYMTAB section""" for section in sections: strtab = sections[section.header.sh_link] if section.header.sh_type in (int(SHT.DYNSYM), int(SHT.SYMTAB)): section.symbols = self.__parseSymbolEntriesForSection(...
def trainable_params(m:nn.Module)->ParamList: "Return list of trainable params in `m`." res = filter(lambda p: p.requires_grad, m.parameters()) return res
def function[trainable_params, parameter[m]]: constant[Return list of trainable params in `m`.] variable[res] assign[=] call[name[filter], parameter[<ast.Lambda object at 0x7da1b1e99f60>, call[name[m].parameters, parameter[]]]] return[name[res]]
keyword[def] identifier[trainable_params] ( identifier[m] : identifier[nn] . identifier[Module] )-> identifier[ParamList] : literal[string] identifier[res] = identifier[filter] ( keyword[lambda] identifier[p] : identifier[p] . identifier[requires_grad] , identifier[m] . identifier[parameters] ()) key...
def trainable_params(m: nn.Module) -> ParamList: """Return list of trainable params in `m`.""" res = filter(lambda p: p.requires_grad, m.parameters()) return res
def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:`<PyPiRecycleBinPackageVersionDetails> <...
def function[restore_package_version_from_recycle_bin, parameter[self, package_version_details, feed_id, package_name, package_version]]: constant[RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:`<PyPiRecycle...
keyword[def] identifier[restore_package_version_from_recycle_bin] ( identifier[self] , identifier[package_version_details] , identifier[feed_id] , identifier[package_name] , identifier[package_version] ): literal[string] identifier[route_values] ={} keyword[if] identifier[feed_id] keywor...
def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:`<PyPiRecycleBinPackageVersionDetails> <azur...
def owner_type(self, value): """Set ``owner_type`` to the given value. In addition: * Update the internal type of the ``owner`` field. * Update the value of the ``owner`` field if a value is already set. """ self._owner_type = value if value == 'User': ...
def function[owner_type, parameter[self, value]]: constant[Set ``owner_type`` to the given value. In addition: * Update the internal type of the ``owner`` field. * Update the value of the ``owner`` field if a value is already set. ] name[self]._owner_type assign[=] name...
keyword[def] identifier[owner_type] ( identifier[self] , identifier[value] ): literal[string] identifier[self] . identifier[_owner_type] = identifier[value] keyword[if] identifier[value] == literal[string] : identifier[self] . identifier[_fields] [ literal[string] ]= identif...
def owner_type(self, value): """Set ``owner_type`` to the given value. In addition: * Update the internal type of the ``owner`` field. * Update the value of the ``owner`` field if a value is already set. """ self._owner_type = value if value == 'User': self._fields[...
def _ige(message, key, iv, operation="decrypt"): """Given a key, given an iv, and message do whatever operation asked in the operation field. Operation will be checked for: "decrypt" and "encrypt" strings. Returns the message encrypted/decrypted. message must be a multiple by 16 bytes (for divis...
def function[_ige, parameter[message, key, iv, operation]]: constant[Given a key, given an iv, and message do whatever operation asked in the operation field. Operation will be checked for: "decrypt" and "encrypt" strings. Returns the message encrypted/decrypted. message must be a multiple b...
keyword[def] identifier[_ige] ( identifier[message] , identifier[key] , identifier[iv] , identifier[operation] = literal[string] ): literal[string] identifier[message] = identifier[bytes] ( identifier[message] ) keyword[if] identifier[len] ( identifier[key] )!= literal[int] : keyword[raise] ...
def _ige(message, key, iv, operation='decrypt'): """Given a key, given an iv, and message do whatever operation asked in the operation field. Operation will be checked for: "decrypt" and "encrypt" strings. Returns the message encrypted/decrypted. message must be a multiple by 16 bytes (for divis...
def mutex(): ''' Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ''' # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test da...
def function[mutex, parameter[]]: constant[ Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex ] variable[mutex_num] assign[=] list[[<ast.Constant object at 0x7da1b216bca0>, <ast.Constant object at 0x7da1b2168040>, <ast.Constant object...
keyword[def] identifier[mutex] (): literal[string] identifier[mutex_num] =[ literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] ] identifier[locks] =[ literal[int] , literal[int] , literal[int] ...
def mutex(): """ Tests the implementation of mutex CLI Examples: .. code-block:: bash salt '*' sysbench.mutex """ # Test options and the values they take # --mutex-num = [50,500,1000] # --mutex-locks = [10000,25000,50000] # --mutex-loops = [2500,5000,10000] # Test data...
def encode(signer, payload, header=None, key_id=None): """Make a signed JWT. Args: signer (google.auth.crypt.Signer): The signer used to sign the JWT. payload (Mapping[str, str]): The JWT payload. header (Mapping[str, str]): Additional JWT header payload. key_id (str): The key i...
def function[encode, parameter[signer, payload, header, key_id]]: constant[Make a signed JWT. Args: signer (google.auth.crypt.Signer): The signer used to sign the JWT. payload (Mapping[str, str]): The JWT payload. header (Mapping[str, str]): Additional JWT header payload. ke...
keyword[def] identifier[encode] ( identifier[signer] , identifier[payload] , identifier[header] = keyword[None] , identifier[key_id] = keyword[None] ): literal[string] keyword[if] identifier[header] keyword[is] keyword[None] : identifier[header] ={} keyword[if] identifier[key_id] keywor...
def encode(signer, payload, header=None, key_id=None): """Make a signed JWT. Args: signer (google.auth.crypt.Signer): The signer used to sign the JWT. payload (Mapping[str, str]): The JWT payload. header (Mapping[str, str]): Additional JWT header payload. key_id (str): The key i...
def make_password(length, chars=string.letters + string.digits + '#$%&!'): """ Generate and return a random password :param length: Desired length :param chars: Character set to use """ return get_random_string(length, chars)
def function[make_password, parameter[length, chars]]: constant[ Generate and return a random password :param length: Desired length :param chars: Character set to use ] return[call[name[get_random_string], parameter[name[length], name[chars]]]]
keyword[def] identifier[make_password] ( identifier[length] , identifier[chars] = identifier[string] . identifier[letters] + identifier[string] . identifier[digits] + literal[string] ): literal[string] keyword[return] identifier[get_random_string] ( identifier[length] , identifier[chars] )
def make_password(length, chars=string.letters + string.digits + '#$%&!'): """ Generate and return a random password :param length: Desired length :param chars: Character set to use """ return get_random_string(length, chars)
def transFringe(beta=None, rho=None): """ Transport matrix of fringe field :param beta: angle of rotation of pole-face in [RAD] :param rho: bending radius in [m] :return: 6x6 numpy array """ m = np.eye(6, 6, dtype=np.float64) if None in (beta, rho): print("warning: 'theta', 'rho' sh...
def function[transFringe, parameter[beta, rho]]: constant[ Transport matrix of fringe field :param beta: angle of rotation of pole-face in [RAD] :param rho: bending radius in [m] :return: 6x6 numpy array ] variable[m] assign[=] call[name[np].eye, parameter[constant[6], constant[6]]] ...
keyword[def] identifier[transFringe] ( identifier[beta] = keyword[None] , identifier[rho] = keyword[None] ): literal[string] identifier[m] = identifier[np] . identifier[eye] ( literal[int] , literal[int] , identifier[dtype] = identifier[np] . identifier[float64] ) keyword[if] keyword[None] keyword[i...
def transFringe(beta=None, rho=None): """ Transport matrix of fringe field :param beta: angle of rotation of pole-face in [RAD] :param rho: bending radius in [m] :return: 6x6 numpy array """ m = np.eye(6, 6, dtype=np.float64) if None in (beta, rho): print("warning: 'theta', 'rho' sh...
def save_map(dsp, path): """ Write Dispatcher graph object in Python pickle format. Pickles are a serialized byte stream of a Python object. This format will preserve Python objects used as nodes or edges. :param dsp: A dispatcher that identifies the model adopted. :type dsp: schedula....
def function[save_map, parameter[dsp, path]]: constant[ Write Dispatcher graph object in Python pickle format. Pickles are a serialized byte stream of a Python object. This format will preserve Python objects used as nodes or edges. :param dsp: A dispatcher that identifies the model ad...
keyword[def] identifier[save_map] ( identifier[dsp] , identifier[path] ): literal[string] keyword[import] identifier[dill] keyword[with] identifier[open] ( identifier[path] , literal[string] ) keyword[as] identifier[f] : identifier[dill] . identifier[dump] ( identifier[dsp] . identifier[d...
def save_map(dsp, path): """ Write Dispatcher graph object in Python pickle format. Pickles are a serialized byte stream of a Python object. This format will preserve Python objects used as nodes or edges. :param dsp: A dispatcher that identifies the model adopted. :type dsp: schedula....
def _create_run_ini(self, port, production, output='development.ini', source='development.ini', override_site_url=True): """ Create run/development.ini in datadir with debug and site_url overridden and with correct db passwords inserted """ cp = SafeConfig...
def function[_create_run_ini, parameter[self, port, production, output, source, override_site_url]]: constant[ Create run/development.ini in datadir with debug and site_url overridden and with correct db passwords inserted ] variable[cp] assign[=] call[name[SafeConfigParser], par...
keyword[def] identifier[_create_run_ini] ( identifier[self] , identifier[port] , identifier[production] , identifier[output] = literal[string] , identifier[source] = literal[string] , identifier[override_site_url] = keyword[True] ): literal[string] identifier[cp] = identifier[SafeConfigParser] () ...
def _create_run_ini(self, port, production, output='development.ini', source='development.ini', override_site_url=True): """ Create run/development.ini in datadir with debug and site_url overridden and with correct db passwords inserted """ cp = SafeConfigParser() try: cp.rea...
def isometric(script, targetAbstractMinFaceNum=140, targetAbstractMaxFaceNum=180, stopCriteria=1, convergenceSpeed=1, DoubleStep=True): """Isometric parameterization """ filter_xml = ''.join([ ' <filter name="Iso Parametrization">\n', ' <Param name="targetAbstractMinFaceNu...
def function[isometric, parameter[script, targetAbstractMinFaceNum, targetAbstractMaxFaceNum, stopCriteria, convergenceSpeed, DoubleStep]]: constant[Isometric parameterization ] variable[filter_xml] assign[=] call[constant[].join, parameter[list[[<ast.Constant object at 0x7da1b024edd0>, <ast.Consta...
keyword[def] identifier[isometric] ( identifier[script] , identifier[targetAbstractMinFaceNum] = literal[int] , identifier[targetAbstractMaxFaceNum] = literal[int] , identifier[stopCriteria] = literal[int] , identifier[convergenceSpeed] = literal[int] , identifier[DoubleStep] = keyword[True] ): literal[string] ...
def isometric(script, targetAbstractMinFaceNum=140, targetAbstractMaxFaceNum=180, stopCriteria=1, convergenceSpeed=1, DoubleStep=True): """Isometric parameterization """ filter_xml = ''.join([' <filter name="Iso Parametrization">\n', ' <Param name="targetAbstractMinFaceNum"', 'value="%d"' % targetAbstr...
def log_setup(debug_bool): """Set up logging. We output only to stdout. Instead of also writing to a log file, redirect stdout to a log file when the script is executed from cron. """ level = logging.DEBUG if debug_bool else logging.INFO logging.config.dictConfig( { "vers...
def function[log_setup, parameter[debug_bool]]: constant[Set up logging. We output only to stdout. Instead of also writing to a log file, redirect stdout to a log file when the script is executed from cron. ] variable[level] assign[=] <ast.IfExp object at 0x7da1b1b6bfa0> call[name[...
keyword[def] identifier[log_setup] ( identifier[debug_bool] ): literal[string] identifier[level] = identifier[logging] . identifier[DEBUG] keyword[if] identifier[debug_bool] keyword[else] identifier[logging] . identifier[INFO] identifier[logging] . identifier[config] . identifier[dictConfig] ( ...
def log_setup(debug_bool): """Set up logging. We output only to stdout. Instead of also writing to a log file, redirect stdout to a log file when the script is executed from cron. """ level = logging.DEBUG if debug_bool else logging.INFO logging.config.dictConfig({'version': 1, 'disable_existi...
def with_reactor(*dec_args, **dec_kwargs): """ Decorator for test functions that require a running reactor. Can be used like this:: @with_reactor def test_connect_to_server(self): ... Or like this:: @with_reactor(timeout=10) def test_connec...
def function[with_reactor, parameter[]]: constant[ Decorator for test functions that require a running reactor. Can be used like this:: @with_reactor def test_connect_to_server(self): ... Or like this:: @with_reactor(timeout=10) def tes...
keyword[def] identifier[with_reactor] (* identifier[dec_args] ,** identifier[dec_kwargs] ): literal[string] keyword[if] identifier[len] ( identifier[dec_args] )== literal[int] keyword[and] identifier[callable] ( identifier[dec_args] [ literal[int] ]) keyword[and] keyword[not] identifi...
def with_reactor(*dec_args, **dec_kwargs): """ Decorator for test functions that require a running reactor. Can be used like this:: @with_reactor def test_connect_to_server(self): ... Or like this:: @with_reactor(timeout=10) def test_connec...
def print_name(self, indent=0, end='\n'): """Print name with optional indent and end.""" print(Style.BRIGHT + ' ' * indent + self.name, end=end)
def function[print_name, parameter[self, indent, end]]: constant[Print name with optional indent and end.] call[name[print], parameter[binary_operation[binary_operation[name[Style].BRIGHT + binary_operation[constant[ ] * name[indent]]] + name[self].name]]]
keyword[def] identifier[print_name] ( identifier[self] , identifier[indent] = literal[int] , identifier[end] = literal[string] ): literal[string] identifier[print] ( identifier[Style] . identifier[BRIGHT] + literal[string] * identifier[indent] + identifier[self] . identifier[name] , identifier[end]...
def print_name(self, indent=0, end='\n'): """Print name with optional indent and end.""" print(Style.BRIGHT + ' ' * indent + self.name, end=end)
def extract_execution_state(self, topology): """ Returns the repesentation of execution state that will be returned from Tracker. """ execution_state = topology.execution_state executionState = { "cluster": execution_state.cluster, "environ": execution_state.environ, "ro...
def function[extract_execution_state, parameter[self, topology]]: constant[ Returns the repesentation of execution state that will be returned from Tracker. ] variable[execution_state] assign[=] name[topology].execution_state variable[executionState] assign[=] dictionary[[<ast.Consta...
keyword[def] identifier[extract_execution_state] ( identifier[self] , identifier[topology] ): literal[string] identifier[execution_state] = identifier[topology] . identifier[execution_state] identifier[executionState] ={ literal[string] : identifier[execution_state] . identifier[cluster] , ...
def extract_execution_state(self, topology): """ Returns the repesentation of execution state that will be returned from Tracker. """ execution_state = topology.execution_state executionState = {'cluster': execution_state.cluster, 'environ': execution_state.environ, 'role': execution_state.role,...
def _TransmissionThreadProc(self): """Entry point for the transmission worker thread.""" reconnect = True while not self._shutdown: self._new_updates.clear() if reconnect: service = self._BuildService() reconnect = False reconnect, delay = self._TransmitBreakpointUpdates...
def function[_TransmissionThreadProc, parameter[self]]: constant[Entry point for the transmission worker thread.] variable[reconnect] assign[=] constant[True] while <ast.UnaryOp object at 0x7da204962110> begin[:] call[name[self]._new_updates.clear, parameter[]] if...
keyword[def] identifier[_TransmissionThreadProc] ( identifier[self] ): literal[string] identifier[reconnect] = keyword[True] keyword[while] keyword[not] identifier[self] . identifier[_shutdown] : identifier[self] . identifier[_new_updates] . identifier[clear] () keyword[if] identif...
def _TransmissionThreadProc(self): """Entry point for the transmission worker thread.""" reconnect = True while not self._shutdown: self._new_updates.clear() if reconnect: service = self._BuildService() reconnect = False # depends on [control=['if'], data=[]] ...
def create_discrete_action_masking_layer(all_logits, action_masks, action_size): """ Creates a masking layer for the discrete actions :param all_logits: The concatenated unnormalized action probabilities for all branches :param action_masks: The mask for the logits. Must be of dimension ...
def function[create_discrete_action_masking_layer, parameter[all_logits, action_masks, action_size]]: constant[ Creates a masking layer for the discrete actions :param all_logits: The concatenated unnormalized action probabilities for all branches :param action_masks: The mask for the lo...
keyword[def] identifier[create_discrete_action_masking_layer] ( identifier[all_logits] , identifier[action_masks] , identifier[action_size] ): literal[string] identifier[action_idx] =[ literal[int] ]+ identifier[list] ( identifier[np] . identifier[cumsum] ( identifier[action_size] )) ident...
def create_discrete_action_masking_layer(all_logits, action_masks, action_size): """ Creates a masking layer for the discrete actions :param all_logits: The concatenated unnormalized action probabilities for all branches :param action_masks: The mask for the logits. Must be of dimension [Non...
def format_legacy_trace_json(span_datas): """Formats a list of SpanData tuples into the legacy 'trace' dictionary format for backwards compatibility :type span_datas: list of :class: `~opencensus.trace.span_data.SpanData` :param list of opencensus.trace.span_data.SpanData span_datas: ...
def function[format_legacy_trace_json, parameter[span_datas]]: constant[Formats a list of SpanData tuples into the legacy 'trace' dictionary format for backwards compatibility :type span_datas: list of :class: `~opencensus.trace.span_data.SpanData` :param list of opencensus.trace.span_da...
keyword[def] identifier[format_legacy_trace_json] ( identifier[span_datas] ): literal[string] keyword[if] keyword[not] identifier[span_datas] : keyword[return] {} identifier[top_span] = identifier[span_datas] [ literal[int] ] keyword[assert] identifier[isinstance] ( identifier[top_spa...
def format_legacy_trace_json(span_datas): """Formats a list of SpanData tuples into the legacy 'trace' dictionary format for backwards compatibility :type span_datas: list of :class: `~opencensus.trace.span_data.SpanData` :param list of opencensus.trace.span_data.SpanData span_datas: ...
def expand_focussed(self): """ Expand currently focussed position; works only if the underlying tree allows it. """ if implementsCollapseAPI(self._tree): w, focuspos = self.get_focus() self._tree.expand(focuspos) self._walker.clear_cache() ...
def function[expand_focussed, parameter[self]]: constant[ Expand currently focussed position; works only if the underlying tree allows it. ] if call[name[implementsCollapseAPI], parameter[name[self]._tree]] begin[:] <ast.Tuple object at 0x7da20c991570> assign[=] c...
keyword[def] identifier[expand_focussed] ( identifier[self] ): literal[string] keyword[if] identifier[implementsCollapseAPI] ( identifier[self] . identifier[_tree] ): identifier[w] , identifier[focuspos] = identifier[self] . identifier[get_focus] () identifier[self] . ide...
def expand_focussed(self): """ Expand currently focussed position; works only if the underlying tree allows it. """ if implementsCollapseAPI(self._tree): (w, focuspos) = self.get_focus() self._tree.expand(focuspos) self._walker.clear_cache() self.refresh()...
def register_aliases(self, aliases): """Registers the given aliases to be exposed in parsed BUILD files. :param aliases: The BuildFileAliases to register. :type aliases: :class:`pants.build_graph.build_file_aliases.BuildFileAliases` """ if not isinstance(aliases, BuildFileAliases): raise Type...
def function[register_aliases, parameter[self, aliases]]: constant[Registers the given aliases to be exposed in parsed BUILD files. :param aliases: The BuildFileAliases to register. :type aliases: :class:`pants.build_graph.build_file_aliases.BuildFileAliases` ] if <ast.UnaryOp object at 0x7...
keyword[def] identifier[register_aliases] ( identifier[self] , identifier[aliases] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[aliases] , identifier[BuildFileAliases] ): keyword[raise] identifier[TypeError] ( literal[string] . identifier[format] ( identifier[al...
def register_aliases(self, aliases): """Registers the given aliases to be exposed in parsed BUILD files. :param aliases: The BuildFileAliases to register. :type aliases: :class:`pants.build_graph.build_file_aliases.BuildFileAliases` """ if not isinstance(aliases, BuildFileAliases): raise Ty...
def get_selected_text(self): """ Return text selected by current text cursor, converted in unicode Replace the unicode line separator character \u2029 by the line separator characters returned by get_line_separator """ return to_text_string(self.textCursor().selec...
def function[get_selected_text, parameter[self]]: constant[ Return text selected by current text cursor, converted in unicode Replace the unicode line separator character 
 by the line separator characters returned by get_line_separator ] return[call[call[name[to_text_string...
keyword[def] identifier[get_selected_text] ( identifier[self] ): literal[string] keyword[return] identifier[to_text_string] ( identifier[self] . identifier[textCursor] (). identifier[selectedText] ()). identifier[replace] ( literal[string] , identifier[self] . identifier[get_line_separ...
def get_selected_text(self): """ Return text selected by current text cursor, converted in unicode Replace the unicode line separator character \u2029 by the line separator characters returned by get_line_separator """ return to_text_string(self.textCursor().selectedText()).repl...
def get_club_members(self, club_id, limit=None): """ Gets the member objects for specified club ID. http://strava.github.io/api/v3/clubs/#get-members :param club_id: The numeric ID for the club. :type club_id: int :param limit: Maximum number of athletes to return. (de...
def function[get_club_members, parameter[self, club_id, limit]]: constant[ Gets the member objects for specified club ID. http://strava.github.io/api/v3/clubs/#get-members :param club_id: The numeric ID for the club. :type club_id: int :param limit: Maximum number of a...
keyword[def] identifier[get_club_members] ( identifier[self] , identifier[club_id] , identifier[limit] = keyword[None] ): literal[string] identifier[result_fetcher] = identifier[functools] . identifier[partial] ( identifier[self] . identifier[protocol] . identifier[get] , literal[string] ,...
def get_club_members(self, club_id, limit=None): """ Gets the member objects for specified club ID. http://strava.github.io/api/v3/clubs/#get-members :param club_id: The numeric ID for the club. :type club_id: int :param limit: Maximum number of athletes to return. (defaul...
def _delete_port_channel_resources(self, host_id, switch_ip, intf_type, nexus_port, port_id): '''This determines if port channel id needs to be freed.''' # if this connection is not a port-channel, nothing to do. if intf_type != 'port-channel': ...
def function[_delete_port_channel_resources, parameter[self, host_id, switch_ip, intf_type, nexus_port, port_id]]: constant[This determines if port channel id needs to be freed.] if compare[name[intf_type] not_equal[!=] constant[port-channel]] begin[:] return[None] <ast.Try object at 0x7da18...
keyword[def] identifier[_delete_port_channel_resources] ( identifier[self] , identifier[host_id] , identifier[switch_ip] , identifier[intf_type] , identifier[nexus_port] , identifier[port_id] ): literal[string] keyword[if] identifier[intf_type] != literal[string] : keyword[...
def _delete_port_channel_resources(self, host_id, switch_ip, intf_type, nexus_port, port_id): """This determines if port channel id needs to be freed.""" # if this connection is not a port-channel, nothing to do. if intf_type != 'port-channel': return # depends on [control=['if'], data=[]] # Ch...
def _migrate_subresource(subresource, parent, migrations): """ Migrate a resource's subresource :param subresource: the perch.SubResource instance :param parent: the parent perch.Document instance :param migrations: the migrations for a resource """ for key, doc in getattr(parent, subresour...
def function[_migrate_subresource, parameter[subresource, parent, migrations]]: constant[ Migrate a resource's subresource :param subresource: the perch.SubResource instance :param parent: the parent perch.Document instance :param migrations: the migrations for a resource ] for tage...
keyword[def] identifier[_migrate_subresource] ( identifier[subresource] , identifier[parent] , identifier[migrations] ): literal[string] keyword[for] identifier[key] , identifier[doc] keyword[in] identifier[getattr] ( identifier[parent] , identifier[subresource] . identifier[parent_key] ,{}). identifier...
def _migrate_subresource(subresource, parent, migrations): """ Migrate a resource's subresource :param subresource: the perch.SubResource instance :param parent: the parent perch.Document instance :param migrations: the migrations for a resource """ for (key, doc) in getattr(parent, subreso...
def term_counts(self): """ Returns: OrderedDict: An ordered dictionary of term counts. """ counts = OrderedDict() for term in self.terms: counts[term] = len(self.terms[term]) return utils.sort_dict(counts)
def function[term_counts, parameter[self]]: constant[ Returns: OrderedDict: An ordered dictionary of term counts. ] variable[counts] assign[=] call[name[OrderedDict], parameter[]] for taget[name[term]] in starred[name[self].terms] begin[:] call[name[co...
keyword[def] identifier[term_counts] ( identifier[self] ): literal[string] identifier[counts] = identifier[OrderedDict] () keyword[for] identifier[term] keyword[in] identifier[self] . identifier[terms] : identifier[counts] [ identifier[term] ]= identifier[len] ( identifie...
def term_counts(self): """ Returns: OrderedDict: An ordered dictionary of term counts. """ counts = OrderedDict() for term in self.terms: counts[term] = len(self.terms[term]) # depends on [control=['for'], data=['term']] return utils.sort_dict(counts)
def get_full_path(request, remove_querystrings=[]): """Gets the current path, removing specified querstrings""" path = request.get_full_path() for qs in remove_querystrings: path = re.sub(r'&?' + qs + '=?(.+)?&?', '', path) return path
def function[get_full_path, parameter[request, remove_querystrings]]: constant[Gets the current path, removing specified querstrings] variable[path] assign[=] call[name[request].get_full_path, parameter[]] for taget[name[qs]] in starred[name[remove_querystrings]] begin[:] variabl...
keyword[def] identifier[get_full_path] ( identifier[request] , identifier[remove_querystrings] =[]): literal[string] identifier[path] = identifier[request] . identifier[get_full_path] () keyword[for] identifier[qs] keyword[in] identifier[remove_querystrings] : identifier[path] = identifie...
def get_full_path(request, remove_querystrings=[]): """Gets the current path, removing specified querstrings""" path = request.get_full_path() for qs in remove_querystrings: path = re.sub('&?' + qs + '=?(.+)?&?', '', path) # depends on [control=['for'], data=['qs']] return path
def remove_adapter(widget_class, flavour=None): """Removes the given widget class information from the default set of adapters. If widget_class had been previously added by using add_adapter, the added adapter will be removed, restoring possibly previusly existing adapter(s). Notice that this funct...
def function[remove_adapter, parameter[widget_class, flavour]]: constant[Removes the given widget class information from the default set of adapters. If widget_class had been previously added by using add_adapter, the added adapter will be removed, restoring possibly previusly existing adapter(...
keyword[def] identifier[remove_adapter] ( identifier[widget_class] , identifier[flavour] = keyword[None] ): literal[string] keyword[for] identifier[it] , identifier[tu] keyword[in] identifier[enumerate] ( identifier[__def_adapter] ): keyword[if] ( identifier[widget_class] == identifier[tu] [ id...
def remove_adapter(widget_class, flavour=None): """Removes the given widget class information from the default set of adapters. If widget_class had been previously added by using add_adapter, the added adapter will be removed, restoring possibly previusly existing adapter(s). Notice that this funct...
def safe_zip(*args): """like zip but with these properties: - returns a list, rather than an iterator. This is the old Python2 zip behavior. - a guarantee that all arguments are the same length. (normal zip silently drops entries to make them the same length) """ length = len(args[0]) if not all(len(arg) ...
def function[safe_zip, parameter[]]: constant[like zip but with these properties: - returns a list, rather than an iterator. This is the old Python2 zip behavior. - a guarantee that all arguments are the same length. (normal zip silently drops entries to make them the same length) ] variable[len...
keyword[def] identifier[safe_zip] (* identifier[args] ): literal[string] identifier[length] = identifier[len] ( identifier[args] [ literal[int] ]) keyword[if] keyword[not] identifier[all] ( identifier[len] ( identifier[arg] )== identifier[length] keyword[for] identifier[arg] keyword[in] identifier[arg...
def safe_zip(*args): """like zip but with these properties: - returns a list, rather than an iterator. This is the old Python2 zip behavior. - a guarantee that all arguments are the same length. (normal zip silently drops entries to make them the same length) """ length = len(args[0]) if not all((le...
def validate_username_for_new_person(username): """ Validate the new username for a new person. If the username is invalid or in use, raises :py:exc:`UsernameInvalid` or :py:exc:`UsernameTaken`. :param username: Username to validate. """ # is the username valid? validate_username(username) ...
def function[validate_username_for_new_person, parameter[username]]: constant[ Validate the new username for a new person. If the username is invalid or in use, raises :py:exc:`UsernameInvalid` or :py:exc:`UsernameTaken`. :param username: Username to validate. ] call[name[validate_username]...
keyword[def] identifier[validate_username_for_new_person] ( identifier[username] ): literal[string] identifier[validate_username] ( identifier[username] ) identifier[count] = identifier[Person] . identifier[objects] . identifier[filter] ( identifier[username__exact] = identifier[username...
def validate_username_for_new_person(username): """ Validate the new username for a new person. If the username is invalid or in use, raises :py:exc:`UsernameInvalid` or :py:exc:`UsernameTaken`. :param username: Username to validate. """ # is the username valid? validate_username(username) ...
def node_query(self, node): """ Return the query for the gql call node """ if isinstance(node, ast.Call): assert node.args arg = node.args[0] if not isinstance(arg, ast.Str): return else: raise TypeError(type(node))...
def function[node_query, parameter[self, node]]: constant[ Return the query for the gql call node ] if call[name[isinstance], parameter[name[node], name[ast].Call]] begin[:] assert[name[node].args] variable[arg] assign[=] call[name[node].args][constant[0]] ...
keyword[def] identifier[node_query] ( identifier[self] , identifier[node] ): literal[string] keyword[if] identifier[isinstance] ( identifier[node] , identifier[ast] . identifier[Call] ): keyword[assert] identifier[node] . identifier[args] identifier[arg] = identifier[n...
def node_query(self, node): """ Return the query for the gql call node """ if isinstance(node, ast.Call): assert node.args arg = node.args[0] if not isinstance(arg, ast.Str): return # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]...
def intervals(annotation, **kwargs): '''Plotting wrapper for labeled intervals''' times, labels = annotation.to_interval_values() return mir_eval.display.labeled_intervals(times, labels, **kwargs)
def function[intervals, parameter[annotation]]: constant[Plotting wrapper for labeled intervals] <ast.Tuple object at 0x7da1b004c580> assign[=] call[name[annotation].to_interval_values, parameter[]] return[call[name[mir_eval].display.labeled_intervals, parameter[name[times], name[labels]]]]
keyword[def] identifier[intervals] ( identifier[annotation] ,** identifier[kwargs] ): literal[string] identifier[times] , identifier[labels] = identifier[annotation] . identifier[to_interval_values] () keyword[return] identifier[mir_eval] . identifier[display] . identifier[labeled_intervals] ( ident...
def intervals(annotation, **kwargs): """Plotting wrapper for labeled intervals""" (times, labels) = annotation.to_interval_values() return mir_eval.display.labeled_intervals(times, labels, **kwargs)
def provider(function): """Decorator for :class:`Module` methods, registering a provider of a type. >>> class MyModule(Module): ... @provider ... def provide_name(self) -> str: ... return 'Bob' @provider-decoration implies @inject so you can omit it and things will work just the ...
def function[provider, parameter[function]]: constant[Decorator for :class:`Module` methods, registering a provider of a type. >>> class MyModule(Module): ... @provider ... def provide_name(self) -> str: ... return 'Bob' @provider-decoration implies @inject so you can omit it and...
keyword[def] identifier[provider] ( identifier[function] ): literal[string] identifier[scope_] = identifier[getattr] ( identifier[function] , literal[string] , keyword[None] ) identifier[annotations] = identifier[inspect] . identifier[getfullargspec] ( identifier[function] ). identifier[annotations] ...
def provider(function): """Decorator for :class:`Module` methods, registering a provider of a type. >>> class MyModule(Module): ... @provider ... def provide_name(self) -> str: ... return 'Bob' @provider-decoration implies @inject so you can omit it and things will work just the ...
def create_ramp_plan(err, ramp): """ Formulate and execute on a plan to slowly add heat or cooling to the system `err` initial error (PV - SP) `ramp` the size of the ramp A ramp plan might yield MVs in this order at every timestep: [5, 0, 4, 0, 3, 0, 2, 0, 1] where err == 5 + 4 + 3...
def function[create_ramp_plan, parameter[err, ramp]]: constant[ Formulate and execute on a plan to slowly add heat or cooling to the system `err` initial error (PV - SP) `ramp` the size of the ramp A ramp plan might yield MVs in this order at every timestep: [5, 0, 4, 0, 3, 0, 2, 0, 1]...
keyword[def] identifier[create_ramp_plan] ( identifier[err] , identifier[ramp] ): literal[string] keyword[if] identifier[ramp] == literal[int] : keyword[yield] identifier[int] ( identifier[err] ) keyword[while] keyword[True] : keyword[yield] literal[int] ...
def create_ramp_plan(err, ramp): """ Formulate and execute on a plan to slowly add heat or cooling to the system `err` initial error (PV - SP) `ramp` the size of the ramp A ramp plan might yield MVs in this order at every timestep: [5, 0, 4, 0, 3, 0, 2, 0, 1] where err == 5 + 4 + 3...
def get_instance(name, provider=None): ''' Return details on an instance. Similar to the cloud action show_instance but returns only the instance details. CLI Example: .. code-block:: bash salt minionname cloud.get_instance myinstance SLS Example: .. code-block:: bash ...
def function[get_instance, parameter[name, provider]]: constant[ Return details on an instance. Similar to the cloud action show_instance but returns only the instance details. CLI Example: .. code-block:: bash salt minionname cloud.get_instance myinstance SLS Example: ...
keyword[def] identifier[get_instance] ( identifier[name] , identifier[provider] = keyword[None] ): literal[string] identifier[data] = identifier[action] ( identifier[fun] = literal[string] , identifier[names] =[ identifier[name] ], identifier[provider] = identifier[provider] ) identifier[info] = ident...
def get_instance(name, provider=None): """ Return details on an instance. Similar to the cloud action show_instance but returns only the instance details. CLI Example: .. code-block:: bash salt minionname cloud.get_instance myinstance SLS Example: .. code-block:: bash ...
def fetch(self): """ Fetch a DocumentPermissionInstance :returns: Fetched DocumentPermissionInstance :rtype: twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance """ params = values.of({}) payload = self._version.fetch( ...
def function[fetch, parameter[self]]: constant[ Fetch a DocumentPermissionInstance :returns: Fetched DocumentPermissionInstance :rtype: twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance ] variable[params] assign[=] call[name[values].of, ...
keyword[def] identifier[fetch] ( identifier[self] ): literal[string] identifier[params] = identifier[values] . identifier[of] ({}) identifier[payload] = identifier[self] . identifier[_version] . identifier[fetch] ( literal[string] , identifier[self] . identifier[_uri] , ...
def fetch(self): """ Fetch a DocumentPermissionInstance :returns: Fetched DocumentPermissionInstance :rtype: twilio.rest.sync.v1.service.document.document_permission.DocumentPermissionInstance """ params = values.of({}) payload = self._version.fetch('GET', self._uri, params=...
def md5_for_file(f, block_size=2 ** 20): """Generate an MD5 has for a possibly large file by breaking it into chunks.""" md5 = hashlib.md5() try: # Guess that f is a FLO. f.seek(0) return md5_for_stream(f, block_size=block_size) except AttributeError: # Nope, not a...
def function[md5_for_file, parameter[f, block_size]]: constant[Generate an MD5 has for a possibly large file by breaking it into chunks.] variable[md5] assign[=] call[name[hashlib].md5, parameter[]] <ast.Try object at 0x7da18f58fcd0>
keyword[def] identifier[md5_for_file] ( identifier[f] , identifier[block_size] = literal[int] ** literal[int] ): literal[string] identifier[md5] = identifier[hashlib] . identifier[md5] () keyword[try] : identifier[f] . identifier[seek] ( literal[int] ) keyword[return] identif...
def md5_for_file(f, block_size=2 ** 20): """Generate an MD5 has for a possibly large file by breaking it into chunks.""" md5 = hashlib.md5() try: # Guess that f is a FLO. f.seek(0) return md5_for_stream(f, block_size=block_size) # depends on [control=['try'], data=[]] except...
def _GetParsersFromPresetCategory(cls, category): """Retrieves the parser names of specific preset category. Args: category (str): parser preset categories. Returns: list[str]: parser names in alphabetical order. """ preset_definition = cls._presets.GetPresetByName(category) if pre...
def function[_GetParsersFromPresetCategory, parameter[cls, category]]: constant[Retrieves the parser names of specific preset category. Args: category (str): parser preset categories. Returns: list[str]: parser names in alphabetical order. ] variable[preset_definition] assign[=...
keyword[def] identifier[_GetParsersFromPresetCategory] ( identifier[cls] , identifier[category] ): literal[string] identifier[preset_definition] = identifier[cls] . identifier[_presets] . identifier[GetPresetByName] ( identifier[category] ) keyword[if] identifier[preset_definition] keyword[is] keyw...
def _GetParsersFromPresetCategory(cls, category): """Retrieves the parser names of specific preset category. Args: category (str): parser preset categories. Returns: list[str]: parser names in alphabetical order. """ preset_definition = cls._presets.GetPresetByName(category) if pre...
def calculate_single_terms(self): """Apply all methods stored in the hidden attribute `PART_ODE_METHODS`. >>> from hydpy.models.test_v1 import * >>> parameterstep() >>> k(0.25) >>> states.s = 1.0 >>> model.calculate_single_terms() >>> fluxes.q q(0...
def function[calculate_single_terms, parameter[self]]: constant[Apply all methods stored in the hidden attribute `PART_ODE_METHODS`. >>> from hydpy.models.test_v1 import * >>> parameterstep() >>> k(0.25) >>> states.s = 1.0 >>> model.calculate_single_terms() ...
keyword[def] identifier[calculate_single_terms] ( identifier[self] ): literal[string] identifier[self] . identifier[numvars] . identifier[nmb_calls] = identifier[self] . identifier[numvars] . identifier[nmb_calls] + literal[int] keyword[for] identifier[method] keyword[in] identifier[se...
def calculate_single_terms(self): """Apply all methods stored in the hidden attribute `PART_ODE_METHODS`. >>> from hydpy.models.test_v1 import * >>> parameterstep() >>> k(0.25) >>> states.s = 1.0 >>> model.calculate_single_terms() >>> fluxes.q q(0.25)...
def _jog(self, axis, direction, step): """ Move the pipette on `axis` in `direction` by `step` and update the position tracker """ jog(axis, direction, step, self.hardware, self._current_mount) self.current_position = self._position() return 'Jog: {}'.format([axi...
def function[_jog, parameter[self, axis, direction, step]]: constant[ Move the pipette on `axis` in `direction` by `step` and update the position tracker ] call[name[jog], parameter[name[axis], name[direction], name[step], name[self].hardware, name[self]._current_mount]] ...
keyword[def] identifier[_jog] ( identifier[self] , identifier[axis] , identifier[direction] , identifier[step] ): literal[string] identifier[jog] ( identifier[axis] , identifier[direction] , identifier[step] , identifier[self] . identifier[hardware] , identifier[self] . identifier[_current_mount] )...
def _jog(self, axis, direction, step): """ Move the pipette on `axis` in `direction` by `step` and update the position tracker """ jog(axis, direction, step, self.hardware, self._current_mount) self.current_position = self._position() return 'Jog: {}'.format([axis, str(direction)...
def require_auth_captcha(self, response, query_params, login_form_data, http_session): """Resolve auth captcha case :param response: http response :param query_params: dict: response query params, for example: {'s': '0', 'email': 'my@email', 'dif': '1', 'rol...
def function[require_auth_captcha, parameter[self, response, query_params, login_form_data, http_session]]: constant[Resolve auth captcha case :param response: http response :param query_params: dict: response query params, for example: {'s': '0', 'email': 'my@email', 'dif': '1', 'role'...
keyword[def] identifier[require_auth_captcha] ( identifier[self] , identifier[response] , identifier[query_params] , identifier[login_form_data] , identifier[http_session] ): literal[string] identifier[logger] . identifier[info] ( literal[string] , identifier[query_params] ) identifier[fo...
def require_auth_captcha(self, response, query_params, login_form_data, http_session): """Resolve auth captcha case :param response: http response :param query_params: dict: response query params, for example: {'s': '0', 'email': 'my@email', 'dif': '1', 'role': 'fast', 'sid': '1'} ...
def validate_bagit_file(bagit_path): """Check if a BagIt file is valid. Raises: ServiceFailure If the BagIt zip archive file fails any of the following checks: - Is a valid zip file. - The tag and manifest files are correctly formatted. - Contains all th...
def function[validate_bagit_file, parameter[bagit_path]]: constant[Check if a BagIt file is valid. Raises: ServiceFailure If the BagIt zip archive file fails any of the following checks: - Is a valid zip file. - The tag and manifest files are correctly formatted...
keyword[def] identifier[validate_bagit_file] ( identifier[bagit_path] ): literal[string] identifier[_assert_zip_file] ( identifier[bagit_path] ) identifier[bagit_zip] = identifier[zipfile] . identifier[ZipFile] ( identifier[bagit_path] ) identifier[manifest_info_list] = identifier[_get_manifest_i...
def validate_bagit_file(bagit_path): """Check if a BagIt file is valid. Raises: ServiceFailure If the BagIt zip archive file fails any of the following checks: - Is a valid zip file. - The tag and manifest files are correctly formatted. - Contains all th...
def _af_filter(data, in_file, out_file): """Soft-filter variants with AF below min_allele_fraction (appends "MinAF" to FILTER) """ min_freq = float(utils.get_in(data["config"], ("algorithm", "min_allele_fraction"), 10)) / 100.0 logger.debug("Filtering MuTect2 calls with allele fraction threshold of %s" ...
def function[_af_filter, parameter[data, in_file, out_file]]: constant[Soft-filter variants with AF below min_allele_fraction (appends "MinAF" to FILTER) ] variable[min_freq] assign[=] binary_operation[call[name[float], parameter[call[name[utils].get_in, parameter[call[name[data]][constant[config]],...
keyword[def] identifier[_af_filter] ( identifier[data] , identifier[in_file] , identifier[out_file] ): literal[string] identifier[min_freq] = identifier[float] ( identifier[utils] . identifier[get_in] ( identifier[data] [ literal[string] ],( literal[string] , literal[string] ), literal[int] ))/ literal[int...
def _af_filter(data, in_file, out_file): """Soft-filter variants with AF below min_allele_fraction (appends "MinAF" to FILTER) """ min_freq = float(utils.get_in(data['config'], ('algorithm', 'min_allele_fraction'), 10)) / 100.0 logger.debug('Filtering MuTect2 calls with allele fraction threshold of %s' ...
def timetopythonvalue(time_val): "Convert a time or time range from ArcGIS REST server format to Python" if isinstance(time_val, sequence): return map(timetopythonvalue, time_val) elif isinstance(time_val, numeric): return datetime.datetime(*(time.gmtime(time_val))[:6]) elif isinstance(t...
def function[timetopythonvalue, parameter[time_val]]: constant[Convert a time or time range from ArcGIS REST server format to Python] if call[name[isinstance], parameter[name[time_val], name[sequence]]] begin[:] return[call[name[map], parameter[name[timetopythonvalue], name[time_val]]]] <ast...
keyword[def] identifier[timetopythonvalue] ( identifier[time_val] ): literal[string] keyword[if] identifier[isinstance] ( identifier[time_val] , identifier[sequence] ): keyword[return] identifier[map] ( identifier[timetopythonvalue] , identifier[time_val] ) keyword[elif] identifier[isinsta...
def timetopythonvalue(time_val): """Convert a time or time range from ArcGIS REST server format to Python""" if isinstance(time_val, sequence): return map(timetopythonvalue, time_val) # depends on [control=['if'], data=[]] elif isinstance(time_val, numeric): return datetime.datetime(*time.g...
def as_odict(self): """ returns an odict version of the object, based on it's attributes """ if hasattr(self, 'cust_odict'): return self.cust_odict if hasattr(self, 'attr_check'): self.attr_check() odc = odict() for attr in self.at...
def function[as_odict, parameter[self]]: constant[ returns an odict version of the object, based on it's attributes ] if call[name[hasattr], parameter[name[self], constant[cust_odict]]] begin[:] return[name[self].cust_odict] if call[name[hasattr], parameter[name[self], co...
keyword[def] identifier[as_odict] ( identifier[self] ): literal[string] keyword[if] identifier[hasattr] ( identifier[self] , literal[string] ): keyword[return] identifier[self] . identifier[cust_odict] keyword[if] identifier[hasattr] ( identifier[self] , literal[string...
def as_odict(self): """ returns an odict version of the object, based on it's attributes """ if hasattr(self, 'cust_odict'): return self.cust_odict # depends on [control=['if'], data=[]] if hasattr(self, 'attr_check'): self.attr_check() # depends on [control=['if'], data=[]...
def np_to_list(elem): """Returns list from list, tuple or ndarray.""" if isinstance(elem, list): return elem elif isinstance(elem, tuple): return list(elem) elif isinstance(elem, np.ndarray): return list(elem) else: raise ValueError( 'Input elements of a sequence should be either a num...
def function[np_to_list, parameter[elem]]: constant[Returns list from list, tuple or ndarray.] if call[name[isinstance], parameter[name[elem], name[list]]] begin[:] return[name[elem]]
keyword[def] identifier[np_to_list] ( identifier[elem] ): literal[string] keyword[if] identifier[isinstance] ( identifier[elem] , identifier[list] ): keyword[return] identifier[elem] keyword[elif] identifier[isinstance] ( identifier[elem] , identifier[tuple] ): keyword[return] identifier[list...
def np_to_list(elem): """Returns list from list, tuple or ndarray.""" if isinstance(elem, list): return elem # depends on [control=['if'], data=[]] elif isinstance(elem, tuple): return list(elem) # depends on [control=['if'], data=[]] elif isinstance(elem, np.ndarray): return l...
def normalize_names(self): """ It is internally used to normalize the name of the widgets. It means a widget named foo:vbox-dialog in glade is refered self.vbox_dialog in the code. It also sets a data "prefixes" with the list of prefixes a widget has for each widget. ...
def function[normalize_names, parameter[self]]: constant[ It is internally used to normalize the name of the widgets. It means a widget named foo:vbox-dialog in glade is refered self.vbox_dialog in the code. It also sets a data "prefixes" with the list of prefixes a widg...
keyword[def] identifier[normalize_names] ( identifier[self] ): literal[string] keyword[for] identifier[widget] keyword[in] identifier[self] . identifier[get_widgets] (): keyword[if] identifier[isinstance] ( identifier[widget] , identifier[Gtk] . identifier[Buildable] ): ...
def normalize_names(self): """ It is internally used to normalize the name of the widgets. It means a widget named foo:vbox-dialog in glade is refered self.vbox_dialog in the code. It also sets a data "prefixes" with the list of prefixes a widget has for each widget. ...
def _lim_moment(self, u, order=1): """ This method calculates the kth order limiting moment of the distribution. It is given by - E(u) = Integral (-inf to u) [ (x^k)*pdf(x) dx ] + (u^k)(1-cdf(u)) where, pdf is the probability density function and cdf is the cumulative d...
def function[_lim_moment, parameter[self, u, order]]: constant[ This method calculates the kth order limiting moment of the distribution. It is given by - E(u) = Integral (-inf to u) [ (x^k)*pdf(x) dx ] + (u^k)(1-cdf(u)) where, pdf is the probability density function and cdf is...
keyword[def] identifier[_lim_moment] ( identifier[self] , identifier[u] , identifier[order] = literal[int] ): literal[string] keyword[def] identifier[fun] ( identifier[x] ): keyword[return] identifier[np] . identifier[power] ( identifier[x] , identifier[order] )* identifier[self] . i...
def _lim_moment(self, u, order=1): """ This method calculates the kth order limiting moment of the distribution. It is given by - E(u) = Integral (-inf to u) [ (x^k)*pdf(x) dx ] + (u^k)(1-cdf(u)) where, pdf is the probability density function and cdf is the cumulative densi...
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to ...
def function[to_cloudformation, parameter[self]]: constant[Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormati...
keyword[def] identifier[to_cloudformation] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[function] = identifier[kwargs] . identifier[get] ( literal[string] ) keyword[if] keyword[not] identifier[function] : keyword[raise] identifier[TypeError] ( li...
def to_cloudformation(self, **kwargs): """Returns the CloudWatch Logs Subscription Filter and Lambda Permission to which this CloudWatch Logs event source corresponds. :param dict kwargs: no existing resources need to be modified :returns: a list of vanilla CloudFormation Resources, to whic...
def H_iso(x,params): """ Isochrone Hamiltonian = -GM/(b+sqrt(b**2+(r-r0)**2))""" #r = (np.sqrt(np.sum(x[:3]**2))-params[2])**2 r = np.sum(x[:3]**2) return 0.5*np.sum(x[3:]**2)-Grav*params[0]/(params[1]+np.sqrt(params[1]**2+r))
def function[H_iso, parameter[x, params]]: constant[ Isochrone Hamiltonian = -GM/(b+sqrt(b**2+(r-r0)**2))] variable[r] assign[=] call[name[np].sum, parameter[binary_operation[call[name[x]][<ast.Slice object at 0x7da1b0efd5a0>] ** constant[2]]]] return[binary_operation[binary_operation[constant[0.5] ...
keyword[def] identifier[H_iso] ( identifier[x] , identifier[params] ): literal[string] identifier[r] = identifier[np] . identifier[sum] ( identifier[x] [: literal[int] ]** literal[int] ) keyword[return] literal[int] * identifier[np] . identifier[sum] ( identifier[x] [ literal[int] :]** literal[i...
def H_iso(x, params): """ Isochrone Hamiltonian = -GM/(b+sqrt(b**2+(r-r0)**2))""" #r = (np.sqrt(np.sum(x[:3]**2))-params[2])**2 r = np.sum(x[:3] ** 2) return 0.5 * np.sum(x[3:] ** 2) - Grav * params[0] / (params[1] + np.sqrt(params[1] ** 2 + r))
def verify(self, type_): """ Check whether a type implements ``self``. Parameters ---------- type_ : type The type to check. Raises ------ TypeError If ``type_`` doesn't conform to our interface. Returns ------- ...
def function[verify, parameter[self, type_]]: constant[ Check whether a type implements ``self``. Parameters ---------- type_ : type The type to check. Raises ------ TypeError If ``type_`` doesn't conform to our interface. ...
keyword[def] identifier[verify] ( identifier[self] , identifier[type_] ): literal[string] identifier[raw_missing] , identifier[mistyped] , identifier[mismatched] = identifier[self] . identifier[_diff_signatures] ( identifier[type_] ) identifier[missing] =[] identifier[de...
def verify(self, type_): """ Check whether a type implements ``self``. Parameters ---------- type_ : type The type to check. Raises ------ TypeError If ``type_`` doesn't conform to our interface. Returns ------- ...
def _googleauth(key_file=None, scopes=[], user_agent=None): """ Google http_auth helper. If key_file is not specified, default credentials will be used. If scopes is specified (and key_file), will be used instead of DEFAULT_SCOPES :param key_file: path to key file to use. Default is None :typ...
def function[_googleauth, parameter[key_file, scopes, user_agent]]: constant[ Google http_auth helper. If key_file is not specified, default credentials will be used. If scopes is specified (and key_file), will be used instead of DEFAULT_SCOPES :param key_file: path to key file to use. Defaul...
keyword[def] identifier[_googleauth] ( identifier[key_file] = keyword[None] , identifier[scopes] =[], identifier[user_agent] = keyword[None] ): literal[string] keyword[if] identifier[key_file] : keyword[if] keyword[not] identifier[scopes] : identifier[scopes] = identifier[DEFAULT_S...
def _googleauth(key_file=None, scopes=[], user_agent=None): """ Google http_auth helper. If key_file is not specified, default credentials will be used. If scopes is specified (and key_file), will be used instead of DEFAULT_SCOPES :param key_file: path to key file to use. Default is None :typ...
def _meet(intervals_hier, labels_hier, frame_size): '''Compute the (sparse) least-common-ancestor (LCA) matrix for a hierarchical segmentation. For any pair of frames ``(s, t)``, the LCA is the deepest level in the hierarchy such that ``(s, t)`` are contained within a single segment at that level. ...
def function[_meet, parameter[intervals_hier, labels_hier, frame_size]]: constant[Compute the (sparse) least-common-ancestor (LCA) matrix for a hierarchical segmentation. For any pair of frames ``(s, t)``, the LCA is the deepest level in the hierarchy such that ``(s, t)`` are contained within a sin...
keyword[def] identifier[_meet] ( identifier[intervals_hier] , identifier[labels_hier] , identifier[frame_size] ): literal[string] identifier[frame_size] = identifier[float] ( identifier[frame_size] ) identifier[n_start] , identifier[n_end] = identifier[_hierarchy_bounds] ( identifier[intervals...
def _meet(intervals_hier, labels_hier, frame_size): """Compute the (sparse) least-common-ancestor (LCA) matrix for a hierarchical segmentation. For any pair of frames ``(s, t)``, the LCA is the deepest level in the hierarchy such that ``(s, t)`` are contained within a single segment at that level. ...
def verify(self) -> None: """Raises a |RuntimeError| if at least one of the required values of a |Variable| object is |None| or |numpy.nan|. The descriptor `mask` defines, which values are considered to be necessary. Example on a 0-dimensional |Variable|: >>> from hydpy.core.va...
def function[verify, parameter[self]]: constant[Raises a |RuntimeError| if at least one of the required values of a |Variable| object is |None| or |numpy.nan|. The descriptor `mask` defines, which values are considered to be necessary. Example on a 0-dimensional |Variable|: >>>...
keyword[def] identifier[verify] ( identifier[self] )-> keyword[None] : literal[string] identifier[nmbnan] : identifier[int] = identifier[numpy] . identifier[sum] ( identifier[numpy] . identifier[isnan] ( identifier[numpy] . identifier[array] ( identifier[self] . identifier[value] )[ identi...
def verify(self) -> None: """Raises a |RuntimeError| if at least one of the required values of a |Variable| object is |None| or |numpy.nan|. The descriptor `mask` defines, which values are considered to be necessary. Example on a 0-dimensional |Variable|: >>> from hydpy.core.variab...
def plot_composition(df, intervals, axes=None): """ Plot time series of generics and label underlying instruments which these series are composed of. Parameters: ----------- df: pd.DataFrame DataFrame of time series to be plotted. Each column is a generic time series. interv...
def function[plot_composition, parameter[df, intervals, axes]]: constant[ Plot time series of generics and label underlying instruments which these series are composed of. Parameters: ----------- df: pd.DataFrame DataFrame of time series to be plotted. Each column is a generic time ...
keyword[def] identifier[plot_composition] ( identifier[df] , identifier[intervals] , identifier[axes] = keyword[None] ): literal[string] identifier[generics] = identifier[df] . identifier[columns] keyword[if] ( identifier[axes] keyword[is] keyword[not] keyword[None] ) keyword[and] ( identifier[le...
def plot_composition(df, intervals, axes=None): """ Plot time series of generics and label underlying instruments which these series are composed of. Parameters: ----------- df: pd.DataFrame DataFrame of time series to be plotted. Each column is a generic time series. interv...
def _has_integer_used_as_pointers(self): """ Test if there is any (suspicious) pointer decryption in the code. :return: True if there is any pointer decryption, False otherwise. :rtype: bool """ # check all integer accesses and see if there is any integer being used as ...
def function[_has_integer_used_as_pointers, parameter[self]]: constant[ Test if there is any (suspicious) pointer decryption in the code. :return: True if there is any pointer decryption, False otherwise. :rtype: bool ] variable[candidates] assign[=] <ast.ListComp object...
keyword[def] identifier[_has_integer_used_as_pointers] ( identifier[self] ): literal[string] identifier[candidates] =[ identifier[i] keyword[for] identifier[i] keyword[in] identifier[self] . identifier[cfg] . identifier[memory_data] . identifier[values] () keyword[i...
def _has_integer_used_as_pointers(self): """ Test if there is any (suspicious) pointer decryption in the code. :return: True if there is any pointer decryption, False otherwise. :rtype: bool """ # check all integer accesses and see if there is any integer being used as a pointer...
def _read_map(ctx: ReaderContext) -> lmap.Map: """Return a map from the input stream.""" reader = ctx.reader start = reader.advance() assert start == "{" d: MutableMapping[Any, Any] = {} while True: if reader.peek() == "}": reader.next_token() break k = _r...
def function[_read_map, parameter[ctx]]: constant[Return a map from the input stream.] variable[reader] assign[=] name[ctx].reader variable[start] assign[=] call[name[reader].advance, parameter[]] assert[compare[name[start] equal[==] constant[{]]] <ast.AnnAssign object at 0x7da1b0213820>...
keyword[def] identifier[_read_map] ( identifier[ctx] : identifier[ReaderContext] )-> identifier[lmap] . identifier[Map] : literal[string] identifier[reader] = identifier[ctx] . identifier[reader] identifier[start] = identifier[reader] . identifier[advance] () keyword[assert] identifier[start] =...
def _read_map(ctx: ReaderContext) -> lmap.Map: """Return a map from the input stream.""" reader = ctx.reader start = reader.advance() assert start == '{' d: MutableMapping[Any, Any] = {} while True: if reader.peek() == '}': reader.next_token() break # depends on ...
def run(self, args): """Runs the firmware command. Args: self (FirmwareCommand): the ``FirmwareCommand`` instance args (Namespace): arguments to parse Returns: ``None`` """ jlink = self.create_jlink(args) if args.downgrade: if n...
def function[run, parameter[self, args]]: constant[Runs the firmware command. Args: self (FirmwareCommand): the ``FirmwareCommand`` instance args (Namespace): arguments to parse Returns: ``None`` ] variable[jlink] assign[=] call[name[self].create_j...
keyword[def] identifier[run] ( identifier[self] , identifier[args] ): literal[string] identifier[jlink] = identifier[self] . identifier[create_jlink] ( identifier[args] ) keyword[if] identifier[args] . identifier[downgrade] : keyword[if] keyword[not] identifier[jlink] . ide...
def run(self, args): """Runs the firmware command. Args: self (FirmwareCommand): the ``FirmwareCommand`` instance args (Namespace): arguments to parse Returns: ``None`` """ jlink = self.create_jlink(args) if args.downgrade: if not jlink.firmwar...
def damping(self): """Strain-compatible damping.""" try: value = self._damping.value except AttributeError: value = self._damping return value
def function[damping, parameter[self]]: constant[Strain-compatible damping.] <ast.Try object at 0x7da1b2487580> return[name[value]]
keyword[def] identifier[damping] ( identifier[self] ): literal[string] keyword[try] : identifier[value] = identifier[self] . identifier[_damping] . identifier[value] keyword[except] identifier[AttributeError] : identifier[value] = identifier[self] . identifier[_...
def damping(self): """Strain-compatible damping.""" try: value = self._damping.value # depends on [control=['try'], data=[]] except AttributeError: value = self._damping # depends on [control=['except'], data=[]] return value
def find_records(self, check, keys=None): """Find records matching a query dict, optionally extracting subset of keys. Returns dict keyed by msg_id of matching records. Parameters ---------- check: dict mongodb-style query argument keys: list of strs [optio...
def function[find_records, parameter[self, check, keys]]: constant[Find records matching a query dict, optionally extracting subset of keys. Returns dict keyed by msg_id of matching records. Parameters ---------- check: dict mongodb-style query argument key...
keyword[def] identifier[find_records] ( identifier[self] , identifier[check] , identifier[keys] = keyword[None] ): literal[string] identifier[matches] = identifier[self] . identifier[_match] ( identifier[check] ) keyword[if] identifier[keys] : keyword[return] [ identifier[sel...
def find_records(self, check, keys=None): """Find records matching a query dict, optionally extracting subset of keys. Returns dict keyed by msg_id of matching records. Parameters ---------- check: dict mongodb-style query argument keys: list of strs [optional]...
def enums(): """ Return the dictionary of H₂O enums, retrieved from data in schemas(). For each entry in the dictionary its key is the name of the enum, and the value is the set of all enum values. """ enumset = defaultdict(set) for schema in schemas(): for field in schema["fields"]: ...
def function[enums, parameter[]]: constant[ Return the dictionary of H₂O enums, retrieved from data in schemas(). For each entry in the dictionary its key is the name of the enum, and the value is the set of all enum values. ] variable[enumset] assign[=] call[name[defaultdict], parameter[nam...
keyword[def] identifier[enums] (): literal[string] identifier[enumset] = identifier[defaultdict] ( identifier[set] ) keyword[for] identifier[schema] keyword[in] identifier[schemas] (): keyword[for] identifier[field] keyword[in] identifier[schema] [ literal[string] ]: keywor...
def enums(): """ Return the dictionary of H₂O enums, retrieved from data in schemas(). For each entry in the dictionary its key is the name of the enum, and the value is the set of all enum values. """ enumset = defaultdict(set) for schema in schemas(): for field in schema['fields']: ...
def _maybe_cache(arg, format, cache, convert_listlike): """ Create a cache of unique dates from an array of dates Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series format : string Strftime format to parse time cache : boolean True a...
def function[_maybe_cache, parameter[arg, format, cache, convert_listlike]]: constant[ Create a cache of unique dates from an array of dates Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series format : string Strftime format to parse time ...
keyword[def] identifier[_maybe_cache] ( identifier[arg] , identifier[format] , identifier[cache] , identifier[convert_listlike] ): literal[string] keyword[from] identifier[pandas] keyword[import] identifier[Series] identifier[cache_array] = identifier[Series] () keyword[if] identifier[cache]...
def _maybe_cache(arg, format, cache, convert_listlike): """ Create a cache of unique dates from an array of dates Parameters ---------- arg : integer, float, string, datetime, list, tuple, 1-d array, Series format : string Strftime format to parse time cache : boolean True a...
def p_state_action_constraint_section(self, p): '''state_action_constraint_section : STATE_ACTION_CONSTRAINTS LCURLY state_cons_list RCURLY SEMI | STATE_ACTION_CONSTRAINTS LCURLY RCURLY SEMI''' if len(p) == 6: p[0] = ('constraints', p[3]) el...
def function[p_state_action_constraint_section, parameter[self, p]]: constant[state_action_constraint_section : STATE_ACTION_CONSTRAINTS LCURLY state_cons_list RCURLY SEMI | STATE_ACTION_CONSTRAINTS LCURLY RCURLY SEMI] if compare[call[name[len], parameter[name[...
keyword[def] identifier[p_state_action_constraint_section] ( identifier[self] , identifier[p] ): literal[string] keyword[if] identifier[len] ( identifier[p] )== literal[int] : identifier[p] [ literal[int] ]=( literal[string] , identifier[p] [ literal[int] ]) keyword[elif] id...
def p_state_action_constraint_section(self, p): """state_action_constraint_section : STATE_ACTION_CONSTRAINTS LCURLY state_cons_list RCURLY SEMI | STATE_ACTION_CONSTRAINTS LCURLY RCURLY SEMI""" if len(p) == 6: p[0] = ('constraints', p[3]) # depends on [control...
def remove_tmp_dir(self, directory): """ Remove the directory if it is located in /tmp """ if(not directory.startswith('/tmp/')): print('Directory not in /tmp') exit() print('Deleting directory: ' + directory) shutil.rmtree(directory)
def function[remove_tmp_dir, parameter[self, directory]]: constant[ Remove the directory if it is located in /tmp ] if <ast.UnaryOp object at 0x7da18fe91a20> begin[:] call[name[print], parameter[constant[Directory not in /tmp]]] call[name[exit], parameter[...
keyword[def] identifier[remove_tmp_dir] ( identifier[self] , identifier[directory] ): literal[string] keyword[if] ( keyword[not] identifier[directory] . identifier[startswith] ( literal[string] )): identifier[print] ( literal[string] ) identifier[exit] () identi...
def remove_tmp_dir(self, directory): """ Remove the directory if it is located in /tmp """ if not directory.startswith('/tmp/'): print('Directory not in /tmp') exit() # depends on [control=['if'], data=[]] print('Deleting directory: ' + directory) shutil.rmtree(directory...
def Latex( formula, pos=(0, 0, 0), normal=(0, 0, 1), c='k', s=1, bg=None, alpha=1, res=30, usetex=False, fromweb=False, ): """ Render Latex formulas. :param str formula: latex text string :param list pos: position coordinates in space :param list normal: ...
def function[Latex, parameter[formula, pos, normal, c, s, bg, alpha, res, usetex, fromweb]]: constant[ Render Latex formulas. :param str formula: latex text string :param list pos: position coordinates in space :param list normal: normal to the plane of the image :param c: face color ...
keyword[def] identifier[Latex] ( identifier[formula] , identifier[pos] =( literal[int] , literal[int] , literal[int] ), identifier[normal] =( literal[int] , literal[int] , literal[int] ), identifier[c] = literal[string] , identifier[s] = literal[int] , identifier[bg] = keyword[None] , identifier[alpha] = liter...
def Latex(formula, pos=(0, 0, 0), normal=(0, 0, 1), c='k', s=1, bg=None, alpha=1, res=30, usetex=False, fromweb=False): """ Render Latex formulas. :param str formula: latex text string :param list pos: position coordinates in space :param list normal: normal to the plane of the image :param...
def insertRows(self, row, count, parent=QModelIndex()): """ Reimplements the :meth:`QAbstractItemModel.insertRows` method. :param row: Row. :type row: int :param count: Count. :type count: int :param parent: Parent. :type parent: QModelIndex :retu...
def function[insertRows, parameter[self, row, count, parent]]: constant[ Reimplements the :meth:`QAbstractItemModel.insertRows` method. :param row: Row. :type row: int :param count: Count. :type count: int :param parent: Parent. :type parent: QModelIndex ...
keyword[def] identifier[insertRows] ( identifier[self] , identifier[row] , identifier[count] , identifier[parent] = identifier[QModelIndex] ()): literal[string] identifier[parent_node] = identifier[self] . identifier[get_node] ( identifier[parent] ) identifier[self] . identifier[beginInse...
def insertRows(self, row, count, parent=QModelIndex()): """ Reimplements the :meth:`QAbstractItemModel.insertRows` method. :param row: Row. :type row: int :param count: Count. :type count: int :param parent: Parent. :type parent: QModelIndex :return: ...