code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _caches_dicts(self): """ Caches variants_dict and replace_dict in a single database hit. """ qs = (self.get_query_set() if django.VERSION < (1, 6) else self.get_queryset()) variants_dict = self._get_variants_dict(qs) cache.set(VARIANTS_DICT_CACHE_KEY, ...
def function[_caches_dicts, parameter[self]]: constant[ Caches variants_dict and replace_dict in a single database hit. ] variable[qs] assign[=] <ast.IfExp object at 0x7da2047e85e0> variable[variants_dict] assign[=] call[name[self]._get_variants_dict, parameter[name[qs]]] ...
keyword[def] identifier[_caches_dicts] ( identifier[self] ): literal[string] identifier[qs] =( identifier[self] . identifier[get_query_set] () keyword[if] identifier[django] . identifier[VERSION] <( literal[int] , literal[int] ) keyword[else] identifier[self] . identifier[get_queryset] ...
def _caches_dicts(self): """ Caches variants_dict and replace_dict in a single database hit. """ qs = self.get_query_set() if django.VERSION < (1, 6) else self.get_queryset() variants_dict = self._get_variants_dict(qs) cache.set(VARIANTS_DICT_CACHE_KEY, variants_dict) replace_dict = ...
def scope_compose(scope, name, sep=private.SCOPE_SEPARATOR): """ compose a new scope :param str scope: current scope :param str name: name of next level in scope :return the composed scope """ if name == None: new_scope = scope else: new_scope = scope if scope else name ...
def function[scope_compose, parameter[scope, name, sep]]: constant[ compose a new scope :param str scope: current scope :param str name: name of next level in scope :return the composed scope ] if compare[name[name] equal[==] constant[None]] begin[:] variable[new_scope] ...
keyword[def] identifier[scope_compose] ( identifier[scope] , identifier[name] , identifier[sep] = identifier[private] . identifier[SCOPE_SEPARATOR] ): literal[string] keyword[if] identifier[name] == keyword[None] : identifier[new_scope] = identifier[scope] keyword[else] : identifi...
def scope_compose(scope, name, sep=private.SCOPE_SEPARATOR): """ compose a new scope :param str scope: current scope :param str name: name of next level in scope :return the composed scope """ if name == None: new_scope = scope # depends on [control=['if'], data=[]] else: n...
def persons_significant_control(self, num, statements=False, **kwargs): """Search for a list of persons with significant control. Searches for persons of significant control based on company number for a specified company. Specify statements=True to only search for officers with stateme...
def function[persons_significant_control, parameter[self, num, statements]]: constant[Search for a list of persons with significant control. Searches for persons of significant control based on company number for a specified company. Specify statements=True to only search for officers w...
keyword[def] identifier[persons_significant_control] ( identifier[self] , identifier[num] , identifier[statements] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[baseuri] =( identifier[self] . identifier[_BASE_URI] + literal[string] . identifier[format] ( identifier[...
def persons_significant_control(self, num, statements=False, **kwargs): """Search for a list of persons with significant control. Searches for persons of significant control based on company number for a specified company. Specify statements=True to only search for officers with statements....
def write_if_different(filename, data): """Write `data` to `filename`, if the content of the file is different. Parameters ---------- filename : str The file name to be written to. data : bytes The data to be written to `filename`. """ assert isinstance(data, bytes) if...
def function[write_if_different, parameter[filename, data]]: constant[Write `data` to `filename`, if the content of the file is different. Parameters ---------- filename : str The file name to be written to. data : bytes The data to be written to `filename`. ] assert[cal...
keyword[def] identifier[write_if_different] ( identifier[filename] , identifier[data] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[data] , identifier[bytes] ) keyword[if] identifier[os] . identifier[path] . identifier[exists] ( identifier[filename] ): keyword[wit...
def write_if_different(filename, data): """Write `data` to `filename`, if the content of the file is different. Parameters ---------- filename : str The file name to be written to. data : bytes The data to be written to `filename`. """ assert isinstance(data, bytes) if o...
def import_process_template_status(self, id): """ImportProcessTemplateStatus. [Preview API] Tells whether promote has completed for the specified promote job ID. :param str id: The ID of the promote job operation :rtype: :class:`<ProcessPromoteStatus> <azure.devops.v5_0.work_item_trackin...
def function[import_process_template_status, parameter[self, id]]: constant[ImportProcessTemplateStatus. [Preview API] Tells whether promote has completed for the specified promote job ID. :param str id: The ID of the promote job operation :rtype: :class:`<ProcessPromoteStatus> <azure.de...
keyword[def] identifier[import_process_template_status] ( identifier[self] , identifier[id] ): literal[string] identifier[route_values] ={} keyword[if] identifier[id] keyword[is] keyword[not] keyword[None] : identifier[route_values] [ literal[string] ]= identifier[self] . ...
def import_process_template_status(self, id): """ImportProcessTemplateStatus. [Preview API] Tells whether promote has completed for the specified promote job ID. :param str id: The ID of the promote job operation :rtype: :class:`<ProcessPromoteStatus> <azure.devops.v5_0.work_item_tracking_pr...
def iam(cls, account_name, api_key, **kwargs): """ Create a Cloudant client that uses IAM authentication. :param account_name: Cloudant account name. :param api_key: IAM authentication API key. """ return cls(None, api_key, account=a...
def function[iam, parameter[cls, account_name, api_key]]: constant[ Create a Cloudant client that uses IAM authentication. :param account_name: Cloudant account name. :param api_key: IAM authentication API key. ] return[call[name[cls], parameter[constant[None], name[api_key]...
keyword[def] identifier[iam] ( identifier[cls] , identifier[account_name] , identifier[api_key] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[cls] ( keyword[None] , identifier[api_key] , identifier[account] = identifier[account_name] , identifier[a...
def iam(cls, account_name, api_key, **kwargs): """ Create a Cloudant client that uses IAM authentication. :param account_name: Cloudant account name. :param api_key: IAM authentication API key. """ return cls(None, api_key, account=account_name, auto_renew=kwargs.get('auto_renew...
def set_priors(self, priors=None, fixed=None, random=None, match_derived_names=True): '''Set priors for one or more existing terms. Args: priors (dict): Dict of priors to update. Keys are names of terms to update; values are the new priors (either a Prior ...
def function[set_priors, parameter[self, priors, fixed, random, match_derived_names]]: constant[Set priors for one or more existing terms. Args: priors (dict): Dict of priors to update. Keys are names of terms to update; values are the new priors (either a Prior instance, ...
keyword[def] identifier[set_priors] ( identifier[self] , identifier[priors] = keyword[None] , identifier[fixed] = keyword[None] , identifier[random] = keyword[None] , identifier[match_derived_names] = keyword[True] ): literal[string] identifier[kwargs] = identifier[dict] ( identifier[zip]...
def set_priors(self, priors=None, fixed=None, random=None, match_derived_names=True): """Set priors for one or more existing terms. Args: priors (dict): Dict of priors to update. Keys are names of terms to update; values are the new priors (either a Prior instance, ...
def get_mysql_credentials(cfg_file): """Get the credentials and database name from options in config file.""" try: parser = ConfigParser.ConfigParser() cfg_fp = open(cfg_file) parser.readfp(cfg_fp) cfg_fp.close() except ConfigParser.NoOptionError: cfg_fp.close() ...
def function[get_mysql_credentials, parameter[cfg_file]]: constant[Get the credentials and database name from options in config file.] <ast.Try object at 0x7da18ede6680> variable[value] assign[=] call[name[parser].get, parameter[constant[dfa_mysql], constant[connection]]] <ast.Try object at 0x7d...
keyword[def] identifier[get_mysql_credentials] ( identifier[cfg_file] ): literal[string] keyword[try] : identifier[parser] = identifier[ConfigParser] . identifier[ConfigParser] () identifier[cfg_fp] = identifier[open] ( identifier[cfg_file] ) identifier[parser] . identifier[read...
def get_mysql_credentials(cfg_file): """Get the credentials and database name from options in config file.""" try: parser = ConfigParser.ConfigParser() cfg_fp = open(cfg_file) parser.readfp(cfg_fp) cfg_fp.close() # depends on [control=['try'], data=[]] except ConfigParser.No...
def dice(edge=15, fn=32): """ dice """ edge = float(edge) # dice c = ops.Cube(edge, center=True) s = ops.Sphere(edge * 3 / 4, center=True) dice = c & s # points c = ops.Circle(edge / 12, _fn=fn) h = 0.7 point = c.linear_extrude(heig...
def function[dice, parameter[edge, fn]]: constant[ dice ] variable[edge] assign[=] call[name[float], parameter[name[edge]]] variable[c] assign[=] call[name[ops].Cube, parameter[name[edge]]] variable[s] assign[=] call[name[ops].Sphere, parameter[binary_operation[binary_operation[n...
keyword[def] identifier[dice] ( identifier[edge] = literal[int] , identifier[fn] = literal[int] ): literal[string] identifier[edge] = identifier[float] ( identifier[edge] ) identifier[c] = identifier[ops] . identifier[Cube] ( identifier[edge] , identifier[center] = keyword[True] )...
def dice(edge=15, fn=32): """ dice """ edge = float(edge) # dice c = ops.Cube(edge, center=True) s = ops.Sphere(edge * 3 / 4, center=True) dice = c & s # points c = ops.Circle(edge / 12, _fn=fn) h = 0.7 point = c.linear_extrude(height=h) point1 = point.translate([0, 0...
def get_bookmark(self, bookmark_id): """ Get a single bookmark represented by `bookmark_id`. The requested bookmark must belong to the current user. :param bookmark_id: ID of the bookmark to retrieve. """ url = self._generate_url('bookmarks/{0}'.format(bookmark_id)) ...
def function[get_bookmark, parameter[self, bookmark_id]]: constant[ Get a single bookmark represented by `bookmark_id`. The requested bookmark must belong to the current user. :param bookmark_id: ID of the bookmark to retrieve. ] variable[url] assign[=] call[name[self]....
keyword[def] identifier[get_bookmark] ( identifier[self] , identifier[bookmark_id] ): literal[string] identifier[url] = identifier[self] . identifier[_generate_url] ( literal[string] . identifier[format] ( identifier[bookmark_id] )) keyword[return] identifier[self] . identifier[get] ( ide...
def get_bookmark(self, bookmark_id): """ Get a single bookmark represented by `bookmark_id`. The requested bookmark must belong to the current user. :param bookmark_id: ID of the bookmark to retrieve. """ url = self._generate_url('bookmarks/{0}'.format(bookmark_id)) return ...
def prepare_url_list(urlresolver, namespace_path='', namespace=''): """ returns list of tuples [(<url_name>, <url_patern_tuple> ), ...] """ exclude_ns = getattr(settings, 'JS_REVERSE_EXCLUDE_NAMESPACES', JS_EXCLUDE_NAMESPACES) include_only_ns = getattr(settings, 'JS_REVERSE_INCLUDE_ONLY_NAMESPACES',...
def function[prepare_url_list, parameter[urlresolver, namespace_path, namespace]]: constant[ returns list of tuples [(<url_name>, <url_patern_tuple> ), ...] ] variable[exclude_ns] assign[=] call[name[getattr], parameter[name[settings], constant[JS_REVERSE_EXCLUDE_NAMESPACES], name[JS_EXCLUDE_NAM...
keyword[def] identifier[prepare_url_list] ( identifier[urlresolver] , identifier[namespace_path] = literal[string] , identifier[namespace] = literal[string] ): literal[string] identifier[exclude_ns] = identifier[getattr] ( identifier[settings] , literal[string] , identifier[JS_EXCLUDE_NAMESPACES] ) id...
def prepare_url_list(urlresolver, namespace_path='', namespace=''): """ returns list of tuples [(<url_name>, <url_patern_tuple> ), ...] """ exclude_ns = getattr(settings, 'JS_REVERSE_EXCLUDE_NAMESPACES', JS_EXCLUDE_NAMESPACES) include_only_ns = getattr(settings, 'JS_REVERSE_INCLUDE_ONLY_NAMESPACES',...
def get_summary(self): """Returns some summary data for a finished analysis""" if not self.analysis_finished: return [] summary = {'times_summary': []} for i in range(len(self.runs[self.current_run].steps) - 1): step = self.runs[self.current_run].steps[i] ...
def function[get_summary, parameter[self]]: constant[Returns some summary data for a finished analysis] if <ast.UnaryOp object at 0x7da20c990d00> begin[:] return[list[[]]] variable[summary] assign[=] dictionary[[<ast.Constant object at 0x7da20c992740>], [<ast.List object at 0x7da20c992dd...
keyword[def] identifier[get_summary] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[analysis_finished] : keyword[return] [] identifier[summary] ={ literal[string] :[]} keyword[for] identifier[i] keyword[in] identifier...
def get_summary(self): """Returns some summary data for a finished analysis""" if not self.analysis_finished: return [] # depends on [control=['if'], data=[]] summary = {'times_summary': []} for i in range(len(self.runs[self.current_run].steps) - 1): step = self.runs[self.current_run].s...
def get_heron_dir(): """ This will extract heron directory from .pex file. For example, when __file__ is '/Users/heron-user/bin/heron/heron/tools/common/src/python/utils/config.pyc', and its real path is '/Users/heron-user/.heron/bin/heron/tools/common/src/python/utils/config.pyc', the internal variable ``...
def function[get_heron_dir, parameter[]]: constant[ This will extract heron directory from .pex file. For example, when __file__ is '/Users/heron-user/bin/heron/heron/tools/common/src/python/utils/config.pyc', and its real path is '/Users/heron-user/.heron/bin/heron/tools/common/src/python/utils/config...
keyword[def] identifier[get_heron_dir] (): literal[string] identifier[go_above_dirs] = literal[int] identifier[path] = literal[string] . identifier[join] ( identifier[os] . identifier[path] . identifier[realpath] ( identifier[__file__] ). identifier[split] ( literal[string] )[:- identifier[go_above_dirs] ]...
def get_heron_dir(): """ This will extract heron directory from .pex file. For example, when __file__ is '/Users/heron-user/bin/heron/heron/tools/common/src/python/utils/config.pyc', and its real path is '/Users/heron-user/.heron/bin/heron/tools/common/src/python/utils/config.pyc', the internal variable ...
def dispense(self, volume=None, location=None, rate=1.0): """ Dispense a volume of liquid (in microliters/uL) using this pipette Notes ----- If only a volume is passed, the pipette will dispense from it's current positio...
def function[dispense, parameter[self, volume, location, rate]]: constant[ Dispense a volume of liquid (in microliters/uL) using this pipette Notes ----- If only a volume is passed, the pipette will dispense from it's current position. If only a location is passed, ...
keyword[def] identifier[dispense] ( identifier[self] , identifier[volume] = keyword[None] , identifier[location] = keyword[None] , identifier[rate] = literal[int] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[tip_attached] : identifier[log] . identifier...
def dispense(self, volume=None, location=None, rate=1.0): """ Dispense a volume of liquid (in microliters/uL) using this pipette Notes ----- If only a volume is passed, the pipette will dispense from it's current position. If only a location is passed, `dispense` wil...
def _update_history(self): """Update the history file""" version = self.data['new_version'] history = self.vcs.history_file() if not history: logger.warn("No history file found") return history_lines = open(history).read().split('\n') headings = ut...
def function[_update_history, parameter[self]]: constant[Update the history file] variable[version] assign[=] call[name[self].data][constant[new_version]] variable[history] assign[=] call[name[self].vcs.history_file, parameter[]] if <ast.UnaryOp object at 0x7da1b146dc90> begin[:] ...
keyword[def] identifier[_update_history] ( identifier[self] ): literal[string] identifier[version] = identifier[self] . identifier[data] [ literal[string] ] identifier[history] = identifier[self] . identifier[vcs] . identifier[history_file] () keyword[if] keyword[not] identifier...
def _update_history(self): """Update the history file""" version = self.data['new_version'] history = self.vcs.history_file() if not history: logger.warn('No history file found') return # depends on [control=['if'], data=[]] history_lines = open(history).read().split('\n') headi...
def jdbc_datasource_present(name, description='', enabled=True, restype='datasource', vendor='mysql', sql_url='', sql_user='', ...
def function[jdbc_datasource_present, parameter[name, description, enabled, restype, vendor, sql_url, sql_user, sql_password, min_size, max_size, resize_quantity, idle_timeout, wait_timeout, non_transactional, transaction_isolation, isolation_guaranteed, server]]: constant[ Ensures that the JDBC Datasource ...
keyword[def] identifier[jdbc_datasource_present] ( identifier[name] , identifier[description] = literal[string] , identifier[enabled] = keyword[True] , identifier[restype] = literal[string] , identifier[vendor] = literal[string] , identifier[sql_url] = literal[string] , identifier[sql_user] = literal[string] , ...
def jdbc_datasource_present(name, description='', enabled=True, restype='datasource', vendor='mysql', sql_url='', sql_user='', sql_password='', min_size=8, max_size=32, resize_quantity=2, idle_timeout=300, wait_timeout=60, non_transactional=False, transaction_isolation='', isolation_guaranteed=True, server=None): "...
def _read_fasta_files(f, args): """ read fasta files of each sample and generate a seq_obj with the information of each unique sequence in each sample :param f: file containing the path for each fasta file and the name of the sample. Two column format with `tab` as field separator :returns: * ...
def function[_read_fasta_files, parameter[f, args]]: constant[ read fasta files of each sample and generate a seq_obj with the information of each unique sequence in each sample :param f: file containing the path for each fasta file and the name of the sample. Two column format with `tab` as field ...
keyword[def] identifier[_read_fasta_files] ( identifier[f] , identifier[args] ): literal[string] identifier[seq_l] ={} identifier[sample_l] =[] identifier[idx] = literal[int] keyword[for] identifier[line1] keyword[in] identifier[f] : identifier[line1] = identifier[line1] . ident...
def _read_fasta_files(f, args): """ read fasta files of each sample and generate a seq_obj with the information of each unique sequence in each sample :param f: file containing the path for each fasta file and the name of the sample. Two column format with `tab` as field separator :returns: * ...
def evpn_afi(self, **kwargs): """EVPN AFI. This method just enables/disables or gets the EVPN AFI. Args: rbridge_id (str): The rbridge ID of the device on which BGP will be configured in a VCS fabric. delete (bool): Deletes the neighbor if `delete` is ``True``. ...
def function[evpn_afi, parameter[self]]: constant[EVPN AFI. This method just enables/disables or gets the EVPN AFI. Args: rbridge_id (str): The rbridge ID of the device on which BGP will be configured in a VCS fabric. delete (bool): Deletes the neighbor if `delet...
keyword[def] identifier[evpn_afi] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[callback] = identifier[kwargs] . identifier[pop] ( literal[string] , identifier[self] . identifier[_callback] ) identifier[config] = identifier[ET] . identifier[Element] ( literal[stri...
def evpn_afi(self, **kwargs): """EVPN AFI. This method just enables/disables or gets the EVPN AFI. Args: rbridge_id (str): The rbridge ID of the device on which BGP will be configured in a VCS fabric. delete (bool): Deletes the neighbor if `delete` is ``True``. ...
def rect_to_cyl_vec(vx,vy,vz,X,Y,Z,cyl=False): """ NAME: rect_to_cyl_vec PURPOSE: transform vectors from rectangular to cylindrical coordinates vectors INPUT: vx - vy - vz - X - X Y - Y Z - Z cyl - if True, X,Y,Z are already cy...
def function[rect_to_cyl_vec, parameter[vx, vy, vz, X, Y, Z, cyl]]: constant[ NAME: rect_to_cyl_vec PURPOSE: transform vectors from rectangular to cylindrical coordinates vectors INPUT: vx - vy - vz - X - X Y - Y Z - Z cyl ...
keyword[def] identifier[rect_to_cyl_vec] ( identifier[vx] , identifier[vy] , identifier[vz] , identifier[X] , identifier[Y] , identifier[Z] , identifier[cyl] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[cyl] : identifier[R] , identifier[phi] , identifier[Z] = identifie...
def rect_to_cyl_vec(vx, vy, vz, X, Y, Z, cyl=False): """ NAME: rect_to_cyl_vec PURPOSE: transform vectors from rectangular to cylindrical coordinates vectors INPUT: vx - vy - vz - X - X Y - Y Z - Z cyl - if True, X,Y,Z are alre...
def move_emitters(self): """ Move each emitter by it's velocity. Emmitters that move off the ends and are not wrapped get sacked. """ moved_emitters = [] for e_pos, e_dir, e_vel, e_range, e_color, e_pal in self.emitters: e_pos = e_pos + e_vel if e...
def function[move_emitters, parameter[self]]: constant[ Move each emitter by it's velocity. Emmitters that move off the ends and are not wrapped get sacked. ] variable[moved_emitters] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da204621180>, <ast.Name objec...
keyword[def] identifier[move_emitters] ( identifier[self] ): literal[string] identifier[moved_emitters] =[] keyword[for] identifier[e_pos] , identifier[e_dir] , identifier[e_vel] , identifier[e_range] , identifier[e_color] , identifier[e_pal] keyword[in] identifier[self] . identifier[em...
def move_emitters(self): """ Move each emitter by it's velocity. Emmitters that move off the ends and are not wrapped get sacked. """ moved_emitters = [] for (e_pos, e_dir, e_vel, e_range, e_color, e_pal) in self.emitters: e_pos = e_pos + e_vel if e_vel > 0: ...
def fmtval(value, colorstr=None, precision=None, spacing=True, trunc=True, end=' '): ''' Formats and returns a given number according to specifications. ''' colwidth = opts.colwidth # get precision if precision is None: precision = opts.precision fmt = '%%.%sf' % precision # ...
def function[fmtval, parameter[value, colorstr, precision, spacing, trunc, end]]: constant[ Formats and returns a given number according to specifications. ] variable[colwidth] assign[=] name[opts].colwidth if compare[name[precision] is constant[None]] begin[:] variable[precision...
keyword[def] identifier[fmtval] ( identifier[value] , identifier[colorstr] = keyword[None] , identifier[precision] = keyword[None] , identifier[spacing] = keyword[True] , identifier[trunc] = keyword[True] , identifier[end] = literal[string] ): literal[string] identifier[colwidth] = identifier[opts] . iden...
def fmtval(value, colorstr=None, precision=None, spacing=True, trunc=True, end=' '): """ Formats and returns a given number according to specifications. """ colwidth = opts.colwidth # get precision if precision is None: precision = opts.precision # depends on [control=['if'], data=['precision']...
def do_cp(self, params): """ \x1b[1mNAME\x1b[0m cp - Copy from/to local/remote or remote/remote paths \x1b[1mSYNOPSIS\x1b[0m cp <src> <dst> [recursive] [overwrite] [asynchronous] [verbose] [max_items] \x1b[1mDESCRIPTION\x1b[0m src and dst can be: /some/path (in the connecte...
def function[do_cp, parameter[self, params]]: constant[ NAME cp - Copy from/to local/remote or remote/remote paths SYNOPSIS cp <src> <dst> [recursive] [overwrite] [asynchronous] [verbose] [max_items] DESCRIPTION src and dst can be: /some/path (in the...
keyword[def] identifier[do_cp] ( identifier[self] , identifier[params] ): literal[string] keyword[try] : identifier[self] . identifier[copy] ( identifier[params] , identifier[params] . identifier[recursive] , identifier[params] . identifier[overwrite] , identifier[params] . identifier[...
def do_cp(self, params): """ \x1b[1mNAME\x1b[0m cp - Copy from/to local/remote or remote/remote paths \x1b[1mSYNOPSIS\x1b[0m cp <src> <dst> [recursive] [overwrite] [asynchronous] [verbose] [max_items] \x1b[1mDESCRIPTION\x1b[0m src and dst can be: /some/path (in the connected se...
def isValidSemver(version): """Semantic version number - determines whether the version is qualified. The format is MAJOR.Minor.PATCH, more with https://semver.org/""" if version and isinstance(version, string_types): try: semver.parse(version) except (TypeError,ValueError): ...
def function[isValidSemver, parameter[version]]: constant[Semantic version number - determines whether the version is qualified. The format is MAJOR.Minor.PATCH, more with https://semver.org/] if <ast.BoolOp object at 0x7da20c6aa350> begin[:] <ast.Try object at 0x7da1b0cb80a0> return[constan...
keyword[def] identifier[isValidSemver] ( identifier[version] ): literal[string] keyword[if] identifier[version] keyword[and] identifier[isinstance] ( identifier[version] , identifier[string_types] ): keyword[try] : identifier[semver] . identifier[parse] ( identifier[version] ) ...
def isValidSemver(version): """Semantic version number - determines whether the version is qualified. The format is MAJOR.Minor.PATCH, more with https://semver.org/""" if version and isinstance(version, string_types): try: semver.parse(version) # depends on [control=['try'], data=[]] ...
def select_font_face(self, family='', slant=constants.FONT_SLANT_NORMAL, weight=constants.FONT_WEIGHT_NORMAL): """Selects a family and style of font from a simplified description as a family name, slant and weight. .. note:: The :meth:`select_font_face` met...
def function[select_font_face, parameter[self, family, slant, weight]]: constant[Selects a family and style of font from a simplified description as a family name, slant and weight. .. note:: The :meth:`select_font_face` method is part of what the cairo designers call t...
keyword[def] identifier[select_font_face] ( identifier[self] , identifier[family] = literal[string] , identifier[slant] = identifier[constants] . identifier[FONT_SLANT_NORMAL] , identifier[weight] = identifier[constants] . identifier[FONT_WEIGHT_NORMAL] ): literal[string] identifier[cairo] . ident...
def select_font_face(self, family='', slant=constants.FONT_SLANT_NORMAL, weight=constants.FONT_WEIGHT_NORMAL): """Selects a family and style of font from a simplified description as a family name, slant and weight. .. note:: The :meth:`select_font_face` method is part of wh...
def get_parameters(self, params, graph=None): """Get the parameters of the model. :param params: dictionary of keys (str names) and values (tensors). :return: evaluated tensors in params """ g = graph if graph is not None else self.tf_graph with g.as_default(): ...
def function[get_parameters, parameter[self, params, graph]]: constant[Get the parameters of the model. :param params: dictionary of keys (str names) and values (tensors). :return: evaluated tensors in params ] variable[g] assign[=] <ast.IfExp object at 0x7da18f09cd30> w...
keyword[def] identifier[get_parameters] ( identifier[self] , identifier[params] , identifier[graph] = keyword[None] ): literal[string] identifier[g] = identifier[graph] keyword[if] identifier[graph] keyword[is] keyword[not] keyword[None] keyword[else] identifier[self] . identifier[tf_graph] ...
def get_parameters(self, params, graph=None): """Get the parameters of the model. :param params: dictionary of keys (str names) and values (tensors). :return: evaluated tensors in params """ g = graph if graph is not None else self.tf_graph with g.as_default(): with tf.Sessi...
def credential_property(cred): """ A credential property factory for each message class that will set private attributes and return obfuscated credentials when requested. """ def getter(instance): return "***obfuscated***" def setter(instance, value): private = "_" + cred ...
def function[credential_property, parameter[cred]]: constant[ A credential property factory for each message class that will set private attributes and return obfuscated credentials when requested. ] def function[getter, parameter[instance]]: return[constant[***obfuscated***]] ...
keyword[def] identifier[credential_property] ( identifier[cred] ): literal[string] keyword[def] identifier[getter] ( identifier[instance] ): keyword[return] literal[string] keyword[def] identifier[setter] ( identifier[instance] , identifier[value] ): identifier[private] = liter...
def credential_property(cred): """ A credential property factory for each message class that will set private attributes and return obfuscated credentials when requested. """ def getter(instance): return '***obfuscated***' def setter(instance, value): private = '_' + cred ...
def start_server( server_address: str = None, *, backend: Callable = multiprocessing.Process ) -> Tuple[multiprocessing.Process, str]: """ Start a new zproc server. :param server_address: .. include:: /api/snippets/server_address.rst :param backend: .. include:: /api/snippets/ba...
def function[start_server, parameter[server_address]]: constant[ Start a new zproc server. :param server_address: .. include:: /api/snippets/server_address.rst :param backend: .. include:: /api/snippets/backend.rst :return: ` A `tuple``, containing a :py:class:`...
keyword[def] identifier[start_server] ( identifier[server_address] : identifier[str] = keyword[None] ,*, identifier[backend] : identifier[Callable] = identifier[multiprocessing] . identifier[Process] )-> identifier[Tuple] [ identifier[multiprocessing] . identifier[Process] , identifier[str] ]: literal[string] ...
def start_server(server_address: str=None, *, backend: Callable=multiprocessing.Process) -> Tuple[multiprocessing.Process, str]: """ Start a new zproc server. :param server_address: .. include:: /api/snippets/server_address.rst :param backend: .. include:: /api/snippets/backend.rst ...
def block_layer(inputs, filters, bottleneck, block_fn, blocks, strides, training, name, data_format): """Creates one layer of blocks for the ResNet model. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depending on data_form...
def function[block_layer, parameter[inputs, filters, bottleneck, block_fn, blocks, strides, training, name, data_format]]: constant[Creates one layer of blocks for the ResNet model. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depen...
keyword[def] identifier[block_layer] ( identifier[inputs] , identifier[filters] , identifier[bottleneck] , identifier[block_fn] , identifier[blocks] , identifier[strides] , identifier[training] , identifier[name] , identifier[data_format] ): literal[string] identifier[filters_out] = identifier[filters] * ...
def block_layer(inputs, filters, bottleneck, block_fn, blocks, strides, training, name, data_format): """Creates one layer of blocks for the ResNet model. Args: inputs: A tensor of size [batch, channels, height_in, width_in] or [batch, height_in, width_in, channels] depending on data_format. filter...
def build_wheel_graph(num_nodes): """Builds a wheel graph with the specified number of nodes. Ref: http://mathworld.wolfram.com/WheelGraph.html""" # The easiest way to build a wheel graph is to build # C_n-1 and then add a hub node and spoke edges graph = build_cycle_graph(num_nodes - 1) cyc...
def function[build_wheel_graph, parameter[num_nodes]]: constant[Builds a wheel graph with the specified number of nodes. Ref: http://mathworld.wolfram.com/WheelGraph.html] variable[graph] assign[=] call[name[build_cycle_graph], parameter[binary_operation[name[num_nodes] - constant[1]]]] v...
keyword[def] identifier[build_wheel_graph] ( identifier[num_nodes] ): literal[string] identifier[graph] = identifier[build_cycle_graph] ( identifier[num_nodes] - literal[int] ) identifier[cycle_graph_vertices] = identifier[graph] . identifier[get_all_node_ids] () identifier[node_id] =...
def build_wheel_graph(num_nodes): """Builds a wheel graph with the specified number of nodes. Ref: http://mathworld.wolfram.com/WheelGraph.html""" # The easiest way to build a wheel graph is to build # C_n-1 and then add a hub node and spoke edges graph = build_cycle_graph(num_nodes - 1) cycl...
def add_node(self, node, node_data=None): """ Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value. """ # # the nodes...
def function[add_node, parameter[self, node, node_data]]: constant[ Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value. ] i...
keyword[def] identifier[add_node] ( identifier[self] , identifier[node] , identifier[node_data] = keyword[None] ): literal[string] keyword[if] identifier[node] keyword[in] identifier[self] . identifier[hidden_nodes] : k...
def add_node(self, node, node_data=None): """ Adds a new node to the graph. Arbitrary data can be attached to the node via the node_data parameter. Adding the same node twice will be silently ignored. The node must be a hashable value. """ # # the nodes will contai...
def spawn_process(self, port): """Create an Application and HTTPServer for the given port. :param int port: The port to listen on :rtype: multiprocessing.Process """ return process.Process(name="ServerProcess.%i" % port, kwargs={'namespace': self....
def function[spawn_process, parameter[self, port]]: constant[Create an Application and HTTPServer for the given port. :param int port: The port to listen on :rtype: multiprocessing.Process ] return[call[name[process].Process, parameter[]]]
keyword[def] identifier[spawn_process] ( identifier[self] , identifier[port] ): literal[string] keyword[return] identifier[process] . identifier[Process] ( identifier[name] = literal[string] % identifier[port] , identifier[kwargs] ={ literal[string] : identifier[self] . identifier[namespa...
def spawn_process(self, port): """Create an Application and HTTPServer for the given port. :param int port: The port to listen on :rtype: multiprocessing.Process """ return process.Process(name='ServerProcess.%i' % port, kwargs={'namespace': self.namespace, 'port': port})
def some(arr): """Return True iff there is an element, a, of arr such that a is not None""" return functools.reduce(lambda x, y: x or (y is not None), arr, False)
def function[some, parameter[arr]]: constant[Return True iff there is an element, a, of arr such that a is not None] return[call[name[functools].reduce, parameter[<ast.Lambda object at 0x7da1b1c7aa40>, name[arr], constant[False]]]]
keyword[def] identifier[some] ( identifier[arr] ): literal[string] keyword[return] identifier[functools] . identifier[reduce] ( keyword[lambda] identifier[x] , identifier[y] : identifier[x] keyword[or] ( identifier[y] keyword[is] keyword[not] keyword[None] ), identifier[arr] , keyword[False] )
def some(arr): """Return True iff there is an element, a, of arr such that a is not None""" return functools.reduce(lambda x, y: x or y is not None, arr, False)
def _set_attrib(name, key, value, param, root=None, validate=True): ''' Set a parameter in /etc/shadow ''' pre_info = info(name, root=root) # If the user is not present or the attribute is already present, # we return early if not pre_info['name']: return False if value == pre_...
def function[_set_attrib, parameter[name, key, value, param, root, validate]]: constant[ Set a parameter in /etc/shadow ] variable[pre_info] assign[=] call[name[info], parameter[name[name]]] if <ast.UnaryOp object at 0x7da20e74bf70> begin[:] return[constant[False]] if com...
keyword[def] identifier[_set_attrib] ( identifier[name] , identifier[key] , identifier[value] , identifier[param] , identifier[root] = keyword[None] , identifier[validate] = keyword[True] ): literal[string] identifier[pre_info] = identifier[info] ( identifier[name] , identifier[root] = identifier[root] ) ...
def _set_attrib(name, key, value, param, root=None, validate=True): """ Set a parameter in /etc/shadow """ pre_info = info(name, root=root) # If the user is not present or the attribute is already present, # we return early if not pre_info['name']: return False # depends on [control...
def _shuffle_items(items, bucket_key=None, disable=None, seed=None, session=None): """ Shuffles a list of `items` in place. If `bucket_key` is None, items are shuffled across the entire list. `bucket_key` is an optional function called for each item in `items` to calculate the key of bucket in whi...
def function[_shuffle_items, parameter[items, bucket_key, disable, seed, session]]: constant[ Shuffles a list of `items` in place. If `bucket_key` is None, items are shuffled across the entire list. `bucket_key` is an optional function called for each item in `items` to calculate the key of bu...
keyword[def] identifier[_shuffle_items] ( identifier[items] , identifier[bucket_key] = keyword[None] , identifier[disable] = keyword[None] , identifier[seed] = keyword[None] , identifier[session] = keyword[None] ): literal[string] keyword[if] identifier[seed] keyword[is] keyword[not] keyword[None] : ...
def _shuffle_items(items, bucket_key=None, disable=None, seed=None, session=None): """ Shuffles a list of `items` in place. If `bucket_key` is None, items are shuffled across the entire list. `bucket_key` is an optional function called for each item in `items` to calculate the key of bucket in whi...
def _call_dunder_colr(cls, obj): """ Call __colr__ on an object, after some checks. If color is disabled, the object itself is returned. If __colr__ doesn't return a Colr instance, TypeError is raised. On success, a Colr instance is returned from obj.__colr__(). """ ...
def function[_call_dunder_colr, parameter[cls, obj]]: constant[ Call __colr__ on an object, after some checks. If color is disabled, the object itself is returned. If __colr__ doesn't return a Colr instance, TypeError is raised. On success, a Colr instance is returned from ob...
keyword[def] identifier[_call_dunder_colr] ( identifier[cls] , identifier[obj] ): literal[string] keyword[if] identifier[_disabled] : keyword[return] identifier[obj] identifier[clr] = identifier[obj] . identifier[__colr__] () keyword[if] keyword[not] ide...
def _call_dunder_colr(cls, obj): """ Call __colr__ on an object, after some checks. If color is disabled, the object itself is returned. If __colr__ doesn't return a Colr instance, TypeError is raised. On success, a Colr instance is returned from obj.__colr__(). """ i...
def bitceil(N): """ Find the bit (i.e. power of 2) immediately greater than or equal to N Note: this works for numbers up to 2 ** 64. Roughly equivalent to int(2 ** np.ceil(np.log2(N))) """ # Note: for Python 2.7 and 3.x, this is faster: # return 1 << int(N - 1).bit_length() N = int(N) ...
def function[bitceil, parameter[N]]: constant[ Find the bit (i.e. power of 2) immediately greater than or equal to N Note: this works for numbers up to 2 ** 64. Roughly equivalent to int(2 ** np.ceil(np.log2(N))) ] variable[N] assign[=] binary_operation[call[name[int], parameter[name[N]...
keyword[def] identifier[bitceil] ( identifier[N] ): literal[string] identifier[N] = identifier[int] ( identifier[N] )- literal[int] keyword[for] identifier[i] keyword[in] [ literal[int] , literal[int] , literal[int] , literal[int] , literal[int] , literal[int] ]: identifier[N] |=...
def bitceil(N): """ Find the bit (i.e. power of 2) immediately greater than or equal to N Note: this works for numbers up to 2 ** 64. Roughly equivalent to int(2 ** np.ceil(np.log2(N))) """ # Note: for Python 2.7 and 3.x, this is faster: # return 1 << int(N - 1).bit_length() N = int(N) ...
def parse(binary, **params): """Turns a TAR file into a frozen sample.""" binary = io.BytesIO(binary) collection = list() with tarfile.TarFile(fileobj=binary, mode='r') as tar: for tar_info in tar.getmembers(): content_type, encoding = mimetypes.guess_type(tar_info.name) ...
def function[parse, parameter[binary]]: constant[Turns a TAR file into a frozen sample.] variable[binary] assign[=] call[name[io].BytesIO, parameter[name[binary]]] variable[collection] assign[=] call[name[list], parameter[]] with call[name[tarfile].TarFile, parameter[]] begin[:] ...
keyword[def] identifier[parse] ( identifier[binary] ,** identifier[params] ): literal[string] identifier[binary] = identifier[io] . identifier[BytesIO] ( identifier[binary] ) identifier[collection] = identifier[list] () keyword[with] identifier[tarfile] . identifier[TarFile] ( identifier[fileobj...
def parse(binary, **params): """Turns a TAR file into a frozen sample.""" binary = io.BytesIO(binary) collection = list() with tarfile.TarFile(fileobj=binary, mode='r') as tar: for tar_info in tar.getmembers(): (content_type, encoding) = mimetypes.guess_type(tar_info.name) ...
def add_actor(self, uinput, reset_camera=False, name=None, loc=None, culling=False): """ Adds an actor to render window. Creates an actor if input is a mapper. Parameters ---------- uinput : vtk.vtkMapper or vtk.vtkActor vtk mapper or vtk a...
def function[add_actor, parameter[self, uinput, reset_camera, name, loc, culling]]: constant[ Adds an actor to render window. Creates an actor if input is a mapper. Parameters ---------- uinput : vtk.vtkMapper or vtk.vtkActor vtk mapper or vtk actor to be ad...
keyword[def] identifier[add_actor] ( identifier[self] , identifier[uinput] , identifier[reset_camera] = keyword[False] , identifier[name] = keyword[None] , identifier[loc] = keyword[None] , identifier[culling] = keyword[False] ): literal[string] identifier[rv] = identifier[self] . identif...
def add_actor(self, uinput, reset_camera=False, name=None, loc=None, culling=False): """ Adds an actor to render window. Creates an actor if input is a mapper. Parameters ---------- uinput : vtk.vtkMapper or vtk.vtkActor vtk mapper or vtk actor to be added. ...
def _CreateFeed(client): """Creates the feed for DSA page URLs. Args: client: an AdWordsClient instance. Returns: A _DSAFeedDetails instance containing details about the created feed. """ # Get the FeedService. feed_service = client.GetService('FeedService', version='v201809') # Create operatio...
def function[_CreateFeed, parameter[client]]: constant[Creates the feed for DSA page URLs. Args: client: an AdWordsClient instance. Returns: A _DSAFeedDetails instance containing details about the created feed. ] variable[feed_service] assign[=] call[name[client].GetService, parameter[co...
keyword[def] identifier[_CreateFeed] ( identifier[client] ): literal[string] identifier[feed_service] = identifier[client] . identifier[GetService] ( literal[string] , identifier[version] = literal[string] ) identifier[operation] ={ literal[string] :{ literal[string] : literal[string] % iden...
def _CreateFeed(client): """Creates the feed for DSA page URLs. Args: client: an AdWordsClient instance. Returns: A _DSAFeedDetails instance containing details about the created feed. """ # Get the FeedService. feed_service = client.GetService('FeedService', version='v201809') # Create o...
def filter_extant_exports(client, bucket, prefix, days, start, end=None): """Filter days where the bucket already has extant export keys. """ end = end or datetime.now() # days = [start + timedelta(i) for i in range((end-start).days)] try: tag_set = client.get_object_tagging(Bucket=bucket, K...
def function[filter_extant_exports, parameter[client, bucket, prefix, days, start, end]]: constant[Filter days where the bucket already has extant export keys. ] variable[end] assign[=] <ast.BoolOp object at 0x7da18f09d240> <ast.Try object at 0x7da18f09eb30> variable[tags] assign[=] <ast...
keyword[def] identifier[filter_extant_exports] ( identifier[client] , identifier[bucket] , identifier[prefix] , identifier[days] , identifier[start] , identifier[end] = keyword[None] ): literal[string] identifier[end] = identifier[end] keyword[or] identifier[datetime] . identifier[now] () keywo...
def filter_extant_exports(client, bucket, prefix, days, start, end=None): """Filter days where the bucket already has extant export keys. """ end = end or datetime.now() # days = [start + timedelta(i) for i in range((end-start).days)] try: tag_set = client.get_object_tagging(Bucket=bucket, K...
def plfit_lsq(x,y): """ Returns A and B in y=Ax^B http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html """ n = len(x) btop = n * (log(x)*log(y)).sum() - (log(x)).sum()*(log(y)).sum() bbottom = n*(log(x)**2).sum() - (log(x).sum())**2 b = btop / bbottom a = ( log(y).sum() - b ...
def function[plfit_lsq, parameter[x, y]]: constant[ Returns A and B in y=Ax^B http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html ] variable[n] assign[=] call[name[len], parameter[name[x]]] variable[btop] assign[=] binary_operation[binary_operation[name[n] * call[binary_ope...
keyword[def] identifier[plfit_lsq] ( identifier[x] , identifier[y] ): literal[string] identifier[n] = identifier[len] ( identifier[x] ) identifier[btop] = identifier[n] *( identifier[log] ( identifier[x] )* identifier[log] ( identifier[y] )). identifier[sum] ()-( identifier[log] ( identifier[x] )). id...
def plfit_lsq(x, y): """ Returns A and B in y=Ax^B http://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html """ n = len(x) btop = n * (log(x) * log(y)).sum() - log(x).sum() * log(y).sum() bbottom = n * (log(x) ** 2).sum() - log(x).sum() ** 2 b = btop / bbottom a = (log(y).sum() ...
def chr(self): """the reference chromosome. greedy return the first chromosome in exon array :return: chromosome :rtype: string """ if len(self.exons)==0: sys.stderr.write("WARNING can't return chromsome with nothing here\n") return None return self._rngs[0].chr
def function[chr, parameter[self]]: constant[the reference chromosome. greedy return the first chromosome in exon array :return: chromosome :rtype: string ] if compare[call[name[len], parameter[name[self].exons]] equal[==] constant[0]] begin[:] call[name[sys].stderr.write, p...
keyword[def] identifier[chr] ( identifier[self] ): literal[string] keyword[if] identifier[len] ( identifier[self] . identifier[exons] )== literal[int] : identifier[sys] . identifier[stderr] . identifier[write] ( literal[string] ) keyword[return] keyword[None] keyword[return] identifi...
def chr(self): """the reference chromosome. greedy return the first chromosome in exon array :return: chromosome :rtype: string """ if len(self.exons) == 0: sys.stderr.write("WARNING can't return chromsome with nothing here\n") return None # depends on [control=['if'], data=[]] ...
def select_specimen(self, specimen): """ Goes through the calculations necessary to plot measurement data for specimen and sets specimen as current GUI specimen, also attempts to handle changing current fit. """ try: fit_index = self.pmag_results_data['specime...
def function[select_specimen, parameter[self, specimen]]: constant[ Goes through the calculations necessary to plot measurement data for specimen and sets specimen as current GUI specimen, also attempts to handle changing current fit. ] <ast.Try object at 0x7da18c4cece0> ...
keyword[def] identifier[select_specimen] ( identifier[self] , identifier[specimen] ): literal[string] keyword[try] : identifier[fit_index] = identifier[self] . identifier[pmag_results_data] [ literal[string] ][ identifier[self] . identifier[s] ]. identifier[index] ( identi...
def select_specimen(self, specimen): """ Goes through the calculations necessary to plot measurement data for specimen and sets specimen as current GUI specimen, also attempts to handle changing current fit. """ try: fit_index = self.pmag_results_data['specimens'][self.s]...
def sizes(args): """ %prog sizes gaps.bed a.fasta b.fasta Take the flanks of gaps within a.fasta, map them onto b.fasta. Compile the results to the gap size estimates in b. The output is detailed below: Columns are: 1. A scaffold 2. Start position 3. End position 4. Gap identif...
def function[sizes, parameter[args]]: constant[ %prog sizes gaps.bed a.fasta b.fasta Take the flanks of gaps within a.fasta, map them onto b.fasta. Compile the results to the gap size estimates in b. The output is detailed below: Columns are: 1. A scaffold 2. Start position 3. E...
keyword[def] identifier[sizes] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[formats] . identifier[base] keyword[import] identifier[DictFile] keyword[from] identifier[jcvi] . identifier[apps] . identifier[align] keyword[import] identifier[blast] identi...
def sizes(args): """ %prog sizes gaps.bed a.fasta b.fasta Take the flanks of gaps within a.fasta, map them onto b.fasta. Compile the results to the gap size estimates in b. The output is detailed below: Columns are: 1. A scaffold 2. Start position 3. End position 4. Gap identif...
def add_missing_price_information_message(request, item): """ Add a message to the Django messages store indicating that we failed to retrieve price information about an item. :param request: The current request. :param item: The item for which price information is missing. Example: a program title, or...
def function[add_missing_price_information_message, parameter[request, item]]: constant[ Add a message to the Django messages store indicating that we failed to retrieve price information about an item. :param request: The current request. :param item: The item for which price information is missin...
keyword[def] identifier[add_missing_price_information_message] ( identifier[request] , identifier[item] ): literal[string] identifier[messages] . identifier[warning] ( identifier[request] , identifier[_] ( literal[string] literal[string] literal[string] ). identifier[format]...
def add_missing_price_information_message(request, item): """ Add a message to the Django messages store indicating that we failed to retrieve price information about an item. :param request: The current request. :param item: The item for which price information is missing. Example: a program title, or...
def write_single_coil(self, starting_address, value): """ Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written """ self.__transactionIdentifier+=1 if (self.__ser is not None): if (se...
def function[write_single_coil, parameter[self, starting_address, value]]: constant[ Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written ] <ast.AugAssign object at 0x7da1b1c60ee0> if compare[name[s...
keyword[def] identifier[write_single_coil] ( identifier[self] , identifier[starting_address] , identifier[value] ): literal[string] identifier[self] . identifier[__transactionIdentifier] += literal[int] keyword[if] ( identifier[self] . identifier[__ser] keyword[is] keyword[not] keyword...
def write_single_coil(self, starting_address, value): """ Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written """ self.__transactionIdentifier += 1 if self.__ser is not None: if self.__ser.closed: ...
def get_fields_by_prop(cls, prop_key, prop_val): """ Return a list of field names matching a prop key/val :param prop_key: key name :param prop_val: value :return: list """ ret = [] for key, val in cls.get_fields_with_prop(prop_key): if val == prop_...
def function[get_fields_by_prop, parameter[cls, prop_key, prop_val]]: constant[ Return a list of field names matching a prop key/val :param prop_key: key name :param prop_val: value :return: list ] variable[ret] assign[=] list[[]] for taget[tuple[[<ast.Name objec...
keyword[def] identifier[get_fields_by_prop] ( identifier[cls] , identifier[prop_key] , identifier[prop_val] ): literal[string] identifier[ret] =[] keyword[for] identifier[key] , identifier[val] keyword[in] identifier[cls] . identifier[get_fields_with_prop] ( identifier[prop_key] ): ...
def get_fields_by_prop(cls, prop_key, prop_val): """ Return a list of field names matching a prop key/val :param prop_key: key name :param prop_val: value :return: list """ ret = [] for (key, val) in cls.get_fields_with_prop(prop_key): if val == prop_val: ...
def thresholdcands(candsfile, threshold, numberperscan=1): """ Returns list of significant candidate loc in candsfile. Can define threshold and maximum number of locs per scan. Works on merge or per-scan cands pkls. """ # read metadata and define columns of interest loc, prop, d = read_candidat...
def function[thresholdcands, parameter[candsfile, threshold, numberperscan]]: constant[ Returns list of significant candidate loc in candsfile. Can define threshold and maximum number of locs per scan. Works on merge or per-scan cands pkls. ] <ast.Tuple object at 0x7da20c6c7100> assign[=] ca...
keyword[def] identifier[thresholdcands] ( identifier[candsfile] , identifier[threshold] , identifier[numberperscan] = literal[int] ): literal[string] identifier[loc] , identifier[prop] , identifier[d] = identifier[read_candidates] ( identifier[candsfile] , identifier[returnstate] = keyword[True] ) ...
def thresholdcands(candsfile, threshold, numberperscan=1): """ Returns list of significant candidate loc in candsfile. Can define threshold and maximum number of locs per scan. Works on merge or per-scan cands pkls. """ # read metadata and define columns of interest (loc, prop, d) = read_candida...
def progressbar(iterable, length=23): """Print a simple progress bar while processing the given iterable. Function |progressbar| does print the progress bar when option `printprogress` is activted: >>> from hydpy import pub >>> pub.options.printprogress = True You can pass an iterable object....
def function[progressbar, parameter[iterable, length]]: constant[Print a simple progress bar while processing the given iterable. Function |progressbar| does print the progress bar when option `printprogress` is activted: >>> from hydpy import pub >>> pub.options.printprogress = True You ...
keyword[def] identifier[progressbar] ( identifier[iterable] , identifier[length] = literal[int] ): literal[string] keyword[if] identifier[hydpy] . identifier[pub] . identifier[options] . identifier[printprogress] keyword[and] ( identifier[len] ( identifier[iterable] )> literal[int] ): identifier...
def progressbar(iterable, length=23): """Print a simple progress bar while processing the given iterable. Function |progressbar| does print the progress bar when option `printprogress` is activted: >>> from hydpy import pub >>> pub.options.printprogress = True You can pass an iterable object....
def remap_index_fn(ref_file): """Map sequence references to equivalent novoalign indexes. """ checks = [os.path.splitext(ref_file)[0].replace("/seq/", "/novoalign/"), os.path.splitext(ref_file)[0] + ".ndx", ref_file + ".bs.ndx", ref_file + ".ndx"] for check in c...
def function[remap_index_fn, parameter[ref_file]]: constant[Map sequence references to equivalent novoalign indexes. ] variable[checks] assign[=] list[[<ast.Call object at 0x7da1b2345360>, <ast.BinOp object at 0x7da1b23446a0>, <ast.BinOp object at 0x7da1b170b400>, <ast.BinOp object at 0x7da1b17088e0...
keyword[def] identifier[remap_index_fn] ( identifier[ref_file] ): literal[string] identifier[checks] =[ identifier[os] . identifier[path] . identifier[splitext] ( identifier[ref_file] )[ literal[int] ]. identifier[replace] ( literal[string] , literal[string] ), identifier[os] . identifier[path] . iden...
def remap_index_fn(ref_file): """Map sequence references to equivalent novoalign indexes. """ checks = [os.path.splitext(ref_file)[0].replace('/seq/', '/novoalign/'), os.path.splitext(ref_file)[0] + '.ndx', ref_file + '.bs.ndx', ref_file + '.ndx'] for check in checks: if os.path.exists(check): ...
def getDarkCurrentAverages(exposuretimes, imgs): ''' return exposure times, image averages for each exposure time ''' x, imgs_p = sortForSameExpTime(exposuretimes, imgs) s0, s1 = imgs[0].shape imgs = np.empty(shape=(len(x), s0, s1), dtype=imgs[0].dtype) for i, i...
def function[getDarkCurrentAverages, parameter[exposuretimes, imgs]]: constant[ return exposure times, image averages for each exposure time ] <ast.Tuple object at 0x7da1b11ed0c0> assign[=] call[name[sortForSameExpTime], parameter[name[exposuretimes], name[imgs]]] <ast.Tuple object at 0x...
keyword[def] identifier[getDarkCurrentAverages] ( identifier[exposuretimes] , identifier[imgs] ): literal[string] identifier[x] , identifier[imgs_p] = identifier[sortForSameExpTime] ( identifier[exposuretimes] , identifier[imgs] ) identifier[s0] , identifier[s1] = identifier[imgs] [ literal[int] ]....
def getDarkCurrentAverages(exposuretimes, imgs): """ return exposure times, image averages for each exposure time """ (x, imgs_p) = sortForSameExpTime(exposuretimes, imgs) (s0, s1) = imgs[0].shape imgs = np.empty(shape=(len(x), s0, s1), dtype=imgs[0].dtype) for (i, ip) in zip(imgs, imgs_p): ...
def shot(self, **kwargs): # type: (Any) -> str """ Helper to save the screen shot of the 1st monitor, by default. You can pass the same arguments as for ``save``. """ kwargs["mon"] = kwargs.get("mon", 1) return next(self.save(**kwargs))
def function[shot, parameter[self]]: constant[ Helper to save the screen shot of the 1st monitor, by default. You can pass the same arguments as for ``save``. ] call[name[kwargs]][constant[mon]] assign[=] call[name[kwargs].get, parameter[constant[mon], constant[1]]] return[ca...
keyword[def] identifier[shot] ( identifier[self] ,** identifier[kwargs] ): literal[string] identifier[kwargs] [ literal[string] ]= identifier[kwargs] . identifier[get] ( literal[string] , literal[int] ) keyword[return] identifier[next] ( identifier[self] . identifier[save] (** identifie...
def shot(self, **kwargs): # type: (Any) -> str '\n Helper to save the screen shot of the 1st monitor, by default.\n You can pass the same arguments as for ``save``.\n ' kwargs['mon'] = kwargs.get('mon', 1) return next(self.save(**kwargs))
def _status_apf(): ''' Return True if apf is running otherwise return False ''' status = 0 table = iptc.Table(iptc.Table.FILTER) for chain in table.chains: if 'sanity' in chain.name.lower(): status = 1 return True if status else False
def function[_status_apf, parameter[]]: constant[ Return True if apf is running otherwise return False ] variable[status] assign[=] constant[0] variable[table] assign[=] call[name[iptc].Table, parameter[name[iptc].Table.FILTER]] for taget[name[chain]] in starred[name[table].chain...
keyword[def] identifier[_status_apf] (): literal[string] identifier[status] = literal[int] identifier[table] = identifier[iptc] . identifier[Table] ( identifier[iptc] . identifier[Table] . identifier[FILTER] ) keyword[for] identifier[chain] keyword[in] identifier[table] . identifier[chains] :...
def _status_apf(): """ Return True if apf is running otherwise return False """ status = 0 table = iptc.Table(iptc.Table.FILTER) for chain in table.chains: if 'sanity' in chain.name.lower(): status = 1 # depends on [control=['if'], data=[]] # depends on [control=['for'], da...
def random(length, chars=None): """Generates a random string. :param length: Length of the string to generate. This can be a numbe or a pair: ``(min_length, max_length)`` :param chars: String of characters to choose from """ if chars is None: chars = string.ascii_letters ...
def function[random, parameter[length, chars]]: constant[Generates a random string. :param length: Length of the string to generate. This can be a numbe or a pair: ``(min_length, max_length)`` :param chars: String of characters to choose from ] if compare[name[chars] is c...
keyword[def] identifier[random] ( identifier[length] , identifier[chars] = keyword[None] ): literal[string] keyword[if] identifier[chars] keyword[is] keyword[None] : identifier[chars] = identifier[string] . identifier[ascii_letters] + identifier[string] . identifier[digits] keyword[else] ...
def random(length, chars=None): """Generates a random string. :param length: Length of the string to generate. This can be a numbe or a pair: ``(min_length, max_length)`` :param chars: String of characters to choose from """ if chars is None: chars = string.ascii_letters ...
def base_elts(elt, cls=None, depth=None): """Get bases elements of the input elt. - If elt is an instance, get class and all base classes. - If elt is a method, get all base methods. - If elt is a class, get all base classes. - In other case, get an empty list. :param elt: supposed inherited e...
def function[base_elts, parameter[elt, cls, depth]]: constant[Get bases elements of the input elt. - If elt is an instance, get class and all base classes. - If elt is a method, get all base methods. - If elt is a class, get all base classes. - In other case, get an empty list. :param elt:...
keyword[def] identifier[base_elts] ( identifier[elt] , identifier[cls] = keyword[None] , identifier[depth] = keyword[None] ): literal[string] identifier[result] =[] identifier[elt_name] = identifier[getattr] ( identifier[elt] , literal[string] , keyword[None] ) keyword[if] identifier[elt_name...
def base_elts(elt, cls=None, depth=None): """Get bases elements of the input elt. - If elt is an instance, get class and all base classes. - If elt is a method, get all base methods. - If elt is a class, get all base classes. - In other case, get an empty list. :param elt: supposed inherited e...
def builds(self, confs): """For retro compatibility directly assigning builds""" self._named_builds = {} self._builds = [] for values in confs: if len(values) == 2: self._builds.append(BuildConf(values[0], values[1], {}, {}, self.reference)) elif l...
def function[builds, parameter[self, confs]]: constant[For retro compatibility directly assigning builds] name[self]._named_builds assign[=] dictionary[[], []] name[self]._builds assign[=] list[[]] for taget[name[values]] in starred[name[confs]] begin[:] if compare[call[n...
keyword[def] identifier[builds] ( identifier[self] , identifier[confs] ): literal[string] identifier[self] . identifier[_named_builds] ={} identifier[self] . identifier[_builds] =[] keyword[for] identifier[values] keyword[in] identifier[confs] : keyword[if] identi...
def builds(self, confs): """For retro compatibility directly assigning builds""" self._named_builds = {} self._builds = [] for values in confs: if len(values) == 2: self._builds.append(BuildConf(values[0], values[1], {}, {}, self.reference)) # depends on [control=['if'], data=[]] ...
def _prepare_coords(lons1, lats1, lons2, lats2): """ Convert two pairs of spherical coordinates in decimal degrees to numpy arrays of radians. Makes sure that respective coordinates in pairs have the same shape. """ lons1 = numpy.radians(lons1) lats1 = numpy.radians(lats1) assert lons1.s...
def function[_prepare_coords, parameter[lons1, lats1, lons2, lats2]]: constant[ Convert two pairs of spherical coordinates in decimal degrees to numpy arrays of radians. Makes sure that respective coordinates in pairs have the same shape. ] variable[lons1] assign[=] call[name[numpy].radi...
keyword[def] identifier[_prepare_coords] ( identifier[lons1] , identifier[lats1] , identifier[lons2] , identifier[lats2] ): literal[string] identifier[lons1] = identifier[numpy] . identifier[radians] ( identifier[lons1] ) identifier[lats1] = identifier[numpy] . identifier[radians] ( identifier[lats1] ...
def _prepare_coords(lons1, lats1, lons2, lats2): """ Convert two pairs of spherical coordinates in decimal degrees to numpy arrays of radians. Makes sure that respective coordinates in pairs have the same shape. """ lons1 = numpy.radians(lons1) lats1 = numpy.radians(lats1) assert lons1.s...
def start_environment( self, user_name, environment_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts an environment by starting all resources inside the environment. This operation can take a while to complete. :param user_name: The name of the user. ...
def function[start_environment, parameter[self, user_name, environment_id, custom_headers, raw, polling]]: constant[Starts an environment by starting all resources inside the environment. This operation can take a while to complete. :param user_name: The name of the user. :type user_nam...
keyword[def] identifier[start_environment] ( identifier[self] , identifier[user_name] , identifier[environment_id] , identifier[custom_headers] = keyword[None] , identifier[raw] = keyword[False] , identifier[polling] = keyword[True] ,** identifier[operation_config] ): literal[string] identifier[ra...
def start_environment(self, user_name, environment_id, custom_headers=None, raw=False, polling=True, **operation_config): """Starts an environment by starting all resources inside the environment. This operation can take a while to complete. :param user_name: The name of the user. :type use...
def cancel(self): """Cancel the future if possible. Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed. """ with self._condition: if self._state in [RUNNING, FINISHED]: ret...
def function[cancel, parameter[self]]: constant[Cancel the future if possible. Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed. ] with name[self]._condition begin[:] if compare[name...
keyword[def] identifier[cancel] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[_condition] : keyword[if] identifier[self] . identifier[_state] keyword[in] [ identifier[RUNNING] , identifier[FINISHED] ]: keyword[return] keyword[Fal...
def cancel(self): """Cancel the future if possible. Returns True if the future was cancelled, False otherwise. A future cannot be cancelled if it is running or has already completed. """ with self._condition: if self._state in [RUNNING, FINISHED]: return False # dep...
def skip_read_line(fd, no_eof=False): """ Read the first non-empty line (if any) from the given file object. Return an empty string at EOF, if `no_eof` is False. If it is True, raise the EOFError instead. """ ls = '' while 1: try: line = fd.readline() except EOFE...
def function[skip_read_line, parameter[fd, no_eof]]: constant[ Read the first non-empty line (if any) from the given file object. Return an empty string at EOF, if `no_eof` is False. If it is True, raise the EOFError instead. ] variable[ls] assign[=] constant[] while constant[1] ...
keyword[def] identifier[skip_read_line] ( identifier[fd] , identifier[no_eof] = keyword[False] ): literal[string] identifier[ls] = literal[string] keyword[while] literal[int] : keyword[try] : identifier[line] = identifier[fd] . identifier[readline] () keyword[except] ...
def skip_read_line(fd, no_eof=False): """ Read the first non-empty line (if any) from the given file object. Return an empty string at EOF, if `no_eof` is False. If it is True, raise the EOFError instead. """ ls = '' while 1: try: line = fd.readline() # depends on [contr...
def smsc(self, smscNumber): """ Set the default SMSC number to use when sending SMS messages """ if smscNumber != self._smscNumber: if self.alive: self.write('AT+CSCA="{0}"'.format(smscNumber)) self._smscNumber = smscNumber
def function[smsc, parameter[self, smscNumber]]: constant[ Set the default SMSC number to use when sending SMS messages ] if compare[name[smscNumber] not_equal[!=] name[self]._smscNumber] begin[:] if name[self].alive begin[:] call[name[self].write, parameter[call[...
keyword[def] identifier[smsc] ( identifier[self] , identifier[smscNumber] ): literal[string] keyword[if] identifier[smscNumber] != identifier[self] . identifier[_smscNumber] : keyword[if] identifier[self] . identifier[alive] : identifier[self] . identifier[write] ( l...
def smsc(self, smscNumber): """ Set the default SMSC number to use when sending SMS messages """ if smscNumber != self._smscNumber: if self.alive: self.write('AT+CSCA="{0}"'.format(smscNumber)) # depends on [control=['if'], data=[]] self._smscNumber = smscNumber # depends on [contr...
def list_tables(self, exclusive_start_table_name=None, limit=None): """ Invoke the `ListTables`_ function. Returns an array of table names associated with the current account and endpoint. The output from *ListTables* is paginated, with each page returning a maximum of ``100`` t...
def function[list_tables, parameter[self, exclusive_start_table_name, limit]]: constant[ Invoke the `ListTables`_ function. Returns an array of table names associated with the current account and endpoint. The output from *ListTables* is paginated, with each page returning a max...
keyword[def] identifier[list_tables] ( identifier[self] , identifier[exclusive_start_table_name] = keyword[None] , identifier[limit] = keyword[None] ): literal[string] identifier[payload] ={} keyword[if] identifier[exclusive_start_table_name] : identifier[payload] [ literal[s...
def list_tables(self, exclusive_start_table_name=None, limit=None): """ Invoke the `ListTables`_ function. Returns an array of table names associated with the current account and endpoint. The output from *ListTables* is paginated, with each page returning a maximum of ``100`` table...
def srcnode(self): """If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. """ srcdir_list = self.dir.srcdir_list() if srcdir_list: srcnode = srcdir_list[0].Entry(self.name) srcnode.must_be_...
def function[srcnode, parameter[self]]: constant[If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. ] variable[srcdir_list] assign[=] call[name[self].dir.srcdir_list, parameter[]] if name[srcdir_list] begin[:] ...
keyword[def] identifier[srcnode] ( identifier[self] ): literal[string] identifier[srcdir_list] = identifier[self] . identifier[dir] . identifier[srcdir_list] () keyword[if] identifier[srcdir_list] : identifier[srcnode] = identifier[srcdir_list] [ literal[int] ]. identifier[En...
def srcnode(self): """If this node is in a build path, return the node corresponding to its source file. Otherwise, return ourself. """ srcdir_list = self.dir.srcdir_list() if srcdir_list: srcnode = srcdir_list[0].Entry(self.name) srcnode.must_be_same(self.__class__)...
def fastp_read_n_plot(self): """ Make the read N content plot for Fastp """ data_labels, pdata = self.filter_pconfig_pdata_subplots(self.fastp_n_content_data, 'Base Content Percent') pconfig = { 'id': 'fastp-seq-content-n-plot', 'title': 'Fastp: Read N Content', ...
def function[fastp_read_n_plot, parameter[self]]: constant[ Make the read N content plot for Fastp ] <ast.Tuple object at 0x7da18eb55ae0> assign[=] call[name[self].filter_pconfig_pdata_subplots, parameter[name[self].fastp_n_content_data, constant[Base Content Percent]]] variable[pconfig] assign[...
keyword[def] identifier[fastp_read_n_plot] ( identifier[self] ): literal[string] identifier[data_labels] , identifier[pdata] = identifier[self] . identifier[filter_pconfig_pdata_subplots] ( identifier[self] . identifier[fastp_n_content_data] , literal[string] ) identifier[pconfig] ={ ...
def fastp_read_n_plot(self): """ Make the read N content plot for Fastp """ (data_labels, pdata) = self.filter_pconfig_pdata_subplots(self.fastp_n_content_data, 'Base Content Percent') pconfig = {'id': 'fastp-seq-content-n-plot', 'title': 'Fastp: Read N Content', 'xlab': 'Read Position', 'ylab': 'R1 Before ...
def partial(cls, id, token, *, adapter): """Creates a partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. Parameters ----------- id: :class:`int` The ID of the webhook. token: :class:`str` The authenticati...
def function[partial, parameter[cls, id, token]]: constant[Creates a partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. Parameters ----------- id: :class:`int` The ID of the webhook. token: :class:`str` T...
keyword[def] identifier[partial] ( identifier[cls] , identifier[id] , identifier[token] ,*, identifier[adapter] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[adapter] , identifier[WebhookAdapter] ): keyword[raise] identifier[TypeError] ( literal[st...
def partial(cls, id, token, *, adapter): """Creates a partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. Parameters ----------- id: :class:`int` The ID of the webhook. token: :class:`str` The authentication t...
def disable_host_event_handler(self, host): """Disable event handlers for a host Format of the line that triggers function call:: DISABLE_HOST_EVENT_HANDLER;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return: None """ if ...
def function[disable_host_event_handler, parameter[self, host]]: constant[Disable event handlers for a host Format of the line that triggers function call:: DISABLE_HOST_EVENT_HANDLER;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return: N...
keyword[def] identifier[disable_host_event_handler] ( identifier[self] , identifier[host] ): literal[string] keyword[if] identifier[host] . identifier[event_handler_enabled] : identifier[host] . identifier[modified_attributes] |= identifier[DICT_MODATTR] [ literal[string] ]. identifie...
def disable_host_event_handler(self, host): """Disable event handlers for a host Format of the line that triggers function call:: DISABLE_HOST_EVENT_HANDLER;<host_name> :param host: host to edit :type host: alignak.objects.host.Host :return: None """ if host.eve...
def render_POST(self, request): """Dispatch Method called by twisted render, creates a request/response handler chain. request -- twisted.web.server.Request """ from twisted.internet.defer import maybeDeferred chain = self.factory.newInstance() data = re...
def function[render_POST, parameter[self, request]]: constant[Dispatch Method called by twisted render, creates a request/response handler chain. request -- twisted.web.server.Request ] from relative_module[twisted.internet.defer] import module[maybeDeferred] variable[chain]...
keyword[def] identifier[render_POST] ( identifier[self] , identifier[request] ): literal[string] keyword[from] identifier[twisted] . identifier[internet] . identifier[defer] keyword[import] identifier[maybeDeferred] identifier[chain] = identifier[self] . identifier[factory] . identifi...
def render_POST(self, request): """Dispatch Method called by twisted render, creates a request/response handler chain. request -- twisted.web.server.Request """ from twisted.internet.defer import maybeDeferred chain = self.factory.newInstance() data = request.content.read() ...
def design_stat_extremes(self, value="Extremes"): """Corresponds to IDD Field `design_stat_extremes` Args: value (str): value for IDD Field `design_stat_extremes` Accepted values are: - Extremes Default value: Extremes if...
def function[design_stat_extremes, parameter[self, value]]: constant[Corresponds to IDD Field `design_stat_extremes` Args: value (str): value for IDD Field `design_stat_extremes` Accepted values are: - Extremes Default value: Extremes ...
keyword[def] identifier[design_stat_extremes] ( identifier[self] , identifier[value] = literal[string] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[not] keyword[None] : keyword[try] : identifier[value] = identifier[str] ( identifier[value] )...
def design_stat_extremes(self, value='Extremes'): """Corresponds to IDD Field `design_stat_extremes` Args: value (str): value for IDD Field `design_stat_extremes` Accepted values are: - Extremes Default value: Extremes if `va...
def update(self, searched_resource, uri_parameters=None, request_body_dict=None, query_parameters_dict=None, additional_headers=None): """ This method is used to update a resource using the PUT HTTP Method :param searched_resource: A valid display name in the RAML file matching th...
def function[update, parameter[self, searched_resource, uri_parameters, request_body_dict, query_parameters_dict, additional_headers]]: constant[ This method is used to update a resource using the PUT HTTP Method :param searched_resource: A valid display name in the RAML file matching the resour...
keyword[def] identifier[update] ( identifier[self] , identifier[searched_resource] , identifier[uri_parameters] = keyword[None] , identifier[request_body_dict] = keyword[None] , identifier[query_parameters_dict] = keyword[None] , identifier[additional_headers] = keyword[None] ): literal[string] ke...
def update(self, searched_resource, uri_parameters=None, request_body_dict=None, query_parameters_dict=None, additional_headers=None): """ This method is used to update a resource using the PUT HTTP Method :param searched_resource: A valid display name in the RAML file matching the resource ...
def detachPanelCopy(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() view = self._curren...
def function[detachPanelCopy, parameter[self]]: constant[ Detaches the current panel as a floating window. ] from relative_module[projexui.widgets.xviewwidget] import module[XViewDialog] variable[dlg] assign[=] call[name[XViewDialog], parameter[name[self]._viewWidget, call[name[self]...
keyword[def] identifier[detachPanelCopy] ( identifier[self] ): literal[string] keyword[from] identifier[projexui] . identifier[widgets] . identifier[xviewwidget] keyword[import] identifier[XViewDialog] identifier[dlg] = identifier[XViewDialog] ( identifier[self] . identifier[_viewWidg...
def detachPanelCopy(self): """ Detaches the current panel as a floating window. """ from projexui.widgets.xviewwidget import XViewDialog dlg = XViewDialog(self._viewWidget, self._viewWidget.viewTypes()) size = self._currentPanel.size() view = self._currentPanel.currentView() # du...
def get_value(kv, key, value = None): """get value from the keyvalues (options)""" res = [] for k, v in kv: if k == key: value = v else: res.append([k, v]) return value, res
def function[get_value, parameter[kv, key, value]]: constant[get value from the keyvalues (options)] variable[res] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da20c7cb520>, <ast.Name object at 0x7da20c7cb220>]]] in starred[name[kv]] begin[:] if compare[name[k] equa...
keyword[def] identifier[get_value] ( identifier[kv] , identifier[key] , identifier[value] = keyword[None] ): literal[string] identifier[res] =[] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[kv] : keyword[if] identifier[k] == identifier[key] : identifier[v...
def get_value(kv, key, value=None): """get value from the keyvalues (options)""" res = [] for (k, v) in kv: if k == key: value = v # depends on [control=['if'], data=[]] else: res.append([k, v]) # depends on [control=['for'], data=[]] return (value, res)
def get_url_parameters(self): """Create a dictionary of parameters used in URLs for this model.""" url_fields = {} for field in self.url_fields: url_fields[field] = getattr(self, field) return url_fields
def function[get_url_parameters, parameter[self]]: constant[Create a dictionary of parameters used in URLs for this model.] variable[url_fields] assign[=] dictionary[[], []] for taget[name[field]] in starred[name[self].url_fields] begin[:] call[name[url_fields]][name[field]] assi...
keyword[def] identifier[get_url_parameters] ( identifier[self] ): literal[string] identifier[url_fields] ={} keyword[for] identifier[field] keyword[in] identifier[self] . identifier[url_fields] : identifier[url_fields] [ identifier[field] ]= identifier[getattr] ( identifier...
def get_url_parameters(self): """Create a dictionary of parameters used in URLs for this model.""" url_fields = {} for field in self.url_fields: url_fields[field] = getattr(self, field) # depends on [control=['for'], data=['field']] return url_fields
def normalize(lx): """ Accepts log-values as input, exponentiates them, normalizes and returns the result. Handles underflow by rescaling so that the largest values is exactly 1.0. """ lx = numpy.asarray(lx) base = lx.max() x = numpy.exp(lx - base) result = x / x.sum() conventional = (numpy.exp(lx)...
def function[normalize, parameter[lx]]: constant[ Accepts log-values as input, exponentiates them, normalizes and returns the result. Handles underflow by rescaling so that the largest values is exactly 1.0. ] variable[lx] assign[=] call[name[numpy].asarray, parameter[name[lx]]] variable...
keyword[def] identifier[normalize] ( identifier[lx] ): literal[string] identifier[lx] = identifier[numpy] . identifier[asarray] ( identifier[lx] ) identifier[base] = identifier[lx] . identifier[max] () identifier[x] = identifier[numpy] . identifier[exp] ( identifier[lx] - identifier[base] ) identifier...
def normalize(lx): """ Accepts log-values as input, exponentiates them, normalizes and returns the result. Handles underflow by rescaling so that the largest values is exactly 1.0. """ lx = numpy.asarray(lx) base = lx.max() x = numpy.exp(lx - base) result = x / x.sum() conventional = num...
def image_height(image): """ Returns the height of the image found at the path supplied by `image` relative to your project's images directory. """ image_size_cache = _get_cache('image_size_cache') if not Image: raise SassMissingDependency('PIL', 'image manipulation') filepath = Stri...
def function[image_height, parameter[image]]: constant[ Returns the height of the image found at the path supplied by `image` relative to your project's images directory. ] variable[image_size_cache] assign[=] call[name[_get_cache], parameter[constant[image_size_cache]]] if <ast.Unar...
keyword[def] identifier[image_height] ( identifier[image] ): literal[string] identifier[image_size_cache] = identifier[_get_cache] ( literal[string] ) keyword[if] keyword[not] identifier[Image] : keyword[raise] identifier[SassMissingDependency] ( literal[string] , literal[string] ) id...
def image_height(image): """ Returns the height of the image found at the path supplied by `image` relative to your project's images directory. """ image_size_cache = _get_cache('image_size_cache') if not Image: raise SassMissingDependency('PIL', 'image manipulation') # depends on [cont...
def build_pipeline(cls, project, zones, min_cores, min_ram, disk_size, boot_disk_size, preemptible, accelerator_type, accelerator_count, image, script_name, envs, inputs, outputs, pipeline_name): """Builds a pipeline configuration for execution. Ar...
def function[build_pipeline, parameter[cls, project, zones, min_cores, min_ram, disk_size, boot_disk_size, preemptible, accelerator_type, accelerator_count, image, script_name, envs, inputs, outputs, pipeline_name]]: constant[Builds a pipeline configuration for execution. Args: project: string name o...
keyword[def] identifier[build_pipeline] ( identifier[cls] , identifier[project] , identifier[zones] , identifier[min_cores] , identifier[min_ram] , identifier[disk_size] , identifier[boot_disk_size] , identifier[preemptible] , identifier[accelerator_type] , identifier[accelerator_count] , identifier[image] , identi...
def build_pipeline(cls, project, zones, min_cores, min_ram, disk_size, boot_disk_size, preemptible, accelerator_type, accelerator_count, image, script_name, envs, inputs, outputs, pipeline_name): """Builds a pipeline configuration for execution. Args: project: string name of project. zones: list of...
def OnTableChanged(self, event): """Table changed event handler""" if hasattr(event, 'table'): self.Select(event.table) self.EnsureVisible(event.table) event.Skip()
def function[OnTableChanged, parameter[self, event]]: constant[Table changed event handler] if call[name[hasattr], parameter[name[event], constant[table]]] begin[:] call[name[self].Select, parameter[name[event].table]] call[name[self].EnsureVisible, parameter[name[event]....
keyword[def] identifier[OnTableChanged] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[hasattr] ( identifier[event] , literal[string] ): identifier[self] . identifier[Select] ( identifier[event] . identifier[table] ) identifier[self] . i...
def OnTableChanged(self, event): """Table changed event handler""" if hasattr(event, 'table'): self.Select(event.table) self.EnsureVisible(event.table) # depends on [control=['if'], data=[]] event.Skip()
def invoked(self, ctx): """Method called when the command is invoked.""" if not ctx.ansi.is_enabled: print("You need color support to use this demo") else: print(ctx.ansi.cmd('erase_display')) self._demo_fg_color(ctx) self._demo_bg_color(ctx) ...
def function[invoked, parameter[self, ctx]]: constant[Method called when the command is invoked.] if <ast.UnaryOp object at 0x7da2044c0670> begin[:] call[name[print], parameter[constant[You need color support to use this demo]]]
keyword[def] identifier[invoked] ( identifier[self] , identifier[ctx] ): literal[string] keyword[if] keyword[not] identifier[ctx] . identifier[ansi] . identifier[is_enabled] : identifier[print] ( literal[string] ) keyword[else] : identifier[print] ( identifier[c...
def invoked(self, ctx): """Method called when the command is invoked.""" if not ctx.ansi.is_enabled: print('You need color support to use this demo') # depends on [control=['if'], data=[]] else: print(ctx.ansi.cmd('erase_display')) self._demo_fg_color(ctx) self._demo_bg_colo...
def delete(self, url, headers=None, kwargs=None): """Make a DELETE request. To make a DELETE request pass, ``url`` :param url: ``str`` :param headers: ``dict`` :param kwargs: ``dict`` """ return self._request( method='delete', url=url, ...
def function[delete, parameter[self, url, headers, kwargs]]: constant[Make a DELETE request. To make a DELETE request pass, ``url`` :param url: ``str`` :param headers: ``dict`` :param kwargs: ``dict`` ] return[call[name[self]._request, parameter[]]]
keyword[def] identifier[delete] ( identifier[self] , identifier[url] , identifier[headers] = keyword[None] , identifier[kwargs] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[_request] ( identifier[method] = literal[string] , identifier[url] = id...
def delete(self, url, headers=None, kwargs=None): """Make a DELETE request. To make a DELETE request pass, ``url`` :param url: ``str`` :param headers: ``dict`` :param kwargs: ``dict`` """ return self._request(method='delete', url=url, headers=headers, kwargs=kwargs)
def _as_in_context(data, ctx): """Move data into new context.""" if isinstance(data, nd.NDArray): return data.as_in_context(ctx) elif isinstance(data, (list, tuple)): return [_as_in_context(d, ctx) for d in data] return data
def function[_as_in_context, parameter[data, ctx]]: constant[Move data into new context.] if call[name[isinstance], parameter[name[data], name[nd].NDArray]] begin[:] return[call[name[data].as_in_context, parameter[name[ctx]]]] return[name[data]]
keyword[def] identifier[_as_in_context] ( identifier[data] , identifier[ctx] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[nd] . identifier[NDArray] ): keyword[return] identifier[data] . identifier[as_in_context] ( identifier[ctx] ) keyword[elif] ide...
def _as_in_context(data, ctx): """Move data into new context.""" if isinstance(data, nd.NDArray): return data.as_in_context(ctx) # depends on [control=['if'], data=[]] elif isinstance(data, (list, tuple)): return [_as_in_context(d, ctx) for d in data] # depends on [control=['if'], data=[]]...
def choice_voters_changed_update_cache( sender, instance, action, reverse, model, pk_set, **kwargs): """Update cache when choice.voters changes.""" if action not in ('post_add', 'post_remove', 'post_clear'): # post_clear is not handled, because clear is called in # django.db.models.field...
def function[choice_voters_changed_update_cache, parameter[sender, instance, action, reverse, model, pk_set]]: constant[Update cache when choice.voters changes.] if compare[name[action] <ast.NotIn object at 0x7da2590d7190> tuple[[<ast.Constant object at 0x7da204621e70>, <ast.Constant object at 0x7da2046...
keyword[def] identifier[choice_voters_changed_update_cache] ( identifier[sender] , identifier[instance] , identifier[action] , identifier[reverse] , identifier[model] , identifier[pk_set] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[action] keyword[not] keyword[in] ( literal[string]...
def choice_voters_changed_update_cache(sender, instance, action, reverse, model, pk_set, **kwargs): """Update cache when choice.voters changes.""" if action not in ('post_add', 'post_remove', 'post_clear'): # post_clear is not handled, because clear is called in # django.db.models.fields.related...
def append_system_paths(self): """Append system paths to $PATH.""" from rez.shells import Shell, create_shell sh = self.interpreter if isinstance(self.interpreter, Shell) \ else create_shell() paths = sh.get_syspaths() paths_str = os.pathsep.join(paths) self....
def function[append_system_paths, parameter[self]]: constant[Append system paths to $PATH.] from relative_module[rez.shells] import module[Shell], module[create_shell] variable[sh] assign[=] <ast.IfExp object at 0x7da18f8127d0> variable[paths] assign[=] call[name[sh].get_syspaths, parameter[...
keyword[def] identifier[append_system_paths] ( identifier[self] ): literal[string] keyword[from] identifier[rez] . identifier[shells] keyword[import] identifier[Shell] , identifier[create_shell] identifier[sh] = identifier[self] . identifier[interpreter] keyword[if] identifier[isinst...
def append_system_paths(self): """Append system paths to $PATH.""" from rez.shells import Shell, create_shell sh = self.interpreter if isinstance(self.interpreter, Shell) else create_shell() paths = sh.get_syspaths() paths_str = os.pathsep.join(paths) self.env.PATH.append(paths_str)
async def _sign_submit(self, req_json: str) -> str: """ Sign and submit (json) request to ledger; return (json) result. Raise ClosedPool if pool is not yet open, CorruptWallet if existing wallet's pool is no longer extant, or BadLedgerTxn on any other failure. :param req_json: ...
<ast.AsyncFunctionDef object at 0x7da18dc9b190>
keyword[async] keyword[def] identifier[_sign_submit] ( identifier[self] , identifier[req_json] : identifier[str] )-> identifier[str] : literal[string] identifier[LOGGER] . identifier[debug] ( literal[string] , identifier[req_json] ) keyword[if] keyword[not] identifier[self] . identifi...
async def _sign_submit(self, req_json: str) -> str: """ Sign and submit (json) request to ledger; return (json) result. Raise ClosedPool if pool is not yet open, CorruptWallet if existing wallet's pool is no longer extant, or BadLedgerTxn on any other failure. :param req_json: json...
def cleanup_deployments(self): """ Delete all deployments created in namespaces associated with this backend :return: None """ deployments = self.list_deployments() for deployment in deployments: if deployment.namespace in self.managed_namespaces: ...
def function[cleanup_deployments, parameter[self]]: constant[ Delete all deployments created in namespaces associated with this backend :return: None ] variable[deployments] assign[=] call[name[self].list_deployments, parameter[]] for taget[name[deployment]] in starred[na...
keyword[def] identifier[cleanup_deployments] ( identifier[self] ): literal[string] identifier[deployments] = identifier[self] . identifier[list_deployments] () keyword[for] identifier[deployment] keyword[in] identifier[deployments] : keyword[if] identifier[deployment] . i...
def cleanup_deployments(self): """ Delete all deployments created in namespaces associated with this backend :return: None """ deployments = self.list_deployments() for deployment in deployments: if deployment.namespace in self.managed_namespaces: deployment.delet...
def random(length: int = 8, chars: str = digits + ascii_lowercase) -> Iterator[str]: """ A random string. Not unique, but has around 1 in a million chance of collision (with the default 8 character length). e.g. 'fubui5e6' Args: length: Length of the random string. chars: The chara...
def function[random, parameter[length, chars]]: constant[ A random string. Not unique, but has around 1 in a million chance of collision (with the default 8 character length). e.g. 'fubui5e6' Args: length: Length of the random string. chars: The characters to randomly choose fr...
keyword[def] identifier[random] ( identifier[length] : identifier[int] = literal[int] , identifier[chars] : identifier[str] = identifier[digits] + identifier[ascii_lowercase] )-> identifier[Iterator] [ identifier[str] ]: literal[string] keyword[while] keyword[True] : keyword[yield] literal[strin...
def random(length: int=8, chars: str=digits + ascii_lowercase) -> Iterator[str]: """ A random string. Not unique, but has around 1 in a million chance of collision (with the default 8 character length). e.g. 'fubui5e6' Args: length: Length of the random string. chars: The character...
def save_file_revisions(self,snapshot,file_revisions): """ We convert various items in the file revision to documents, so that we can easily search and retrieve them... """ annotations = defaultdict(list) for file_revision in file_revisions: issues_results =...
def function[save_file_revisions, parameter[self, snapshot, file_revisions]]: constant[ We convert various items in the file revision to documents, so that we can easily search and retrieve them... ] variable[annotations] assign[=] call[name[defaultdict], parameter[name[list]]] ...
keyword[def] identifier[save_file_revisions] ( identifier[self] , identifier[snapshot] , identifier[file_revisions] ): literal[string] identifier[annotations] = identifier[defaultdict] ( identifier[list] ) keyword[for] identifier[file_revision] keyword[in] identifier[file_revisions] :...
def save_file_revisions(self, snapshot, file_revisions): """ We convert various items in the file revision to documents, so that we can easily search and retrieve them... """ annotations = defaultdict(list) for file_revision in file_revisions: issues_results = {} for ...
def stop_server(self, datacenter_id, server_id): """ Stops the server. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``str`` """ ...
def function[stop_server, parameter[self, datacenter_id, server_id]]: constant[ Stops the server. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: `...
keyword[def] identifier[stop_server] ( identifier[self] , identifier[datacenter_id] , identifier[server_id] ): literal[string] identifier[response] = identifier[self] . identifier[_perform_request] ( identifier[url] = literal[string] %( identifier[datacenter_id] , identif...
def stop_server(self, datacenter_id, server_id): """ Stops the server. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``str`` """ respons...
def _get_magnitude_vector_properties(catalogue, config): '''If an input minimum magnitude is given then consider catalogue only above the minimum magnitude - returns corresponding properties''' mmin = config.get('input_mmin', np.min(catalogue['magnitude'])) neq = np.float(np.sum(catalogue['magnitude'] ...
def function[_get_magnitude_vector_properties, parameter[catalogue, config]]: constant[If an input minimum magnitude is given then consider catalogue only above the minimum magnitude - returns corresponding properties] variable[mmin] assign[=] call[name[config].get, parameter[constant[input_mmin], c...
keyword[def] identifier[_get_magnitude_vector_properties] ( identifier[catalogue] , identifier[config] ): literal[string] identifier[mmin] = identifier[config] . identifier[get] ( literal[string] , identifier[np] . identifier[min] ( identifier[catalogue] [ literal[string] ])) identifier[neq] = identi...
def _get_magnitude_vector_properties(catalogue, config): """If an input minimum magnitude is given then consider catalogue only above the minimum magnitude - returns corresponding properties""" mmin = config.get('input_mmin', np.min(catalogue['magnitude'])) neq = np.float(np.sum(catalogue['magnitude'] >...
def sum_distances(self, indices, distance_matrix): """Calculate combinatorial distance between a select group of trajectories, indicated by indices Arguments --------- indices : tuple distance_matrix : numpy.ndarray (M,M) Returns ------- numpy.nd...
def function[sum_distances, parameter[self, indices, distance_matrix]]: constant[Calculate combinatorial distance between a select group of trajectories, indicated by indices Arguments --------- indices : tuple distance_matrix : numpy.ndarray (M,M) Returns ...
keyword[def] identifier[sum_distances] ( identifier[self] , identifier[indices] , identifier[distance_matrix] ): literal[string] identifier[combs_tup] = identifier[np] . identifier[array] ( identifier[tuple] ( identifier[combinations] ( identifier[indices] , literal[int] ))) iden...
def sum_distances(self, indices, distance_matrix): """Calculate combinatorial distance between a select group of trajectories, indicated by indices Arguments --------- indices : tuple distance_matrix : numpy.ndarray (M,M) Returns ------- numpy.ndarra...
def set_run_completed(self, boolean, start_datetime, end_datetime): """Set the value of _run_completed.""" self._run_completed = boolean if (start_datetime, end_datetime) != (None, None): # start_datetime: Sat Feb 28 23:54:27 2015 # end_datetime: Sat Feb 28 23:54:30 2015...
def function[set_run_completed, parameter[self, boolean, start_datetime, end_datetime]]: constant[Set the value of _run_completed.] name[self]._run_completed assign[=] name[boolean] if compare[tuple[[<ast.Name object at 0x7da20c6a8520>, <ast.Name object at 0x7da20c6a8a00>]] not_equal[!=] tuple[[...
keyword[def] identifier[set_run_completed] ( identifier[self] , identifier[boolean] , identifier[start_datetime] , identifier[end_datetime] ): literal[string] identifier[self] . identifier[_run_completed] = identifier[boolean] keyword[if] ( identifier[start_datetime] , identifier[end_dat...
def set_run_completed(self, boolean, start_datetime, end_datetime): """Set the value of _run_completed.""" self._run_completed = boolean if (start_datetime, end_datetime) != (None, None): # start_datetime: Sat Feb 28 23:54:27 2015 # end_datetime: Sat Feb 28 23:54:30 2015 try: ...
def get_variation(self, experiment, user_id, attributes, ignore_user_profile=False): """ Top-level function to help determine variation user should be put in. First, check if experiment is running. Second, check if user is forced in a variation. Third, check if there is a stored decision for the user a...
def function[get_variation, parameter[self, experiment, user_id, attributes, ignore_user_profile]]: constant[ Top-level function to help determine variation user should be put in. First, check if experiment is running. Second, check if user is forced in a variation. Third, check if there is a store...
keyword[def] identifier[get_variation] ( identifier[self] , identifier[experiment] , identifier[user_id] , identifier[attributes] , identifier[ignore_user_profile] = keyword[False] ): literal[string] keyword[if] keyword[not] identifier[experiment_helper] . identifier[is_experiment_running] ( identi...
def get_variation(self, experiment, user_id, attributes, ignore_user_profile=False): """ Top-level function to help determine variation user should be put in. First, check if experiment is running. Second, check if user is forced in a variation. Third, check if there is a stored decision for the user a...
def delete(self, **kwds): """ Endpoint: /album/<id>/delete.json Deletes this album. Returns True if successful. Raises a TroveboxError if not. """ result = self._client.album.delete(self, **kwds) self._delete_fields() return result
def function[delete, parameter[self]]: constant[ Endpoint: /album/<id>/delete.json Deletes this album. Returns True if successful. Raises a TroveboxError if not. ] variable[result] assign[=] call[name[self]._client.album.delete, parameter[name[self]]] cal...
keyword[def] identifier[delete] ( identifier[self] ,** identifier[kwds] ): literal[string] identifier[result] = identifier[self] . identifier[_client] . identifier[album] . identifier[delete] ( identifier[self] ,** identifier[kwds] ) identifier[self] . identifier[_delete_fields] () ...
def delete(self, **kwds): """ Endpoint: /album/<id>/delete.json Deletes this album. Returns True if successful. Raises a TroveboxError if not. """ result = self._client.album.delete(self, **kwds) self._delete_fields() return result
def send(self, message, socket_): """ Sends a message (dict) to the socket. Message consists of a 8-byte len header followed by a msgpack-numpy encoded dict. Args: message: The message dict (e.g. {"cmd": "reset"}) socket_: The python socket object to use. ...
def function[send, parameter[self, message, socket_]]: constant[ Sends a message (dict) to the socket. Message consists of a 8-byte len header followed by a msgpack-numpy encoded dict. Args: message: The message dict (e.g. {"cmd": "reset"}) socket_: The pytho...
keyword[def] identifier[send] ( identifier[self] , identifier[message] , identifier[socket_] ): literal[string] keyword[if] keyword[not] identifier[socket_] : keyword[raise] identifier[TensorForceError] ( literal[string] ) keyword[elif] keyword[not] identifier[isinstance]...
def send(self, message, socket_): """ Sends a message (dict) to the socket. Message consists of a 8-byte len header followed by a msgpack-numpy encoded dict. Args: message: The message dict (e.g. {"cmd": "reset"}) socket_: The python socket object to use. ...
def get_i2c_bus_numbers(glober = glob.glob): """Search all the available I2C devices in the system""" res = [] for device in glober("/dev/i2c-*"): r = re.match("/dev/i2c-([\d]){1,2}", device) res.append(int(r.group(1))) return res
def function[get_i2c_bus_numbers, parameter[glober]]: constant[Search all the available I2C devices in the system] variable[res] assign[=] list[[]] for taget[name[device]] in starred[call[name[glober], parameter[constant[/dev/i2c-*]]]] begin[:] variable[r] assign[=] call[name[re]...
keyword[def] identifier[get_i2c_bus_numbers] ( identifier[glober] = identifier[glob] . identifier[glob] ): literal[string] identifier[res] =[] keyword[for] identifier[device] keyword[in] identifier[glober] ( literal[string] ): identifier[r] = identifier[re] . identifier[mat...
def get_i2c_bus_numbers(glober=glob.glob): """Search all the available I2C devices in the system""" res = [] for device in glober('/dev/i2c-*'): r = re.match('/dev/i2c-([\\d]){1,2}', device) res.append(int(r.group(1))) # depends on [control=['for'], data=['device']] return res
def freeze(plugins_directory): ''' Parameters ---------- plugins_directory : str Path to MicroDrop user plugins directory. Returns ------- list List of package strings corresponding to installed plugin versions. ''' # Check existing version (if any). package_vers...
def function[freeze, parameter[plugins_directory]]: constant[ Parameters ---------- plugins_directory : str Path to MicroDrop user plugins directory. Returns ------- list List of package strings corresponding to installed plugin versions. ] variable[package_v...
keyword[def] identifier[freeze] ( identifier[plugins_directory] ): literal[string] identifier[package_versions] =[] keyword[for] identifier[plugin_path_i] keyword[in] identifier[plugins_directory] . identifier[dirs] (): keyword[try] : identifier[plugin_metadata] = identif...
def freeze(plugins_directory): """ Parameters ---------- plugins_directory : str Path to MicroDrop user plugins directory. Returns ------- list List of package strings corresponding to installed plugin versions. """ # Check existing version (if any). package_vers...
def _query(self, path: str, method: str, data: Dict[str, Any]=None, expected_status: int = 200) \ -> Union[List[Dict[str, Any]], Dict[str, Any], None]: """Make an HTTP request Args: path: the URI path (not including the base url, start with the first uri segment,...
def function[_query, parameter[self, path, method, data, expected_status]]: constant[Make an HTTP request Args: path: the URI path (not including the base url, start with the first uri segment, like 'users/...') method: the HTTP method to use (GET, POST, PATCH, ....
keyword[def] identifier[_query] ( identifier[self] , identifier[path] : identifier[str] , identifier[method] : identifier[str] , identifier[data] : identifier[Dict] [ identifier[str] , identifier[Any] ]= keyword[None] , identifier[expected_status] : identifier[int] = literal[int] )-> identifier[Union] [ identifier[Li...
def _query(self, path: str, method: str, data: Dict[str, Any]=None, expected_status: int=200) -> Union[List[Dict[str, Any]], Dict[str, Any], None]: """Make an HTTP request Args: path: the URI path (not including the base url, start with the first uri segment, like 'users/...') ...
def qteToBeKilled(self): """ Remove all selections and install the original lexer. """ self.qteWidget.SCISetStylingEx(0, 0, self.styleOrig) self.qteWidget.qteSetLexer(self.originalLexer)
def function[qteToBeKilled, parameter[self]]: constant[ Remove all selections and install the original lexer. ] call[name[self].qteWidget.SCISetStylingEx, parameter[constant[0], constant[0], name[self].styleOrig]] call[name[self].qteWidget.qteSetLexer, parameter[name[self].origin...
keyword[def] identifier[qteToBeKilled] ( identifier[self] ): literal[string] identifier[self] . identifier[qteWidget] . identifier[SCISetStylingEx] ( literal[int] , literal[int] , identifier[self] . identifier[styleOrig] ) identifier[self] . identifier[qteWidget] . identifier[qteSetLexer] ...
def qteToBeKilled(self): """ Remove all selections and install the original lexer. """ self.qteWidget.SCISetStylingEx(0, 0, self.styleOrig) self.qteWidget.qteSetLexer(self.originalLexer)
def validate_list_of_strings_param(param_name, param_argument): """Validate that an argument is a list of strings. :param param_name: The name of the parameter being validated. Used in any resulting exception messages. :type param_name: str | unicode :param param_argument: The argument to validate. ...
def function[validate_list_of_strings_param, parameter[param_name, param_argument]]: constant[Validate that an argument is a list of strings. :param param_name: The name of the parameter being validated. Used in any resulting exception messages. :type param_name: str | unicode :param param_argument...
keyword[def] identifier[validate_list_of_strings_param] ( identifier[param_name] , identifier[param_argument] ): literal[string] keyword[if] identifier[param_argument] keyword[is] keyword[None] : identifier[param_argument] =[] keyword[if] identifier[isinstance] ( identifier[param_argument...
def validate_list_of_strings_param(param_name, param_argument): """Validate that an argument is a list of strings. :param param_name: The name of the parameter being validated. Used in any resulting exception messages. :type param_name: str | unicode :param param_argument: The argument to validate. ...
def user_view_task(self, ): """View the task that is selected :returns: None :rtype: None :raises: None """ if not self.cur_user: return i = self.user_task_treev.currentIndex() item = i.internalPointer() if item: task = ite...
def function[user_view_task, parameter[self]]: constant[View the task that is selected :returns: None :rtype: None :raises: None ] if <ast.UnaryOp object at 0x7da1b16ab820> begin[:] return[None] variable[i] assign[=] call[name[self].user_task_treev.curren...
keyword[def] identifier[user_view_task] ( identifier[self] ,): literal[string] keyword[if] keyword[not] identifier[self] . identifier[cur_user] : keyword[return] identifier[i] = identifier[self] . identifier[user_task_treev] . identifier[currentIndex] () identifier...
def user_view_task(self): """View the task that is selected :returns: None :rtype: None :raises: None """ if not self.cur_user: return # depends on [control=['if'], data=[]] i = self.user_task_treev.currentIndex() item = i.internalPointer() if item: ...
def _fromData(cls, header, tflags, data): """Construct this ID3 frame from raw string data. Raises: ID3JunkFrameError in case parsing failed NotImplementedError in case parsing isn't implemented ID3EncryptionUnsupportedError in case the frame is encrypted. """ ...
def function[_fromData, parameter[cls, header, tflags, data]]: constant[Construct this ID3 frame from raw string data. Raises: ID3JunkFrameError in case parsing failed NotImplementedError in case parsing isn't implemented ID3EncryptionUnsupportedError in case the frame is encry...
keyword[def] identifier[_fromData] ( identifier[cls] , identifier[header] , identifier[tflags] , identifier[data] ): literal[string] keyword[if] identifier[header] . identifier[version] >= identifier[header] . identifier[_V24] : keyword[if] identifier[tflags] &( identifier[Frame] . ...
def _fromData(cls, header, tflags, data): """Construct this ID3 frame from raw string data. Raises: ID3JunkFrameError in case parsing failed NotImplementedError in case parsing isn't implemented ID3EncryptionUnsupportedError in case the frame is encrypted. """ if header...
def recvSecurityResult(self, data): """ Read security result packet Use by server to inform connection status of client @param data: Stream that contain well formed packet """ result = UInt32Be() data.readType(result) if result == UInt32Be(1): ...
def function[recvSecurityResult, parameter[self, data]]: constant[ Read security result packet Use by server to inform connection status of client @param data: Stream that contain well formed packet ] variable[result] assign[=] call[name[UInt32Be], parameter[]] c...
keyword[def] identifier[recvSecurityResult] ( identifier[self] , identifier[data] ): literal[string] identifier[result] = identifier[UInt32Be] () identifier[data] . identifier[readType] ( identifier[result] ) keyword[if] identifier[result] == identifier[UInt32Be] ( literal[int] )...
def recvSecurityResult(self, data): """ Read security result packet Use by server to inform connection status of client @param data: Stream that contain well formed packet """ result = UInt32Be() data.readType(result) if result == UInt32Be(1): log.info('Authentif...