code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def granules(self): """Return list of SentinelGranule objects.""" for element in self._product_metadata.iter("Product_Info"): product_organisation = element.find("Product_Organisation") if self.product_format == 'SAFE': return [ SentinelGranule(_id.find("G...
def function[granules, parameter[self]]: constant[Return list of SentinelGranule objects.] for taget[name[element]] in starred[call[name[self]._product_metadata.iter, parameter[constant[Product_Info]]]] begin[:] variable[product_organisation] assign[=] call[name[element].find, parameter[...
keyword[def] identifier[granules] ( identifier[self] ): literal[string] keyword[for] identifier[element] keyword[in] identifier[self] . identifier[_product_metadata] . identifier[iter] ( literal[string] ): identifier[product_organisation] = identifier[element] . identifier[find] ( l...
def granules(self): """Return list of SentinelGranule objects.""" for element in self._product_metadata.iter('Product_Info'): product_organisation = element.find('Product_Organisation') # depends on [control=['for'], data=['element']] if self.product_format == 'SAFE': return [SentinelGranul...
def get_image_by_kind(self, kind): """ returns a image of a specific kind """ for ss in self.images: if ss.kind == kind: return ss return None
def function[get_image_by_kind, parameter[self, kind]]: constant[ returns a image of a specific kind ] for taget[name[ss]] in starred[name[self].images] begin[:] if compare[name[ss].kind equal[==] name[kind]] begin[:] return[name[ss]] return[constant[None]]
keyword[def] identifier[get_image_by_kind] ( identifier[self] , identifier[kind] ): literal[string] keyword[for] identifier[ss] keyword[in] identifier[self] . identifier[images] : keyword[if] identifier[ss] . identifier[kind] == identifier[kind] : keyword[return] ...
def get_image_by_kind(self, kind): """ returns a image of a specific kind """ for ss in self.images: if ss.kind == kind: return ss # depends on [control=['if'], data=[]] # depends on [control=['for'], data=['ss']] return None
def extract_features(self, data_frame, pre=''): """ This method extracts all the features available to the Tremor Processor class. :param data_frame: the data frame :type data_frame: pandas.DataFrame :return: amplitude_by_fft, frequency_by_fft, amplitude_by_welch...
def function[extract_features, parameter[self, data_frame, pre]]: constant[ This method extracts all the features available to the Tremor Processor class. :param data_frame: the data frame :type data_frame: pandas.DataFrame :return: amplitude_by_fft, frequency_by...
keyword[def] identifier[extract_features] ( identifier[self] , identifier[data_frame] , identifier[pre] = literal[string] ): literal[string] keyword[try] : identifier[magnitude_partial_autocorrelation] = identifier[self] . identifier[partial_autocorrelation] ( identifier[data_frame] . ...
def extract_features(self, data_frame, pre=''): """ This method extracts all the features available to the Tremor Processor class. :param data_frame: the data frame :type data_frame: pandas.DataFrame :return: amplitude_by_fft, frequency_by_fft, amplitude_by_welch, fr...
def create(self): """Create this instance. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance .. note:: Uses the ``project`` and ``instance_id`` on the current :class:`...
def function[create, parameter[self]]: constant[Create this instance. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance .. note:: Uses the ``project`` and ``instance_id`` on the ...
keyword[def] identifier[create] ( identifier[self] ): literal[string] identifier[api] = identifier[self] . identifier[_client] . identifier[instance_admin_api] identifier[instance_pb] = identifier[admin_v1_pb2] . identifier[Instance] ( identifier[name] = identifier[self] . identi...
def create(self): """Create this instance. See https://cloud.google.com/spanner/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance .. note:: Uses the ``project`` and ``instance_id`` on the current :class:`Inst...
def save_object(self, obj): """ Save object to disk as JSON. Generally shouldn't be called directly. """ obj.pre_save(self.jurisdiction.jurisdiction_id) filename = '{0}_{1}.json'.format(obj._type, obj._id).replace('/', '-') self.info('save %s %s as %s',...
def function[save_object, parameter[self, obj]]: constant[ Save object to disk as JSON. Generally shouldn't be called directly. ] call[name[obj].pre_save, parameter[name[self].jurisdiction.jurisdiction_id]] variable[filename] assign[=] call[call[constant[{0}_{1}....
keyword[def] identifier[save_object] ( identifier[self] , identifier[obj] ): literal[string] identifier[obj] . identifier[pre_save] ( identifier[self] . identifier[jurisdiction] . identifier[jurisdiction_id] ) identifier[filename] = literal[string] . identifier[format] ( identifier[obj] ....
def save_object(self, obj): """ Save object to disk as JSON. Generally shouldn't be called directly. """ obj.pre_save(self.jurisdiction.jurisdiction_id) filename = '{0}_{1}.json'.format(obj._type, obj._id).replace('/', '-') self.info('save %s %s as %s', obj._type, obj, f...
def action2button(action, autoraise=True, text_beside_icon=False, parent=None): """Create a QToolButton directly from a QAction object""" if parent is None: parent = action.parent() button = QToolButton(parent) button.setDefaultAction(action) button.setAutoRaise(autoraise) if text...
def function[action2button, parameter[action, autoraise, text_beside_icon, parent]]: constant[Create a QToolButton directly from a QAction object] if compare[name[parent] is constant[None]] begin[:] variable[parent] assign[=] call[name[action].parent, parameter[]] variable[button...
keyword[def] identifier[action2button] ( identifier[action] , identifier[autoraise] = keyword[True] , identifier[text_beside_icon] = keyword[False] , identifier[parent] = keyword[None] ): literal[string] keyword[if] identifier[parent] keyword[is] keyword[None] : identifier[parent] = identifi...
def action2button(action, autoraise=True, text_beside_icon=False, parent=None): """Create a QToolButton directly from a QAction object""" if parent is None: parent = action.parent() # depends on [control=['if'], data=['parent']] button = QToolButton(parent) button.setDefaultAction(action) b...
def disable(self, everything=False): """ Disable all but possibly not binning, which is needed for FF apps Parameters --------- everything : bool disable binning as well """ self.freeze() if not everything: self.xbin.enable() ...
def function[disable, parameter[self, everything]]: constant[ Disable all but possibly not binning, which is needed for FF apps Parameters --------- everything : bool disable binning as well ] call[name[self].freeze, parameter[]] if <ast.Unary...
keyword[def] identifier[disable] ( identifier[self] , identifier[everything] = keyword[False] ): literal[string] identifier[self] . identifier[freeze] () keyword[if] keyword[not] identifier[everything] : identifier[self] . identifier[xbin] . identifier[enable] () ...
def disable(self, everything=False): """ Disable all but possibly not binning, which is needed for FF apps Parameters --------- everything : bool disable binning as well """ self.freeze() if not everything: self.xbin.enable() self.ybin.ena...
def _set_cfg(self, v, load=False): """ Setter method for cfg, mapped from YANG variable /zoning/defined_configuration/cfg (list) If this variable is read-only (config: false) in the source YANG file, then _set_cfg is considered as a private method. Backends looking to populate this variable should ...
def function[_set_cfg, parameter[self, v, load]]: constant[ Setter method for cfg, mapped from YANG variable /zoning/defined_configuration/cfg (list) If this variable is read-only (config: false) in the source YANG file, then _set_cfg is considered as a private method. Backends looking to popula...
keyword[def] identifier[_set_cfg] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : identifier...
def _set_cfg(self, v, load=False): """ Setter method for cfg, mapped from YANG variable /zoning/defined_configuration/cfg (list) If this variable is read-only (config: false) in the source YANG file, then _set_cfg is considered as a private method. Backends looking to populate this variable should ...
def to_astropy_column(llwcol, cls, copy=False, dtype=None, use_numpy_dtype=False, **kwargs): """Convert a :class:`~ligo.lw.table.Column` to `astropy.table.Column` Parameters ----------- llwcol : :class:`~ligo.lw.table.Column`, `numpy.ndarray`, iterable the LIGO_LW column t...
def function[to_astropy_column, parameter[llwcol, cls, copy, dtype, use_numpy_dtype]]: constant[Convert a :class:`~ligo.lw.table.Column` to `astropy.table.Column` Parameters ----------- llwcol : :class:`~ligo.lw.table.Column`, `numpy.ndarray`, iterable the LIGO_LW column to convert, or an i...
keyword[def] identifier[to_astropy_column] ( identifier[llwcol] , identifier[cls] , identifier[copy] = keyword[False] , identifier[dtype] = keyword[None] , identifier[use_numpy_dtype] = keyword[False] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[dtype] keyword[is] keyword[None] : ...
def to_astropy_column(llwcol, cls, copy=False, dtype=None, use_numpy_dtype=False, **kwargs): """Convert a :class:`~ligo.lw.table.Column` to `astropy.table.Column` Parameters ----------- llwcol : :class:`~ligo.lw.table.Column`, `numpy.ndarray`, iterable the LIGO_LW column to convert, or an itera...
def kent_mean(dec=None, inc=None, di_block=None): """ Calculates the Kent mean and associated statistical parameters from either a list of declination values and a separate list of inclination values or from a di_block (a nested list a nested list of [dec,inc,1.0]). Returns a dictionary with the Ken...
def function[kent_mean, parameter[dec, inc, di_block]]: constant[ Calculates the Kent mean and associated statistical parameters from either a list of declination values and a separate list of inclination values or from a di_block (a nested list a nested list of [dec,inc,1.0]). Returns a diction...
keyword[def] identifier[kent_mean] ( identifier[dec] = keyword[None] , identifier[inc] = keyword[None] , identifier[di_block] = keyword[None] ): literal[string] keyword[if] identifier[di_block] keyword[is] keyword[None] : identifier[di_block] = identifier[make_di_block] ( identifier[dec] , iden...
def kent_mean(dec=None, inc=None, di_block=None): """ Calculates the Kent mean and associated statistical parameters from either a list of declination values and a separate list of inclination values or from a di_block (a nested list a nested list of [dec,inc,1.0]). Returns a dictionary with the Ken...
def inject_config(self, config, from_args): """ :param config: :type config: list :param from_args: :type from_args: dict """ # First get required values from labelStore runtime = self._get_runtime() whitelist = self._get_whitelist() #Run introspection on the libraries to retriev...
def function[inject_config, parameter[self, config, from_args]]: constant[ :param config: :type config: list :param from_args: :type from_args: dict ] variable[runtime] assign[=] call[name[self]._get_runtime, parameter[]] variable[whitelist] assign[=] call[name[self]._get_whi...
keyword[def] identifier[inject_config] ( identifier[self] , identifier[config] , identifier[from_args] ): literal[string] identifier[runtime] = identifier[self] . identifier[_get_runtime] () identifier[whitelist] = identifier[self] . identifier[_get_whitelist] () identifier[found_librar...
def inject_config(self, config, from_args): """ :param config: :type config: list :param from_args: :type from_args: dict """ # First get required values from labelStore runtime = self._get_runtime() whitelist = self._get_whitelist() #Run introspection on the libraries to retriev...
def get_nagios_unit_name(relation_name='nrpe-external-master'): """ Return the nagios unit name prepended with host_context if needed :param str relation_name: Name of relation nrpe sub joined to """ host_context = get_nagios_hostcontext(relation_name) if host_context: unit = "%s:%s" % ...
def function[get_nagios_unit_name, parameter[relation_name]]: constant[ Return the nagios unit name prepended with host_context if needed :param str relation_name: Name of relation nrpe sub joined to ] variable[host_context] assign[=] call[name[get_nagios_hostcontext], parameter[name[relati...
keyword[def] identifier[get_nagios_unit_name] ( identifier[relation_name] = literal[string] ): literal[string] identifier[host_context] = identifier[get_nagios_hostcontext] ( identifier[relation_name] ) keyword[if] identifier[host_context] : identifier[unit] = literal[string] %( identifier[h...
def get_nagios_unit_name(relation_name='nrpe-external-master'): """ Return the nagios unit name prepended with host_context if needed :param str relation_name: Name of relation nrpe sub joined to """ host_context = get_nagios_hostcontext(relation_name) if host_context: unit = '%s:%s' % ...
def get_headline(self, name): """Get stored messages for a service. Args: name (string): The name of the service to get messages from. Returns: ServiceMessage: the headline or None if no headline has been set """ return self._loop.run_coroutine(self._cl...
def function[get_headline, parameter[self, name]]: constant[Get stored messages for a service. Args: name (string): The name of the service to get messages from. Returns: ServiceMessage: the headline or None if no headline has been set ] return[call[name[sel...
keyword[def] identifier[get_headline] ( identifier[self] , identifier[name] ): literal[string] keyword[return] identifier[self] . identifier[_loop] . identifier[run_coroutine] ( identifier[self] . identifier[_client] . identifier[get_headline] ( identifier[name] ))
def get_headline(self, name): """Get stored messages for a service. Args: name (string): The name of the service to get messages from. Returns: ServiceMessage: the headline or None if no headline has been set """ return self._loop.run_coroutine(self._client.get_...
def with_revision(self, label, number): """ Returns a Tag with a given revision """ t = self.clone() t.revision = Revision(label, number) return t
def function[with_revision, parameter[self, label, number]]: constant[ Returns a Tag with a given revision ] variable[t] assign[=] call[name[self].clone, parameter[]] name[t].revision assign[=] call[name[Revision], parameter[name[label], name[number]]] return[name[t]]
keyword[def] identifier[with_revision] ( identifier[self] , identifier[label] , identifier[number] ): literal[string] identifier[t] = identifier[self] . identifier[clone] () identifier[t] . identifier[revision] = identifier[Revision] ( identifier[label] , identifier[number] ) keyw...
def with_revision(self, label, number): """ Returns a Tag with a given revision """ t = self.clone() t.revision = Revision(label, number) return t
def parse_content_type(header): """Parse the "Content-Type" header.""" typ = subtyp = None; options = {} typ, pos = expect_re(re_token, header, 0) _, pos = expect_lit('/', header, pos) subtyp, pos = expect_re(re_token, header, pos) ctype = header[:pos] if subtyp else '' while pos < len(heade...
def function[parse_content_type, parameter[header]]: constant[Parse the "Content-Type" header.] variable[typ] assign[=] constant[None] variable[options] assign[=] dictionary[[], []] <ast.Tuple object at 0x7da18ede6680> assign[=] call[name[expect_re], parameter[name[re_token], name[header...
keyword[def] identifier[parse_content_type] ( identifier[header] ): literal[string] identifier[typ] = identifier[subtyp] = keyword[None] ; identifier[options] ={} identifier[typ] , identifier[pos] = identifier[expect_re] ( identifier[re_token] , identifier[header] , literal[int] ) identifier[_] ,...
def parse_content_type(header): """Parse the "Content-Type" header.""" typ = subtyp = None options = {} (typ, pos) = expect_re(re_token, header, 0) (_, pos) = expect_lit('/', header, pos) (subtyp, pos) = expect_re(re_token, header, pos) ctype = header[:pos] if subtyp else '' while pos < ...
def action_checkbox(self, obj): """ A list_display column containing a checkbox widget. """ if self.check_concurrent_action: return helpers.checkbox.render(helpers.ACTION_CHECKBOX_NAME, force_text("%s,%s" % (obj.pk, ...
def function[action_checkbox, parameter[self, obj]]: constant[ A list_display column containing a checkbox widget. ] if name[self].check_concurrent_action begin[:] return[call[name[helpers].checkbox.render, parameter[name[helpers].ACTION_CHECKBOX_NAME, call[name[force_text], para...
keyword[def] identifier[action_checkbox] ( identifier[self] , identifier[obj] ): literal[string] keyword[if] identifier[self] . identifier[check_concurrent_action] : keyword[return] identifier[helpers] . identifier[checkbox] . identifier[render] ( identifier[helpers] . identifier[ACT...
def action_checkbox(self, obj): """ A list_display column containing a checkbox widget. """ if self.check_concurrent_action: return helpers.checkbox.render(helpers.ACTION_CHECKBOX_NAME, force_text('%s,%s' % (obj.pk, get_revision_of_object(obj)))) # depends on [control=['if'], data=[]] ...
def maybe_clean(self): """Clean the cache if it's time to do so.""" now = time.time() if self.next_cleaning <= now: keys_to_delete = [] for (k, v) in self.data.iteritems(): if v.expiration <= now: keys_to_delete.append(k) f...
def function[maybe_clean, parameter[self]]: constant[Clean the cache if it's time to do so.] variable[now] assign[=] call[name[time].time, parameter[]] if compare[name[self].next_cleaning less_or_equal[<=] name[now]] begin[:] variable[keys_to_delete] assign[=] list[[]] ...
keyword[def] identifier[maybe_clean] ( identifier[self] ): literal[string] identifier[now] = identifier[time] . identifier[time] () keyword[if] identifier[self] . identifier[next_cleaning] <= identifier[now] : identifier[keys_to_delete] =[] keyword[for] ( identi...
def maybe_clean(self): """Clean the cache if it's time to do so.""" now = time.time() if self.next_cleaning <= now: keys_to_delete = [] for (k, v) in self.data.iteritems(): if v.expiration <= now: keys_to_delete.append(k) # depends on [control=['if'], data=[]] #...
def to_sqlite3(self, conn, target, *args, **kwargs): """ Saves the sequence to sqlite3 database. Target table must be created in advance. The table schema is inferred from the elements in the sequence if only target table name is supplied. >>> seq([(1, 'Tom'), (2, 'Jack'...
def function[to_sqlite3, parameter[self, conn, target]]: constant[ Saves the sequence to sqlite3 database. Target table must be created in advance. The table schema is inferred from the elements in the sequence if only target table name is supplied. >>> seq([(1, 'Tom'), ...
keyword[def] identifier[to_sqlite3] ( identifier[self] , identifier[conn] , identifier[target] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[insert_regex] = identifier[re] . identifier[compile] ( literal[string] , identifier[flags] = identifier[re] . identifier[I...
def to_sqlite3(self, conn, target, *args, **kwargs): """ Saves the sequence to sqlite3 database. Target table must be created in advance. The table schema is inferred from the elements in the sequence if only target table name is supplied. >>> seq([(1, 'Tom'), (2, 'Jack')]) ...
def create_paramnames_file(self): """The param_names file lists every parameter's analysis_path and Latex tag, and is used for *GetDist* visualization. The parameter names are determined from the class instance names of the model_mapper. Latex tags are properties of each model class."""...
def function[create_paramnames_file, parameter[self]]: constant[The param_names file lists every parameter's analysis_path and Latex tag, and is used for *GetDist* visualization. The parameter names are determined from the class instance names of the model_mapper. Latex tags are propert...
keyword[def] identifier[create_paramnames_file] ( identifier[self] ): literal[string] identifier[paramnames_names] = identifier[self] . identifier[variable] . identifier[param_names] identifier[paramnames_labels] = identifier[self] . identifier[param_labels] keyword[with] ident...
def create_paramnames_file(self): """The param_names file lists every parameter's analysis_path and Latex tag, and is used for *GetDist* visualization. The parameter names are determined from the class instance names of the model_mapper. Latex tags are properties of each model class.""" ...
def graph_data_on_the_same_graph(list_of_plots, output_directory, resource_path, output_filename): """ graph_data_on_the_same_graph: put a list of plots on the same graph: currently it supports CDF """ maximum_yvalue = -float('inf') minimum_yvalue = float('inf') plots = curate_plot_list(list_of_plots) plo...
def function[graph_data_on_the_same_graph, parameter[list_of_plots, output_directory, resource_path, output_filename]]: constant[ graph_data_on_the_same_graph: put a list of plots on the same graph: currently it supports CDF ] variable[maximum_yvalue] assign[=] <ast.UnaryOp object at 0x7da1aff6da50>...
keyword[def] identifier[graph_data_on_the_same_graph] ( identifier[list_of_plots] , identifier[output_directory] , identifier[resource_path] , identifier[output_filename] ): literal[string] identifier[maximum_yvalue] =- identifier[float] ( literal[string] ) identifier[minimum_yvalue] = identifier[float] ( l...
def graph_data_on_the_same_graph(list_of_plots, output_directory, resource_path, output_filename): """ graph_data_on_the_same_graph: put a list of plots on the same graph: currently it supports CDF """ maximum_yvalue = -float('inf') minimum_yvalue = float('inf') plots = curate_plot_list(list_of_plot...
def st_atime(self): """Return the access time in seconds.""" atime = self._st_atime_ns / 1e9 return atime if self.use_float else int(atime)
def function[st_atime, parameter[self]]: constant[Return the access time in seconds.] variable[atime] assign[=] binary_operation[name[self]._st_atime_ns / constant[1000000000.0]] return[<ast.IfExp object at 0x7da2047ea140>]
keyword[def] identifier[st_atime] ( identifier[self] ): literal[string] identifier[atime] = identifier[self] . identifier[_st_atime_ns] / literal[int] keyword[return] identifier[atime] keyword[if] identifier[self] . identifier[use_float] keyword[else] identifier[int] ( identifier[ati...
def st_atime(self): """Return the access time in seconds.""" atime = self._st_atime_ns / 1000000000.0 return atime if self.use_float else int(atime)
def indices(self, data): '''Generate patch start indices Parameters ---------- data : dict of np.ndarray As produced by pumpp.transform Yields ------ start : int >= 0 The start index of a sample patch ''' duration = self.d...
def function[indices, parameter[self, data]]: constant[Generate patch start indices Parameters ---------- data : dict of np.ndarray As produced by pumpp.transform Yields ------ start : int >= 0 The start index of a sample patch ] ...
keyword[def] identifier[indices] ( identifier[self] , identifier[data] ): literal[string] identifier[duration] = identifier[self] . identifier[data_duration] ( identifier[data] ) keyword[for] identifier[start] keyword[in] identifier[range] ( literal[int] , identifier[duration] - identi...
def indices(self, data): """Generate patch start indices Parameters ---------- data : dict of np.ndarray As produced by pumpp.transform Yields ------ start : int >= 0 The start index of a sample patch """ duration = self.data_dura...
def crossover_template(cls, length, points=2): """Create a crossover template with the given number of points. The crossover template can be used as a mask to crossover two bitstrings of the same length. Usage: assert len(parent1) == len(parent2) template = BitSt...
def function[crossover_template, parameter[cls, length, points]]: constant[Create a crossover template with the given number of points. The crossover template can be used as a mask to crossover two bitstrings of the same length. Usage: assert len(parent1) == len(parent2) ...
keyword[def] identifier[crossover_template] ( identifier[cls] , identifier[length] , identifier[points] = literal[int] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[length] , identifier[int] ) keyword[and] identifier[length] >= literal[int] keyword[assert] ide...
def crossover_template(cls, length, points=2): """Create a crossover template with the given number of points. The crossover template can be used as a mask to crossover two bitstrings of the same length. Usage: assert len(parent1) == len(parent2) template = BitString...
def process_line( line, # type: Text filename, # type: str line_number, # type: int finder=None, # type: Optional[PackageFinder] comes_from=None, # type: Optional[str] options=None, # type: Optional[optparse.Values] session=None, # type: Optional[PipSession] wheel_cache=None, # t...
def function[process_line, parameter[line, filename, line_number, finder, comes_from, options, session, wheel_cache, use_pep517, constraint]]: constant[Process a single requirements line; This can result in creating/yielding requirements, or updating the finder. For lines that contain requirements, the...
keyword[def] identifier[process_line] ( identifier[line] , identifier[filename] , identifier[line_number] , identifier[finder] = keyword[None] , identifier[comes_from] = keyword[None] , identifier[options] = keyword[None] , identifier[session] = keyword[None] , identifier[wheel_cache] = keyword[None] , ident...
def process_line(line, filename, line_number, finder=None, comes_from=None, options=None, session=None, wheel_cache=None, use_pep517=None, constraint=False): # type: Text # type: str # type: int # type: Optional[PackageFinder] # type: Optional[str] # type: Optional[optparse.Values] # type: Opti...
def config_get(key, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs): ''' Get the value of a key in the git configuration file key The name of the configuration key to ...
def function[config_get, parameter[key, cwd, user, password, ignore_retcode, output_encoding]]: constant[ Get the value of a key in the git configuration file key The name of the configuration key to get .. versionchanged:: 2015.8.0 Argument renamed from ``setting_name`` to...
keyword[def] identifier[config_get] ( identifier[key] , identifier[cwd] = keyword[None] , identifier[user] = keyword[None] , identifier[password] = keyword[None] , identifier[ignore_retcode] = keyword[False] , identifier[output_encoding] = keyword[None] , ** identifier[kwargs] ): literal[string] ...
def config_get(key, cwd=None, user=None, password=None, ignore_retcode=False, output_encoding=None, **kwargs): """ Get the value of a key in the git configuration file key The name of the configuration key to get .. versionchanged:: 2015.8.0 Argument renamed from ``setting_name...
def parse(file_to_parse): # suppress(unused-function) """Check file_to_parse for a shebang and return its components. :file_to_parse: can be either a filename or an open file object. If file_to_parse's extension exists in PATHEXT then an empty list will be returned, as it is assumed that the operatin...
def function[parse, parameter[file_to_parse]]: constant[Check file_to_parse for a shebang and return its components. :file_to_parse: can be either a filename or an open file object. If file_to_parse's extension exists in PATHEXT then an empty list will be returned, as it is assumed that the operat...
keyword[def] identifier[parse] ( identifier[file_to_parse] ): literal[string] keyword[if] identifier[hasattr] ( identifier[file_to_parse] , literal[string] ): keyword[return] identifier[_parse] ( identifier[file_to_parse] ) keyword[elif] identifier[isinstance] ( identifier[file_to_parse] ,...
def parse(file_to_parse): # suppress(unused-function) "Check file_to_parse for a shebang and return its components.\n\n :file_to_parse: can be either a filename or an open file object.\n\n If file_to_parse's extension exists in PATHEXT then an empty list\n will be returned, as it is assumed that the opera...
def touch(self, message_id, reservation_id, timeout=None): """Touching a reserved message extends its timeout to the duration specified when the message was created. Arguments: message_id -- The ID of the message. reservation_id -- Reservation Id of the message. timeout -- Optio...
def function[touch, parameter[self, message_id, reservation_id, timeout]]: constant[Touching a reserved message extends its timeout to the duration specified when the message was created. Arguments: message_id -- The ID of the message. reservation_id -- Reservation Id of the message. ...
keyword[def] identifier[touch] ( identifier[self] , identifier[message_id] , identifier[reservation_id] , identifier[timeout] = keyword[None] ): literal[string] identifier[url] = literal[string] %( identifier[self] . identifier[name] , identifier[message_id] ) identifier[qitems] ={ literal...
def touch(self, message_id, reservation_id, timeout=None): """Touching a reserved message extends its timeout to the duration specified when the message was created. Arguments: message_id -- The ID of the message. reservation_id -- Reservation Id of the message. timeout -- Optional....
def _process_priv_part(perms): ''' Process part ''' _tmp = {} previous = None for perm in perms: if previous is None: _tmp[_PRIVILEGES_MAP[perm]] = False previous = _PRIVILEGES_MAP[perm] else: if perm == '*': _tmp[previous] = Tr...
def function[_process_priv_part, parameter[perms]]: constant[ Process part ] variable[_tmp] assign[=] dictionary[[], []] variable[previous] assign[=] constant[None] for taget[name[perm]] in starred[name[perms]] begin[:] if compare[name[previous] is constant[None]]...
keyword[def] identifier[_process_priv_part] ( identifier[perms] ): literal[string] identifier[_tmp] ={} identifier[previous] = keyword[None] keyword[for] identifier[perm] keyword[in] identifier[perms] : keyword[if] identifier[previous] keyword[is] keyword[None] : iden...
def _process_priv_part(perms): """ Process part """ _tmp = {} previous = None for perm in perms: if previous is None: _tmp[_PRIVILEGES_MAP[perm]] = False previous = _PRIVILEGES_MAP[perm] # depends on [control=['if'], data=['previous']] elif perm == '*': ...
def remove_independent_variable(self, variable_name): """ Remove an independent variable which was added with add_independent_variable :param variable_name: name of variable to remove :return: """ self._remove_child(variable_name) # Remove also from the list of...
def function[remove_independent_variable, parameter[self, variable_name]]: constant[ Remove an independent variable which was added with add_independent_variable :param variable_name: name of variable to remove :return: ] call[name[self]._remove_child, parameter[name[var...
keyword[def] identifier[remove_independent_variable] ( identifier[self] , identifier[variable_name] ): literal[string] identifier[self] . identifier[_remove_child] ( identifier[variable_name] ) identifier[self] . identifier[_independent_variables] . identifier[pop] ( identifier[...
def remove_independent_variable(self, variable_name): """ Remove an independent variable which was added with add_independent_variable :param variable_name: name of variable to remove :return: """ self._remove_child(variable_name) # Remove also from the list of independent v...
def list_previous_page(self): """ When paging through results, this will return the previous page, using the same limit. If there are no more results, a NoMoreResults exception will be raised. """ uri = self._paging.get("domain", {}).get("prev_uri") if uri is None...
def function[list_previous_page, parameter[self]]: constant[ When paging through results, this will return the previous page, using the same limit. If there are no more results, a NoMoreResults exception will be raised. ] variable[uri] assign[=] call[call[name[self]._pagi...
keyword[def] identifier[list_previous_page] ( identifier[self] ): literal[string] identifier[uri] = identifier[self] . identifier[_paging] . identifier[get] ( literal[string] ,{}). identifier[get] ( literal[string] ) keyword[if] identifier[uri] keyword[is] keyword[None] : k...
def list_previous_page(self): """ When paging through results, this will return the previous page, using the same limit. If there are no more results, a NoMoreResults exception will be raised. """ uri = self._paging.get('domain', {}).get('prev_uri') if uri is None: ra...
def from_file(cls, filename, name=''): "Imports a mass table from a file" df = pd.read_csv(filename, header=0, delim_whitespace=True, index_col=[0, 1])['M'] df.name = name return cls(df=df, name=name)
def function[from_file, parameter[cls, filename, name]]: constant[Imports a mass table from a file] variable[df] assign[=] call[call[name[pd].read_csv, parameter[name[filename]]]][constant[M]] name[df].name assign[=] name[name] return[call[name[cls], parameter[]]]
keyword[def] identifier[from_file] ( identifier[cls] , identifier[filename] , identifier[name] = literal[string] ): literal[string] identifier[df] = identifier[pd] . identifier[read_csv] ( identifier[filename] , identifier[header] = literal[int] , identifier[delim_whitespace] = keyword[True] , iden...
def from_file(cls, filename, name=''): """Imports a mass table from a file""" df = pd.read_csv(filename, header=0, delim_whitespace=True, index_col=[0, 1])['M'] df.name = name return cls(df=df, name=name)
async def update_price_info(self): """Update price info async.""" query = gql( """ { viewer { home(id: "%s") { currentSubscription { priceInfo { current { energy tax ...
<ast.AsyncFunctionDef object at 0x7da1afe6de10>
keyword[async] keyword[def] identifier[update_price_info] ( identifier[self] ): literal[string] identifier[query] = identifier[gql] ( literal[string] % identifier[self] . identifier[home_id] ) identifier[price_info_temp] = keyword[await] identifier[self] . iden...
async def update_price_info(self): """Update price info async.""" query = gql('\n {\n viewer {\n home(id: "%s") {\n currentSubscription {\n priceInfo {\n current {\n energy\n tax\n to...
def call_ext_prog(self, prog, timeout=300, stderr=True, chroot=True, runat=None): """Execute a command independantly of the output gathering part of sosreport. """ return self.get_command_output(prog, timeout=timeout, stderr=stderr, ...
def function[call_ext_prog, parameter[self, prog, timeout, stderr, chroot, runat]]: constant[Execute a command independantly of the output gathering part of sosreport. ] return[call[name[self].get_command_output, parameter[name[prog]]]]
keyword[def] identifier[call_ext_prog] ( identifier[self] , identifier[prog] , identifier[timeout] = literal[int] , identifier[stderr] = keyword[True] , identifier[chroot] = keyword[True] , identifier[runat] = keyword[None] ): literal[string] keyword[return] identifier[self] . identifier[get_comm...
def call_ext_prog(self, prog, timeout=300, stderr=True, chroot=True, runat=None): """Execute a command independantly of the output gathering part of sosreport. """ return self.get_command_output(prog, timeout=timeout, stderr=stderr, chroot=chroot, runat=runat)
def is_abstract_model(model): """ Given a model class, returns a boolean True if it is abstract and False if it is not. """ return hasattr(model, '_meta') and hasattr(model._meta, 'abstract') and model._meta.abstract
def function[is_abstract_model, parameter[model]]: constant[ Given a model class, returns a boolean True if it is abstract and False if it is not. ] return[<ast.BoolOp object at 0x7da1b1300250>]
keyword[def] identifier[is_abstract_model] ( identifier[model] ): literal[string] keyword[return] identifier[hasattr] ( identifier[model] , literal[string] ) keyword[and] identifier[hasattr] ( identifier[model] . identifier[_meta] , literal[string] ) keyword[and] identifier[model] . identifier[_meta] . ...
def is_abstract_model(model): """ Given a model class, returns a boolean True if it is abstract and False if it is not. """ return hasattr(model, '_meta') and hasattr(model._meta, 'abstract') and model._meta.abstract
def _gorg(a): """Return the farthest origin of a generic class (internal helper).""" assert isinstance(a, GenericMeta) while a.__origin__ is not None: a = a.__origin__ return a
def function[_gorg, parameter[a]]: constant[Return the farthest origin of a generic class (internal helper).] assert[call[name[isinstance], parameter[name[a], name[GenericMeta]]]] while compare[name[a].__origin__ is_not constant[None]] begin[:] variable[a] assign[=] name[a].__origin_...
keyword[def] identifier[_gorg] ( identifier[a] ): literal[string] keyword[assert] identifier[isinstance] ( identifier[a] , identifier[GenericMeta] ) keyword[while] identifier[a] . identifier[__origin__] keyword[is] keyword[not] keyword[None] : identifier[a] = identifier[a] . identifier[_...
def _gorg(a): """Return the farthest origin of a generic class (internal helper).""" assert isinstance(a, GenericMeta) while a.__origin__ is not None: a = a.__origin__ # depends on [control=['while'], data=[]] return a
def from_cdms2(variable): """Convert a cdms2 variable into an DataArray """ values = np.asarray(variable) name = variable.id dims = variable.getAxisIds() coords = {} for axis in variable.getAxisList(): coords[axis.id] = DataArray( np.asarray(axis), dims=[axis.id], ...
def function[from_cdms2, parameter[variable]]: constant[Convert a cdms2 variable into an DataArray ] variable[values] assign[=] call[name[np].asarray, parameter[name[variable]]] variable[name] assign[=] name[variable].id variable[dims] assign[=] call[name[variable].getAxisIds, parame...
keyword[def] identifier[from_cdms2] ( identifier[variable] ): literal[string] identifier[values] = identifier[np] . identifier[asarray] ( identifier[variable] ) identifier[name] = identifier[variable] . identifier[id] identifier[dims] = identifier[variable] . identifier[getAxisIds] () ident...
def from_cdms2(variable): """Convert a cdms2 variable into an DataArray """ values = np.asarray(variable) name = variable.id dims = variable.getAxisIds() coords = {} for axis in variable.getAxisList(): coords[axis.id] = DataArray(np.asarray(axis), dims=[axis.id], attrs=_filter_attrs(...
def _is_string(thing): """Check that **thing** is a string. The definition of the latter depends upon the Python version. :param thing: The thing to check if it's a string. :rtype: bool :returns: ``True`` if **thing** is string (or unicode in Python2). """ if (_py3k and isinstance(thing, st...
def function[_is_string, parameter[thing]]: constant[Check that **thing** is a string. The definition of the latter depends upon the Python version. :param thing: The thing to check if it's a string. :rtype: bool :returns: ``True`` if **thing** is string (or unicode in Python2). ] i...
keyword[def] identifier[_is_string] ( identifier[thing] ): literal[string] keyword[if] ( identifier[_py3k] keyword[and] identifier[isinstance] ( identifier[thing] , identifier[str] )): keyword[return] keyword[True] keyword[if] ( keyword[not] identifier[_py3k] keyword[and] identifier[is...
def _is_string(thing): """Check that **thing** is a string. The definition of the latter depends upon the Python version. :param thing: The thing to check if it's a string. :rtype: bool :returns: ``True`` if **thing** is string (or unicode in Python2). """ if _py3k and isinstance(thing, str...
def outfile(self): """Path of the output file""" return os.path.join(OPTIONS['base_dir'], '{0}.{1}'.format(self.name, OPTIONS['out_ext']))
def function[outfile, parameter[self]]: constant[Path of the output file] return[call[name[os].path.join, parameter[call[name[OPTIONS]][constant[base_dir]], call[constant[{0}.{1}].format, parameter[name[self].name, call[name[OPTIONS]][constant[out_ext]]]]]]]
keyword[def] identifier[outfile] ( identifier[self] ): literal[string] keyword[return] identifier[os] . identifier[path] . identifier[join] ( identifier[OPTIONS] [ literal[string] ], literal[string] . identifier[format] ( identifier[self] . identifier[name] , identifier[OPTIONS] [ literal...
def outfile(self): """Path of the output file""" return os.path.join(OPTIONS['base_dir'], '{0}.{1}'.format(self.name, OPTIONS['out_ext']))
def load_table_from_uri( self, source_uris, destination, job_id=None, job_id_prefix=None, location=None, project=None, job_config=None, retry=DEFAULT_RETRY, ): """Starts a job for loading data into a table from CloudStorage. Se...
def function[load_table_from_uri, parameter[self, source_uris, destination, job_id, job_id_prefix, location, project, job_config, retry]]: constant[Starts a job for loading data into a table from CloudStorage. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configuration.load ...
keyword[def] identifier[load_table_from_uri] ( identifier[self] , identifier[source_uris] , identifier[destination] , identifier[job_id] = keyword[None] , identifier[job_id_prefix] = keyword[None] , identifier[location] = keyword[None] , identifier[project] = keyword[None] , identifier[job_config] = keyword[N...
def load_table_from_uri(self, source_uris, destination, job_id=None, job_id_prefix=None, location=None, project=None, job_config=None, retry=DEFAULT_RETRY): """Starts a job for loading data into a table from CloudStorage. See https://cloud.google.com/bigquery/docs/reference/rest/v2/jobs#configurati...
def finditer(self, string, pos=0, endpos=sys.maxint): """Return a list of all non-overlapping matches of pattern in string.""" scanner = self.scanner(string, pos, endpos) return iter(scanner.search, None)
def function[finditer, parameter[self, string, pos, endpos]]: constant[Return a list of all non-overlapping matches of pattern in string.] variable[scanner] assign[=] call[name[self].scanner, parameter[name[string], name[pos], name[endpos]]] return[call[name[iter], parameter[name[scanner].search, co...
keyword[def] identifier[finditer] ( identifier[self] , identifier[string] , identifier[pos] = literal[int] , identifier[endpos] = identifier[sys] . identifier[maxint] ): literal[string] identifier[scanner] = identifier[self] . identifier[scanner] ( identifier[string] , identifier[pos] , identifier[...
def finditer(self, string, pos=0, endpos=sys.maxint): """Return a list of all non-overlapping matches of pattern in string.""" scanner = self.scanner(string, pos, endpos) return iter(scanner.search, None)
def first_older_than_second(version_a, version_b): """ Tests for the NSS version string in the first parameter being less recent than the second (a < b). Tag order is RTM > RC > BETA > *. Works with hg tags like "NSS_3_7_9_RTM" and version strings reported by nsINSSVersion, like ...
def function[first_older_than_second, parameter[version_a, version_b]]: constant[ Tests for the NSS version string in the first parameter being less recent than the second (a < b). Tag order is RTM > RC > BETA > *. Works with hg tags like "NSS_3_7_9_RTM" and version strings reported by ...
keyword[def] identifier[first_older_than_second] ( identifier[version_a] , identifier[version_b] ): literal[string] identifier[a] = identifier[nssversion] . identifier[to_ints] ( identifier[version_a] ) identifier[b] = identifier[nssversion] . identifier[to_ints] ( identifier[version_b] )...
def first_older_than_second(version_a, version_b): """ Tests for the NSS version string in the first parameter being less recent than the second (a < b). Tag order is RTM > RC > BETA > *. Works with hg tags like "NSS_3_7_9_RTM" and version strings reported by nsINSSVersion, like "3.1...
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): ''' Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem making the comparison. ignore_epoch : False Set to ``True`` to ignore the epoch whe...
def function[version_cmp, parameter[pkg1, pkg2, ignore_epoch]]: constant[ Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem making the comparison. ignore_epoch : False Set to ``True`` to ignor...
keyword[def] identifier[version_cmp] ( identifier[pkg1] , identifier[pkg2] , identifier[ignore_epoch] = keyword[False] ,** identifier[kwargs] ): literal[string] identifier[normalize] = keyword[lambda] identifier[x] : identifier[six] . identifier[text_type] ( identifier[x] ). identifier[split] ( literal[st...
def version_cmp(pkg1, pkg2, ignore_epoch=False, **kwargs): """ Do a cmp-style comparison on two packages. Return -1 if pkg1 < pkg2, 0 if pkg1 == pkg2, and 1 if pkg1 > pkg2. Return None if there was a problem making the comparison. ignore_epoch : False Set to ``True`` to ignore the epoch whe...
def get_gui_hint(self, hint): """Returns the value for specified gui hint (or a sensible default value, if this argument doesn't specify the hint). Args: hint: name of the hint to get value for Returns: value of the hint specified in yaml or a sensible default ...
def function[get_gui_hint, parameter[self, hint]]: constant[Returns the value for specified gui hint (or a sensible default value, if this argument doesn't specify the hint). Args: hint: name of the hint to get value for Returns: value of the hint specified in ya...
keyword[def] identifier[get_gui_hint] ( identifier[self] , identifier[hint] ): literal[string] keyword[if] identifier[hint] == literal[string] : keyword[if] identifier[self] . identifier[kwargs] . identifier[get] ( literal[string] )== literal[string] keyword[or] i...
def get_gui_hint(self, hint): """Returns the value for specified gui hint (or a sensible default value, if this argument doesn't specify the hint). Args: hint: name of the hint to get value for Returns: value of the hint specified in yaml or a sensible default ...
def _sort_layers(self): """Sort the layers by depth.""" self._layers = OrderedDict(sorted(self._layers.items(), key=lambda t: t[0]))
def function[_sort_layers, parameter[self]]: constant[Sort the layers by depth.] name[self]._layers assign[=] call[name[OrderedDict], parameter[call[name[sorted], parameter[call[name[self]._layers.items, parameter[]]]]]]
keyword[def] identifier[_sort_layers] ( identifier[self] ): literal[string] identifier[self] . identifier[_layers] = identifier[OrderedDict] ( identifier[sorted] ( identifier[self] . identifier[_layers] . identifier[items] (), identifier[key] = keyword[lambda] identifier[t] : identifier[t] [ liter...
def _sort_layers(self): """Sort the layers by depth.""" self._layers = OrderedDict(sorted(self._layers.items(), key=lambda t: t[0]))
def _parse_game_date_and_location(self, boxscore): """ Retrieve the game's date and location. The game's meta information, such as date, location, attendance, and duration, follow a complex parsing scheme that changes based on the layout of the page. The information should be ab...
def function[_parse_game_date_and_location, parameter[self, boxscore]]: constant[ Retrieve the game's date and location. The game's meta information, such as date, location, attendance, and duration, follow a complex parsing scheme that changes based on the layout of the page. T...
keyword[def] identifier[_parse_game_date_and_location] ( identifier[self] , identifier[boxscore] ): literal[string] identifier[scheme] = identifier[BOXSCORE_SCHEME] [ literal[string] ] identifier[items] =[ identifier[i] . identifier[text] () keyword[for] identifier[i] keyword[in] identi...
def _parse_game_date_and_location(self, boxscore): """ Retrieve the game's date and location. The game's meta information, such as date, location, attendance, and duration, follow a complex parsing scheme that changes based on the layout of the page. The information should be able t...
def osc_fit_fun(x, a, tau, f, phi, c): """Function used to fit the decay cosine.""" # pylint: disable=invalid-name return a * np.exp(-x / tau) * np.cos(2 * np.pi * f * x + phi) + c
def function[osc_fit_fun, parameter[x, a, tau, f, phi, c]]: constant[Function used to fit the decay cosine.] return[binary_operation[binary_operation[binary_operation[name[a] * call[name[np].exp, parameter[binary_operation[<ast.UnaryOp object at 0x7da1b055eef0> / name[tau]]]]] * call[name[np].cos, parameter...
keyword[def] identifier[osc_fit_fun] ( identifier[x] , identifier[a] , identifier[tau] , identifier[f] , identifier[phi] , identifier[c] ): literal[string] keyword[return] identifier[a] * identifier[np] . identifier[exp] (- identifier[x] / identifier[tau] )* identifier[np] . identifier[cos] ( literal...
def osc_fit_fun(x, a, tau, f, phi, c): """Function used to fit the decay cosine.""" # pylint: disable=invalid-name return a * np.exp(-x / tau) * np.cos(2 * np.pi * f * x + phi) + c
def dqdv_frames(cell, split=False, **kwargs): """Returns dqdv data as pandas.DataFrame(s) for all cycles. Args: cell (CellpyData-object). split (bool): return one frame for charge and one for discharge if True (defaults to False). Returns...
def function[dqdv_frames, parameter[cell, split]]: constant[Returns dqdv data as pandas.DataFrame(s) for all cycles. Args: cell (CellpyData-object). split (bool): return one frame for charge and one for discharge if True (defaults to False). ...
keyword[def] identifier[dqdv_frames] ( identifier[cell] , identifier[split] = keyword[False] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[split] : keyword[return] identifier[_dqdv_split_frames] ( identifier[cell] , identifier[tidy] = keyword[True] ,*...
def dqdv_frames(cell, split=False, **kwargs): """Returns dqdv data as pandas.DataFrame(s) for all cycles. Args: cell (CellpyData-object). split (bool): return one frame for charge and one for discharge if True (defaults to False). Returns...
def getAsWmsDatasetString(self, session): """ Retrieve the WMS Raster as a string in the WMS Dataset format """ # Magic numbers FIRST_VALUE_INDEX = 12 # Write value raster if type(self.raster) != type(None): # Convert to GRASS ASCII Raster ...
def function[getAsWmsDatasetString, parameter[self, session]]: constant[ Retrieve the WMS Raster as a string in the WMS Dataset format ] variable[FIRST_VALUE_INDEX] assign[=] constant[12] if compare[call[name[type], parameter[name[self].raster]] not_equal[!=] call[name[type], par...
keyword[def] identifier[getAsWmsDatasetString] ( identifier[self] , identifier[session] ): literal[string] identifier[FIRST_VALUE_INDEX] = literal[int] keyword[if] identifier[type] ( identifier[self] . identifier[raster] )!= identifier[type] ( keyword[None] ): ...
def getAsWmsDatasetString(self, session): """ Retrieve the WMS Raster as a string in the WMS Dataset format """ # Magic numbers FIRST_VALUE_INDEX = 12 # Write value raster if type(self.raster) != type(None): # Convert to GRASS ASCII Raster valueGrassRasterString = sel...
def check_indent_level(self, string, expected, line_num): """return the indent level of the string """ indent = self.config.indent_string if indent == "\\t": # \t is not interpreted in the configuration file indent = "\t" level = 0 unit_size = len(indent) ...
def function[check_indent_level, parameter[self, string, expected, line_num]]: constant[return the indent level of the string ] variable[indent] assign[=] name[self].config.indent_string if compare[name[indent] equal[==] constant[\t]] begin[:] variable[indent] assign[=] c...
keyword[def] identifier[check_indent_level] ( identifier[self] , identifier[string] , identifier[expected] , identifier[line_num] ): literal[string] identifier[indent] = identifier[self] . identifier[config] . identifier[indent_string] keyword[if] identifier[indent] == literal[string] : ...
def check_indent_level(self, string, expected, line_num): """return the indent level of the string """ indent = self.config.indent_string if indent == '\\t': # \t is not interpreted in the configuration file indent = '\t' # depends on [control=['if'], data=['indent']] level = 0 uni...
def beforeRender(self, ctx): """ Implement this hook to initialize the L{initialPerson} and L{initialState} slots with information from the request url's query args. """ # see the comment in Organizer.urlForViewState which suggests an # alternate implementation of...
def function[beforeRender, parameter[self, ctx]]: constant[ Implement this hook to initialize the L{initialPerson} and L{initialState} slots with information from the request url's query args. ] variable[request] assign[=] call[name[inevow].IRequest, parameter[name[ctx]]]...
keyword[def] identifier[beforeRender] ( identifier[self] , identifier[ctx] ): literal[string] identifier[request] = identifier[inevow] . identifier[IRequest] ( identifier[ctx] ) keyword[if] keyword[not] identifier[set] ([ literal[string] , literal[string] ]). identifier...
def beforeRender(self, ctx): """ Implement this hook to initialize the L{initialPerson} and L{initialState} slots with information from the request url's query args. """ # see the comment in Organizer.urlForViewState which suggests an # alternate implementation of this kind o...
def params_as_tensors_for(*objs, convert=True): """ Context manager which changes the representation of parameters and data holders for the specific parameterized object(s). This can also be used to turn off tensor conversion functions wrapped with `params_as_tensors`: ``` @gpflow.params_as...
def function[params_as_tensors_for, parameter[]]: constant[ Context manager which changes the representation of parameters and data holders for the specific parameterized object(s). This can also be used to turn off tensor conversion functions wrapped with `params_as_tensors`: ``` @gpfl...
keyword[def] identifier[params_as_tensors_for] (* identifier[objs] , identifier[convert] = keyword[True] ): literal[string] identifier[objs] = identifier[set] ( identifier[objs] ) identifier[prev_values] =[ identifier[_params_as_tensors_enter] ( identifier[o] , identifier[convert] ) keyword[for] iden...
def params_as_tensors_for(*objs, convert=True): """ Context manager which changes the representation of parameters and data holders for the specific parameterized object(s). This can also be used to turn off tensor conversion functions wrapped with `params_as_tensors`: ``` @gpflow.params_as...
def _get_csrf_token(self): """Return the CSRF Token of easyname login form.""" from bs4 import BeautifulSoup home_response = self.session.get(self.URLS['login']) self._log('Home', home_response) assert home_response.status_code == 200, \ 'Could not load Easyname login...
def function[_get_csrf_token, parameter[self]]: constant[Return the CSRF Token of easyname login form.] from relative_module[bs4] import module[BeautifulSoup] variable[home_response] assign[=] call[name[self].session.get, parameter[call[name[self].URLS][constant[login]]]] call[name[self]._lo...
keyword[def] identifier[_get_csrf_token] ( identifier[self] ): literal[string] keyword[from] identifier[bs4] keyword[import] identifier[BeautifulSoup] identifier[home_response] = identifier[self] . identifier[session] . identifier[get] ( identifier[self] . identifier[URLS] [ literal[st...
def _get_csrf_token(self): """Return the CSRF Token of easyname login form.""" from bs4 import BeautifulSoup home_response = self.session.get(self.URLS['login']) self._log('Home', home_response) assert home_response.status_code == 200, 'Could not load Easyname login page.' html = BeautifulSoup(h...
def get_network(network_id): """Get the network with the given id.""" try: net = models.Network.query.filter_by(id=network_id).one() except NoResultFound: return error_response( error_type="/network GET: no network found", status=403) # return the data return...
def function[get_network, parameter[network_id]]: constant[Get the network with the given id.] <ast.Try object at 0x7da18f58fa30> return[call[name[success_response], parameter[]]]
keyword[def] identifier[get_network] ( identifier[network_id] ): literal[string] keyword[try] : identifier[net] = identifier[models] . identifier[Network] . identifier[query] . identifier[filter_by] ( identifier[id] = identifier[network_id] ). identifier[one] () keyword[except] identifier[No...
def get_network(network_id): """Get the network with the given id.""" try: net = models.Network.query.filter_by(id=network_id).one() # depends on [control=['try'], data=[]] except NoResultFound: return error_response(error_type='/network GET: no network found', status=403) # depends on [co...
async def freedom(self, root): """Nation's `Freedoms`: three basic indicators of the nation's Civil Rights, Economy, and Political Freedom, as expressive adjectives. Returns ------- an :class:`ApiQuery` of :class:`collections.OrderedDict` with \ keys and values o...
<ast.AsyncFunctionDef object at 0x7da1b28fe980>
keyword[async] keyword[def] identifier[freedom] ( identifier[self] , identifier[root] ): literal[string] identifier[elem] = identifier[root] . identifier[find] ( literal[string] ) identifier[result] = identifier[OrderedDict] () identifier[result] [ literal[string] ]= identifier[...
async def freedom(self, root): """Nation's `Freedoms`: three basic indicators of the nation's Civil Rights, Economy, and Political Freedom, as expressive adjectives. Returns ------- an :class:`ApiQuery` of :class:`collections.OrderedDict` with keys and values of str ...
def getInstalledConfig(installDir, configFile): """ Reads config from the installation directory of Plenum. :param installDir: installation directory of Plenum :param configFile: name of the configuration file :raises: FileNotFoundError :return: the configuration as a python object """ ...
def function[getInstalledConfig, parameter[installDir, configFile]]: constant[ Reads config from the installation directory of Plenum. :param installDir: installation directory of Plenum :param configFile: name of the configuration file :raises: FileNotFoundError :return: the configuration ...
keyword[def] identifier[getInstalledConfig] ( identifier[installDir] , identifier[configFile] ): literal[string] identifier[configPath] = identifier[os] . identifier[path] . identifier[join] ( identifier[installDir] , identifier[configFile] ) keyword[if] keyword[not] identifier[os] . identifier[path...
def getInstalledConfig(installDir, configFile): """ Reads config from the installation directory of Plenum. :param installDir: installation directory of Plenum :param configFile: name of the configuration file :raises: FileNotFoundError :return: the configuration as a python object """ ...
def index_labels(labels, case_sensitive=False): """Convert a list of string identifiers into numerical indices. Parameters ---------- labels : list of strings, shape=(n,) A list of annotations, e.g., segment or chord labels from an annotation file. case_sensitive : bool Set...
def function[index_labels, parameter[labels, case_sensitive]]: constant[Convert a list of string identifiers into numerical indices. Parameters ---------- labels : list of strings, shape=(n,) A list of annotations, e.g., segment or chord labels from an annotation file. case_sen...
keyword[def] identifier[index_labels] ( identifier[labels] , identifier[case_sensitive] = keyword[False] ): literal[string] identifier[label_to_index] ={} identifier[index_to_label] ={} keyword[if] keyword[not] identifier[case_sensitive] : identifier[labels] =[ identifier[str] (...
def index_labels(labels, case_sensitive=False): """Convert a list of string identifiers into numerical indices. Parameters ---------- labels : list of strings, shape=(n,) A list of annotations, e.g., segment or chord labels from an annotation file. case_sensitive : bool Set...
def write_dag(self, out=sys.stdout): """Write info for all GO Terms in obo file, sorted numerically.""" for rec in sorted(self.values()): print(rec, file=out)
def function[write_dag, parameter[self, out]]: constant[Write info for all GO Terms in obo file, sorted numerically.] for taget[name[rec]] in starred[call[name[sorted], parameter[call[name[self].values, parameter[]]]]] begin[:] call[name[print], parameter[name[rec]]]
keyword[def] identifier[write_dag] ( identifier[self] , identifier[out] = identifier[sys] . identifier[stdout] ): literal[string] keyword[for] identifier[rec] keyword[in] identifier[sorted] ( identifier[self] . identifier[values] ()): identifier[print] ( identifier[rec] , identifier...
def write_dag(self, out=sys.stdout): """Write info for all GO Terms in obo file, sorted numerically.""" for rec in sorted(self.values()): print(rec, file=out) # depends on [control=['for'], data=['rec']]
def handle_package_has_file_helper(self, pkg_file): """ Return node representing pkg_file pkg_file should be instance of spdx.file. """ nodes = list(self.graph.triples((None, self.spdx_namespace.fileName, Literal(pkg_file.name)))) if len(nodes) == 1: return no...
def function[handle_package_has_file_helper, parameter[self, pkg_file]]: constant[ Return node representing pkg_file pkg_file should be instance of spdx.file. ] variable[nodes] assign[=] call[name[list], parameter[call[name[self].graph.triples, parameter[tuple[[<ast.Constant obje...
keyword[def] identifier[handle_package_has_file_helper] ( identifier[self] , identifier[pkg_file] ): literal[string] identifier[nodes] = identifier[list] ( identifier[self] . identifier[graph] . identifier[triples] (( keyword[None] , identifier[self] . identifier[spdx_namespace] . identifier[fileNa...
def handle_package_has_file_helper(self, pkg_file): """ Return node representing pkg_file pkg_file should be instance of spdx.file. """ nodes = list(self.graph.triples((None, self.spdx_namespace.fileName, Literal(pkg_file.name)))) if len(nodes) == 1: return nodes[0][0] # dep...
def rankagg_R(df, method="stuart"): """Return aggregated ranks as implemented in the RobustRankAgg R package. This function is now deprecated. References: Kolde et al., 2012, DOI: 10.1093/bioinformatics/btr709 Stuart et al., 2003, DOI: 10.1126/science.1087447 Parameters --------...
def function[rankagg_R, parameter[df, method]]: constant[Return aggregated ranks as implemented in the RobustRankAgg R package. This function is now deprecated. References: Kolde et al., 2012, DOI: 10.1093/bioinformatics/btr709 Stuart et al., 2003, DOI: 10.1126/science.1087447 P...
keyword[def] identifier[rankagg_R] ( identifier[df] , identifier[method] = literal[string] ): literal[string] identifier[tmpdf] = identifier[NamedTemporaryFile] () identifier[tmpscript] = identifier[NamedTemporaryFile] ( identifier[mode] = literal[string] ) identifier[tmpranks] = identifier[Named...
def rankagg_R(df, method='stuart'): """Return aggregated ranks as implemented in the RobustRankAgg R package. This function is now deprecated. References: Kolde et al., 2012, DOI: 10.1093/bioinformatics/btr709 Stuart et al., 2003, DOI: 10.1126/science.1087447 Parameters --------...
def get_needful_files(self): """ Returns set of media files associated with models. Those files won't be deleted. """ needful_files = [] for model in self.models(): media_fields = [] for field in self.model_file_fields(model): media...
def function[get_needful_files, parameter[self]]: constant[ Returns set of media files associated with models. Those files won't be deleted. ] variable[needful_files] assign[=] list[[]] for taget[name[model]] in starred[call[name[self].models, parameter[]]] begin[:] ...
keyword[def] identifier[get_needful_files] ( identifier[self] ): literal[string] identifier[needful_files] =[] keyword[for] identifier[model] keyword[in] identifier[self] . identifier[models] (): identifier[media_fields] =[] keyword[for] identifier[field] key...
def get_needful_files(self): """ Returns set of media files associated with models. Those files won't be deleted. """ needful_files = [] for model in self.models(): media_fields = [] for field in self.model_file_fields(model): media_fields.append(field.nam...
def home_shift_summ(self): """ :returns: :py:class:`.ShiftSummary` by player for the home team :rtype: dict ``{ player_num: shift_summary_obj }`` """ if not self.__wrapped_home: self.__wrapped_home = self.__wrap(self._home.by_player) return self.__wra...
def function[home_shift_summ, parameter[self]]: constant[ :returns: :py:class:`.ShiftSummary` by player for the home team :rtype: dict ``{ player_num: shift_summary_obj }`` ] if <ast.UnaryOp object at 0x7da1b0e0c880> begin[:] name[self].__wrapped_home assign[=] ca...
keyword[def] identifier[home_shift_summ] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[__wrapped_home] : identifier[self] . identifier[__wrapped_home] = identifier[self] . identifier[__wrap] ( identifier[self] . identifier[_home] . ident...
def home_shift_summ(self): """ :returns: :py:class:`.ShiftSummary` by player for the home team :rtype: dict ``{ player_num: shift_summary_obj }`` """ if not self.__wrapped_home: self.__wrapped_home = self.__wrap(self._home.by_player) # depends on [control=['if'], data=[]] re...
def GetAnalyzers(cls): """Retrieves the registered analyzers. Yields: tuple: containing: str: the uniquely identifying name of the analyzer type: the analyzer class. """ for analyzer_name, analyzer_class in iter(cls._analyzer_classes.items()): yield analyzer_name, analyzer_...
def function[GetAnalyzers, parameter[cls]]: constant[Retrieves the registered analyzers. Yields: tuple: containing: str: the uniquely identifying name of the analyzer type: the analyzer class. ] for taget[tuple[[<ast.Name object at 0x7da20c7c9cc0>, <ast.Name object at 0x7...
keyword[def] identifier[GetAnalyzers] ( identifier[cls] ): literal[string] keyword[for] identifier[analyzer_name] , identifier[analyzer_class] keyword[in] identifier[iter] ( identifier[cls] . identifier[_analyzer_classes] . identifier[items] ()): keyword[yield] identifier[analyzer_name] , identi...
def GetAnalyzers(cls): """Retrieves the registered analyzers. Yields: tuple: containing: str: the uniquely identifying name of the analyzer type: the analyzer class. """ for (analyzer_name, analyzer_class) in iter(cls._analyzer_classes.items()): yield (analyzer_name, anal...
def _load_keyring_path(config): "load the keyring-path option (if present)" try: path = config.get("backend", "keyring-path").strip() sys.path.insert(0, path) except (configparser.NoOptionError, configparser.NoSectionError): pass
def function[_load_keyring_path, parameter[config]]: constant[load the keyring-path option (if present)] <ast.Try object at 0x7da1b0061d50>
keyword[def] identifier[_load_keyring_path] ( identifier[config] ): literal[string] keyword[try] : identifier[path] = identifier[config] . identifier[get] ( literal[string] , literal[string] ). identifier[strip] () identifier[sys] . identifier[path] . identifier[insert] ( literal[int] , i...
def _load_keyring_path(config): """load the keyring-path option (if present)""" try: path = config.get('backend', 'keyring-path').strip() sys.path.insert(0, path) # depends on [control=['try'], data=[]] except (configparser.NoOptionError, configparser.NoSectionError): pass # depend...
def pfx_path(path): """ Prefix a path with the OS path separator if it is not already """ if path[0] != os.path.sep: return os.path.sep + path else: return path
def function[pfx_path, parameter[path]]: constant[ Prefix a path with the OS path separator if it is not already ] if compare[call[name[path]][constant[0]] not_equal[!=] name[os].path.sep] begin[:] return[binary_operation[name[os].path.sep + name[path]]]
keyword[def] identifier[pfx_path] ( identifier[path] ): literal[string] keyword[if] identifier[path] [ literal[int] ]!= identifier[os] . identifier[path] . identifier[sep] : keyword[return] identifier[os] . identifier[path] . identifier[sep] + identifier[path] keyword[else] : keyword[return] ident...
def pfx_path(path): """ Prefix a path with the OS path separator if it is not already """ if path[0] != os.path.sep: return os.path.sep + path # depends on [control=['if'], data=[]] else: return path
def get_time_buckets_from_metadata(metadata): '''return a list of time buckets in which the metadata falls''' start = metadata['start'] end = metadata.get('end') or start buckets = DatalakeRecord.get_time_buckets(start, end) if len(buckets) > DatalakeRecord.MAXIMUM_BUCKET_SPAN: ...
def function[get_time_buckets_from_metadata, parameter[metadata]]: constant[return a list of time buckets in which the metadata falls] variable[start] assign[=] call[name[metadata]][constant[start]] variable[end] assign[=] <ast.BoolOp object at 0x7da1b0aa45e0> variable[buckets] assign[=]...
keyword[def] identifier[get_time_buckets_from_metadata] ( identifier[metadata] ): literal[string] identifier[start] = identifier[metadata] [ literal[string] ] identifier[end] = identifier[metadata] . identifier[get] ( literal[string] ) keyword[or] identifier[start] identifier[bu...
def get_time_buckets_from_metadata(metadata): """return a list of time buckets in which the metadata falls""" start = metadata['start'] end = metadata.get('end') or start buckets = DatalakeRecord.get_time_buckets(start, end) if len(buckets) > DatalakeRecord.MAXIMUM_BUCKET_SPAN: msg = 'metada...
def _TypecheckDecorator(subject=None, **kwargs): """Dispatches type checks based on what the subject is. Functions or methods are annotated directly. If this method is called with keyword arguments only, return a decorator. """ if subject is None: return _TypecheckDecoratorFactory(kwargs) elif inspect....
def function[_TypecheckDecorator, parameter[subject]]: constant[Dispatches type checks based on what the subject is. Functions or methods are annotated directly. If this method is called with keyword arguments only, return a decorator. ] if compare[name[subject] is constant[None]] begin[:] ...
keyword[def] identifier[_TypecheckDecorator] ( identifier[subject] = keyword[None] ,** identifier[kwargs] ): literal[string] keyword[if] identifier[subject] keyword[is] keyword[None] : keyword[return] identifier[_TypecheckDecoratorFactory] ( identifier[kwargs] ) keyword[elif] identifier[inspect] ....
def _TypecheckDecorator(subject=None, **kwargs): """Dispatches type checks based on what the subject is. Functions or methods are annotated directly. If this method is called with keyword arguments only, return a decorator. """ if subject is None: return _TypecheckDecoratorFactory(kwargs) # depe...
def generated_password_entropy(self) -> float: """Calculate the entropy of a password that would be generated.""" characters = self._get_password_characters() if ( self.passwordlen is None or not characters ): raise ValueError("Can't calculate ...
def function[generated_password_entropy, parameter[self]]: constant[Calculate the entropy of a password that would be generated.] variable[characters] assign[=] call[name[self]._get_password_characters, parameter[]] if <ast.BoolOp object at 0x7da2047ea920> begin[:] <ast.Raise object at 0...
keyword[def] identifier[generated_password_entropy] ( identifier[self] )-> identifier[float] : literal[string] identifier[characters] = identifier[self] . identifier[_get_password_characters] () keyword[if] ( identifier[self] . identifier[passwordlen] keyword[is] keyword[None] ...
def generated_password_entropy(self) -> float: """Calculate the entropy of a password that would be generated.""" characters = self._get_password_characters() if self.passwordlen is None or not characters: raise ValueError("Can't calculate the password entropy: character set is empty or passwordlen ...
def setup(): """ Initializes the hook queues for the sys module. This method will automatically be called on the first registration for a hook to the system by either the registerDisplay or registerExcept functions. """ global _displayhooks, _excepthooks if _displayhooks is not None: ...
def function[setup, parameter[]]: constant[ Initializes the hook queues for the sys module. This method will automatically be called on the first registration for a hook to the system by either the registerDisplay or registerExcept functions. ] <ast.Global object at 0x7da1b2776b00> ...
keyword[def] identifier[setup] (): literal[string] keyword[global] identifier[_displayhooks] , identifier[_excepthooks] keyword[if] identifier[_displayhooks] keyword[is] keyword[not] keyword[None] : keyword[return] identifier[_displayhooks] =[] identifier[_excepthooks] =[] ...
def setup(): """ Initializes the hook queues for the sys module. This method will automatically be called on the first registration for a hook to the system by either the registerDisplay or registerExcept functions. """ global _displayhooks, _excepthooks if _displayhooks is not None: ...
def equals(series1, series2, ignore_order=False, ignore_index=False, all_close=False, _return_reason=False): ''' Get whether 2 series are equal. ``NaN`` is considered equal to ``NaN`` and `None`. Parameters ---------- series1 : pandas.Series Series to compare. series2 : pandas.Seri...
def function[equals, parameter[series1, series2, ignore_order, ignore_index, all_close, _return_reason]]: constant[ Get whether 2 series are equal. ``NaN`` is considered equal to ``NaN`` and `None`. Parameters ---------- series1 : pandas.Series Series to compare. series2 : pand...
keyword[def] identifier[equals] ( identifier[series1] , identifier[series2] , identifier[ignore_order] = keyword[False] , identifier[ignore_index] = keyword[False] , identifier[all_close] = keyword[False] , identifier[_return_reason] = keyword[False] ): literal[string] identifier[result] = identifier[_equa...
def equals(series1, series2, ignore_order=False, ignore_index=False, all_close=False, _return_reason=False): """ Get whether 2 series are equal. ``NaN`` is considered equal to ``NaN`` and `None`. Parameters ---------- series1 : pandas.Series Series to compare. series2 : pandas.Seri...
def gcn(args): """ %prog gcn gencode.v26.exonunion.bed data/*.vcf.gz Compile gene copy njumber based on CANVAS results. """ p = OptionParser(gcn.__doc__) p.set_cpus() p.set_tmpdir(tmpdir="tmp") p.set_outfile() opts, args = p.parse_args(args) if len(args) < 2: sys.exit(n...
def function[gcn, parameter[args]]: constant[ %prog gcn gencode.v26.exonunion.bed data/*.vcf.gz Compile gene copy njumber based on CANVAS results. ] variable[p] assign[=] call[name[OptionParser], parameter[name[gcn].__doc__]] call[name[p].set_cpus, parameter[]] call[name[p]....
keyword[def] identifier[gcn] ( identifier[args] ): literal[string] identifier[p] = identifier[OptionParser] ( identifier[gcn] . identifier[__doc__] ) identifier[p] . identifier[set_cpus] () identifier[p] . identifier[set_tmpdir] ( identifier[tmpdir] = literal[string] ) identifier[p] . identi...
def gcn(args): """ %prog gcn gencode.v26.exonunion.bed data/*.vcf.gz Compile gene copy njumber based on CANVAS results. """ p = OptionParser(gcn.__doc__) p.set_cpus() p.set_tmpdir(tmpdir='tmp') p.set_outfile() (opts, args) = p.parse_args(args) if len(args) < 2: sys.exit(...
def recursive_update(default, custom): '''Return a dict merged from default and custom >>> recursive_update('a', 'b') Traceback (most recent call last): ... TypeError: Params of recursive_update should be dicts >>> recursive_update({'a': [1]}, {'a': [2], 'c': {'d': {'c': 3}}}) {'a': [2...
def function[recursive_update, parameter[default, custom]]: constant[Return a dict merged from default and custom >>> recursive_update('a', 'b') Traceback (most recent call last): ... TypeError: Params of recursive_update should be dicts >>> recursive_update({'a': [1]}, {'a': [2], 'c':...
keyword[def] identifier[recursive_update] ( identifier[default] , identifier[custom] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[default] , identifier[dict] ) keyword[or] keyword[not] identifier[isinstance] ( identifier[custom] , identifier[dict] ): keyword[...
def recursive_update(default, custom): """Return a dict merged from default and custom >>> recursive_update('a', 'b') Traceback (most recent call last): ... TypeError: Params of recursive_update should be dicts >>> recursive_update({'a': [1]}, {'a': [2], 'c': {'d': {'c': 3}}}) {'a': [2...
def _set_redistribute_ospf(self, v, load=False): """ Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_ospf is considered as ...
def function[_set_redistribute_ospf, parameter[self, v, load]]: constant[ Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribu...
keyword[def] identifier[_set_redistribute_ospf] ( identifier[self] , identifier[v] , identifier[load] = keyword[False] ): literal[string] keyword[if] identifier[hasattr] ( identifier[v] , literal[string] ): identifier[v] = identifier[v] . identifier[_utype] ( identifier[v] ) keyword[try] : ...
def _set_redistribute_ospf(self, v, load=False): """ Setter method for redistribute_ospf, mapped from YANG variable /rbridge_id/ipv6/router/ospf/redistribute/redistribute_ospf (container) If this variable is read-only (config: false) in the source YANG file, then _set_redistribute_ospf is considered as ...
def download_message_media(msg_id): """Download a media file""" message = g.driver.get_message_by_id(msg_id) if not message or not message.mime: abort(404) profile_path = create_static_profile_path(g.client_id) filename = message.save_media(profile_path, True) if os.path.exists(filena...
def function[download_message_media, parameter[msg_id]]: constant[Download a media file] variable[message] assign[=] call[name[g].driver.get_message_by_id, parameter[name[msg_id]]] if <ast.BoolOp object at 0x7da1b1c7a980> begin[:] call[name[abort], parameter[constant[404]]] ...
keyword[def] identifier[download_message_media] ( identifier[msg_id] ): literal[string] identifier[message] = identifier[g] . identifier[driver] . identifier[get_message_by_id] ( identifier[msg_id] ) keyword[if] keyword[not] identifier[message] keyword[or] keyword[not] identifier[message] . iden...
def download_message_media(msg_id): """Download a media file""" message = g.driver.get_message_by_id(msg_id) if not message or not message.mime: abort(404) # depends on [control=['if'], data=[]] profile_path = create_static_profile_path(g.client_id) filename = message.save_media(profile_pat...
def onlineTable(self, login, tableName): """ Parameters: - login - tableName """ self.send_onlineTable(login, tableName) self.recv_onlineTable()
def function[onlineTable, parameter[self, login, tableName]]: constant[ Parameters: - login - tableName ] call[name[self].send_onlineTable, parameter[name[login], name[tableName]]] call[name[self].recv_onlineTable, parameter[]]
keyword[def] identifier[onlineTable] ( identifier[self] , identifier[login] , identifier[tableName] ): literal[string] identifier[self] . identifier[send_onlineTable] ( identifier[login] , identifier[tableName] ) identifier[self] . identifier[recv_onlineTable] ()
def onlineTable(self, login, tableName): """ Parameters: - login - tableName """ self.send_onlineTable(login, tableName) self.recv_onlineTable()
def emoticons_tag(parser, token): """ Tag for rendering emoticons. """ exclude = '' args = token.split_contents() if len(args) == 2: exclude = args[1] elif len(args) > 2: raise template.TemplateSyntaxError( 'emoticons tag has only one optional argument') node...
def function[emoticons_tag, parameter[parser, token]]: constant[ Tag for rendering emoticons. ] variable[exclude] assign[=] constant[] variable[args] assign[=] call[name[token].split_contents, parameter[]] if compare[call[name[len], parameter[name[args]]] equal[==] constant[2]] b...
keyword[def] identifier[emoticons_tag] ( identifier[parser] , identifier[token] ): literal[string] identifier[exclude] = literal[string] identifier[args] = identifier[token] . identifier[split_contents] () keyword[if] identifier[len] ( identifier[args] )== literal[int] : identifier[exc...
def emoticons_tag(parser, token): """ Tag for rendering emoticons. """ exclude = '' args = token.split_contents() if len(args) == 2: exclude = args[1] # depends on [control=['if'], data=[]] elif len(args) > 2: raise template.TemplateSyntaxError('emoticons tag has only one op...
def distance_home(self): """ Distance away from home, in meters. Returns 3D distance if `down` is known, otherwise 2D distance. """ if self.north is not None and self.east is not None: if self.down is not None: return math.sqrt(self.north**2 + self.east**2 + ...
def function[distance_home, parameter[self]]: constant[ Distance away from home, in meters. Returns 3D distance if `down` is known, otherwise 2D distance. ] if <ast.BoolOp object at 0x7da18dc06650> begin[:] if compare[name[self].down is_not constant[None]] begin[:] ...
keyword[def] identifier[distance_home] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[north] keyword[is] keyword[not] keyword[None] keyword[and] identifier[self] . identifier[east] keyword[is] keyword[not] keyword[None] : keyword[if] identifi...
def distance_home(self): """ Distance away from home, in meters. Returns 3D distance if `down` is known, otherwise 2D distance. """ if self.north is not None and self.east is not None: if self.down is not None: return math.sqrt(self.north ** 2 + self.east ** 2 + self.down ** ...
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ evl = self.input.payload if isinstance(evl, Evaluation): summary = evl.summary(title=self.resolve_option("title"), comple...
def function[do_execute, parameter[self]]: constant[ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str ] variable[evl] assign[=] name[self].input.payload if call[name[isinstance], parameter[name[evl], name[Evaluat...
keyword[def] identifier[do_execute] ( identifier[self] ): literal[string] identifier[evl] = identifier[self] . identifier[input] . identifier[payload] keyword[if] identifier[isinstance] ( identifier[evl] , identifier[Evaluation] ): identifier[summary] = identifier[evl] . ide...
def do_execute(self): """ The actual execution of the actor. :return: None if successful, otherwise error message :rtype: str """ evl = self.input.payload if isinstance(evl, Evaluation): summary = evl.summary(title=self.resolve_option('title'), complexity=bool(self.r...
def prepare_post_parameters(self, post_params=None, files=None): """ Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = {} if post_params: param...
def function[prepare_post_parameters, parameter[self, post_params, files]]: constant[ Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. ] variable[params] assign[=] dictionary[[...
keyword[def] identifier[prepare_post_parameters] ( identifier[self] , identifier[post_params] = keyword[None] , identifier[files] = keyword[None] ): literal[string] identifier[params] ={} keyword[if] identifier[post_params] : identifier[params] . identifier[update] ( identif...
def prepare_post_parameters(self, post_params=None, files=None): """ Builds form parameters. :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = {} if post_params: params.update(post_par...
def set_value(self, value): """Set value to action.""" self._value = value for proxy in self.get_proxies(): proxy.handler_block(self._changed_handlers[proxy]) proxy.set_value(self._value) proxy.handler_unblock(self._changed_handlers[proxy]) pass ...
def function[set_value, parameter[self, value]]: constant[Set value to action.] name[self]._value assign[=] name[value] for taget[name[proxy]] in starred[call[name[self].get_proxies, parameter[]]] begin[:] call[name[proxy].handler_block, parameter[call[name[self]._changed_handler...
keyword[def] identifier[set_value] ( identifier[self] , identifier[value] ): literal[string] identifier[self] . identifier[_value] = identifier[value] keyword[for] identifier[proxy] keyword[in] identifier[self] . identifier[get_proxies] (): identifier[proxy] . identifier[...
def set_value(self, value): """Set value to action.""" self._value = value for proxy in self.get_proxies(): proxy.handler_block(self._changed_handlers[proxy]) proxy.set_value(self._value) proxy.handler_unblock(self._changed_handlers[proxy]) pass # depends on [control=['for']...
def parse_duration(line): """ Return a timedelta object from a string in the DURATION property format """ DAYS, SECS = {'D': 1, 'W': 7}, {'S': 1, 'M': 60, 'H': 3600} sign, i = 1, 0 if line[i] in '-+': if line[i] == '-': sign = -1 i += 1 if line[i] != 'P': ...
def function[parse_duration, parameter[line]]: constant[ Return a timedelta object from a string in the DURATION property format ] <ast.Tuple object at 0x7da18f00d810> assign[=] tuple[[<ast.Dict object at 0x7da18f00ed40>, <ast.Dict object at 0x7da18f00d7b0>]] <ast.Tuple object at 0x7da18...
keyword[def] identifier[parse_duration] ( identifier[line] ): literal[string] identifier[DAYS] , identifier[SECS] ={ literal[string] : literal[int] , literal[string] : literal[int] },{ literal[string] : literal[int] , literal[string] : literal[int] , literal[string] : literal[int] } identifier[sign] ,...
def parse_duration(line): """ Return a timedelta object from a string in the DURATION property format """ (DAYS, SECS) = ({'D': 1, 'W': 7}, {'S': 1, 'M': 60, 'H': 3600}) (sign, i) = (1, 0) if line[i] in '-+': if line[i] == '-': sign = -1 # depends on [control=['if'], data=[]...
def to_native(self, value): """Load a value as a list, converting items if necessary""" if isinstance(value, six.string_types): value_list = value.split(self.string_delim) else: value_list = value to_native = self.member_type.to_native if self.member_type is not ...
def function[to_native, parameter[self, value]]: constant[Load a value as a list, converting items if necessary] if call[name[isinstance], parameter[name[value], name[six].string_types]] begin[:] variable[value_list] assign[=] call[name[value].split, parameter[name[self].string_delim]] ...
keyword[def] identifier[to_native] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[six] . identifier[string_types] ): identifier[value_list] = identifier[value] . identifier[split] ( identifier[self] . ident...
def to_native(self, value): """Load a value as a list, converting items if necessary""" if isinstance(value, six.string_types): value_list = value.split(self.string_delim) # depends on [control=['if'], data=[]] else: value_list = value to_native = self.member_type.to_native if self.memb...
def handle_set_services(self, req): """Handles the POST v2/<account>/.services call for setting services information. Can only be called by a reseller .admin. In the :func:`handle_get_account` (GET v2/<account>) call, a section of the returned JSON dict is `services`. This section looks...
def function[handle_set_services, parameter[self, req]]: constant[Handles the POST v2/<account>/.services call for setting services information. Can only be called by a reseller .admin. In the :func:`handle_get_account` (GET v2/<account>) call, a section of the returned JSON dict is `se...
keyword[def] identifier[handle_set_services] ( identifier[self] , identifier[req] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[is_reseller_admin] ( identifier[req] ): keyword[return] identifier[self] . identifier[denied_response] ( identifier[req] ) ...
def handle_set_services(self, req): """Handles the POST v2/<account>/.services call for setting services information. Can only be called by a reseller .admin. In the :func:`handle_get_account` (GET v2/<account>) call, a section of the returned JSON dict is `services`. This section looks som...
def refreshFromTarget(self, level=0): """ Refreshes the configuration tree from the target it monitors (if present). Recursively call _refreshNodeFromTarget for itself and all children. Subclasses should typically override _refreshNodeFromTarget instead of this function. Duri...
def function[refreshFromTarget, parameter[self, level]]: constant[ Refreshes the configuration tree from the target it monitors (if present). Recursively call _refreshNodeFromTarget for itself and all children. Subclasses should typically override _refreshNodeFromTarget instead of this f...
keyword[def] identifier[refreshFromTarget] ( identifier[self] , identifier[level] = literal[int] ): literal[string] keyword[if] identifier[self] . identifier[getRefreshBlocked] (): identifier[logger] . identifier[debug] ( literal[string] ) keyword[return] keywo...
def refreshFromTarget(self, level=0): """ Refreshes the configuration tree from the target it monitors (if present). Recursively call _refreshNodeFromTarget for itself and all children. Subclasses should typically override _refreshNodeFromTarget instead of this function. During u...
def update(self, role_sid=values.unset, last_consumed_message_index=values.unset): """ Update the MemberInstance :param unicode role_sid: The Role assigned to this member. :param unicode last_consumed_message_index: An Integer representing index of the last Message this M...
def function[update, parameter[self, role_sid, last_consumed_message_index]]: constant[ Update the MemberInstance :param unicode role_sid: The Role assigned to this member. :param unicode last_consumed_message_index: An Integer representing index of the last Message this Member has read...
keyword[def] identifier[update] ( identifier[self] , identifier[role_sid] = identifier[values] . identifier[unset] , identifier[last_consumed_message_index] = identifier[values] . identifier[unset] ): literal[string] identifier[data] = identifier[values] . identifier[of] ({ literal[string] : ident...
def update(self, role_sid=values.unset, last_consumed_message_index=values.unset): """ Update the MemberInstance :param unicode role_sid: The Role assigned to this member. :param unicode last_consumed_message_index: An Integer representing index of the last Message this Member has read with...
def expose(func): """ Decorator to be used with :class:`SDKWrapper`. This decorator indicates that the wrapped method or class should be exposed in the proxied object. Args: func(types.FunctionType/types.MethodType): function to decorate Returns: None """ @functools.wraps(...
def function[expose, parameter[func]]: constant[ Decorator to be used with :class:`SDKWrapper`. This decorator indicates that the wrapped method or class should be exposed in the proxied object. Args: func(types.FunctionType/types.MethodType): function to decorate Returns: None...
keyword[def] identifier[expose] ( identifier[func] ): literal[string] @ identifier[functools] . identifier[wraps] ( identifier[func] ) keyword[def] identifier[wrapped] (* identifier[args] ,** identifier[kwargs] ): keyword[return] identifier[func] (* identifier[args] ,** identifier[kwargs] )...
def expose(func): """ Decorator to be used with :class:`SDKWrapper`. This decorator indicates that the wrapped method or class should be exposed in the proxied object. Args: func(types.FunctionType/types.MethodType): function to decorate Returns: None """ @functools.wraps(...
def url(self, _url, **kwargs): """ This will return the url for a Request instead of actually performing the request, and then store it in self['label']. * Note the API call isn't actually made but it is setup to call save or open_as_file :param _url: str of the sub ur...
def function[url, parameter[self, _url]]: constant[ This will return the url for a Request instead of actually performing the request, and then store it in self['label']. * Note the API call isn't actually made but it is setup to call save or open_as_file :param _url: ...
keyword[def] identifier[url] ( identifier[self] , identifier[_url] ,** identifier[kwargs] ): literal[string] identifier[api_call] = identifier[self] . identifier[_create_api_call] ( literal[string] , identifier[_url] , identifier[kwargs] ) identifier[data] = identifier[self] . identifier[_...
def url(self, _url, **kwargs): """ This will return the url for a Request instead of actually performing the request, and then store it in self['label']. * Note the API call isn't actually made but it is setup to call save or open_as_file :param _url: str of the sub url of...
def _init_polling(self): """ Bootstrap polling for throttler. To avoid spiky traffic from throttler clients, we use a random delay before the first poll. """ with self.lock: if not self.running: return r = random.Random() ...
def function[_init_polling, parameter[self]]: constant[ Bootstrap polling for throttler. To avoid spiky traffic from throttler clients, we use a random delay before the first poll. ] with name[self].lock begin[:] if <ast.UnaryOp object at 0x7da20e9569b0> ...
keyword[def] identifier[_init_polling] ( identifier[self] ): literal[string] keyword[with] identifier[self] . identifier[lock] : keyword[if] keyword[not] identifier[self] . identifier[running] : keyword[return] identifier[r] = identifier[random] . ide...
def _init_polling(self): """ Bootstrap polling for throttler. To avoid spiky traffic from throttler clients, we use a random delay before the first poll. """ with self.lock: if not self.running: return # depends on [control=['if'], data=[]] r = rando...
def primitive(self, dictionary): """Item from Python primitive.""" self.__dict__ = {k: v for k, v in dictionary.items() if v}
def function[primitive, parameter[self, dictionary]]: constant[Item from Python primitive.] name[self].__dict__ assign[=] <ast.DictComp object at 0x7da1b1930af0>
keyword[def] identifier[primitive] ( identifier[self] , identifier[dictionary] ): literal[string] identifier[self] . identifier[__dict__] ={ identifier[k] : identifier[v] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[dictionary] . identifier[items] () keyword[if] identifier...
def primitive(self, dictionary): """Item from Python primitive.""" self.__dict__ = {k: v for (k, v) in dictionary.items() if v}
def length(self) -> Optional[int]: """ 获取 body 长度 """ len_ = self.get("content-length") if len_ is not None: return int(cast(str, len_)) return None
def function[length, parameter[self]]: constant[ 获取 body 长度 ] variable[len_] assign[=] call[name[self].get, parameter[constant[content-length]]] if compare[name[len_] is_not constant[None]] begin[:] return[call[name[int], parameter[call[name[cast], parameter[name[str], na...
keyword[def] identifier[length] ( identifier[self] )-> identifier[Optional] [ identifier[int] ]: literal[string] identifier[len_] = identifier[self] . identifier[get] ( literal[string] ) keyword[if] identifier[len_] keyword[is] keyword[not] keyword[None] : keyword[return] ...
def length(self) -> Optional[int]: """ 获取 body 长度 """ len_ = self.get('content-length') if len_ is not None: return int(cast(str, len_)) # depends on [control=['if'], data=['len_']] return None
def initial_contact(self, enable_ssh=True, time_zone=None, keyboard=None, install_on_server=None, filename=None, as_base64=False): """ Allows to save the initial contact for for the specified node :p...
def function[initial_contact, parameter[self, enable_ssh, time_zone, keyboard, install_on_server, filename, as_base64]]: constant[ Allows to save the initial contact for for the specified node :param bool enable_ssh: flag to know if we allow the ssh daemon on the specified node ...
keyword[def] identifier[initial_contact] ( identifier[self] , identifier[enable_ssh] = keyword[True] , identifier[time_zone] = keyword[None] , identifier[keyboard] = keyword[None] , identifier[install_on_server] = keyword[None] , identifier[filename] = keyword[None] , identifier[as_base64] = keyword[False] ): ...
def initial_contact(self, enable_ssh=True, time_zone=None, keyboard=None, install_on_server=None, filename=None, as_base64=False): """ Allows to save the initial contact for for the specified node :param bool enable_ssh: flag to know if we allow the ssh daemon on the specified node ...
def distort(self, img, rotX=0, rotY=0, quad=None): ''' Apply perspective distortion ion self.img angles are in DEG and need to be positive to fit into image ''' self.img = imread(img) # fit old image to self.quad: corr = self.correct(self.img) ...
def function[distort, parameter[self, img, rotX, rotY, quad]]: constant[ Apply perspective distortion ion self.img angles are in DEG and need to be positive to fit into image ] name[self].img assign[=] call[name[imread], parameter[name[img]]] variable[corr] assign[=] cal...
keyword[def] identifier[distort] ( identifier[self] , identifier[img] , identifier[rotX] = literal[int] , identifier[rotY] = literal[int] , identifier[quad] = keyword[None] ): literal[string] identifier[self] . identifier[img] = identifier[imread] ( identifier[img] ) identifie...
def distort(self, img, rotX=0, rotY=0, quad=None): """ Apply perspective distortion ion self.img angles are in DEG and need to be positive to fit into image """ self.img = imread(img) # fit old image to self.quad: corr = self.correct(self.img) s = self.img.shape if quad is ...
def sample(self, bqm, init_solution=None, tenure=None, scale_factor=1, timeout=20, num_reads=1): """Run a tabu search on a given binary quadratic model. Args: bqm (:obj:`~dimod.BinaryQuadraticModel`): The binary quadratic model (BQM) to be sampled. init_solution ...
def function[sample, parameter[self, bqm, init_solution, tenure, scale_factor, timeout, num_reads]]: constant[Run a tabu search on a given binary quadratic model. Args: bqm (:obj:`~dimod.BinaryQuadraticModel`): The binary quadratic model (BQM) to be sampled. init...
keyword[def] identifier[sample] ( identifier[self] , identifier[bqm] , identifier[init_solution] = keyword[None] , identifier[tenure] = keyword[None] , identifier[scale_factor] = literal[int] , identifier[timeout] = literal[int] , identifier[num_reads] = literal[int] ): literal[string] ...
def sample(self, bqm, init_solution=None, tenure=None, scale_factor=1, timeout=20, num_reads=1): """Run a tabu search on a given binary quadratic model. Args: bqm (:obj:`~dimod.BinaryQuadraticModel`): The binary quadratic model (BQM) to be sampled. init_solution (:ob...
def _read_modeling_results(self, directory, silent=False): """Read modeling results from a given mod/ directory. Possible values to read in are: * voltages * potentials * sensitivities """ voltage_file = directory + os.sep + 'volt.dat' if os...
def function[_read_modeling_results, parameter[self, directory, silent]]: constant[Read modeling results from a given mod/ directory. Possible values to read in are: * voltages * potentials * sensitivities ] variable[voltage_file] assign[=] binary_op...
keyword[def] identifier[_read_modeling_results] ( identifier[self] , identifier[directory] , identifier[silent] = keyword[False] ): literal[string] identifier[voltage_file] = identifier[directory] + identifier[os] . identifier[sep] + literal[string] keyword[if] identifier[os] . identifi...
def _read_modeling_results(self, directory, silent=False): """Read modeling results from a given mod/ directory. Possible values to read in are: * voltages * potentials * sensitivities """ voltage_file = directory + os.sep + 'volt.dat' if os.path.isfile(...
def destroy(instances, opts=None): ''' Destroy the named vm(s) ''' client = _get_client() if isinstance(opts, dict): client.opts.update(opts) info = client.destroy(instances) return info
def function[destroy, parameter[instances, opts]]: constant[ Destroy the named vm(s) ] variable[client] assign[=] call[name[_get_client], parameter[]] if call[name[isinstance], parameter[name[opts], name[dict]]] begin[:] call[name[client].opts.update, parameter[name[opts]...
keyword[def] identifier[destroy] ( identifier[instances] , identifier[opts] = keyword[None] ): literal[string] identifier[client] = identifier[_get_client] () keyword[if] identifier[isinstance] ( identifier[opts] , identifier[dict] ): identifier[client] . identifier[opts] . identifier[update...
def destroy(instances, opts=None): """ Destroy the named vm(s) """ client = _get_client() if isinstance(opts, dict): client.opts.update(opts) # depends on [control=['if'], data=[]] info = client.destroy(instances) return info
def cd(self, *subpaths): """ Change the current working directory and update all the paths in the workspace. This is useful for commands that have to be run from a certain directory. """ target = os.path.join(*subpaths) os.chdir(target)
def function[cd, parameter[self]]: constant[ Change the current working directory and update all the paths in the workspace. This is useful for commands that have to be run from a certain directory. ] variable[target] assign[=] call[name[os].path.join, parameter[<ast.Sta...
keyword[def] identifier[cd] ( identifier[self] ,* identifier[subpaths] ): literal[string] identifier[target] = identifier[os] . identifier[path] . identifier[join] (* identifier[subpaths] ) identifier[os] . identifier[chdir] ( identifier[target] )
def cd(self, *subpaths): """ Change the current working directory and update all the paths in the workspace. This is useful for commands that have to be run from a certain directory. """ target = os.path.join(*subpaths) os.chdir(target)
def _get_edge_dict(self): """Return a dict of edges. Keyed tuples of (i, source, target, polarity) with lists of edge ids [id1, id2, ...] """ edge_dict = collections.defaultdict(lambda: []) if len(self._edges) > 0: for e in self._edges: data =...
def function[_get_edge_dict, parameter[self]]: constant[Return a dict of edges. Keyed tuples of (i, source, target, polarity) with lists of edge ids [id1, id2, ...] ] variable[edge_dict] assign[=] call[name[collections].defaultdict, parameter[<ast.Lambda object at 0x7da18bcc98d0...
keyword[def] identifier[_get_edge_dict] ( identifier[self] ): literal[string] identifier[edge_dict] = identifier[collections] . identifier[defaultdict] ( keyword[lambda] :[]) keyword[if] identifier[len] ( identifier[self] . identifier[_edges] )> literal[int] : keyword[for] i...
def _get_edge_dict(self): """Return a dict of edges. Keyed tuples of (i, source, target, polarity) with lists of edge ids [id1, id2, ...] """ edge_dict = collections.defaultdict(lambda : []) if len(self._edges) > 0: for e in self._edges: data = e['data'] ...
def ParseConfigCommandLine(): """Parse all the command line options which control the config system.""" # The user may specify the primary config file on the command line. if flags.FLAGS.config: _CONFIG.Initialize(filename=flags.FLAGS.config, must_exist=True) else: raise RuntimeError("A config file is n...
def function[ParseConfigCommandLine, parameter[]]: constant[Parse all the command line options which control the config system.] if name[flags].FLAGS.config begin[:] call[name[_CONFIG].Initialize, parameter[]] if name[flags].FLAGS.secondary_configs begin[:] for ta...
keyword[def] identifier[ParseConfigCommandLine] (): literal[string] keyword[if] identifier[flags] . identifier[FLAGS] . identifier[config] : identifier[_CONFIG] . identifier[Initialize] ( identifier[filename] = identifier[flags] . identifier[FLAGS] . identifier[config] , identifier[must_exist] = keywo...
def ParseConfigCommandLine(): """Parse all the command line options which control the config system.""" # The user may specify the primary config file on the command line. if flags.FLAGS.config: _CONFIG.Initialize(filename=flags.FLAGS.config, must_exist=True) # depends on [control=['if'], data=[]] ...
def check_sp_certs(self): """ Checks if the x509 certs of the SP exists and are valid. :returns: If the x509 certs of the SP exists and are valid :rtype: boolean """ key = self.get_sp_key() cert = self.get_sp_cert() return key is not None and cert is not N...
def function[check_sp_certs, parameter[self]]: constant[ Checks if the x509 certs of the SP exists and are valid. :returns: If the x509 certs of the SP exists and are valid :rtype: boolean ] variable[key] assign[=] call[name[self].get_sp_key, parameter[]] variable...
keyword[def] identifier[check_sp_certs] ( identifier[self] ): literal[string] identifier[key] = identifier[self] . identifier[get_sp_key] () identifier[cert] = identifier[self] . identifier[get_sp_cert] () keyword[return] identifier[key] keyword[is] keyword[not] keyword[None] ...
def check_sp_certs(self): """ Checks if the x509 certs of the SP exists and are valid. :returns: If the x509 certs of the SP exists and are valid :rtype: boolean """ key = self.get_sp_key() cert = self.get_sp_cert() return key is not None and cert is not None
def _parse_raw_bytes(raw_bytes): """Convert a string of hexadecimal values to decimal values parameters Example: '0x2E 0xF1 0x80 0x28 0x00 0x1A 0x01 0x00' is converted to: 46, 241, [128, 40, 0, 26, 1, 0] :param raw_bytes: string of hexadecimal values :returns: 3 decimal values """ ...
def function[_parse_raw_bytes, parameter[raw_bytes]]: constant[Convert a string of hexadecimal values to decimal values parameters Example: '0x2E 0xF1 0x80 0x28 0x00 0x1A 0x01 0x00' is converted to: 46, 241, [128, 40, 0, 26, 1, 0] :param raw_bytes: string of hexadecimal values :retur...
keyword[def] identifier[_parse_raw_bytes] ( identifier[raw_bytes] ): literal[string] identifier[bytes_list] =[ identifier[int] ( identifier[x] , identifier[base] = literal[int] ) keyword[for] identifier[x] keyword[in] identifier[raw_bytes] . identifier[split] ()] keyword[return] identifier[bytes_l...
def _parse_raw_bytes(raw_bytes): """Convert a string of hexadecimal values to decimal values parameters Example: '0x2E 0xF1 0x80 0x28 0x00 0x1A 0x01 0x00' is converted to: 46, 241, [128, 40, 0, 26, 1, 0] :param raw_bytes: string of hexadecimal values :returns: 3 decimal values """ ...
def handle(self, line_info): """Execute magic functions.""" ifun = line_info.ifun the_rest = line_info.the_rest cmd = '%sget_ipython().magic(%r)' % (line_info.pre_whitespace, (ifun + " " + the_rest)) return cmd
def function[handle, parameter[self, line_info]]: constant[Execute magic functions.] variable[ifun] assign[=] name[line_info].ifun variable[the_rest] assign[=] name[line_info].the_rest variable[cmd] assign[=] binary_operation[constant[%sget_ipython().magic(%r)] <ast.Mod object at 0x7da25...
keyword[def] identifier[handle] ( identifier[self] , identifier[line_info] ): literal[string] identifier[ifun] = identifier[line_info] . identifier[ifun] identifier[the_rest] = identifier[line_info] . identifier[the_rest] identifier[cmd] = literal[string] %( identifier[line_info...
def handle(self, line_info): """Execute magic functions.""" ifun = line_info.ifun the_rest = line_info.the_rest cmd = '%sget_ipython().magic(%r)' % (line_info.pre_whitespace, ifun + ' ' + the_rest) return cmd