code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _ProcessMetadataFile(self, mediator, file_entry): """Processes a metadata file. Args: mediator (ParserMediator): mediates the interactions between parsers and other components, such as storage and abort signals. file_entry (dfvfs.FileEntry): file entry of the metadata file. """ ...
def function[_ProcessMetadataFile, parameter[self, mediator, file_entry]]: constant[Processes a metadata file. Args: mediator (ParserMediator): mediates the interactions between parsers and other components, such as storage and abort signals. file_entry (dfvfs.FileEntry): file entry o...
keyword[def] identifier[_ProcessMetadataFile] ( identifier[self] , identifier[mediator] , identifier[file_entry] ): literal[string] identifier[self] . identifier[processing_status] = identifier[definitions] . identifier[STATUS_INDICATOR_EXTRACTING] identifier[self] . identifier[_event_extractor] . i...
def _ProcessMetadataFile(self, mediator, file_entry): """Processes a metadata file. Args: mediator (ParserMediator): mediates the interactions between parsers and other components, such as storage and abort signals. file_entry (dfvfs.FileEntry): file entry of the metadata file. """ ...
def require_perms(view_func, required): """Enforces permission-based access controls. :param list required: A tuple of permission names, all of which the request user must possess in order access the decorated view. Example usage:: from horizon.decorators import require_...
def function[require_perms, parameter[view_func, required]]: constant[Enforces permission-based access controls. :param list required: A tuple of permission names, all of which the request user must possess in order access the decorated view. Example usage:: from hor...
keyword[def] identifier[require_perms] ( identifier[view_func] , identifier[required] ): literal[string] keyword[from] identifier[horizon] . identifier[exceptions] keyword[import] identifier[NotAuthorized] identifier[current_perms] = identifier[getattr] ( identifier[view_func] , literal[strin...
def require_perms(view_func, required): """Enforces permission-based access controls. :param list required: A tuple of permission names, all of which the request user must possess in order access the decorated view. Example usage:: from horizon.decorators import require_...
def replace_some(ol,value,*indexes,**kwargs): ''' from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = replace_some(ol,'AAA',1,3,7) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rslt =...
def function[replace_some, parameter[ol, value]]: constant[ from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = replace_some(ol,'AAA',1,3,7) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) ...
keyword[def] identifier[replace_some] ( identifier[ol] , identifier[value] ,* identifier[indexes] ,** identifier[kwargs] ): literal[string] keyword[if] ( literal[string] keyword[in] identifier[kwargs] ): identifier[mode] = identifier[kwargs] [ literal[string] ] keyword[else] : iden...
def replace_some(ol, value, *indexes, **kwargs): """ from elist.elist import * ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) new = replace_some(ol,'AAA',1,3,7) ol new id(ol) id(new) #### ol = [1,'a',3,'a',5,'a',6,'a'] id(ol) rsl...
def download_source(version): """ Download Spark version. Uses same name as release tag without the leading 'v'. :param version: Version number to download. :return: None """ local_filename = 'v{}.zip'.format(Spark.svm_version_path(version)) Spark.download(Spark.s...
def function[download_source, parameter[version]]: constant[ Download Spark version. Uses same name as release tag without the leading 'v'. :param version: Version number to download. :return: None ] variable[local_filename] assign[=] call[constant[v{}.zip].format, parame...
keyword[def] identifier[download_source] ( identifier[version] ): literal[string] identifier[local_filename] = literal[string] . identifier[format] ( identifier[Spark] . identifier[svm_version_path] ( identifier[version] )) identifier[Spark] . identifier[download] ( identifier[Spark] . ide...
def download_source(version): """ Download Spark version. Uses same name as release tag without the leading 'v'. :param version: Version number to download. :return: None """ local_filename = 'v{}.zip'.format(Spark.svm_version_path(version)) Spark.download(Spark.spark_version...
def get_binary_stream(name): """Returns a system stream for byte processing. This essentially returns the stream from the sys module with the given name but it solves some compatibility issues between different Python versions. Primarily this function is necessary for getting binary streams on Pyth...
def function[get_binary_stream, parameter[name]]: constant[Returns a system stream for byte processing. This essentially returns the stream from the sys module with the given name but it solves some compatibility issues between different Python versions. Primarily this function is necessary for get...
keyword[def] identifier[get_binary_stream] ( identifier[name] ): literal[string] identifier[opener] = identifier[binary_streams] . identifier[get] ( identifier[name] ) keyword[if] identifier[opener] keyword[is] keyword[None] : keyword[raise] identifier[TypeError] ( literal[string] % ident...
def get_binary_stream(name): """Returns a system stream for byte processing. This essentially returns the stream from the sys module with the given name but it solves some compatibility issues between different Python versions. Primarily this function is necessary for getting binary streams on Pyth...
def extract_coverage(self, container: Container) -> FileLineSet: """ Extracts a report of the lines that have been executed since the last time that a coverage report was extracted. """ uid = container.uid r = self.__api.post('containers/{}/read-coverage'.format(uid)) ...
def function[extract_coverage, parameter[self, container]]: constant[ Extracts a report of the lines that have been executed since the last time that a coverage report was extracted. ] variable[uid] assign[=] name[container].uid variable[r] assign[=] call[name[self].__api...
keyword[def] identifier[extract_coverage] ( identifier[self] , identifier[container] : identifier[Container] )-> identifier[FileLineSet] : literal[string] identifier[uid] = identifier[container] . identifier[uid] identifier[r] = identifier[self] . identifier[__api] . identifier[post] ( li...
def extract_coverage(self, container: Container) -> FileLineSet: """ Extracts a report of the lines that have been executed since the last time that a coverage report was extracted. """ uid = container.uid r = self.__api.post('containers/{}/read-coverage'.format(uid)) if r.status...
def _set_mirror(self, v, load=False): """ Setter method for mirror, mapped from YANG variable /openflow_global/openflow/mirror (container) If this variable is read-only (config: false) in the source YANG file, then _set_mirror is considered as a private method. Backends looking to populate this vari...
def function[_set_mirror, parameter[self, v, load]]: constant[ Setter method for mirror, mapped from YANG variable /openflow_global/openflow/mirror (container) If this variable is read-only (config: false) in the source YANG file, then _set_mirror is considered as a private method. Backends look...
keyword[def] identifier[_set_mirror] ( 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] : identif...
def _set_mirror(self, v, load=False): """ Setter method for mirror, mapped from YANG variable /openflow_global/openflow/mirror (container) If this variable is read-only (config: false) in the source YANG file, then _set_mirror is considered as a private method. Backends looking to populate this vari...
def read_dir(directory): '''Returns the text of all files in a directory.''' content = dir_list(directory) text = '' for filename in content: text += read_file(directory + '/' + filename) text += ' ' return text
def function[read_dir, parameter[directory]]: constant[Returns the text of all files in a directory.] variable[content] assign[=] call[name[dir_list], parameter[name[directory]]] variable[text] assign[=] constant[] for taget[name[filename]] in starred[name[content]] begin[:] <ast...
keyword[def] identifier[read_dir] ( identifier[directory] ): literal[string] identifier[content] = identifier[dir_list] ( identifier[directory] ) identifier[text] = literal[string] keyword[for] identifier[filename] keyword[in] identifier[content] : identifier[text] += identifier[read...
def read_dir(directory): """Returns the text of all files in a directory.""" content = dir_list(directory) text = '' for filename in content: text += read_file(directory + '/' + filename) text += ' ' # depends on [control=['for'], data=['filename']] return text
def tiles_are_equal(tile_data_1, tile_data_2, fmt): """ Returns True if the tile data is equal in tile_data_1 and tile_data_2. For most formats, this is a simple byte-wise equality check. For zipped metatiles, we need to check the contents, as the zip format includes metadata such as timestamps and ...
def function[tiles_are_equal, parameter[tile_data_1, tile_data_2, fmt]]: constant[ Returns True if the tile data is equal in tile_data_1 and tile_data_2. For most formats, this is a simple byte-wise equality check. For zipped metatiles, we need to check the contents, as the zip format includes m...
keyword[def] identifier[tiles_are_equal] ( identifier[tile_data_1] , identifier[tile_data_2] , identifier[fmt] ): literal[string] keyword[if] identifier[fmt] keyword[and] identifier[fmt] == identifier[zip_format] : keyword[return] identifier[metatiles_are_equal] ( identifier[tile_data_1] , id...
def tiles_are_equal(tile_data_1, tile_data_2, fmt): """ Returns True if the tile data is equal in tile_data_1 and tile_data_2. For most formats, this is a simple byte-wise equality check. For zipped metatiles, we need to check the contents, as the zip format includes metadata such as timestamps and ...
def nextGen(self): """ Decide the fate of the cells """ self.current_gen += 1 self.change_gen[self.current_gen % 3] = copy.copy(self.grid) grid_cp = copy.copy(self.grid) for cell in self.grid: y, x = cell y1 = (y - 1) % self.y_grid ...
def function[nextGen, parameter[self]]: constant[ Decide the fate of the cells ] <ast.AugAssign object at 0x7da204623eb0> call[name[self].change_gen][binary_operation[name[self].current_gen <ast.Mod object at 0x7da2590d6920> constant[3]]] assign[=] call[name[copy].copy, parameter[nam...
keyword[def] identifier[nextGen] ( identifier[self] ): literal[string] identifier[self] . identifier[current_gen] += literal[int] identifier[self] . identifier[change_gen] [ identifier[self] . identifier[current_gen] % literal[int] ]= identifier[copy] . identifier[copy] ( identifier[self]...
def nextGen(self): """ Decide the fate of the cells """ self.current_gen += 1 self.change_gen[self.current_gen % 3] = copy.copy(self.grid) grid_cp = copy.copy(self.grid) for cell in self.grid: (y, x) = cell y1 = (y - 1) % self.y_grid y2 = (y + 1) % self.y_grid...
def _nbtt(self): """Increment the tick and return branch, turn, tick Unless we're viewing the past, in which case raise HistoryError. Idea is you use this when you want to advance time, which you can only do once per branch, turn, tick. """ from .cache import HistoryEr...
def function[_nbtt, parameter[self]]: constant[Increment the tick and return branch, turn, tick Unless we're viewing the past, in which case raise HistoryError. Idea is you use this when you want to advance time, which you can only do once per branch, turn, tick. ] from re...
keyword[def] identifier[_nbtt] ( identifier[self] ): literal[string] keyword[from] . identifier[cache] keyword[import] identifier[HistoryError] identifier[branch] , identifier[turn] , identifier[tick] = identifier[self] . identifier[_btt] () identifier[tick] += literal[int] ...
def _nbtt(self): """Increment the tick and return branch, turn, tick Unless we're viewing the past, in which case raise HistoryError. Idea is you use this when you want to advance time, which you can only do once per branch, turn, tick. """ from .cache import HistoryError ...
def base36(value): """ Encode int to base 36. """ result = '' while value: value, i = divmod(value, 36) result = BASE36_ALPHABET[i] + result return result
def function[base36, parameter[value]]: constant[ Encode int to base 36. ] variable[result] assign[=] constant[] while name[value] begin[:] <ast.Tuple object at 0x7da2044c1ab0> assign[=] call[name[divmod], parameter[name[value], constant[36]]] variable[res...
keyword[def] identifier[base36] ( identifier[value] ): literal[string] identifier[result] = literal[string] keyword[while] identifier[value] : identifier[value] , identifier[i] = identifier[divmod] ( identifier[value] , literal[int] ) identifier[result] = identifier[BASE36_ALPHABET...
def base36(value): """ Encode int to base 36. """ result = '' while value: (value, i) = divmod(value, 36) result = BASE36_ALPHABET[i] + result # depends on [control=['while'], data=[]] return result
def _on_complete_hook(self, my_task): """ Runs the task. Should not be called directly. Returns True if completed, False otherwise. """ # Find all matching conditions. outputs = [] for condition, output in self.cond_task_specs: if self.choice is not No...
def function[_on_complete_hook, parameter[self, my_task]]: constant[ Runs the task. Should not be called directly. Returns True if completed, False otherwise. ] variable[outputs] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da1b01c3b50>, <ast.Name object at ...
keyword[def] identifier[_on_complete_hook] ( identifier[self] , identifier[my_task] ): literal[string] identifier[outputs] =[] keyword[for] identifier[condition] , identifier[output] keyword[in] identifier[self] . identifier[cond_task_specs] : keyword[if] identifi...
def _on_complete_hook(self, my_task): """ Runs the task. Should not be called directly. Returns True if completed, False otherwise. """ # Find all matching conditions. outputs = [] for (condition, output) in self.cond_task_specs: if self.choice is not None and output not ...
def detect_interval( self, min_head_length=None, max_head_length=None, min_tail_length=None, max_tail_length=None ): """ Detect the interval of the audio file containing the fragments in the text file. Return the audio inte...
def function[detect_interval, parameter[self, min_head_length, max_head_length, min_tail_length, max_tail_length]]: constant[ Detect the interval of the audio file containing the fragments in the text file. Return the audio interval as a tuple of two :class:`~aeneas.exacttiming....
keyword[def] identifier[detect_interval] ( identifier[self] , identifier[min_head_length] = keyword[None] , identifier[max_head_length] = keyword[None] , identifier[min_tail_length] = keyword[None] , identifier[max_tail_length] = keyword[None] ): literal[string] identifier[head] = identifier[...
def detect_interval(self, min_head_length=None, max_head_length=None, min_tail_length=None, max_tail_length=None): """ Detect the interval of the audio file containing the fragments in the text file. Return the audio interval as a tuple of two :class:`~aeneas.exacttiming.TimeValue` ...
def expand_dimension(self, newdim, dimension, maps={}, relations={}): ''' When we expand we need to provide new maps and relations as those can't be inferred ''' for name, attr in self.__attributes__.items(): if attr.dim == dimension: newattr = attr.copy() ...
def function[expand_dimension, parameter[self, newdim, dimension, maps, relations]]: constant[ When we expand we need to provide new maps and relations as those can't be inferred ] for taget[tuple[[<ast.Name object at 0x7da18dc04f10>, <ast.Name object at 0x7da18dc06620>]]] in starred[call[name[s...
keyword[def] identifier[expand_dimension] ( identifier[self] , identifier[newdim] , identifier[dimension] , identifier[maps] ={}, identifier[relations] ={}): literal[string] keyword[for] identifier[name] , identifier[attr] keyword[in] identifier[self] . identifier[__attributes__] . identifier[i...
def expand_dimension(self, newdim, dimension, maps={}, relations={}): """ When we expand we need to provide new maps and relations as those can't be inferred """ for (name, attr) in self.__attributes__.items(): if attr.dim == dimension: newattr = attr.copy() newattr.empty...
def report_estimation_accuracy(request): """ Idea from Software Estimation, Demystifying the Black Art, McConnel 2006 Fig 3-3. """ contracts = ProjectContract.objects.filter( status=ProjectContract.STATUS_COMPLETE, type=ProjectContract.PROJECT_FIXED ) data = [('Target (hrs)', 'Ac...
def function[report_estimation_accuracy, parameter[request]]: constant[ Idea from Software Estimation, Demystifying the Black Art, McConnel 2006 Fig 3-3. ] variable[contracts] assign[=] call[name[ProjectContract].objects.filter, parameter[]] variable[data] assign[=] list[[<ast.Tuple obje...
keyword[def] identifier[report_estimation_accuracy] ( identifier[request] ): literal[string] identifier[contracts] = identifier[ProjectContract] . identifier[objects] . identifier[filter] ( identifier[status] = identifier[ProjectContract] . identifier[STATUS_COMPLETE] , identifier[type] = identif...
def report_estimation_accuracy(request): """ Idea from Software Estimation, Demystifying the Black Art, McConnel 2006 Fig 3-3. """ contracts = ProjectContract.objects.filter(status=ProjectContract.STATUS_COMPLETE, type=ProjectContract.PROJECT_FIXED) data = [('Target (hrs)', 'Actual (hrs)', 'Point La...
def construct_tpb_graph(experiments: TomographyExperiment): """ Construct a graph where an edge signifies two experiments are diagonal in a TPB. """ g = nx.Graph() for expt in experiments: assert len(expt) == 1, 'already grouped?' expt = expt[0] if expt not in g: ...
def function[construct_tpb_graph, parameter[experiments]]: constant[ Construct a graph where an edge signifies two experiments are diagonal in a TPB. ] variable[g] assign[=] call[name[nx].Graph, parameter[]] for taget[name[expt]] in starred[name[experiments]] begin[:] assert[comp...
keyword[def] identifier[construct_tpb_graph] ( identifier[experiments] : identifier[TomographyExperiment] ): literal[string] identifier[g] = identifier[nx] . identifier[Graph] () keyword[for] identifier[expt] keyword[in] identifier[experiments] : keyword[assert] identifier[len] ( identifi...
def construct_tpb_graph(experiments: TomographyExperiment): """ Construct a graph where an edge signifies two experiments are diagonal in a TPB. """ g = nx.Graph() for expt in experiments: assert len(expt) == 1, 'already grouped?' expt = expt[0] if expt not in g: ...
def add_dir2pypath(path): """Add given directory to PYTHONPATH, e.g. for pylint.""" py_path = os.environ.get('PYTHONPATH', '') if path not in py_path.split(os.pathsep): py_path = ''.join([path, os.pathsep if py_path else '', py_path]) os.environ['PYTHONPATH'] = py_path
def function[add_dir2pypath, parameter[path]]: constant[Add given directory to PYTHONPATH, e.g. for pylint.] variable[py_path] assign[=] call[name[os].environ.get, parameter[constant[PYTHONPATH], constant[]]] if compare[name[path] <ast.NotIn object at 0x7da2590d7190> call[name[py_path].split, pa...
keyword[def] identifier[add_dir2pypath] ( identifier[path] ): literal[string] identifier[py_path] = identifier[os] . identifier[environ] . identifier[get] ( literal[string] , literal[string] ) keyword[if] identifier[path] keyword[not] keyword[in] identifier[py_path] . identifier[split] ( identifie...
def add_dir2pypath(path): """Add given directory to PYTHONPATH, e.g. for pylint.""" py_path = os.environ.get('PYTHONPATH', '') if path not in py_path.split(os.pathsep): py_path = ''.join([path, os.pathsep if py_path else '', py_path]) os.environ['PYTHONPATH'] = py_path # depends on [control...
def read_features(self, tol=1e-3): """Reads the features from a file and stores them in the current object. Parameters ---------- tol: float Tolerance level to detect duration of audio. """ try: # Read JSON file with open(self....
def function[read_features, parameter[self, tol]]: constant[Reads the features from a file and stores them in the current object. Parameters ---------- tol: float Tolerance level to detect duration of audio. ] <ast.Try object at 0x7da1b02a7e20>
keyword[def] identifier[read_features] ( identifier[self] , identifier[tol] = literal[int] ): literal[string] keyword[try] : keyword[with] identifier[open] ( identifier[self] . identifier[file_struct] . identifier[features_file] ) keyword[as] identifier[f] : ...
def read_features(self, tol=0.001): """Reads the features from a file and stores them in the current object. Parameters ---------- tol: float Tolerance level to detect duration of audio. """ try: # Read JSON file with open(self.file_struct.fea...
def save(self): """This function is called by the parent dialog window when the user selects to save the settings.""" if self.path is None: # Delete requested, so remove the current path from sys.path, if present if self.config_manager.userCodeDir is not None: sys.path.remov...
def function[save, parameter[self]]: constant[This function is called by the parent dialog window when the user selects to save the settings.] if compare[name[self].path is constant[None]] begin[:] if compare[name[self].config_manager.userCodeDir is_not constant[None]] begin[:] ...
keyword[def] identifier[save] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[path] keyword[is] keyword[None] : keyword[if] identifier[self] . identifier[config_manager] . identifier[userCodeDir] keyword[is] keyword[not] keyword[None] : ...
def save(self): """This function is called by the parent dialog window when the user selects to save the settings.""" if self.path is None: # Delete requested, so remove the current path from sys.path, if present if self.config_manager.userCodeDir is not None: sys.path.remove(self.config_ma...
def _run(self, tree): """ Run a query from a parse tree """ if tree.throttle: limiter = self._parse_throttle(tree.table, tree.throttle) self._query_rate_limit = limiter del tree["throttle"] return self._run(tree) if tree.action == "SELECT": ...
def function[_run, parameter[self, tree]]: constant[ Run a query from a parse tree ] if name[tree].throttle begin[:] variable[limiter] assign[=] call[name[self]._parse_throttle, parameter[name[tree].table, name[tree].throttle]] name[self]._query_rate_limit assign[=] name[...
keyword[def] identifier[_run] ( identifier[self] , identifier[tree] ): literal[string] keyword[if] identifier[tree] . identifier[throttle] : identifier[limiter] = identifier[self] . identifier[_parse_throttle] ( identifier[tree] . identifier[table] , identifier[tree] . identifier[thro...
def _run(self, tree): """ Run a query from a parse tree """ if tree.throttle: limiter = self._parse_throttle(tree.table, tree.throttle) self._query_rate_limit = limiter del tree['throttle'] return self._run(tree) # depends on [control=['if'], data=[]] if tree.action == 'SELE...
def topNBottomN(self, column=0, nPercent=10, grabTopN=-1): """ Given a column name or one column index, a percent N, this function will return the top or bottom N% of the values of the column of a frame. The column must be a numerical column. :param column: a string for column nam...
def function[topNBottomN, parameter[self, column, nPercent, grabTopN]]: constant[ Given a column name or one column index, a percent N, this function will return the top or bottom N% of the values of the column of a frame. The column must be a numerical column. :param column: a st...
keyword[def] identifier[topNBottomN] ( identifier[self] , identifier[column] = literal[int] , identifier[nPercent] = literal[int] , identifier[grabTopN] =- literal[int] ): literal[string] keyword[assert] ( identifier[nPercent] >= literal[int] ) keyword[and] ( identifier[nPercent] <= literal[int] ),...
def topNBottomN(self, column=0, nPercent=10, grabTopN=-1): """ Given a column name or one column index, a percent N, this function will return the top or bottom N% of the values of the column of a frame. The column must be a numerical column. :param column: a string for column name or...
def get_stargazers(self, url, headers={}): """ Return a list of the stargazers of a GitHub repo Includes both the 'starred_at' and 'user' data. param: url url is the 'stargazers_url' of the form: https://api.github.com/repos/LLNL/spack/stargazers """...
def function[get_stargazers, parameter[self, url, headers]]: constant[ Return a list of the stargazers of a GitHub repo Includes both the 'starred_at' and 'user' data. param: url url is the 'stargazers_url' of the form: https://api.github.com/repos/LLNL/spac...
keyword[def] identifier[get_stargazers] ( identifier[self] , identifier[url] , identifier[headers] ={}): literal[string] identifier[url] = identifier[url] + literal[string] identifier[page] = literal[int] identifier[gazers] =[] identifier[json_data] = identifier[reques...
def get_stargazers(self, url, headers={}): """ Return a list of the stargazers of a GitHub repo Includes both the 'starred_at' and 'user' data. param: url url is the 'stargazers_url' of the form: https://api.github.com/repos/LLNL/spack/stargazers """ ...
def _integrate(self, time_steps, capture_elements, return_timestamps): """ Performs euler integration Parameters ---------- time_steps: iterable the time steps that the integrator progresses over capture_elements: list which model elements to capt...
def function[_integrate, parameter[self, time_steps, capture_elements, return_timestamps]]: constant[ Performs euler integration Parameters ---------- time_steps: iterable the time steps that the integrator progresses over capture_elements: list w...
keyword[def] identifier[_integrate] ( identifier[self] , identifier[time_steps] , identifier[capture_elements] , identifier[return_timestamps] ): literal[string] identifier[outputs] =[] keyword[for] identifier[t2] keyword[in] identifier[time_steps] [ literal[int] :]: ...
def _integrate(self, time_steps, capture_elements, return_timestamps): """ Performs euler integration Parameters ---------- time_steps: iterable the time steps that the integrator progresses over capture_elements: list which model elements to capture ...
def get_referrers(self, url='', headers={}, repo_name=''): """ Retrieves the total referrers and unique referrers of all repos in json and then stores it in a dict. """ #JSON url_referrers = (url + '/traffic/popular/referrers') r1 = requests.get(url_referrers, hea...
def function[get_referrers, parameter[self, url, headers, repo_name]]: constant[ Retrieves the total referrers and unique referrers of all repos in json and then stores it in a dict. ] variable[url_referrers] assign[=] binary_operation[name[url] + constant[/traffic/popular/referr...
keyword[def] identifier[get_referrers] ( identifier[self] , identifier[url] = literal[string] , identifier[headers] ={}, identifier[repo_name] = literal[string] ): literal[string] identifier[url_referrers] =( identifier[url] + literal[string] ) identifier[r1] = identifier[requests...
def get_referrers(self, url='', headers={}, repo_name=''): """ Retrieves the total referrers and unique referrers of all repos in json and then stores it in a dict. """ #JSON url_referrers = url + '/traffic/popular/referrers' r1 = requests.get(url_referrers, headers=headers) ...
def thread_exists(self, thread_id): """Check if a thread exists or has 404'd. Args: thread_id (int): Thread ID Returns: bool: Whether the given thread exists on this board. """ return self._requests_session.head( self._url.thread_api_url( ...
def function[thread_exists, parameter[self, thread_id]]: constant[Check if a thread exists or has 404'd. Args: thread_id (int): Thread ID Returns: bool: Whether the given thread exists on this board. ] return[call[name[self]._requests_session.head, parameter...
keyword[def] identifier[thread_exists] ( identifier[self] , identifier[thread_id] ): literal[string] keyword[return] identifier[self] . identifier[_requests_session] . identifier[head] ( identifier[self] . identifier[_url] . identifier[thread_api_url] ( identifier[thread_id] = id...
def thread_exists(self, thread_id): """Check if a thread exists or has 404'd. Args: thread_id (int): Thread ID Returns: bool: Whether the given thread exists on this board. """ return self._requests_session.head(self._url.thread_api_url(thread_id=thread_id)).ok
def xray_botocore_api_call(wrapped, instance, args, kwargs): """Wrapper around botocore's base client API call method.""" return generic_xray_wrapper( wrapped, instance, args, kwargs, name=get_service_name, namespace='aws', metadata_extractor=extract_aws_metadata, error_h...
def function[xray_botocore_api_call, parameter[wrapped, instance, args, kwargs]]: constant[Wrapper around botocore's base client API call method.] return[call[name[generic_xray_wrapper], parameter[name[wrapped], name[instance], name[args], name[kwargs]]]]
keyword[def] identifier[xray_botocore_api_call] ( identifier[wrapped] , identifier[instance] , identifier[args] , identifier[kwargs] ): literal[string] keyword[return] identifier[generic_xray_wrapper] ( identifier[wrapped] , identifier[instance] , identifier[args] , identifier[kwargs] , identifi...
def xray_botocore_api_call(wrapped, instance, args, kwargs): """Wrapper around botocore's base client API call method.""" return generic_xray_wrapper(wrapped, instance, args, kwargs, name=get_service_name, namespace='aws', metadata_extractor=extract_aws_metadata, error_handling_type=ERROR_HANDLING_BOTOCORE)
def _parse_supybot_timestamp(self, line): """Parse timestamp section""" m = self.SUPYBOT_TIMESTAMP_REGEX.match(line) if not m: msg = "date expected on line %s" % (str(self.nline)) raise ParseError(cause=msg) ts = m.group('ts') msg = m.group('msg') ...
def function[_parse_supybot_timestamp, parameter[self, line]]: constant[Parse timestamp section] variable[m] assign[=] call[name[self].SUPYBOT_TIMESTAMP_REGEX.match, parameter[name[line]]] if <ast.UnaryOp object at 0x7da1b0286cb0> begin[:] variable[msg] assign[=] binary_operation...
keyword[def] identifier[_parse_supybot_timestamp] ( identifier[self] , identifier[line] ): literal[string] identifier[m] = identifier[self] . identifier[SUPYBOT_TIMESTAMP_REGEX] . identifier[match] ( identifier[line] ) keyword[if] keyword[not] identifier[m] : identifier[ms...
def _parse_supybot_timestamp(self, line): """Parse timestamp section""" m = self.SUPYBOT_TIMESTAMP_REGEX.match(line) if not m: msg = 'date expected on line %s' % str(self.nline) raise ParseError(cause=msg) # depends on [control=['if'], data=[]] ts = m.group('ts') msg = m.group('msg'...
def moveEvent(self, event): """Reimplement Qt method""" if not self.isMaximized() and not self.fullscreen_flag: self.window_position = self.pos() QMainWindow.moveEvent(self, event) # To be used by the tour to be able to move self.sig_moved.emit(event)
def function[moveEvent, parameter[self, event]]: constant[Reimplement Qt method] if <ast.BoolOp object at 0x7da18bcc8a30> begin[:] name[self].window_position assign[=] call[name[self].pos, parameter[]] call[name[QMainWindow].moveEvent, parameter[name[self], name[event]]] ...
keyword[def] identifier[moveEvent] ( identifier[self] , identifier[event] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[isMaximized] () keyword[and] keyword[not] identifier[self] . identifier[fullscreen_flag] : identifier[self] . identifier[window_pos...
def moveEvent(self, event): """Reimplement Qt method""" if not self.isMaximized() and (not self.fullscreen_flag): self.window_position = self.pos() # depends on [control=['if'], data=[]] QMainWindow.moveEvent(self, event) # To be used by the tour to be able to move self.sig_moved.emit(event)
def CreateClass(self, *args, **kwargs): """ Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`. """ cc = args[0] if args else kwargs['NewClass'] namespace = self.getns() ...
def function[CreateClass, parameter[self]]: constant[ Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`. ] variable[cc] assign[=] <ast.IfExp object at 0x7da207f9ac80> variable[n...
keyword[def] identifier[CreateClass] ( identifier[self] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[cc] = identifier[args] [ literal[int] ] keyword[if] identifier[args] keyword[else] identifier[kwargs] [ literal[string] ] identifier[namespace] = identifier[s...
def CreateClass(self, *args, **kwargs): """ Override the CreateClass method in MOFWBEMConnection For a description of the parameters, see :meth:`pywbem.WBEMConnection.CreateClass`. """ cc = args[0] if args else kwargs['NewClass'] namespace = self.getns() try: sel...
def clean_package_cache(self, cache_name='com.gliffy.cache.gon'): """ Clean caches from cache management e.g. com.gliffy.cache.gon org.hibernate.cache.internal.StandardQueryCache_v5 """ headers = self.form_token_headers data = {'cacheName': cache_name}...
def function[clean_package_cache, parameter[self, cache_name]]: constant[ Clean caches from cache management e.g. com.gliffy.cache.gon org.hibernate.cache.internal.StandardQueryCache_v5 ] variable[headers] assign[=] name[self].form_token_headers variab...
keyword[def] identifier[clean_package_cache] ( identifier[self] , identifier[cache_name] = literal[string] ): literal[string] identifier[headers] = identifier[self] . identifier[form_token_headers] identifier[data] ={ literal[string] : identifier[cache_name] } keyword[return] id...
def clean_package_cache(self, cache_name='com.gliffy.cache.gon'): """ Clean caches from cache management e.g. com.gliffy.cache.gon org.hibernate.cache.internal.StandardQueryCache_v5 """ headers = self.form_token_headers data = {'cacheName': cache_name} return ...
def search_media(self, series, query_string): """Search for media from a series starting with query_string, case-sensitive @param crunchyroll.models.Series series the series to search in @param str query_string the search query, same restrictions ...
def function[search_media, parameter[self, series, query_string]]: constant[Search for media from a series starting with query_string, case-sensitive @param crunchyroll.models.Series series the series to search in @param str query_string the search query, same restrictio...
keyword[def] identifier[search_media] ( identifier[self] , identifier[series] , identifier[query_string] ): literal[string] identifier[params] ={ literal[string] : identifier[ANDROID] . identifier[FILTER_PREFIX] + identifier[query_string] , } identifier[params] . identifie...
def search_media(self, series, query_string): """Search for media from a series starting with query_string, case-sensitive @param crunchyroll.models.Series series the series to search in @param str query_string the search query, same restrictions ...
def download(self, url, listener=None, path_or_fd=None, chunk_size_bytes=None, timeout_secs=None): """Downloads data from the given URL. By default data is downloaded to a temporary file. :param string url: the url to GET data from :param listener: an optional listener to notify of all download lifecy...
def function[download, parameter[self, url, listener, path_or_fd, chunk_size_bytes, timeout_secs]]: constant[Downloads data from the given URL. By default data is downloaded to a temporary file. :param string url: the url to GET data from :param listener: an optional listener to notify of all down...
keyword[def] identifier[download] ( identifier[self] , identifier[url] , identifier[listener] = keyword[None] , identifier[path_or_fd] = keyword[None] , identifier[chunk_size_bytes] = keyword[None] , identifier[timeout_secs] = keyword[None] ): literal[string] @ identifier[contextmanager] keyword[def] ...
def download(self, url, listener=None, path_or_fd=None, chunk_size_bytes=None, timeout_secs=None): """Downloads data from the given URL. By default data is downloaded to a temporary file. :param string url: the url to GET data from :param listener: an optional listener to notify of all download lifecy...
def set_integration_time(self, integration_time): """Sets the integration time for the TC34725. Provide one of these constants: - TCS34725_INTEGRATIONTIME_2_4MS = 2.4ms - 1 cycle - Max Count: 1024 - TCS34725_INTEGRATIONTIME_24MS = 24ms - 10 cycles - Max Count: 10240 -...
def function[set_integration_time, parameter[self, integration_time]]: constant[Sets the integration time for the TC34725. Provide one of these constants: - TCS34725_INTEGRATIONTIME_2_4MS = 2.4ms - 1 cycle - Max Count: 1024 - TCS34725_INTEGRATIONTIME_24MS = 24ms - 10 cycles - ...
keyword[def] identifier[set_integration_time] ( identifier[self] , identifier[integration_time] ): literal[string] identifier[self] . identifier[_integration_time] = identifier[integration_time] identifier[self] . identifier[_write8] ( identifier[TCS34725_ATIME] , identifier[integration_t...
def set_integration_time(self, integration_time): """Sets the integration time for the TC34725. Provide one of these constants: - TCS34725_INTEGRATIONTIME_2_4MS = 2.4ms - 1 cycle - Max Count: 1024 - TCS34725_INTEGRATIONTIME_24MS = 24ms - 10 cycles - Max Count: 10240 - TCS...
def eventsource_connect(url, io_loop=None, callback=None, connect_timeout=None): """Client-side eventsource support. Takes a url and returns a Future whose result is a `EventSourceClient`. """ if io_loop is None: io_loop = IOLoop.current() if isinstance(url, httpclient.HTTPRequest): ...
def function[eventsource_connect, parameter[url, io_loop, callback, connect_timeout]]: constant[Client-side eventsource support. Takes a url and returns a Future whose result is a `EventSourceClient`. ] if compare[name[io_loop] is constant[None]] begin[:] variable[io_loop] ...
keyword[def] identifier[eventsource_connect] ( identifier[url] , identifier[io_loop] = keyword[None] , identifier[callback] = keyword[None] , identifier[connect_timeout] = keyword[None] ): literal[string] keyword[if] identifier[io_loop] keyword[is] keyword[None] : identifier[io_loop] = identifi...
def eventsource_connect(url, io_loop=None, callback=None, connect_timeout=None): """Client-side eventsource support. Takes a url and returns a Future whose result is a `EventSourceClient`. """ if io_loop is None: io_loop = IOLoop.current() # depends on [control=['if'], data=['io_loop']] ...
def set_custom_colorset(self): """Defines a colorset with matching colors. Provided by Joachim.""" cmd.set_color('myorange', '[253, 174, 97]') cmd.set_color('mygreen', '[171, 221, 164]') cmd.set_color('myred', '[215, 25, 28]') cmd.set_color('myblue', '[43, 131, 186]') cmd...
def function[set_custom_colorset, parameter[self]]: constant[Defines a colorset with matching colors. Provided by Joachim.] call[name[cmd].set_color, parameter[constant[myorange], constant[[253, 174, 97]]]] call[name[cmd].set_color, parameter[constant[mygreen], constant[[171, 221, 164]]]] ...
keyword[def] identifier[set_custom_colorset] ( identifier[self] ): literal[string] identifier[cmd] . identifier[set_color] ( literal[string] , literal[string] ) identifier[cmd] . identifier[set_color] ( literal[string] , literal[string] ) identifier[cmd] . identifier[set_color] ( ...
def set_custom_colorset(self): """Defines a colorset with matching colors. Provided by Joachim.""" cmd.set_color('myorange', '[253, 174, 97]') cmd.set_color('mygreen', '[171, 221, 164]') cmd.set_color('myred', '[215, 25, 28]') cmd.set_color('myblue', '[43, 131, 186]') cmd.set_color('mylightblue'...
def radiance2tb(self, rad): """ Get the Tb from the radiance using the Planck function and the central wavelength of the band rad: Radiance in SI units """ return radiance2tb(rad, self.rsr[self.bandname][self.detector]['central_wavelength'] * 1e-6)
def function[radiance2tb, parameter[self, rad]]: constant[ Get the Tb from the radiance using the Planck function and the central wavelength of the band rad: Radiance in SI units ] return[call[name[radiance2tb], parameter[name[rad], binary_operation[call[call[call[name[s...
keyword[def] identifier[radiance2tb] ( identifier[self] , identifier[rad] ): literal[string] keyword[return] identifier[radiance2tb] ( identifier[rad] , identifier[self] . identifier[rsr] [ identifier[self] . identifier[bandname] ][ identifier[self] . identifier[detector] ][ literal[string] ]* lit...
def radiance2tb(self, rad): """ Get the Tb from the radiance using the Planck function and the central wavelength of the band rad: Radiance in SI units """ return radiance2tb(rad, self.rsr[self.bandname][self.detector]['central_wavelength'] * 1e-06)
def refresh_decorations(self, force=False): """ Refresh decorations colors. This function is called by the syntax highlighter when the style changed so that we may update our decorations colors according to the new style. """ cursor = self.editor.textCursor() if (...
def function[refresh_decorations, parameter[self, force]]: constant[ Refresh decorations colors. This function is called by the syntax highlighter when the style changed so that we may update our decorations colors according to the new style. ] variable[cursor] assign[=] ...
keyword[def] identifier[refresh_decorations] ( identifier[self] , identifier[force] = keyword[False] ): literal[string] identifier[cursor] = identifier[self] . identifier[editor] . identifier[textCursor] () keyword[if] ( identifier[self] . identifier[_prev_cursor] keyword[is] keyword[Non...
def refresh_decorations(self, force=False): """ Refresh decorations colors. This function is called by the syntax highlighter when the style changed so that we may update our decorations colors according to the new style. """ cursor = self.editor.textCursor() if self._prev_cu...
def get_witness_for_key_prefix(db, node_hash, key): """ Get all witness given a keypath prefix. Include 1. witness along the keypath and 2. witness in the subtrie of the last node in keypath """ validate_is_bytes(key) return tuple(_get_witness_for_key_prefix(db, node_hash, encode_to_bi...
def function[get_witness_for_key_prefix, parameter[db, node_hash, key]]: constant[ Get all witness given a keypath prefix. Include 1. witness along the keypath and 2. witness in the subtrie of the last node in keypath ] call[name[validate_is_bytes], parameter[name[key]]] return[...
keyword[def] identifier[get_witness_for_key_prefix] ( identifier[db] , identifier[node_hash] , identifier[key] ): literal[string] identifier[validate_is_bytes] ( identifier[key] ) keyword[return] identifier[tuple] ( identifier[_get_witness_for_key_prefix] ( identifier[db] , identifier[node_hash] , i...
def get_witness_for_key_prefix(db, node_hash, key): """ Get all witness given a keypath prefix. Include 1. witness along the keypath and 2. witness in the subtrie of the last node in keypath """ validate_is_bytes(key) return tuple(_get_witness_for_key_prefix(db, node_hash, encode_to_bin...
def add_emission(self, chunksize=2**19, comp_filter=default_compression, overwrite=False, params=dict(), chunkslice='bytes'): """Add the `emission` array in '/trajectories'. """ nparams = self.numeric_params num_particles = nparams['np'] return self.add_traj...
def function[add_emission, parameter[self, chunksize, comp_filter, overwrite, params, chunkslice]]: constant[Add the `emission` array in '/trajectories'. ] variable[nparams] assign[=] name[self].numeric_params variable[num_particles] assign[=] call[name[nparams]][constant[np]] return...
keyword[def] identifier[add_emission] ( identifier[self] , identifier[chunksize] = literal[int] ** literal[int] , identifier[comp_filter] = identifier[default_compression] , identifier[overwrite] = keyword[False] , identifier[params] = identifier[dict] (), identifier[chunkslice] = literal[string] ): literal...
def add_emission(self, chunksize=2 ** 19, comp_filter=default_compression, overwrite=False, params=dict(), chunkslice='bytes'): """Add the `emission` array in '/trajectories'. """ nparams = self.numeric_params num_particles = nparams['np'] return self.add_trajectory('emission', shape=(num_partic...
def rgb2cmy(self, img, whitebg=False): """transforms image from RGB to CMY""" tmp = img*1.0 if whitebg: tmp = (1.0 - (img - img.min())/(img.max() - img.min())) out = tmp*0.0 out[:,:,0] = (tmp[:,:,1] + tmp[:,:,2])/2.0 out[:,:,1] = (tmp[:,:,0] + tmp[:,:,2])/2.0 ...
def function[rgb2cmy, parameter[self, img, whitebg]]: constant[transforms image from RGB to CMY] variable[tmp] assign[=] binary_operation[name[img] * constant[1.0]] if name[whitebg] begin[:] variable[tmp] assign[=] binary_operation[constant[1.0] - binary_operation[binary_operatio...
keyword[def] identifier[rgb2cmy] ( identifier[self] , identifier[img] , identifier[whitebg] = keyword[False] ): literal[string] identifier[tmp] = identifier[img] * literal[int] keyword[if] identifier[whitebg] : identifier[tmp] =( literal[int] -( identifier[img] - identifier[...
def rgb2cmy(self, img, whitebg=False): """transforms image from RGB to CMY""" tmp = img * 1.0 if whitebg: tmp = 1.0 - (img - img.min()) / (img.max() - img.min()) # depends on [control=['if'], data=[]] out = tmp * 0.0 out[:, :, 0] = (tmp[:, :, 1] + tmp[:, :, 2]) / 2.0 out[:, :, 1] = (tmp...
def clip(self, lower=0, upper=127): """ Clip the pianoroll by the given lower and upper bounds. Parameters ---------- lower : int or float The lower bound to clip the pianoroll. Defaults to 0. upper : int or float The upper bound to clip the piano...
def function[clip, parameter[self, lower, upper]]: constant[ Clip the pianoroll by the given lower and upper bounds. Parameters ---------- lower : int or float The lower bound to clip the pianoroll. Defaults to 0. upper : int or float The upper bo...
keyword[def] identifier[clip] ( identifier[self] , identifier[lower] = literal[int] , identifier[upper] = literal[int] ): literal[string] identifier[self] . identifier[pianoroll] = identifier[self] . identifier[pianoroll] . identifier[clip] ( identifier[lower] , identifier[upper] )
def clip(self, lower=0, upper=127): """ Clip the pianoroll by the given lower and upper bounds. Parameters ---------- lower : int or float The lower bound to clip the pianoroll. Defaults to 0. upper : int or float The upper bound to clip the pianoroll...
def _update_slider_length_horizontal(self): """ Measure the length of the slider and update the value of self._sliderlength. self.scale.identify(x, y) is used to find the first and last pixels of the slider. Indeed, self.scale.identify(x, y) returns the element of the ttk.Scale ...
def function[_update_slider_length_horizontal, parameter[self]]: constant[ Measure the length of the slider and update the value of self._sliderlength. self.scale.identify(x, y) is used to find the first and last pixels of the slider. Indeed, self.scale.identify(x, y) returns the elemen...
keyword[def] identifier[_update_slider_length_horizontal] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[scale] . identifier[identify] ( literal[int] , literal[int] ): identifier[self] . identi...
def _update_slider_length_horizontal(self): """ Measure the length of the slider and update the value of self._sliderlength. self.scale.identify(x, y) is used to find the first and last pixels of the slider. Indeed, self.scale.identify(x, y) returns the element of the ttk.Scale to w...
def get_composition_search_session_for_repository(self, repository_id, proxy): """Gets a composition search session for the given repository. arg: repository_id (osid.id.Id): the Id of the repository arg proxy (osid.proxy.Proxy): a proxy return: (osid.repository.CompositionSearch...
def function[get_composition_search_session_for_repository, parameter[self, repository_id, proxy]]: constant[Gets a composition search session for the given repository. arg: repository_id (osid.id.Id): the Id of the repository arg proxy (osid.proxy.Proxy): a proxy return: (osid.r...
keyword[def] identifier[get_composition_search_session_for_repository] ( identifier[self] , identifier[repository_id] , identifier[proxy] ): literal[string] keyword[if] identifier[repository_id] keyword[is] keyword[None] : keyword[raise] identifier[NullArgument] () keyword...
def get_composition_search_session_for_repository(self, repository_id, proxy): """Gets a composition search session for the given repository. arg: repository_id (osid.id.Id): the Id of the repository arg proxy (osid.proxy.Proxy): a proxy return: (osid.repository.CompositionSearchSess...
def eval_objfn(self): r"""Compute components of objective function as well as total contribution to objective function. Data fidelity term is :math:`(1/2) \| \mathbf{x} - \mathbf{s} \|_2^2` and regularisation term is :math:`\| D \mathbf{x} \|_2^2`. """ gvr = self.obfn_gv...
def function[eval_objfn, parameter[self]]: constant[Compute components of objective function as well as total contribution to objective function. Data fidelity term is :math:`(1/2) \| \mathbf{x} - \mathbf{s} \|_2^2` and regularisation term is :math:`\| D \mathbf{x} \|_2^2`. ] ...
keyword[def] identifier[eval_objfn] ( identifier[self] ): literal[string] identifier[gvr] = identifier[self] . identifier[obfn_gvar] () identifier[dfd] = identifier[np] . identifier[sum] ( identifier[np] . identifier[abs] ( identifier[self] . identifier[Wdf] * identifier[gvr] )) ...
def eval_objfn(self): """Compute components of objective function as well as total contribution to objective function. Data fidelity term is :math:`(1/2) \\| \\mathbf{x} - \\mathbf{s} \\|_2^2` and regularisation term is :math:`\\| D \\mathbf{x} \\|_2^2`. """ gvr = self.obfn_gvar(...
def dict_trim_by_values(self, lower=None, upper=None): """ Filter dictionary values to a given range (inclusive). Trimming is only performed on values which can be compared to the bound values. Fails on SArrays whose data type is not ``dict``. Parameters ---------- ...
def function[dict_trim_by_values, parameter[self, lower, upper]]: constant[ Filter dictionary values to a given range (inclusive). Trimming is only performed on values which can be compared to the bound values. Fails on SArrays whose data type is not ``dict``. Parameters ...
keyword[def] identifier[dict_trim_by_values] ( identifier[self] , identifier[lower] = keyword[None] , identifier[upper] = keyword[None] ): literal[string] keyword[if] keyword[not] ( identifier[lower] keyword[is] keyword[None] keyword[or] identifier[isinstance] ( identifier[lower] , identifier...
def dict_trim_by_values(self, lower=None, upper=None): """ Filter dictionary values to a given range (inclusive). Trimming is only performed on values which can be compared to the bound values. Fails on SArrays whose data type is not ``dict``. Parameters ---------- l...
def update(self, list_id, segment_id, data): """ Update a specific segment in a list. :param list_id: The unique id for the list. :type list_id: :py:class:`str` :param segment_id: The unique id for the segment. :type segment_id: :py:class:`str` :param data: The r...
def function[update, parameter[self, list_id, segment_id, data]]: constant[ Update a specific segment in a list. :param list_id: The unique id for the list. :type list_id: :py:class:`str` :param segment_id: The unique id for the segment. :type segment_id: :py:class:`str`...
keyword[def] identifier[update] ( identifier[self] , identifier[list_id] , identifier[segment_id] , identifier[data] ): literal[string] identifier[self] . identifier[list_id] = identifier[list_id] identifier[self] . identifier[segment_id] = identifier[segment_id] keyword[if] li...
def update(self, list_id, segment_id, data): """ Update a specific segment in a list. :param list_id: The unique id for the list. :type list_id: :py:class:`str` :param segment_id: The unique id for the segment. :type segment_id: :py:class:`str` :param data: The reque...
def set_inteface_up(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target inter...
def function[set_inteface_up, parameter[devid, ifindex]]: constant[ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int o...
keyword[def] identifier[set_inteface_up] ( identifier[devid] , identifier[ifindex] ): literal[string] keyword[if] identifier[auth] keyword[is] keyword[None] keyword[or] identifier[url] keyword[is] keyword[None] : identifier[set_imc_creds] () identifier[set_int_up_url] = literal[string]...
def set_inteface_up(devid, ifindex): """ function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec ified interface on the target device. :param devid: int or str value of the target device :param ifindex: int or str value of the target inter...
def get_plugins_of_type(self, plugin_class): """ Retrieve a list of plugins of desired class, KeyError raised otherwise """ logger.debug("Searching for plugins: %s", plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] i...
def function[get_plugins_of_type, parameter[self, plugin_class]]: constant[ Retrieve a list of plugins of desired class, KeyError raised otherwise ] call[name[logger].debug, parameter[constant[Searching for plugins: %s], name[plugin_class]]] variable[matches] assign[=] <ast.ListC...
keyword[def] identifier[get_plugins_of_type] ( identifier[self] , identifier[plugin_class] ): literal[string] identifier[logger] . identifier[debug] ( literal[string] , identifier[plugin_class] ) identifier[matches] =[ identifier[plugin] keyword[for] identifier[plugin] keyword[in] iden...
def get_plugins_of_type(self, plugin_class): """ Retrieve a list of plugins of desired class, KeyError raised otherwise """ logger.debug('Searching for plugins: %s', plugin_class) matches = [plugin for plugin in self.plugins.values() if isinstance(plugin, plugin_class)] if matches: ...
def pop(self, key, default=NotDefined): # type: (Hashable, Any) -> Any """ Pop the last item for a list on the dict. Afterwards the key is removed from the dict, so additional values are discarded: >>> d = MultiValueDict({"foo": [1, 2, 3]}) >>> d.pop("foo") 1 ...
def function[pop, parameter[self, key, default]]: constant[ Pop the last item for a list on the dict. Afterwards the key is removed from the dict, so additional values are discarded: >>> d = MultiValueDict({"foo": [1, 2, 3]}) >>> d.pop("foo") 1 >>> "foo" in d ...
keyword[def] identifier[pop] ( identifier[self] , identifier[key] , identifier[default] = identifier[NotDefined] ): literal[string] keyword[try] : keyword[return] identifier[dict] . identifier[pop] ( identifier[self] , identifier[key] )[- literal[int] ] keyword[except] iden...
def pop(self, key, default=NotDefined): # type: (Hashable, Any) -> Any '\n Pop the last item for a list on the dict. Afterwards the\n key is removed from the dict, so additional values are discarded:\n >>> d = MultiValueDict({"foo": [1, 2, 3]})\n >>> d.pop("foo")\n 1\n ...
def add_route(self, router, index=None): '''Add a new :class:`Router` to the :attr:`routes` list. ''' assert isinstance(router, Router), 'Not a valid Router' assert router is not self, 'cannot add self to children' for r in self.routes: if r == router: ...
def function[add_route, parameter[self, router, index]]: constant[Add a new :class:`Router` to the :attr:`routes` list. ] assert[call[name[isinstance], parameter[name[router], name[Router]]]] assert[compare[name[router] is_not name[self]]] for taget[name[r]] in starred[name[self].routes]...
keyword[def] identifier[add_route] ( identifier[self] , identifier[router] , identifier[index] = keyword[None] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[router] , identifier[Router] ), literal[string] keyword[assert] identifier[router] keyword[is] keyword[...
def add_route(self, router, index=None): """Add a new :class:`Router` to the :attr:`routes` list. """ assert isinstance(router, Router), 'Not a valid Router' assert router is not self, 'cannot add self to children' for r in self.routes: if r == router: return r # depends on ...
def memoizedproperty(func): """ Decorator to cause a method to cache it's results in self for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> class Foo (object): ... _x = 1 ... @memoiz...
def function[memoizedproperty, parameter[func]]: constant[ Decorator to cause a method to cache it's results in self for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> class Foo (object): ...
keyword[def] identifier[memoizedproperty] ( identifier[func] ): literal[string] identifier[inner_attname] = literal[string] % identifier[func] . identifier[__name__] keyword[def] identifier[new_fget] ( identifier[self] ): keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , ...
def memoizedproperty(func): """ Decorator to cause a method to cache it's results in self for each combination of inputs and return the cached result on subsequent calls. Does not support named arguments or arg values that are not hashable. >>> class Foo (object): ... _x = 1 ... @memoiz...
def _dataset_report( self, dataset, dataset_validation, dataset_index, catalog_fields, harvest='none', report=None, catalog_homepage=None ): """ Genera una línea del `catalog_report`, correspondiente a un dataset de los que conforman el catálogo analizado.""" # hace ...
def function[_dataset_report, parameter[self, dataset, dataset_validation, dataset_index, catalog_fields, harvest, report, catalog_homepage]]: constant[ Genera una línea del `catalog_report`, correspondiente a un dataset de los que conforman el catálogo analizado.] <ast.Tuple object at 0x7da1b04...
keyword[def] identifier[_dataset_report] ( identifier[self] , identifier[dataset] , identifier[dataset_validation] , identifier[dataset_index] , identifier[catalog_fields] , identifier[harvest] = literal[string] , identifier[report] = keyword[None] , identifier[catalog_homepage] = keyword[None] ): literal...
def _dataset_report(self, dataset, dataset_validation, dataset_index, catalog_fields, harvest='none', report=None, catalog_homepage=None): """ Genera una línea del `catalog_report`, correspondiente a un dataset de los que conforman el catálogo analizado.""" # hace un breve análisis de qa al dataset ...
def create(self, ontology=None,subject_category=None,object_category=None,evidence=None,taxon=None,relation=None, file=None, fmt=None, skim=True): """ creates an AssociationSet Currently, this uses an eager binding to a `ontobio.golr` instance. All compact associations for the particular combin...
def function[create, parameter[self, ontology, subject_category, object_category, evidence, taxon, relation, file, fmt, skim]]: constant[ creates an AssociationSet Currently, this uses an eager binding to a `ontobio.golr` instance. All compact associations for the particular combination ...
keyword[def] identifier[create] ( identifier[self] , identifier[ontology] = keyword[None] , identifier[subject_category] = keyword[None] , identifier[object_category] = keyword[None] , identifier[evidence] = keyword[None] , identifier[taxon] = keyword[None] , identifier[relation] = keyword[None] , identifier[file] = ...
def create(self, ontology=None, subject_category=None, object_category=None, evidence=None, taxon=None, relation=None, file=None, fmt=None, skim=True): """ creates an AssociationSet Currently, this uses an eager binding to a `ontobio.golr` instance. All compact associations for the particular combi...
def emit(self, record): """ Throws an error based on the information that the logger reported, given the logging level. :param record: <logging.LogRecord> """ if not logging.raiseExceptions: return logger = logging.getLogger(record.name...
def function[emit, parameter[self, record]]: constant[ Throws an error based on the information that the logger reported, given the logging level. :param record: <logging.LogRecord> ] if <ast.UnaryOp object at 0x7da1b28840d0> begin[:] return[None] ...
keyword[def] identifier[emit] ( identifier[self] , identifier[record] ): literal[string] keyword[if] keyword[not] identifier[logging] . identifier[raiseExceptions] : keyword[return] identifier[logger] = identifier[logging] . identifier[getLogger] ( identifier[record] . ide...
def emit(self, record): """ Throws an error based on the information that the logger reported, given the logging level. :param record: <logging.LogRecord> """ if not logging.raiseExceptions: return # depends on [control=['if'], data=[]] logger = loggin...
def exact_match(self): """Returns the symbol under the cursor looking both directions as part of a definition lookup for an exact match. """ #We don't have to worry about grouping or anything else fancy. Just #loop through forward and back until we hit a character that can't be ...
def function[exact_match, parameter[self]]: constant[Returns the symbol under the cursor looking both directions as part of a definition lookup for an exact match. ] if compare[name[self]._exact_match is constant[None]] begin[:] variable[i] assign[=] binary_operation[call...
keyword[def] identifier[exact_match] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_exact_match] keyword[is] keyword[None] : identifier[i] = identifier[self] . identifier[pos] [ literal[int] ]- literal[int] i...
def exact_match(self): """Returns the symbol under the cursor looking both directions as part of a definition lookup for an exact match. """ #We don't have to worry about grouping or anything else fancy. Just #loop through forward and back until we hit a character that can't be #part of ...
def get_all(self, qry, tpl): ''' get all rows for a query ''' self.cur.execute(qry, tpl) result = self.cur.fetchall() return result
def function[get_all, parameter[self, qry, tpl]]: constant[ get all rows for a query ] call[name[self].cur.execute, parameter[name[qry], name[tpl]]] variable[result] assign[=] call[name[self].cur.fetchall, parameter[]] return[name[result]]
keyword[def] identifier[get_all] ( identifier[self] , identifier[qry] , identifier[tpl] ): literal[string] identifier[self] . identifier[cur] . identifier[execute] ( identifier[qry] , identifier[tpl] ) identifier[result] = identifier[self] . identifier[cur] . identifier[fetchall] () ...
def get_all(self, qry, tpl): """ get all rows for a query """ self.cur.execute(qry, tpl) result = self.cur.fetchall() return result
def indent_width(self, value): """ Setter for **self.__indent_width** attribute. :param value: Attribute value. :type value: int """ if value is not None: assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format("indent_width", value) ...
def function[indent_width, parameter[self, value]]: constant[ Setter for **self.__indent_width** attribute. :param value: Attribute value. :type value: int ] if compare[name[value] is_not constant[None]] begin[:] assert[compare[call[name[type], parameter[name[val...
keyword[def] identifier[indent_width] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[assert] identifier[type] ( identifier[value] ) keyword[is] identifier[int] , literal[string] . identifie...
def indent_width(self, value): """ Setter for **self.__indent_width** attribute. :param value: Attribute value. :type value: int """ if value is not None: assert type(value) is int, "'{0}' attribute: '{1}' type is not 'int'!".format('indent_width', value) # depends on [...
def preconstrain_flag_page(self, magic_content): """ Preconstrain the data in the flag page. :param magic_content: The content of the magic page as a bytestring. """ for m, v in zip(magic_content, self.state.cgc.flag_bytes): self.preconstrain(m, v)
def function[preconstrain_flag_page, parameter[self, magic_content]]: constant[ Preconstrain the data in the flag page. :param magic_content: The content of the magic page as a bytestring. ] for taget[tuple[[<ast.Name object at 0x7da20c7ca050>, <ast.Name object at 0x7da20c7c9c...
keyword[def] identifier[preconstrain_flag_page] ( identifier[self] , identifier[magic_content] ): literal[string] keyword[for] identifier[m] , identifier[v] keyword[in] identifier[zip] ( identifier[magic_content] , identifier[self] . identifier[state] . identifier[cgc] . identifier[flag_bytes] )...
def preconstrain_flag_page(self, magic_content): """ Preconstrain the data in the flag page. :param magic_content: The content of the magic page as a bytestring. """ for (m, v) in zip(magic_content, self.state.cgc.flag_bytes): self.preconstrain(m, v) # depends on [control=['f...
def dump(self, stream): """Serialize self to text stream. Matches convention of mongooplog. """ items = ( ('time', self.time), ('inc', self.inc), ) # use ordered dict to retain order ts = collections.OrderedDict(items) json.dump(di...
def function[dump, parameter[self, stream]]: constant[Serialize self to text stream. Matches convention of mongooplog. ] variable[items] assign[=] tuple[[<ast.Tuple object at 0x7da1b24049a0>, <ast.Tuple object at 0x7da1b24063b0>]] variable[ts] assign[=] call[name[collections].Or...
keyword[def] identifier[dump] ( identifier[self] , identifier[stream] ): literal[string] identifier[items] =( ( literal[string] , identifier[self] . identifier[time] ), ( literal[string] , identifier[self] . identifier[inc] ), ) identifier[ts] = identifier[...
def dump(self, stream): """Serialize self to text stream. Matches convention of mongooplog. """ items = (('time', self.time), ('inc', self.inc)) # use ordered dict to retain order ts = collections.OrderedDict(items) json.dump(dict(ts=ts), stream)
def _wait_for_response(self): """ Wait until the user accepted or rejected the request """ while not self.server.response_code: time.sleep(2) time.sleep(5) self.server.shutdown()
def function[_wait_for_response, parameter[self]]: constant[ Wait until the user accepted or rejected the request ] while <ast.UnaryOp object at 0x7da1b0328340> begin[:] call[name[time].sleep, parameter[constant[2]]] call[name[time].sleep, parameter[constant[5]]] call...
keyword[def] identifier[_wait_for_response] ( identifier[self] ): literal[string] keyword[while] keyword[not] identifier[self] . identifier[server] . identifier[response_code] : identifier[time] . identifier[sleep] ( literal[int] ) identifier[time] . identifier[sleep] ( literal[int] ) identifier[se...
def _wait_for_response(self): """ Wait until the user accepted or rejected the request """ while not self.server.response_code: time.sleep(2) # depends on [control=['while'], data=[]] time.sleep(5) self.server.shutdown()
def __driver_stub(self, text, state): """Display help messages or invoke the proper completer. The interface of helper methods and completer methods are documented in the helper() decorator method and the completer() decorator method, respectively. Arguments: text: ...
def function[__driver_stub, parameter[self, text, state]]: constant[Display help messages or invoke the proper completer. The interface of helper methods and completer methods are documented in the helper() decorator method and the completer() decorator method, respectively. Ar...
keyword[def] identifier[__driver_stub] ( identifier[self] , identifier[text] , identifier[state] ): literal[string] identifier[origline] = identifier[readline] . identifier[get_line_buffer] () identifier[line] = identifier[origline] . identifier[lstrip] () keyword[if] identifier[...
def __driver_stub(self, text, state): """Display help messages or invoke the proper completer. The interface of helper methods and completer methods are documented in the helper() decorator method and the completer() decorator method, respectively. Arguments: text: A st...
def fullversion(): ''' Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ''' ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
def function[fullversion, parameter[]]: constant[ Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion ] variable[ret] assign[=] dictionary[[], []] variable[cmd] assign[=] constant[lvm version] variable[out] assign...
keyword[def] identifier[fullversion] (): literal[string] identifier[ret] ={} identifier[cmd] = literal[string] identifier[out] = identifier[__salt__] [ literal[string] ]( identifier[cmd] ). identifier[splitlines] () keyword[for] identifier[line] keyword[in] identifier[out] : ide...
def fullversion(): """ Return all version info from lvm version CLI Example: .. code-block:: bash salt '*' lvm.fullversion """ ret = {} cmd = 'lvm version' out = __salt__['cmd.run'](cmd).splitlines() for line in out: comps = line.split(':') ret[comps[0].str...
def crypto_secretstream_xchacha20poly1305_push( state, m, ad=None, tag=crypto_secretstream_xchacha20poly1305_TAG_MESSAGE, ): """ Add an encrypted message to the secret stream. :param state: a secretstream state object :type state: crypto_secretstream_xchacha20poly1305_state :param m...
def function[crypto_secretstream_xchacha20poly1305_push, parameter[state, m, ad, tag]]: constant[ Add an encrypted message to the secret stream. :param state: a secretstream state object :type state: crypto_secretstream_xchacha20poly1305_state :param m: the message to encrypt, the maximum lengt...
keyword[def] identifier[crypto_secretstream_xchacha20poly1305_push] ( identifier[state] , identifier[m] , identifier[ad] = keyword[None] , identifier[tag] = identifier[crypto_secretstream_xchacha20poly1305_TAG_MESSAGE] , ): literal[string] identifier[ensure] ( identifier[isinstance] ( identifier[s...
def crypto_secretstream_xchacha20poly1305_push(state, m, ad=None, tag=crypto_secretstream_xchacha20poly1305_TAG_MESSAGE): """ Add an encrypted message to the secret stream. :param state: a secretstream state object :type state: crypto_secretstream_xchacha20poly1305_state :param m: the message to en...
def get_signature(self, signature): """Retrieve one signature, discriminated by name or id. Note that signature name is not case sensitive. :param: a zobjects.Signature describing the signature like "Signature(name='my-sig')" :returns: a zobjects.Signature object, fille...
def function[get_signature, parameter[self, signature]]: constant[Retrieve one signature, discriminated by name or id. Note that signature name is not case sensitive. :param: a zobjects.Signature describing the signature like "Signature(name='my-sig')" :returns: a zobje...
keyword[def] identifier[get_signature] ( identifier[self] , identifier[signature] ): literal[string] identifier[resp] = identifier[self] . identifier[request_list] ( literal[string] ) keyword[if] identifier[resp] keyword[and] ( identifier[len] ( identifier[resp] )> lit...
def get_signature(self, signature): """Retrieve one signature, discriminated by name or id. Note that signature name is not case sensitive. :param: a zobjects.Signature describing the signature like "Signature(name='my-sig')" :returns: a zobjects.Signature object, filled wi...
def adjust_jobs_priority(self, high_value_jobs, priority=1): """For every job priority determine if we need to increase or decrease the job priority Currently, high value jobs have a priority of 1 and a timeout of 0. """ # Only job priorities that don't have an expiration date (2 weeks ...
def function[adjust_jobs_priority, parameter[self, high_value_jobs, priority]]: constant[For every job priority determine if we need to increase or decrease the job priority Currently, high value jobs have a priority of 1 and a timeout of 0. ] for taget[name[jp]] in starred[call[name[Jo...
keyword[def] identifier[adjust_jobs_priority] ( identifier[self] , identifier[high_value_jobs] , identifier[priority] = literal[int] ): literal[string] keyword[for] identifier[jp] keyword[in] identifier[JobPriority] . identifier[objects] . identifier[filter] ( identifier[expira...
def adjust_jobs_priority(self, high_value_jobs, priority=1): """For every job priority determine if we need to increase or decrease the job priority Currently, high value jobs have a priority of 1 and a timeout of 0. """ # Only job priorities that don't have an expiration date (2 weeks for new ...
def buildpack(self, url): """Add a buildpack by URL.""" cmd = ["heroku", "buildpacks:add", url, "--app", self.name] self._run(cmd)
def function[buildpack, parameter[self, url]]: constant[Add a buildpack by URL.] variable[cmd] assign[=] list[[<ast.Constant object at 0x7da18ede6b00>, <ast.Constant object at 0x7da18ede6860>, <ast.Name object at 0x7da18ede7520>, <ast.Constant object at 0x7da18ede57e0>, <ast.Attribute object at 0x7da18e...
keyword[def] identifier[buildpack] ( identifier[self] , identifier[url] ): literal[string] identifier[cmd] =[ literal[string] , literal[string] , identifier[url] , literal[string] , identifier[self] . identifier[name] ] identifier[self] . identifier[_run] ( identifier[cmd] )
def buildpack(self, url): """Add a buildpack by URL.""" cmd = ['heroku', 'buildpacks:add', url, '--app', self.name] self._run(cmd)
def list_nodes_min(location=None, call=None): ''' Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs. ''' if call == 'action': raise SaltCloudSystemExit( ...
def function[list_nodes_min, parameter[location, call]]: constant[ Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs. ] if compare[name[call] equal[==] const...
keyword[def] identifier[list_nodes_min] ( identifier[location] = keyword[None] , identifier[call] = keyword[None] ): literal[string] keyword[if] identifier[call] == literal[string] : keyword[raise] identifier[SaltCloudSystemExit] ( literal[string] ) identifier[ret] ={} ...
def list_nodes_min(location=None, call=None): """ Return a list of the VMs that are on the provider. Only a list of VM names, and their state, is returned. This is the minimum amount of information needed to check for existing VMs. """ if call == 'action': raise SaltCloudSystemExit('The ...
def search_uris( self, uri, threat_types, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ This method is used to check whether a URI is on a given threatList. Example: ...
def function[search_uris, parameter[self, uri, threat_types, retry, timeout, metadata]]: constant[ This method is used to check whether a URI is on a given threatList. Example: >>> from google.cloud import webrisk_v1beta1 >>> from google.cloud.webrisk_v1beta1 import enum...
keyword[def] identifier[search_uris] ( identifier[self] , identifier[uri] , identifier[threat_types] , identifier[retry] = identifier[google] . identifier[api_core] . identifier[gapic_v1] . identifier[method] . identifier[DEFAULT] , identifier[timeout] = identifier[google] . identifier[api_core] . identifier[gap...
def search_uris(self, uri, threat_types, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None): """ This method is used to check whether a URI is on a given threatList. Example: >>> from google.cloud import webrisk_v1beta1 ...
def CrearPlantillaPDF(self, papel="A4", orientacion="portrait"): "Iniciar la creación del archivo PDF" # genero el renderizador con propiedades del PDF t = Template( format=papel, orientation=orientacion, title="F 1116 B/C %s" % (self.NroOrden), ...
def function[CrearPlantillaPDF, parameter[self, papel, orientacion]]: constant[Iniciar la creación del archivo PDF] variable[t] assign[=] call[name[Template], parameter[]] name[self].template assign[=] name[t] return[constant[True]]
keyword[def] identifier[CrearPlantillaPDF] ( identifier[self] , identifier[papel] = literal[string] , identifier[orientacion] = literal[string] ): literal[string] identifier[t] = identifier[Template] ( identifier[format] = identifier[papel] , identifier[orientation] = identifier[...
def CrearPlantillaPDF(self, papel='A4', orientacion='portrait'): """Iniciar la creación del archivo PDF""" # genero el renderizador con propiedades del PDF t = Template(format=papel, orientation=orientacion, title='F 1116 B/C %s' % self.NroOrden, author='CUIT %s' % self.Cuit, subject='COE %s' % self.params_...
def addPositionToGraph( self, reference_id, position, position_types=None, strand=None): """ Add the positional information to the graph, following the faldo model. We assume that if the strand is None, we give it a generic "Position" only. Triples: my_positio...
def function[addPositionToGraph, parameter[self, reference_id, position, position_types, strand]]: constant[ Add the positional information to the graph, following the faldo model. We assume that if the strand is None, we give it a generic "Position" only. Triples: my_pos...
keyword[def] identifier[addPositionToGraph] ( identifier[self] , identifier[reference_id] , identifier[position] , identifier[position_types] = keyword[None] , identifier[strand] = keyword[None] ): literal[string] identifier[pos_id] = identifier[self] . identifier[_makePositionId] ( identifier[ref...
def addPositionToGraph(self, reference_id, position, position_types=None, strand=None): """ Add the positional information to the graph, following the faldo model. We assume that if the strand is None, we give it a generic "Position" only. Triples: my_position a (any of: fald...
def create_object(self, text): ''' Allow creation of transaction parties using a full name string. ''' if self.create_field == 'name': if text.startswith('Location_'): this_id = text[len('Location_'):] this_loc = Location.objects.get(id=this_id) ...
def function[create_object, parameter[self, text]]: constant[ Allow creation of transaction parties using a full name string. ] if compare[name[self].create_field equal[==] constant[name]] begin[:] if call[name[text].startswith, parameter[constant[Location_]]] begin[:] ...
keyword[def] identifier[create_object] ( identifier[self] , identifier[text] ): literal[string] keyword[if] identifier[self] . identifier[create_field] == literal[string] : keyword[if] identifier[text] . identifier[startswith] ( literal[string] ): identifier[th...
def create_object(self, text): """ Allow creation of transaction parties using a full name string. """ if self.create_field == 'name': if text.startswith('Location_'): this_id = text[len('Location_'):] this_loc = Location.objects.get(id=this_id) return self.get_querys...
def get_array(self, rowBased=True): """Return a two dimensional list with the values of the :py:obj:`self`. :param boolean rowBased: Indicates wether the returned list should be row or column based. Has to be True if list[i] should be the i'th row, False if list[i] should be the...
def function[get_array, parameter[self, rowBased]]: constant[Return a two dimensional list with the values of the :py:obj:`self`. :param boolean rowBased: Indicates wether the returned list should be row or column based. Has to be True if list[i] should be the i'th row, False if...
keyword[def] identifier[get_array] ( identifier[self] , identifier[rowBased] = keyword[True] ): literal[string] keyword[if] identifier[rowBased] : identifier[array] =[] keyword[for] identifier[row] keyword[in] identifier[xrange] ( identifier[self] . identifier[_rows] )...
def get_array(self, rowBased=True): """Return a two dimensional list with the values of the :py:obj:`self`. :param boolean rowBased: Indicates wether the returned list should be row or column based. Has to be True if list[i] should be the i'th row, False if list[i] should be the i't...
def strip_fit(self, **kwargs): """Strip water and fit to the remaining system. First runs :meth:`strip_water` and then :meth:`fit`; see there for arguments. - *strip_input* is used for :meth:`strip_water` (but is only useful in special cases, e.g. when there is no Protein gro...
def function[strip_fit, parameter[self]]: constant[Strip water and fit to the remaining system. First runs :meth:`strip_water` and then :meth:`fit`; see there for arguments. - *strip_input* is used for :meth:`strip_water` (but is only useful in special cases, e.g. when there ...
keyword[def] identifier[strip_fit] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[kwargs] . identifier[setdefault] ( literal[string] , literal[string] ) identifier[kw_fit] ={} keyword[for] identifier[k] keyword[in] ( literal[string] , literal[string] , l...
def strip_fit(self, **kwargs): """Strip water and fit to the remaining system. First runs :meth:`strip_water` and then :meth:`fit`; see there for arguments. - *strip_input* is used for :meth:`strip_water` (but is only useful in special cases, e.g. when there is no Protein group d...
def group_exists(self, group_name): """Checks a group via provisioning API. If you get back an error 999, then the provisioning API is not enabled. :param group_name: name of group to be checked :returns: True if group exists :raises: HTTPResponseError in case an HTTP error sta...
def function[group_exists, parameter[self, group_name]]: constant[Checks a group via provisioning API. If you get back an error 999, then the provisioning API is not enabled. :param group_name: name of group to be checked :returns: True if group exists :raises: HTTPResponseErro...
keyword[def] identifier[group_exists] ( identifier[self] , identifier[group_name] ): literal[string] identifier[res] = identifier[self] . identifier[_make_ocs_request] ( literal[string] , identifier[self] . identifier[OCS_SERVICE_CLOUD] , literal[string] + identifier[grou...
def group_exists(self, group_name): """Checks a group via provisioning API. If you get back an error 999, then the provisioning API is not enabled. :param group_name: name of group to be checked :returns: True if group exists :raises: HTTPResponseError in case an HTTP error status ...
def memoize(func=None, maxlen=None): """Cache a function's return value each time it is called. This function serves as a function decorator to provide a caching of evaluated fitness values. If called later with the same arguments, the cached value is returned instead of being re-evaluated. ...
def function[memoize, parameter[func, maxlen]]: constant[Cache a function's return value each time it is called. This function serves as a function decorator to provide a caching of evaluated fitness values. If called later with the same arguments, the cached value is returned instead of being...
keyword[def] identifier[memoize] ( identifier[func] = keyword[None] , identifier[maxlen] = keyword[None] ): literal[string] keyword[if] identifier[func] keyword[is] keyword[not] keyword[None] : identifier[cache] = identifier[BoundedOrderedDict] ( identifier[maxlen] = identifier[maxlen] ) ...
def memoize(func=None, maxlen=None): """Cache a function's return value each time it is called. This function serves as a function decorator to provide a caching of evaluated fitness values. If called later with the same arguments, the cached value is returned instead of being re-evaluated. ...
def _follow_link(self, link_path_components, link): """Follow a link w.r.t. a path resolved so far. The component is either a real file, which is a no-op, or a symlink. In the case of a symlink, we have to modify the path as built up so far /a/b => ../c should yield /a/../c (...
def function[_follow_link, parameter[self, link_path_components, link]]: constant[Follow a link w.r.t. a path resolved so far. The component is either a real file, which is a no-op, or a symlink. In the case of a symlink, we have to modify the path as built up so far /a/b => ....
keyword[def] identifier[_follow_link] ( identifier[self] , identifier[link_path_components] , identifier[link] ): literal[string] identifier[link_path] = identifier[link] . identifier[contents] identifier[sep] = identifier[self] . identifier[_path_separator] ( identifier[link_path] ) ...
def _follow_link(self, link_path_components, link): """Follow a link w.r.t. a path resolved so far. The component is either a real file, which is a no-op, or a symlink. In the case of a symlink, we have to modify the path as built up so far /a/b => ../c should yield /a/../c (whic...
def _deliver_errored_events(errstream, recs): """Deliver errors to error stream.""" rlogger.info("Going to handle %s failed events", len(recs)) rlogger.info( "First failed event: %s", json.dumps(recs[0], indent=4)) kinesis_stream = errstream.get("kinesis_stream") randomkey = str(uuid.uuid4(...
def function[_deliver_errored_events, parameter[errstream, recs]]: constant[Deliver errors to error stream.] call[name[rlogger].info, parameter[constant[Going to handle %s failed events], call[name[len], parameter[name[recs]]]]] call[name[rlogger].info, parameter[constant[First failed event: %s]...
keyword[def] identifier[_deliver_errored_events] ( identifier[errstream] , identifier[recs] ): literal[string] identifier[rlogger] . identifier[info] ( literal[string] , identifier[len] ( identifier[recs] )) identifier[rlogger] . identifier[info] ( literal[string] , identifier[json] . identifier[...
def _deliver_errored_events(errstream, recs): """Deliver errors to error stream.""" rlogger.info('Going to handle %s failed events', len(recs)) rlogger.info('First failed event: %s', json.dumps(recs[0], indent=4)) kinesis_stream = errstream.get('kinesis_stream') randomkey = str(uuid.uuid4()) if ...
def _expand_placeholder_value(value): """ Return the SQL string representation of the specified placeholder's value. @param value: the value of a placeholder such as a simple element, a list, or a tuple of one string. @note: by convention, a tuple of one string in...
def function[_expand_placeholder_value, parameter[value]]: constant[ Return the SQL string representation of the specified placeholder's value. @param value: the value of a placeholder such as a simple element, a list, or a tuple of one string. @note: by conventio...
keyword[def] identifier[_expand_placeholder_value] ( identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] ,( identifier[list] , identifier[set] )) keyword[or] ( identifier[isinstance] ( identifier[value] , identifier[tuple] ) keyword[and] identifier[len] ( i...
def _expand_placeholder_value(value): """ Return the SQL string representation of the specified placeholder's value. @param value: the value of a placeholder such as a simple element, a list, or a tuple of one string. @note: by convention, a tuple of one string indica...
def _cached_pages(self, target_page=-1): """ Get a page or all pages from page generator, caching results. This is necessary because PDFMiner searches recursively for pages, so we won't know how many there are until we parse the whole document, which we don't want to do unti...
def function[_cached_pages, parameter[self, target_page]]: constant[ Get a page or all pages from page generator, caching results. This is necessary because PDFMiner searches recursively for pages, so we won't know how many there are until we parse the whole document, which we do...
keyword[def] identifier[_cached_pages] ( identifier[self] , identifier[target_page] =- literal[int] ): literal[string] keyword[try] : identifier[self] . identifier[_pages_iter] = identifier[self] . identifier[_pages_iter] keyword[or] identifier[self] . identifier[doc] . ...
def _cached_pages(self, target_page=-1): """ Get a page or all pages from page generator, caching results. This is necessary because PDFMiner searches recursively for pages, so we won't know how many there are until we parse the whole document, which we don't want to do until we need...
def registerCategory(category): """ Register a given category in the debug system. A level will be assigned to it based on previous calls to setDebug. """ # parse what level it is set to based on _DEBUG # example: *:2,admin:4 global _DEBUG global _levels global _categories level...
def function[registerCategory, parameter[category]]: constant[ Register a given category in the debug system. A level will be assigned to it based on previous calls to setDebug. ] <ast.Global object at 0x7da1b0a48e20> <ast.Global object at 0x7da1b0a4ad40> <ast.Global object at 0x7da1b0a4...
keyword[def] identifier[registerCategory] ( identifier[category] ): literal[string] keyword[global] identifier[_DEBUG] keyword[global] identifier[_levels] keyword[global] identifier[_categories] identifier[level] = literal[int] identifier[chunks] = identifier[_DEBUG] ....
def registerCategory(category): """ Register a given category in the debug system. A level will be assigned to it based on previous calls to setDebug. """ # parse what level it is set to based on _DEBUG # example: *:2,admin:4 global _DEBUG global _levels global _categories level ...
def write(self, text: str): """ Prints text to the screen. Supports colors by using the color constants. To use colors, add the color before the text you want to print. :param text: The text to print. """ # Default color is NORMAL. last_color = (self._DAR...
def function[write, parameter[self, text]]: constant[ Prints text to the screen. Supports colors by using the color constants. To use colors, add the color before the text you want to print. :param text: The text to print. ] variable[last_color] assign[=] tuple[[...
keyword[def] identifier[write] ( identifier[self] , identifier[text] : identifier[str] ): literal[string] identifier[last_color] =( identifier[self] . identifier[_DARK_CODE] , literal[int] ) identifier[original_lines] = identifier[text] . identifier[splitlines] (...
def write(self, text: str): """ Prints text to the screen. Supports colors by using the color constants. To use colors, add the color before the text you want to print. :param text: The text to print. """ # Default color is NORMAL. last_color = (self._DARK_CODE, 0) ...
def action(args): """ Show information about reference packages. """ log.info('loading reference package') pkg = refpkg.Refpkg(args.refpkg, create=False) with open(pkg.file_abspath('seq_info'), 'rU') as seq_info: seqinfo = list(csv.DictReader(seq_info)) snames = [row['seqname']...
def function[action, parameter[args]]: constant[ Show information about reference packages. ] call[name[log].info, parameter[constant[loading reference package]]] variable[pkg] assign[=] call[name[refpkg].Refpkg, parameter[name[args].refpkg]] with call[name[open], parameter[call[...
keyword[def] identifier[action] ( identifier[args] ): literal[string] identifier[log] . identifier[info] ( literal[string] ) identifier[pkg] = identifier[refpkg] . identifier[Refpkg] ( identifier[args] . identifier[refpkg] , identifier[create] = keyword[False] ) keyword[with] identifier[open] ...
def action(args): """ Show information about reference packages. """ log.info('loading reference package') pkg = refpkg.Refpkg(args.refpkg, create=False) with open(pkg.file_abspath('seq_info'), 'rU') as seq_info: seqinfo = list(csv.DictReader(seq_info)) snames = [row['seqname'] f...
def handle_markdown(value): md = markdown( value, extensions=[ 'markdown.extensions.fenced_code', 'codehilite', ] ) """ For some unknown reason markdown wraps the value in <p> tags. Currently there doesn't seem to be an extension to turn this off. ...
def function[handle_markdown, parameter[value]]: variable[md] assign[=] call[name[markdown], parameter[name[value]]] constant[ For some unknown reason markdown wraps the value in <p> tags. Currently there doesn't seem to be an extension to turn this off. ] variable[open_tag] assign[=...
keyword[def] identifier[handle_markdown] ( identifier[value] ): identifier[md] = identifier[markdown] ( identifier[value] , identifier[extensions] =[ literal[string] , literal[string] , ] ) literal[string] identifier[open_tag] = literal[string] identifier[close_tag] =...
def handle_markdown(value): md = markdown(value, extensions=['markdown.extensions.fenced_code', 'codehilite']) " For some unknown reason markdown wraps the value in <p> tags.\n Currently there doesn't seem to be an extension to turn this off.\n " open_tag = '<p>' close_tag = '</p>' if md.s...
def gaussian_gradient_magnitude(image, sigma = 5, voxelspacing = None, mask = slice(None)): r""" Computes the gradient magnitude (edge-detection) of the supplied image using gaussian derivates and returns the intensity values. Optionally a binary mask can be supplied to select the voxels for which ...
def function[gaussian_gradient_magnitude, parameter[image, sigma, voxelspacing, mask]]: constant[ Computes the gradient magnitude (edge-detection) of the supplied image using gaussian derivates and returns the intensity values. Optionally a binary mask can be supplied to select the voxels for w...
keyword[def] identifier[gaussian_gradient_magnitude] ( identifier[image] , identifier[sigma] = literal[int] , identifier[voxelspacing] = keyword[None] , identifier[mask] = identifier[slice] ( keyword[None] )): literal[string] keyword[return] identifier[_extract_feature] ( identifier[_extract_gaussian_grad...
def gaussian_gradient_magnitude(image, sigma=5, voxelspacing=None, mask=slice(None)): """ Computes the gradient magnitude (edge-detection) of the supplied image using gaussian derivates and returns the intensity values. Optionally a binary mask can be supplied to select the voxels for which the fea...
def stop_artifact_creation(self, id_or_uri, task_uri): """ Stops creation of the selected Artifact Bundle. Args: id_or_uri: ID or URI of the Artifact Bundle. task_uri: Task URI associated with the Artifact Bundle. Returns: string: """ ...
def function[stop_artifact_creation, parameter[self, id_or_uri, task_uri]]: constant[ Stops creation of the selected Artifact Bundle. Args: id_or_uri: ID or URI of the Artifact Bundle. task_uri: Task URI associated with the Artifact Bundle. Returns: ...
keyword[def] identifier[stop_artifact_creation] ( identifier[self] , identifier[id_or_uri] , identifier[task_uri] ): literal[string] identifier[data] ={ literal[string] : identifier[task_uri] } identifier[uri] = identifier[self] . identifier[URI] + literal[string] + iden...
def stop_artifact_creation(self, id_or_uri, task_uri): """ Stops creation of the selected Artifact Bundle. Args: id_or_uri: ID or URI of the Artifact Bundle. task_uri: Task URI associated with the Artifact Bundle. Returns: string: """ data = ...
def set_variable(self, key, value, per_reference=False, access_key=None, data_type=None): """Sets a global variable :param key: the key of the global variable to be set :param value: the new value of the global variable :param per_reference: a flag to decide if the variable should be st...
def function[set_variable, parameter[self, key, value, per_reference, access_key, data_type]]: constant[Sets a global variable :param key: the key of the global variable to be set :param value: the new value of the global variable :param per_reference: a flag to decide if the variable s...
keyword[def] identifier[set_variable] ( identifier[self] , identifier[key] , identifier[value] , identifier[per_reference] = keyword[False] , identifier[access_key] = keyword[None] , identifier[data_type] = keyword[None] ): literal[string] identifier[key] = identifier[str] ( identifier[key] ) ...
def set_variable(self, key, value, per_reference=False, access_key=None, data_type=None): """Sets a global variable :param key: the key of the global variable to be set :param value: the new value of the global variable :param per_reference: a flag to decide if the variable should be stored...
def get_element_tail(parent_to_parse, element_path=None, default_value=u''): """ :return: text following the parsed parent element if it exists, otherwise the default value. :see: get_element(parent_to_parse, element_path) """ parent_element = get_element(parent_to_parse, element_path) if ...
def function[get_element_tail, parameter[parent_to_parse, element_path, default_value]]: constant[ :return: text following the parsed parent element if it exists, otherwise the default value. :see: get_element(parent_to_parse, element_path) ] variable[parent_element] assign[=] call[name[...
keyword[def] identifier[get_element_tail] ( identifier[parent_to_parse] , identifier[element_path] = keyword[None] , identifier[default_value] = literal[string] ): literal[string] identifier[parent_element] = identifier[get_element] ( identifier[parent_to_parse] , identifier[element_path] ) keyword[...
def get_element_tail(parent_to_parse, element_path=None, default_value=u''): """ :return: text following the parsed parent element if it exists, otherwise the default value. :see: get_element(parent_to_parse, element_path) """ parent_element = get_element(parent_to_parse, element_path) if pa...
def add_function(self, function_id=None, function=None, inputs=None, outputs=None, input_domain=None, weight=None, inp_weight=None, out_weight=None, description=None, filters=None, await_domain=None, await_result=None, **kwargs): ...
def function[add_function, parameter[self, function_id, function, inputs, outputs, input_domain, weight, inp_weight, out_weight, description, filters, await_domain, await_result]]: constant[ Add a single function node to dispatcher. :param function_id: Function node id. ...
keyword[def] identifier[add_function] ( identifier[self] , identifier[function_id] = keyword[None] , identifier[function] = keyword[None] , identifier[inputs] = keyword[None] , identifier[outputs] = keyword[None] , identifier[input_domain] = keyword[None] , identifier[weight] = keyword[None] , identifier[inp_weight...
def add_function(self, function_id=None, function=None, inputs=None, outputs=None, input_domain=None, weight=None, inp_weight=None, out_weight=None, description=None, filters=None, await_domain=None, await_result=None, **kwargs): """ Add a single function node to dispatcher. :param function_id: ...
def _parse_remote_model(self, context): """ parse the remote resource model and adds its full name :type context: models.QualiDriverModels.ResourceRemoteCommandContext """ if not context.remote_endpoints: raise Exception('no remote resources found in context: {0}', j...
def function[_parse_remote_model, parameter[self, context]]: constant[ parse the remote resource model and adds its full name :type context: models.QualiDriverModels.ResourceRemoteCommandContext ] if <ast.UnaryOp object at 0x7da18dc99180> begin[:] <ast.Raise object at 0x...
keyword[def] identifier[_parse_remote_model] ( identifier[self] , identifier[context] ): literal[string] keyword[if] keyword[not] identifier[context] . identifier[remote_endpoints] : keyword[raise] identifier[Exception] ( literal[string] , identifier[jsonpickle] . identifier[encode]...
def _parse_remote_model(self, context): """ parse the remote resource model and adds its full name :type context: models.QualiDriverModels.ResourceRemoteCommandContext """ if not context.remote_endpoints: raise Exception('no remote resources found in context: {0}', jsonpickle.en...
def _srcRect_x(self, attr_name): """ Value of `p:blipFill/a:srcRect/@{attr_name}` or 0.0 if not present. """ srcRect = self.blipFill.srcRect if srcRect is None: return 0.0 return getattr(srcRect, attr_name)
def function[_srcRect_x, parameter[self, attr_name]]: constant[ Value of `p:blipFill/a:srcRect/@{attr_name}` or 0.0 if not present. ] variable[srcRect] assign[=] name[self].blipFill.srcRect if compare[name[srcRect] is constant[None]] begin[:] return[constant[0.0]] ret...
keyword[def] identifier[_srcRect_x] ( identifier[self] , identifier[attr_name] ): literal[string] identifier[srcRect] = identifier[self] . identifier[blipFill] . identifier[srcRect] keyword[if] identifier[srcRect] keyword[is] keyword[None] : keyword[return] literal[int] ...
def _srcRect_x(self, attr_name): """ Value of `p:blipFill/a:srcRect/@{attr_name}` or 0.0 if not present. """ srcRect = self.blipFill.srcRect if srcRect is None: return 0.0 # depends on [control=['if'], data=[]] return getattr(srcRect, attr_name)
def OnPreferences(self, event): """Preferences event handler that launches preferences dialog""" preferences = self.interfaces.get_preferences_from_user() if preferences: for key in preferences: if type(config[key]) in (type(u""), type("")): conf...
def function[OnPreferences, parameter[self, event]]: constant[Preferences event handler that launches preferences dialog] variable[preferences] assign[=] call[name[self].interfaces.get_preferences_from_user, parameter[]] if name[preferences] begin[:] for taget[name[key]] in starr...
keyword[def] identifier[OnPreferences] ( identifier[self] , identifier[event] ): literal[string] identifier[preferences] = identifier[self] . identifier[interfaces] . identifier[get_preferences_from_user] () keyword[if] identifier[preferences] : keyword[for] identifier[key...
def OnPreferences(self, event): """Preferences event handler that launches preferences dialog""" preferences = self.interfaces.get_preferences_from_user() if preferences: for key in preferences: if type(config[key]) in (type(u''), type('')): config[key] = preferences[key]...
def cmd_extract_email(infile, verbose, jsonout): """Extract email addresses from a file or stdin. Example: \b $ cat /var/log/auth.log | habu.extract.email john@securetia.com raven@acmecorp.net nmarks@fimax.com """ if verbose: logging.basicConfig(level=logging.INFO, format=...
def function[cmd_extract_email, parameter[infile, verbose, jsonout]]: constant[Extract email addresses from a file or stdin. Example:  $ cat /var/log/auth.log | habu.extract.email john@securetia.com raven@acmecorp.net nmarks@fimax.com ] if name[verbose] begin[:] ...
keyword[def] identifier[cmd_extract_email] ( identifier[infile] , identifier[verbose] , identifier[jsonout] ): literal[string] keyword[if] identifier[verbose] : identifier[logging] . identifier[basicConfig] ( identifier[level] = identifier[logging] . identifier[INFO] , identifier[format] = liter...
def cmd_extract_email(infile, verbose, jsonout): """Extract email addresses from a file or stdin. Example: \x08 $ cat /var/log/auth.log | habu.extract.email john@securetia.com raven@acmecorp.net nmarks@fimax.com """ if verbose: logging.basicConfig(level=logging.INFO, format...
def light_bahdanau_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args: key: A tensorfl...
def function[light_bahdanau_attention, parameter[key, context, hidden_size, projected_align]]: constant[ It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args...
keyword[def] identifier[light_bahdanau_attention] ( identifier[key] , identifier[context] , identifier[hidden_size] , identifier[projected_align] = keyword[False] ): literal[string] identifier[batch_size] = identifier[tf] . identifier[shape] ( identifier[context] )[ literal[int] ] identifier[max_num_t...
def light_bahdanau_attention(key, context, hidden_size, projected_align=False): """ It is a implementation of the Bahdanau et al. attention mechanism. Based on the paper: https://arxiv.org/abs/1409.0473 "Neural Machine Translation by Jointly Learning to Align and Translate" Args: key: A tensorfl...
def _round_to(dt, hour, minute, second): """ Route the given datetime to the latest time with the hour, minute, second before it. """ new_dt = dt.replace(hour=hour, minute=minute, second=second) if new_dt == dt: return new_dt elif new_dt < dt: before = new_dt after = ...
def function[_round_to, parameter[dt, hour, minute, second]]: constant[ Route the given datetime to the latest time with the hour, minute, second before it. ] variable[new_dt] assign[=] call[name[dt].replace, parameter[]] if compare[name[new_dt] equal[==] name[dt]] begin[:] r...
keyword[def] identifier[_round_to] ( identifier[dt] , identifier[hour] , identifier[minute] , identifier[second] ): literal[string] identifier[new_dt] = identifier[dt] . identifier[replace] ( identifier[hour] = identifier[hour] , identifier[minute] = identifier[minute] , identifier[second] = identifier[sec...
def _round_to(dt, hour, minute, second): """ Route the given datetime to the latest time with the hour, minute, second before it. """ new_dt = dt.replace(hour=hour, minute=minute, second=second) if new_dt == dt: return new_dt # depends on [control=['if'], data=['new_dt']] elif new_d...
def _update_trsys(self, event): """Transform object(s) have changed for this Node; assign these to the visual's TransformSystem. """ doc = self.document_node scene = self.scene_node root = self.root_node self.transforms.visual_transform = self.node_transform(scene...
def function[_update_trsys, parameter[self, event]]: constant[Transform object(s) have changed for this Node; assign these to the visual's TransformSystem. ] variable[doc] assign[=] name[self].document_node variable[scene] assign[=] name[self].scene_node variable[root] as...
keyword[def] identifier[_update_trsys] ( identifier[self] , identifier[event] ): literal[string] identifier[doc] = identifier[self] . identifier[document_node] identifier[scene] = identifier[self] . identifier[scene_node] identifier[root] = identifier[self] . identifier[root_nod...
def _update_trsys(self, event): """Transform object(s) have changed for this Node; assign these to the visual's TransformSystem. """ doc = self.document_node scene = self.scene_node root = self.root_node self.transforms.visual_transform = self.node_transform(scene) self.transform...
def measurement_time_typical(self): """Typical time in milliseconds required to complete a measurement in normal mode""" meas_time_ms = 1.0 if self.overscan_temperature != OVERSCAN_DISABLE: meas_time_ms += (2 * _BME280_OVERSCANS.get(self.overscan_temperature)) if self.oversca...
def function[measurement_time_typical, parameter[self]]: constant[Typical time in milliseconds required to complete a measurement in normal mode] variable[meas_time_ms] assign[=] constant[1.0] if compare[name[self].overscan_temperature not_equal[!=] name[OVERSCAN_DISABLE]] begin[:] <ast....
keyword[def] identifier[measurement_time_typical] ( identifier[self] ): literal[string] identifier[meas_time_ms] = literal[int] keyword[if] identifier[self] . identifier[overscan_temperature] != identifier[OVERSCAN_DISABLE] : identifier[meas_time_ms] +=( literal[int] * ident...
def measurement_time_typical(self): """Typical time in milliseconds required to complete a measurement in normal mode""" meas_time_ms = 1.0 if self.overscan_temperature != OVERSCAN_DISABLE: meas_time_ms += 2 * _BME280_OVERSCANS.get(self.overscan_temperature) # depends on [control=['if'], data=[]] ...
def context(self, context): """Sets the context that Selenium commands are running in using a `with` statement. The state of the context on the server is saved before entering the block, and restored upon exiting it. :param context: Context, may be one of the class properties ...
def function[context, parameter[self, context]]: constant[Sets the context that Selenium commands are running in using a `with` statement. The state of the context on the server is saved before entering the block, and restored upon exiting it. :param context: Context, may be one of the ...
keyword[def] identifier[context] ( identifier[self] , identifier[context] ): literal[string] identifier[initial_context] = identifier[self] . identifier[execute] ( literal[string] ). identifier[pop] ( literal[string] ) identifier[self] . identifier[set_context] ( identifier[context] ) ...
def context(self, context): """Sets the context that Selenium commands are running in using a `with` statement. The state of the context on the server is saved before entering the block, and restored upon exiting it. :param context: Context, may be one of the class properties `C...
def _destroy(self, target_position_groups): """Destroy indicated position groups, handle any chain destructions, and return all destroyed groups.""" target_position_groups = list(target_position_groups) # work on a copy destroyed_tile_groups = list() blank = Tile.singleton('.') ...
def function[_destroy, parameter[self, target_position_groups]]: constant[Destroy indicated position groups, handle any chain destructions, and return all destroyed groups.] variable[target_position_groups] assign[=] call[name[list], parameter[name[target_position_groups]]] variable[dest...
keyword[def] identifier[_destroy] ( identifier[self] , identifier[target_position_groups] ): literal[string] identifier[target_position_groups] = identifier[list] ( identifier[target_position_groups] ) identifier[destroyed_tile_groups] = identifier[list] () identifier[blank] = ide...
def _destroy(self, target_position_groups): """Destroy indicated position groups, handle any chain destructions, and return all destroyed groups.""" target_position_groups = list(target_position_groups) # work on a copy destroyed_tile_groups = list() blank = Tile.singleton('.') a = self._ar...
def from_labeled_point(rdd, categorical=False, nb_classes=None): """Convert a LabeledPoint RDD back to a pair of numpy arrays :param rdd: LabeledPoint RDD :param categorical: boolean, if labels should be one-hot encode when returned :param nb_classes: optional int, indicating the number of class labels...
def function[from_labeled_point, parameter[rdd, categorical, nb_classes]]: constant[Convert a LabeledPoint RDD back to a pair of numpy arrays :param rdd: LabeledPoint RDD :param categorical: boolean, if labels should be one-hot encode when returned :param nb_classes: optional int, indicating the nu...
keyword[def] identifier[from_labeled_point] ( identifier[rdd] , identifier[categorical] = keyword[False] , identifier[nb_classes] = keyword[None] ): literal[string] identifier[features] = identifier[np] . identifier[asarray] ( identifier[rdd] . identifier[map] ( keyword[lambda] identifier[lp] : ident...
def from_labeled_point(rdd, categorical=False, nb_classes=None): """Convert a LabeledPoint RDD back to a pair of numpy arrays :param rdd: LabeledPoint RDD :param categorical: boolean, if labels should be one-hot encode when returned :param nb_classes: optional int, indicating the number of class labels...