code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def get_or_create_environment(self, id=None, name=None, zone=None, default=False): """ Get environment by id or name. If not found: create with given or generated parameters """ if id: return self.get_environment(id=id) elif name: try: env ...
def function[get_or_create_environment, parameter[self, id, name, zone, default]]: constant[ Get environment by id or name. If not found: create with given or generated parameters ] if name[id] begin[:] return[call[name[self].get_environment, parameter[]]]
keyword[def] identifier[get_or_create_environment] ( identifier[self] , identifier[id] = keyword[None] , identifier[name] = keyword[None] , identifier[zone] = keyword[None] , identifier[default] = keyword[False] ): literal[string] keyword[if] identifier[id] : keyword[return] identifi...
def get_or_create_environment(self, id=None, name=None, zone=None, default=False): """ Get environment by id or name. If not found: create with given or generated parameters """ if id: return self.get_environment(id=id) # depends on [control=['if'], data=[]] elif name: try: ...
def refresh(self): """ Updates the cache with setting values from the database. """ # `values_list('name', 'value')` doesn't work because `value` is not a # setting (base class) field, it's a setting value (subclass) field. So # we have to get real instances. args...
def function[refresh, parameter[self]]: constant[ Updates the cache with setting values from the database. ] variable[args] assign[=] <ast.ListComp object at 0x7da20e955180> call[call[name[super], parameter[name[SettingDict], name[self]]].update, parameter[name[args]]] na...
keyword[def] identifier[refresh] ( identifier[self] ): literal[string] identifier[args] =[( identifier[obj] . identifier[name] , identifier[obj] . identifier[value] ) keyword[for] identifier[obj] keyword[in] identifier[self] . identifier[queryset] . identifier[all] ()]...
def refresh(self): """ Updates the cache with setting values from the database. """ # `values_list('name', 'value')` doesn't work because `value` is not a # setting (base class) field, it's a setting value (subclass) field. So # we have to get real instances. args = [(obj.name, obj.v...
def get_contact(self, jid): """ Returns a contact Args: jid (aioxmpp.JID): jid of the contact Returns: dict: the roster of contacts """ try: return self.get_contacts()[jid.bare()] except KeyError: raise ContactNotFoun...
def function[get_contact, parameter[self, jid]]: constant[ Returns a contact Args: jid (aioxmpp.JID): jid of the contact Returns: dict: the roster of contacts ] <ast.Try object at 0x7da1b07930d0>
keyword[def] identifier[get_contact] ( identifier[self] , identifier[jid] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[get_contacts] ()[ identifier[jid] . identifier[bare] ()] keyword[except] identifier[KeyError] : keyword[rais...
def get_contact(self, jid): """ Returns a contact Args: jid (aioxmpp.JID): jid of the contact Returns: dict: the roster of contacts """ try: return self.get_contacts()[jid.bare()] # depends on [control=['try'], data=[]] except KeyError: ...
def getAsGrassAsciiRaster(self, tableName, rasterId=1, rasterIdFieldName='id', rasterFieldName='raster', newSRID=None): """ Returns a string representation of the raster in GRASS ASCII raster format. """ # Get raster in ArcInfo Grid format arcInfoGrid = self.getAsGdalRaster(raste...
def function[getAsGrassAsciiRaster, parameter[self, tableName, rasterId, rasterIdFieldName, rasterFieldName, newSRID]]: constant[ Returns a string representation of the raster in GRASS ASCII raster format. ] variable[arcInfoGrid] assign[=] call[call[name[self].getAsGdalRaster, parameter[...
keyword[def] identifier[getAsGrassAsciiRaster] ( identifier[self] , identifier[tableName] , identifier[rasterId] = literal[int] , identifier[rasterIdFieldName] = literal[string] , identifier[rasterFieldName] = literal[string] , identifier[newSRID] = keyword[None] ): literal[string] identif...
def getAsGrassAsciiRaster(self, tableName, rasterId=1, rasterIdFieldName='id', rasterFieldName='raster', newSRID=None): """ Returns a string representation of the raster in GRASS ASCII raster format. """ # Get raster in ArcInfo Grid format arcInfoGrid = self.getAsGdalRaster(rasterFieldName, ...
def _dict_compare(d1, d2): """ We care if one of two things happens: * d2 has added a new key * a (value for the same key) in d2 has a different value than d1 We don't care if this stuff happens: * A key is deleted from the dict Should return a list of keys that either have been ad...
def function[_dict_compare, parameter[d1, d2]]: constant[ We care if one of two things happens: * d2 has added a new key * a (value for the same key) in d2 has a different value than d1 We don't care if this stuff happens: * A key is deleted from the dict Should return a list o...
keyword[def] identifier[_dict_compare] ( identifier[d1] , identifier[d2] ): literal[string] identifier[keys_added] = identifier[set] ( identifier[d2] . identifier[keys] ())- identifier[set] ( identifier[d1] . identifier[keys] ()) identifier[keys_changed] =[ identifier[k] keyword[for] identifier[k] ...
def _dict_compare(d1, d2): """ We care if one of two things happens: * d2 has added a new key * a (value for the same key) in d2 has a different value than d1 We don't care if this stuff happens: * A key is deleted from the dict Should return a list of keys that either have been ad...
def _write_model(self, specification, specification_set): """ Write autogenerate specification file """ filename = "%s%s.py" % (self._class_prefix.lower(), specification.entity_name.lower()) override_content = self._extract_override_content(specification.entity_name) constants ...
def function[_write_model, parameter[self, specification, specification_set]]: constant[ Write autogenerate specification file ] variable[filename] assign[=] binary_operation[constant[%s%s.py] <ast.Mod object at 0x7da2590d6920> tuple[[<ast.Call object at 0x7da1b0693b80>, <ast.Call object at 0x7...
keyword[def] identifier[_write_model] ( identifier[self] , identifier[specification] , identifier[specification_set] ): literal[string] identifier[filename] = literal[string] %( identifier[self] . identifier[_class_prefix] . identifier[lower] (), identifier[specification] . identifier[entity_name] ...
def _write_model(self, specification, specification_set): """ Write autogenerate specification file """ filename = '%s%s.py' % (self._class_prefix.lower(), specification.entity_name.lower()) override_content = self._extract_override_content(specification.entity_name) constants = self._extract_c...
def _query_helper(self, by=None): """ Internal helper for preparing queries. """ if by is None: primary_keys = self.table.primary_key.columns.keys() if len(primary_keys) > 1: warnings.warn("WARNING: MORE THAN 1 PRIMARY KEY FOR TABLE %s. " ...
def function[_query_helper, parameter[self, by]]: constant[ Internal helper for preparing queries. ] if compare[name[by] is constant[None]] begin[:] variable[primary_keys] assign[=] call[name[self].table.primary_key.columns.keys, parameter[]] if compare[ca...
keyword[def] identifier[_query_helper] ( identifier[self] , identifier[by] = keyword[None] ): literal[string] keyword[if] identifier[by] keyword[is] keyword[None] : identifier[primary_keys] = identifier[self] . identifier[table] . identifier[primary_key] . identifier[columns] . iden...
def _query_helper(self, by=None): """ Internal helper for preparing queries. """ if by is None: primary_keys = self.table.primary_key.columns.keys() if len(primary_keys) > 1: warnings.warn('WARNING: MORE THAN 1 PRIMARY KEY FOR TABLE %s. USING THE FIRST KEY %s.' % (sel...
def get_spectral_index(src, egy): """Compute the local spectral index of a source.""" delta = 1E-5 f0 = src.spectrum()(pyLike.dArg(egy * (1 - delta))) f1 = src.spectrum()(pyLike.dArg(egy * (1 + delta))) if f0 > 0 and f1 > 0: gamma = np.log10(f0 / f1) / np.log10((1 - delta) / (1 + delta)) ...
def function[get_spectral_index, parameter[src, egy]]: constant[Compute the local spectral index of a source.] variable[delta] assign[=] constant[1e-05] variable[f0] assign[=] call[call[name[src].spectrum, parameter[]], parameter[call[name[pyLike].dArg, parameter[binary_operation[name[egy] * bin...
keyword[def] identifier[get_spectral_index] ( identifier[src] , identifier[egy] ): literal[string] identifier[delta] = literal[int] identifier[f0] = identifier[src] . identifier[spectrum] ()( identifier[pyLike] . identifier[dArg] ( identifier[egy] *( literal[int] - identifier[delta] ))) identifi...
def get_spectral_index(src, egy): """Compute the local spectral index of a source.""" delta = 1e-05 f0 = src.spectrum()(pyLike.dArg(egy * (1 - delta))) f1 = src.spectrum()(pyLike.dArg(egy * (1 + delta))) if f0 > 0 and f1 > 0: gamma = np.log10(f0 / f1) / np.log10((1 - delta) / (1 + delta)) #...
def parse_opt(self): """ parses the command line options for different settings. """ optparser = optparse.OptionParser() optparser.add_option('-c', '--config', action='store', dest='config', type='string', default='experiments.cfg', help="your experiments config file") ...
def function[parse_opt, parameter[self]]: constant[ parses the command line options for different settings. ] variable[optparser] assign[=] call[name[optparse].OptionParser, parameter[]] call[name[optparser].add_option, parameter[constant[-c], constant[--config]]] call[name[optparser].ad...
keyword[def] identifier[parse_opt] ( identifier[self] ): literal[string] identifier[optparser] = identifier[optparse] . identifier[OptionParser] () identifier[optparser] . identifier[add_option] ( literal[string] , literal[string] , identifier[action] = literal[string] , identifie...
def parse_opt(self): """ parses the command line options for different settings. """ optparser = optparse.OptionParser() optparser.add_option('-c', '--config', action='store', dest='config', type='string', default='experiments.cfg', help='your experiments config file') optparser.add_option('-n', '--numc...
def _structure_dict(self, obj, cl): """Convert a mapping into a potentially generic dict.""" if is_bare(cl) or cl.__args__ == (Any, Any): return dict(obj) else: key_type, val_type = cl.__args__ if key_type is Any: val_conv = self._structure_fun...
def function[_structure_dict, parameter[self, obj, cl]]: constant[Convert a mapping into a potentially generic dict.] if <ast.BoolOp object at 0x7da1b07bde70> begin[:] return[call[name[dict], parameter[name[obj]]]]
keyword[def] identifier[_structure_dict] ( identifier[self] , identifier[obj] , identifier[cl] ): literal[string] keyword[if] identifier[is_bare] ( identifier[cl] ) keyword[or] identifier[cl] . identifier[__args__] ==( identifier[Any] , identifier[Any] ): keyword[return] identifier[...
def _structure_dict(self, obj, cl): """Convert a mapping into a potentially generic dict.""" if is_bare(cl) or cl.__args__ == (Any, Any): return dict(obj) # depends on [control=['if'], data=[]] else: (key_type, val_type) = cl.__args__ if key_type is Any: val_conv = self....
def _contextMenu(self, pos): """Handle plot area customContextMenuRequested signal. :param QPoint pos: Mouse position relative to plot area """ # Create the context menu. menu = QMenu(self) menu.addAction(self._zoomBackAction) # Displaying the context menu at th...
def function[_contextMenu, parameter[self, pos]]: constant[Handle plot area customContextMenuRequested signal. :param QPoint pos: Mouse position relative to plot area ] variable[menu] assign[=] call[name[QMenu], parameter[name[self]]] call[name[menu].addAction, parameter[name[se...
keyword[def] identifier[_contextMenu] ( identifier[self] , identifier[pos] ): literal[string] identifier[menu] = identifier[QMenu] ( identifier[self] ) identifier[menu] . identifier[addAction] ( identifier[self] . identifier[_zoomBackAction] ) ...
def _contextMenu(self, pos): """Handle plot area customContextMenuRequested signal. :param QPoint pos: Mouse position relative to plot area """ # Create the context menu. menu = QMenu(self) menu.addAction(self._zoomBackAction) # Displaying the context menu at the mouse position requ...
def _to_meta_data(pif_obj, dataset_hit, mdf_acl): """Convert the meta-data from the PIF into MDF""" pif = pif_obj.as_dictionary() dataset = dataset_hit.as_dictionary() mdf = {} try: if pif.get("names"): mdf["title"] = pif["names"][0] else: mdf["title"] = "Citr...
def function[_to_meta_data, parameter[pif_obj, dataset_hit, mdf_acl]]: constant[Convert the meta-data from the PIF into MDF] variable[pif] assign[=] call[name[pif_obj].as_dictionary, parameter[]] variable[dataset] assign[=] call[name[dataset_hit].as_dictionary, parameter[]] variable[mdf]...
keyword[def] identifier[_to_meta_data] ( identifier[pif_obj] , identifier[dataset_hit] , identifier[mdf_acl] ): literal[string] identifier[pif] = identifier[pif_obj] . identifier[as_dictionary] () identifier[dataset] = identifier[dataset_hit] . identifier[as_dictionary] () identifier[mdf] ={} ...
def _to_meta_data(pif_obj, dataset_hit, mdf_acl): """Convert the meta-data from the PIF into MDF""" pif = pif_obj.as_dictionary() dataset = dataset_hit.as_dictionary() mdf = {} try: if pif.get('names'): mdf['title'] = pif['names'][0] # depends on [control=['if'], data=[]] ...
def activate(self, experiment_key, user_id, attributes=None): """ Buckets visitor and sends impression event to Optimizely. Args: experiment_key: Experiment which needs to be activated. user_id: ID for user. attributes: Dict representing user attributes and values which need to be recorded. ...
def function[activate, parameter[self, experiment_key, user_id, attributes]]: constant[ Buckets visitor and sends impression event to Optimizely. Args: experiment_key: Experiment which needs to be activated. user_id: ID for user. attributes: Dict representing user attributes and values wh...
keyword[def] identifier[activate] ( identifier[self] , identifier[experiment_key] , identifier[user_id] , identifier[attributes] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[is_valid] : identifier[self] . identifier[logger] . identifier[error] ( identi...
def activate(self, experiment_key, user_id, attributes=None): """ Buckets visitor and sends impression event to Optimizely. Args: experiment_key: Experiment which needs to be activated. user_id: ID for user. attributes: Dict representing user attributes and values which need to be recorded. ...
def average_returns(ts, **kwargs): ''' Compute geometric average returns from a returns time serie''' average_type = kwargs.get('type', 'net') if average_type == 'net': relative = 0 else: relative = -1 # gross #start = kwargs.get('start', ts.index[0]) #end = kwargs.get('end', ts...
def function[average_returns, parameter[ts]]: constant[ Compute geometric average returns from a returns time serie] variable[average_type] assign[=] call[name[kwargs].get, parameter[constant[type], constant[net]]] if compare[name[average_type] equal[==] constant[net]] begin[:] v...
keyword[def] identifier[average_returns] ( identifier[ts] ,** identifier[kwargs] ): literal[string] identifier[average_type] = identifier[kwargs] . identifier[get] ( literal[string] , literal[string] ) keyword[if] identifier[average_type] == literal[string] : identifier[relative] = literal[i...
def average_returns(ts, **kwargs): """ Compute geometric average returns from a returns time serie""" average_type = kwargs.get('type', 'net') if average_type == 'net': relative = 0 # depends on [control=['if'], data=[]] else: relative = -1 # gross #start = kwargs.get('start', ts.i...
def meta_changed(self, model, prop_name, info): """This method notifies the parent state about changes made to the meta data """ if self.parent is not None: msg = info.arg # Add information about notification to the signal message notification = Notification(m...
def function[meta_changed, parameter[self, model, prop_name, info]]: constant[This method notifies the parent state about changes made to the meta data ] if compare[name[self].parent is_not constant[None]] begin[:] variable[msg] assign[=] name[info].arg variable[n...
keyword[def] identifier[meta_changed] ( identifier[self] , identifier[model] , identifier[prop_name] , identifier[info] ): literal[string] keyword[if] identifier[self] . identifier[parent] keyword[is] keyword[not] keyword[None] : identifier[msg] = identifier[info] . identifier[arg]...
def meta_changed(self, model, prop_name, info): """This method notifies the parent state about changes made to the meta data """ if self.parent is not None: msg = info.arg # Add information about notification to the signal message notification = Notification(model, prop_name, inf...
def _get_session(self, session): """Creates a new session with basic auth, unless one was provided, and sets headers. :param session: (optional) Session to re-use :return: - :class:`requests.Session` object """ if not session: logger.debug('(SESSION_CREA...
def function[_get_session, parameter[self, session]]: constant[Creates a new session with basic auth, unless one was provided, and sets headers. :param session: (optional) Session to re-use :return: - :class:`requests.Session` object ] if <ast.UnaryOp object at 0x7da...
keyword[def] identifier[_get_session] ( identifier[self] , identifier[session] ): literal[string] keyword[if] keyword[not] identifier[session] : identifier[logger] . identifier[debug] ( literal[string] % identifier[self] . identifier[_user] ) identifier[s] = identifier[...
def _get_session(self, session): """Creates a new session with basic auth, unless one was provided, and sets headers. :param session: (optional) Session to re-use :return: - :class:`requests.Session` object """ if not session: logger.debug('(SESSION_CREATE) User: %s'...
def GetNeighbors(ID, model = None, neighbors = None, mag_range = None, cdpp_range = None, aperture_name = None, cadence = 'lc', **kwargs): ''' Return `neighbors` random bright stars on the same module as `EPIC`. :param int ID: The target ID number :param str model: The :py...
def function[GetNeighbors, parameter[ID, model, neighbors, mag_range, cdpp_range, aperture_name, cadence]]: constant[ Return `neighbors` random bright stars on the same module as `EPIC`. :param int ID: The target ID number :param str model: The :py:obj:`everest` model name. Only used when imposing CDPP...
keyword[def] identifier[GetNeighbors] ( identifier[ID] , identifier[model] = keyword[None] , identifier[neighbors] = keyword[None] , identifier[mag_range] = keyword[None] , identifier[cdpp_range] = keyword[None] , identifier[aperture_name] = keyword[None] , identifier[cadence] = literal[string] ,** identifier[kwarg...
def GetNeighbors(ID, model=None, neighbors=None, mag_range=None, cdpp_range=None, aperture_name=None, cadence='lc', **kwargs): """ Return `neighbors` random bright stars on the same module as `EPIC`. :param int ID: The target ID number :param str model: The :py:obj:`everest` model name. Only used when impo...
def load(self, filename, offset): """Will eventually load information for Apple_Boot volume. \ Not yet implemented""" try: self.offset = offset # self.fd = open(filename, 'rb') # self.fd.close() except IOError: self.logger.error('Unable to ...
def function[load, parameter[self, filename, offset]]: constant[Will eventually load information for Apple_Boot volume. Not yet implemented] <ast.Try object at 0x7da1b27eb730>
keyword[def] identifier[load] ( identifier[self] , identifier[filename] , identifier[offset] ): literal[string] keyword[try] : identifier[self] . identifier[offset] = identifier[offset] keyword[except] identifier[IOError] : identifier[s...
def load(self, filename, offset): """Will eventually load information for Apple_Boot volume. Not yet implemented""" try: self.offset = offset # depends on [control=['try'], data=[]] # self.fd = open(filename, 'rb') # self.fd.close() except IOError: self.logger.error('Unable ...
def max_delta_volume(self): """ Maximum volume change along insertion """ vols = [v.vol_charge for v in self.voltage_pairs] vols.extend([v.vol_discharge for v in self.voltage_pairs]) return max(vols) / min(vols) - 1
def function[max_delta_volume, parameter[self]]: constant[ Maximum volume change along insertion ] variable[vols] assign[=] <ast.ListComp object at 0x7da1b1c35b40> call[name[vols].extend, parameter[<ast.ListComp object at 0x7da1b1c36d40>]] return[binary_operation[binary_opera...
keyword[def] identifier[max_delta_volume] ( identifier[self] ): literal[string] identifier[vols] =[ identifier[v] . identifier[vol_charge] keyword[for] identifier[v] keyword[in] identifier[self] . identifier[voltage_pairs] ] identifier[vols] . identifier[extend] ([ identifier[v] . iden...
def max_delta_volume(self): """ Maximum volume change along insertion """ vols = [v.vol_charge for v in self.voltage_pairs] vols.extend([v.vol_discharge for v in self.voltage_pairs]) return max(vols) / min(vols) - 1
def _remove_by_number(self, number: int): """ Removes the data object from this collection with the given number. A `ValueError` will be raised if a data object with the given number does not exist. :param number: the number of the data object to remove """ if number not ...
def function[_remove_by_number, parameter[self, number]]: constant[ Removes the data object from this collection with the given number. A `ValueError` will be raised if a data object with the given number does not exist. :param number: the number of the data object to remove ] ...
keyword[def] identifier[_remove_by_number] ( identifier[self] , identifier[number] : identifier[int] ): literal[string] keyword[if] identifier[number] keyword[not] keyword[in] identifier[self] . identifier[_data] : keyword[raise] identifier[ValueError] ( literal[string] % identifi...
def _remove_by_number(self, number: int): """ Removes the data object from this collection with the given number. A `ValueError` will be raised if a data object with the given number does not exist. :param number: the number of the data object to remove """ if number not in self....
def remove_option(self, section, option, remove_default=True): """ Remove an option if it exists in config from a file or default config. If both of config have the same option, this removes the option in both configs unless remove_default=False. """ if super().has_option...
def function[remove_option, parameter[self, section, option, remove_default]]: constant[ Remove an option if it exists in config from a file or default config. If both of config have the same option, this removes the option in both configs unless remove_default=False. ] i...
keyword[def] identifier[remove_option] ( identifier[self] , identifier[section] , identifier[option] , identifier[remove_default] = keyword[True] ): literal[string] keyword[if] identifier[super] (). identifier[has_option] ( identifier[section] , identifier[option] ): identifier[super]...
def remove_option(self, section, option, remove_default=True): """ Remove an option if it exists in config from a file or default config. If both of config have the same option, this removes the option in both configs unless remove_default=False. """ if super().has_option(section...
def draw_line(self, ax, line, force_trans=None): """Process a matplotlib line and call renderer.draw_line""" coordinates, data = self.process_transform(line.get_transform(), ax, line.get_xydata(), force...
def function[draw_line, parameter[self, ax, line, force_trans]]: constant[Process a matplotlib line and call renderer.draw_line] <ast.Tuple object at 0x7da1b0e7a200> assign[=] call[name[self].process_transform, parameter[call[name[line].get_transform, parameter[]], name[ax], call[name[line].get_xydata, ...
keyword[def] identifier[draw_line] ( identifier[self] , identifier[ax] , identifier[line] , identifier[force_trans] = keyword[None] ): literal[string] identifier[coordinates] , identifier[data] = identifier[self] . identifier[process_transform] ( identifier[line] . identifier[get_transform] (), ...
def draw_line(self, ax, line, force_trans=None): """Process a matplotlib line and call renderer.draw_line""" (coordinates, data) = self.process_transform(line.get_transform(), ax, line.get_xydata(), force_trans=force_trans) linestyle = utils.get_line_style(line) if linestyle['dasharray'] is None: ...
def validate_password(entry, username, check_function, password=None, retries=1, save_on_success=True, prompt=None, **check_args): """ Validate a password with a check function & retry if the password is incorrect. Useful for after a user has changed their password in LDAP, but their local keychain ent...
def function[validate_password, parameter[entry, username, check_function, password, retries, save_on_success, prompt]]: constant[ Validate a password with a check function & retry if the password is incorrect. Useful for after a user has changed their password in LDAP, but their local keychain ent...
keyword[def] identifier[validate_password] ( identifier[entry] , identifier[username] , identifier[check_function] , identifier[password] = keyword[None] , identifier[retries] = literal[int] , identifier[save_on_success] = keyword[True] , identifier[prompt] = keyword[None] ,** identifier[check_args] ): literal[s...
def validate_password(entry, username, check_function, password=None, retries=1, save_on_success=True, prompt=None, **check_args): """ Validate a password with a check function & retry if the password is incorrect. Useful for after a user has changed their password in LDAP, but their local keychain ent...
def fit_tranform(self, raw_documents): """ Transform given list of raw_documents to document-term matrix in sparse CSR format (see scipy) """ X = self.transform(raw_documents, new_document=True) return X
def function[fit_tranform, parameter[self, raw_documents]]: constant[ Transform given list of raw_documents to document-term matrix in sparse CSR format (see scipy) ] variable[X] assign[=] call[name[self].transform, parameter[name[raw_documents]]] return[name[X]]
keyword[def] identifier[fit_tranform] ( identifier[self] , identifier[raw_documents] ): literal[string] identifier[X] = identifier[self] . identifier[transform] ( identifier[raw_documents] , identifier[new_document] = keyword[True] ) keyword[return] identifier[X]
def fit_tranform(self, raw_documents): """ Transform given list of raw_documents to document-term matrix in sparse CSR format (see scipy) """ X = self.transform(raw_documents, new_document=True) return X
def _report_error(self, legacy_message, new_message=None, schema_suffix=None): """ Report an error during validation. There are two error messages. The legacy message is used for backwards compatibility and usually contains the object (possibly very large) ...
def function[_report_error, parameter[self, legacy_message, new_message, schema_suffix]]: constant[ Report an error during validation. There are two error messages. The legacy message is used for backwards compatibility and usually contains the object (possibly very large) that ...
keyword[def] identifier[_report_error] ( identifier[self] , identifier[legacy_message] , identifier[new_message] = keyword[None] , identifier[schema_suffix] = keyword[None] ): literal[string] identifier[object_expr] = identifier[self] . identifier[_get_object_expression] () identifier[sch...
def _report_error(self, legacy_message, new_message=None, schema_suffix=None): """ Report an error during validation. There are two error messages. The legacy message is used for backwards compatibility and usually contains the object (possibly very large) that failed to validate. T...
def GetValues(self): """Retrieves all values within the key. Returns: generator[WinRegistryValue]: Windows Registry value generator. """ if not self._registry_key and self._registry: self._GetKeyFromRegistry() if self._registry_key: return self._registry_key.GetValues() retu...
def function[GetValues, parameter[self]]: constant[Retrieves all values within the key. Returns: generator[WinRegistryValue]: Windows Registry value generator. ] if <ast.BoolOp object at 0x7da18dc05ba0> begin[:] call[name[self]._GetKeyFromRegistry, parameter[]] if ...
keyword[def] identifier[GetValues] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[_registry_key] keyword[and] identifier[self] . identifier[_registry] : identifier[self] . identifier[_GetKeyFromRegistry] () keyword[if] identifier[self] . ident...
def GetValues(self): """Retrieves all values within the key. Returns: generator[WinRegistryValue]: Windows Registry value generator. """ if not self._registry_key and self._registry: self._GetKeyFromRegistry() # depends on [control=['if'], data=[]] if self._registry_key: retu...
def get_current_bios_settings(self, only_allowed_settings=True): """Get current BIOS settings. :param: only_allowed_settings: True when only allowed BIOS settings are to be returned. If False, All the BIOS settings supported by iLO are returned. :return: a dictio...
def function[get_current_bios_settings, parameter[self, only_allowed_settings]]: constant[Get current BIOS settings. :param: only_allowed_settings: True when only allowed BIOS settings are to be returned. If False, All the BIOS settings supported by iLO are returned. ...
keyword[def] identifier[get_current_bios_settings] ( identifier[self] , identifier[only_allowed_settings] = keyword[True] ): literal[string] identifier[sushy_system] = identifier[self] . identifier[_get_sushy_system] ( identifier[PROLIANT_SYSTEM_ID] ) keyword[try] : identifier...
def get_current_bios_settings(self, only_allowed_settings=True): """Get current BIOS settings. :param: only_allowed_settings: True when only allowed BIOS settings are to be returned. If False, All the BIOS settings supported by iLO are returned. :return: a dictionary...
def store(self, obj, distinct=False): ''' Store an object in the table. :param obj: An object to store :param distinct: Store object only if there is none identical of such. If at least one field is different, store it. :return: ''' if d...
def function[store, parameter[self, obj, distinct]]: constant[ Store an object in the table. :param obj: An object to store :param distinct: Store object only if there is none identical of such. If at least one field is different, store it. :return: ...
keyword[def] identifier[store] ( identifier[self] , identifier[obj] , identifier[distinct] = keyword[False] ): literal[string] keyword[if] identifier[distinct] : identifier[fields] = identifier[dict] ( identifier[zip] ( identifier[self] . identifier[_tables] [ identifier[obj] . identi...
def store(self, obj, distinct=False): """ Store an object in the table. :param obj: An object to store :param distinct: Store object only if there is none identical of such. If at least one field is different, store it. :return: """ if distinct:...
def find_element_by_jquery(step, browser, selector): """Find a single HTML element using jQuery-style selectors.""" elements = find_elements_by_jquery(browser, selector) assert_true(step, len(elements) > 0) return elements[0]
def function[find_element_by_jquery, parameter[step, browser, selector]]: constant[Find a single HTML element using jQuery-style selectors.] variable[elements] assign[=] call[name[find_elements_by_jquery], parameter[name[browser], name[selector]]] call[name[assert_true], parameter[name[step], co...
keyword[def] identifier[find_element_by_jquery] ( identifier[step] , identifier[browser] , identifier[selector] ): literal[string] identifier[elements] = identifier[find_elements_by_jquery] ( identifier[browser] , identifier[selector] ) identifier[assert_true] ( identifier[step] , identifier[len] ( id...
def find_element_by_jquery(step, browser, selector): """Find a single HTML element using jQuery-style selectors.""" elements = find_elements_by_jquery(browser, selector) assert_true(step, len(elements) > 0) return elements[0]
def scheduled_event_trigger(self, event_type): """Returns a callback that schedules events for the future. Returned callback function will add an event of type event_type to a queue which will be checked the next time an event is requested.""" def callback(when, **kwargs): s...
def function[scheduled_event_trigger, parameter[self, event_type]]: constant[Returns a callback that schedules events for the future. Returned callback function will add an event of type event_type to a queue which will be checked the next time an event is requested.] def function[callb...
keyword[def] identifier[scheduled_event_trigger] ( identifier[self] , identifier[event_type] ): literal[string] keyword[def] identifier[callback] ( identifier[when] ,** identifier[kwargs] ): identifier[self] . identifier[queued_scheduled_events] . identifier[append] (( identifier[when...
def scheduled_event_trigger(self, event_type): """Returns a callback that schedules events for the future. Returned callback function will add an event of type event_type to a queue which will be checked the next time an event is requested.""" def callback(when, **kwargs): self.queued_...
def sync(self, rules: list): """ Synchronizes the given ruleset with the one on the server and adds the not yet existing rules to the server. :type rules: collections.Iterable[Rule] """ self.client = self.connect() try: server_rules = set(self....
def function[sync, parameter[self, rules]]: constant[ Synchronizes the given ruleset with the one on the server and adds the not yet existing rules to the server. :type rules: collections.Iterable[Rule] ] name[self].client assign[=] call[name[self].connect, parame...
keyword[def] identifier[sync] ( identifier[self] , identifier[rules] : identifier[list] ): literal[string] identifier[self] . identifier[client] = identifier[self] . identifier[connect] () keyword[try] : identifier[server_rules] = identifier[set] ( identifier[self] . identifie...
def sync(self, rules: list): """ Synchronizes the given ruleset with the one on the server and adds the not yet existing rules to the server. :type rules: collections.Iterable[Rule] """ self.client = self.connect() try: server_rules = set(self.server_rules) ...
def roll_down_capture(returns, factor_returns, window=10, **kwargs): """ Computes the down capture measure over a rolling window. see documentation for :func:`~empyrical.stats.down_capture`. (pass all args, kwargs required) Parameters ---------- returns : pd.Series or np.ndarray Dai...
def function[roll_down_capture, parameter[returns, factor_returns, window]]: constant[ Computes the down capture measure over a rolling window. see documentation for :func:`~empyrical.stats.down_capture`. (pass all args, kwargs required) Parameters ---------- returns : pd.Series or np.n...
keyword[def] identifier[roll_down_capture] ( identifier[returns] , identifier[factor_returns] , identifier[window] = literal[int] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[roll] ( identifier[returns] , identifier[factor_returns] , identifier[window] = identifier[window] , identi...
def roll_down_capture(returns, factor_returns, window=10, **kwargs): """ Computes the down capture measure over a rolling window. see documentation for :func:`~empyrical.stats.down_capture`. (pass all args, kwargs required) Parameters ---------- returns : pd.Series or np.ndarray Dai...
def retrieve_keras_weights(java_model): """For a previously imported Keras model, after training it with DL4J Spark, we want to set the resulting weights back to the original Keras model. :param java_model: DL4J model (MultiLayerNetwork or ComputationGraph :return: list of numpy arrays in correct order...
def function[retrieve_keras_weights, parameter[java_model]]: constant[For a previously imported Keras model, after training it with DL4J Spark, we want to set the resulting weights back to the original Keras model. :param java_model: DL4J model (MultiLayerNetwork or ComputationGraph :return: list o...
keyword[def] identifier[retrieve_keras_weights] ( identifier[java_model] ): literal[string] identifier[weights] =[] identifier[layers] = identifier[java_model] . identifier[getLayers] () keyword[for] identifier[layer] keyword[in] identifier[layers] : identifier[params] = identifier[la...
def retrieve_keras_weights(java_model): """For a previously imported Keras model, after training it with DL4J Spark, we want to set the resulting weights back to the original Keras model. :param java_model: DL4J model (MultiLayerNetwork or ComputationGraph :return: list of numpy arrays in correct order...
def setEnable(self, status, lanInterfaceId=1, timeout=1): """Set enable status for a LAN interface, be careful you don't cut yourself off. :param bool status: enable or disable the interface :param int lanInterfaceId: the id of the LAN interface :param float timeout: the timeout to wait...
def function[setEnable, parameter[self, status, lanInterfaceId, timeout]]: constant[Set enable status for a LAN interface, be careful you don't cut yourself off. :param bool status: enable or disable the interface :param int lanInterfaceId: the id of the LAN interface :param float timeo...
keyword[def] identifier[setEnable] ( identifier[self] , identifier[status] , identifier[lanInterfaceId] = literal[int] , identifier[timeout] = literal[int] ): literal[string] identifier[namespace] = identifier[Lan] . identifier[getServiceType] ( literal[string] )+ identifier[str] ( identifier[lanIn...
def setEnable(self, status, lanInterfaceId=1, timeout=1): """Set enable status for a LAN interface, be careful you don't cut yourself off. :param bool status: enable or disable the interface :param int lanInterfaceId: the id of the LAN interface :param float timeout: the timeout to wait for...
def in_out_ratio(self, node: BaseEntity) -> float: """Calculate the ratio of in-degree / out-degree of a node.""" return self.graph.in_degree(node) / float(self.graph.out_degree(node))
def function[in_out_ratio, parameter[self, node]]: constant[Calculate the ratio of in-degree / out-degree of a node.] return[binary_operation[call[name[self].graph.in_degree, parameter[name[node]]] / call[name[float], parameter[call[name[self].graph.out_degree, parameter[name[node]]]]]]]
keyword[def] identifier[in_out_ratio] ( identifier[self] , identifier[node] : identifier[BaseEntity] )-> identifier[float] : literal[string] keyword[return] identifier[self] . identifier[graph] . identifier[in_degree] ( identifier[node] )/ identifier[float] ( identifier[self] . identifier[graph] ....
def in_out_ratio(self, node: BaseEntity) -> float: """Calculate the ratio of in-degree / out-degree of a node.""" return self.graph.in_degree(node) / float(self.graph.out_degree(node))
def _gen_trend_graph(start, end, force_overwrite=False): """ Total trend graph for machine category. """ filename = graphs.get_trend_graph_filename(start, end) csv_filename = os.path.join(GRAPH_ROOT, filename + '.csv') png_filename = os.path.join(GRAPH_ROOT, filename + '.png') _check_directory_exis...
def function[_gen_trend_graph, parameter[start, end, force_overwrite]]: constant[ Total trend graph for machine category. ] variable[filename] assign[=] call[name[graphs].get_trend_graph_filename, parameter[name[start], name[end]]] variable[csv_filename] assign[=] call[name[os].path.join, parame...
keyword[def] identifier[_gen_trend_graph] ( identifier[start] , identifier[end] , identifier[force_overwrite] = keyword[False] ): literal[string] identifier[filename] = identifier[graphs] . identifier[get_trend_graph_filename] ( identifier[start] , identifier[end] ) identifier[csv_filename] = identifi...
def _gen_trend_graph(start, end, force_overwrite=False): """ Total trend graph for machine category. """ filename = graphs.get_trend_graph_filename(start, end) csv_filename = os.path.join(GRAPH_ROOT, filename + '.csv') png_filename = os.path.join(GRAPH_ROOT, filename + '.png') _check_directory_exist...
def add_n_trend(trend_input, average_time, initial_trend, subs, subscript_dict): """Trend. Parameters ---------- trend_input: <string> average_time: <string> trend_initial: <string> subs: list of strings List of strings of subscript indices that corre...
def function[add_n_trend, parameter[trend_input, average_time, initial_trend, subs, subscript_dict]]: constant[Trend. Parameters ---------- trend_input: <string> average_time: <string> trend_initial: <string> subs: list of strings List of strings ...
keyword[def] identifier[add_n_trend] ( identifier[trend_input] , identifier[average_time] , identifier[initial_trend] , identifier[subs] , identifier[subscript_dict] ): literal[string] identifier[stateful] ={ literal[string] : identifier[utils] . identifier[make_python_identifier] ( literal[string] %...
def add_n_trend(trend_input, average_time, initial_trend, subs, subscript_dict): """Trend. Parameters ---------- trend_input: <string> average_time: <string> trend_initial: <string> subs: list of strings List of strings of subscript indices that corre...
def parse_verilog(text): '''Parse a text buffer of Verilog code Args: text (str): Source code to parse Returns: List of parsed objects. ''' lex = VerilogLexer name = None kind = None saved_type = None mode = 'input' ptype = 'wire' metacomments = [] parameters = [] param_items = [] ...
def function[parse_verilog, parameter[text]]: constant[Parse a text buffer of Verilog code Args: text (str): Source code to parse Returns: List of parsed objects. ] variable[lex] assign[=] name[VerilogLexer] variable[name] assign[=] constant[None] variable[kind] assign[=] ...
keyword[def] identifier[parse_verilog] ( identifier[text] ): literal[string] identifier[lex] = identifier[VerilogLexer] identifier[name] = keyword[None] identifier[kind] = keyword[None] identifier[saved_type] = keyword[None] identifier[mode] = literal[string] identifier[ptype] = literal[st...
def parse_verilog(text): """Parse a text buffer of Verilog code Args: text (str): Source code to parse Returns: List of parsed objects. """ lex = VerilogLexer name = None kind = None saved_type = None mode = 'input' ptype = 'wire' metacomments = [] parameters = [] ...
def setAvailableLocales(self, locales): """ Sets a list of the available locales to use for displaying the locale information for. This provides a way to filter the interface for only locales that you care about. :param locales | [<str>, ..] """ ...
def function[setAvailableLocales, parameter[self, locales]]: constant[ Sets a list of the available locales to use for displaying the locale information for. This provides a way to filter the interface for only locales that you care about. :param locales | [<str>, ....
keyword[def] identifier[setAvailableLocales] ( identifier[self] , identifier[locales] ): literal[string] keyword[try] : identifier[expr] = identifier[re] . identifier[compile] ( literal[string] ) identifier[babel_locales] =[] keyword[for] identifier[loca...
def setAvailableLocales(self, locales): """ Sets a list of the available locales to use for displaying the locale information for. This provides a way to filter the interface for only locales that you care about. :param locales | [<str>, ..] """ try: ...
def export_default_scripts(target_folder, source_folder = None, raise_errors = False, verbose=False): """ tries to instantiate all the scripts that are imported in /scripts/__init__.py saves each script that could be instantiated into a .b26 file in the folder path Args: target_folder: target pa...
def function[export_default_scripts, parameter[target_folder, source_folder, raise_errors, verbose]]: constant[ tries to instantiate all the scripts that are imported in /scripts/__init__.py saves each script that could be instantiated into a .b26 file in the folder path Args: target_folder:...
keyword[def] identifier[export_default_scripts] ( identifier[target_folder] , identifier[source_folder] = keyword[None] , identifier[raise_errors] = keyword[False] , identifier[verbose] = keyword[False] ): literal[string] identifier[scripts_to_load] = identifier[get_classes_in_folder] ( identifier[source_...
def export_default_scripts(target_folder, source_folder=None, raise_errors=False, verbose=False): """ tries to instantiate all the scripts that are imported in /scripts/__init__.py saves each script that could be instantiated into a .b26 file in the folder path Args: target_folder: target path f...
def forms_invalid(self, form, inlines): """ If the form or formsets are invalid, re-render the context data with the data-filled form and formsets and errors. """ return self.render_to_response(self.get_context_data(form=form, inlines=inlines))
def function[forms_invalid, parameter[self, form, inlines]]: constant[ If the form or formsets are invalid, re-render the context data with the data-filled form and formsets and errors. ] return[call[name[self].render_to_response, parameter[call[name[self].get_context_data, parameter...
keyword[def] identifier[forms_invalid] ( identifier[self] , identifier[form] , identifier[inlines] ): literal[string] keyword[return] identifier[self] . identifier[render_to_response] ( identifier[self] . identifier[get_context_data] ( identifier[form] = identifier[form] , identifier[inlines] = id...
def forms_invalid(self, form, inlines): """ If the form or formsets are invalid, re-render the context data with the data-filled form and formsets and errors. """ return self.render_to_response(self.get_context_data(form=form, inlines=inlines))
def _normal_prompt(self): """ Flushes the prompt before requesting the input :return: The command line """ sys.stdout.write(self.__get_ps1()) sys.stdout.flush() return safe_input()
def function[_normal_prompt, parameter[self]]: constant[ Flushes the prompt before requesting the input :return: The command line ] call[name[sys].stdout.write, parameter[call[name[self].__get_ps1, parameter[]]]] call[name[sys].stdout.flush, parameter[]] return[call[...
keyword[def] identifier[_normal_prompt] ( identifier[self] ): literal[string] identifier[sys] . identifier[stdout] . identifier[write] ( identifier[self] . identifier[__get_ps1] ()) identifier[sys] . identifier[stdout] . identifier[flush] () keyword[return] identifier[safe_input]...
def _normal_prompt(self): """ Flushes the prompt before requesting the input :return: The command line """ sys.stdout.write(self.__get_ps1()) sys.stdout.flush() return safe_input()
def STOS(cpu, dest, src): """ Stores String. Stores a byte, word, or doubleword from the AL, AX, or EAX register, respectively, into the destination operand. The destination operand is a memory location, the address of which is read from either the ES:EDI or the ES:DI re...
def function[STOS, parameter[cpu, dest, src]]: constant[ Stores String. Stores a byte, word, or doubleword from the AL, AX, or EAX register, respectively, into the destination operand. The destination operand is a memory location, the address of which is read from either the ES:...
keyword[def] identifier[STOS] ( identifier[cpu] , identifier[dest] , identifier[src] ): literal[string] identifier[size] = identifier[src] . identifier[size] identifier[dest] . identifier[write] ( identifier[src] . identifier[read] ()) identifier[dest_reg] = identifier[dest] . id...
def STOS(cpu, dest, src): """ Stores String. Stores a byte, word, or doubleword from the AL, AX, or EAX register, respectively, into the destination operand. The destination operand is a memory location, the address of which is read from either the ES:EDI or the ES:DI regist...
def add(self, layer, items): """ Add items in model. """ for k in items.iterkeys(): if k in self.model[layer]: raise Exception('item %s is already in layer %s' % (k, layer)) self.model[layer].update(items) # this should also update Layer.layer,...
def function[add, parameter[self, layer, items]]: constant[ Add items in model. ] for taget[name[k]] in starred[call[name[items].iterkeys, parameter[]]] begin[:] if compare[name[k] in call[name[self].model][name[layer]]] begin[:] <ast.Raise object at 0x7da20c7...
keyword[def] identifier[add] ( identifier[self] , identifier[layer] , identifier[items] ): literal[string] keyword[for] identifier[k] keyword[in] identifier[items] . identifier[iterkeys] (): keyword[if] identifier[k] keyword[in] identifier[self] . identifier[model] [ identifier[l...
def add(self, layer, items): """ Add items in model. """ for k in items.iterkeys(): if k in self.model[layer]: raise Exception('item %s is already in layer %s' % (k, layer)) # depends on [control=['if'], data=['k']] # depends on [control=['for'], data=['k']] self.model[...
def str_to_dt(val): """ Return a datetime object if the string value represents one Epoch integer or an ISO 8601 compatible string is supported. :param val: str :return: datetime :raise: ValueError """ if isinstance(val, dt): return val try: if val.isdigit(): ...
def function[str_to_dt, parameter[val]]: constant[ Return a datetime object if the string value represents one Epoch integer or an ISO 8601 compatible string is supported. :param val: str :return: datetime :raise: ValueError ] if call[name[isinstance], parameter[name[val], name...
keyword[def] identifier[str_to_dt] ( identifier[val] ): literal[string] keyword[if] identifier[isinstance] ( identifier[val] , identifier[dt] ): keyword[return] identifier[val] keyword[try] : keyword[if] identifier[val] . identifier[isdigit] (): keyword[return] id...
def str_to_dt(val): """ Return a datetime object if the string value represents one Epoch integer or an ISO 8601 compatible string is supported. :param val: str :return: datetime :raise: ValueError """ if isinstance(val, dt): return val # depends on [control=['if'], data=[]] ...
def build_layers(self): """ Constructs layers. Returns: list: List of DrawElements. Raises: VisualizationError: When the drawing is, for some reason, impossible to be drawn. """ wire_names = self.wire_names(with_initial_value=True) if not w...
def function[build_layers, parameter[self]]: constant[ Constructs layers. Returns: list: List of DrawElements. Raises: VisualizationError: When the drawing is, for some reason, impossible to be drawn. ] variable[wire_names] assign[=] call[name[self...
keyword[def] identifier[build_layers] ( identifier[self] ): literal[string] identifier[wire_names] = identifier[self] . identifier[wire_names] ( identifier[with_initial_value] = keyword[True] ) keyword[if] keyword[not] identifier[wire_names] : keyword[return] [] id...
def build_layers(self): """ Constructs layers. Returns: list: List of DrawElements. Raises: VisualizationError: When the drawing is, for some reason, impossible to be drawn. """ wire_names = self.wire_names(with_initial_value=True) if not wire_names: ...
def _trace_summary(self): """ Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method. """ for (i, (val, args)) in enumerate(self.trace): if args is StopIteration: ...
def function[_trace_summary, parameter[self]]: constant[ Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method. ] for taget[tuple[[<ast.Name object at 0x7da1afe57b20>, <ast.Tuple ...
keyword[def] identifier[_trace_summary] ( identifier[self] ): literal[string] keyword[for] ( identifier[i] ,( identifier[val] , identifier[args] )) keyword[in] identifier[enumerate] ( identifier[self] . identifier[trace] ): keyword[if] identifier[args] keyword[is] identifier[StopIt...
def _trace_summary(self): """ Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned. May be used to implement the summary method. """ for (i, (val, args)) in enumerate(self.trace): if args is StopIteration: info ...
def get_variation(self, experiment_key, user_id, attributes=None): """ Gets variation where user will be bucketed. Args: experiment_key: Experiment for which user variation needs to be determined. user_id: ID for user. attributes: Dict representing user attributes. Returns: Variati...
def function[get_variation, parameter[self, experiment_key, user_id, attributes]]: constant[ Gets variation where user will be bucketed. Args: experiment_key: Experiment for which user variation needs to be determined. user_id: ID for user. attributes: Dict representing user attributes. ...
keyword[def] identifier[get_variation] ( identifier[self] , identifier[experiment_key] , identifier[user_id] , identifier[attributes] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[self] . identifier[is_valid] : identifier[self] . identifier[logger] . identifier[error] ( i...
def get_variation(self, experiment_key, user_id, attributes=None): """ Gets variation where user will be bucketed. Args: experiment_key: Experiment for which user variation needs to be determined. user_id: ID for user. attributes: Dict representing user attributes. Returns: Variati...
def cmd_playtune(self, args): '''send PLAY_TUNE message''' if len(args) < 1: print("Usage: playtune TUNE") return tune = args[0] str1 = tune[0:30] str2 = tune[30:] if sys.version_info.major >= 3 and not isinstance(str1, bytes): str1 = b...
def function[cmd_playtune, parameter[self, args]]: constant[send PLAY_TUNE message] if compare[call[name[len], parameter[name[args]]] less[<] constant[1]] begin[:] call[name[print], parameter[constant[Usage: playtune TUNE]]] return[None] variable[tune] assign[=] call[name...
keyword[def] identifier[cmd_playtune] ( identifier[self] , identifier[args] ): literal[string] keyword[if] identifier[len] ( identifier[args] )< literal[int] : identifier[print] ( literal[string] ) keyword[return] identifier[tune] = identifier[args] [ literal[in...
def cmd_playtune(self, args): """send PLAY_TUNE message""" if len(args) < 1: print('Usage: playtune TUNE') return # depends on [control=['if'], data=[]] tune = args[0] str1 = tune[0:30] str2 = tune[30:] if sys.version_info.major >= 3 and (not isinstance(str1, bytes)): st...
def generate_corpus(self, text): """ Given a text string, returns a list of lists; that is, a list of "sentences," each of which is a list of words. Before splitting into words, the sentences are filtered through `self.test_sentence_input` """ if isinstance(text, str): ...
def function[generate_corpus, parameter[self, text]]: constant[ Given a text string, returns a list of lists; that is, a list of "sentences," each of which is a list of words. Before splitting into words, the sentences are filtered through `self.test_sentence_input` ] if ...
keyword[def] identifier[generate_corpus] ( identifier[self] , identifier[text] ): literal[string] keyword[if] identifier[isinstance] ( identifier[text] , identifier[str] ): identifier[sentences] = identifier[self] . identifier[sentence_split] ( identifier[text] ) keyword[else...
def generate_corpus(self, text): """ Given a text string, returns a list of lists; that is, a list of "sentences," each of which is a list of words. Before splitting into words, the sentences are filtered through `self.test_sentence_input` """ if isinstance(text, str): se...
def probe_response(msg, arg): """Process responses from from the query sent by genl_ctrl_probe_by_name(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L203 Process returned messages, filling out the missing information in the genl_family structure. Positional arguments: msg -...
def function[probe_response, parameter[msg, arg]]: constant[Process responses from from the query sent by genl_ctrl_probe_by_name(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L203 Process returned messages, filling out the missing information in the genl_family structure. ...
keyword[def] identifier[probe_response] ( identifier[msg] , identifier[arg] ): literal[string] identifier[tb] = identifier[dict] (( identifier[i] , keyword[None] ) keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[CTRL_ATTR_MAX] + literal[int] )) identifier[nlh] = identifier[nlm...
def probe_response(msg, arg): """Process responses from from the query sent by genl_ctrl_probe_by_name(). https://github.com/thom311/libnl/blob/libnl3_2_25/lib/genl/ctrl.c#L203 Process returned messages, filling out the missing information in the genl_family structure. Positional arguments: msg -...
def MapFields(function, key=True): """ Transformation factory that maps `function` on the values of a row. It can be applied either to 1. all columns (`key=True`), 2. no column (`key=False`), or 3. a subset of columns by passing a callable, which takes column name and returns `bool` (same a...
def function[MapFields, parameter[function, key]]: constant[ Transformation factory that maps `function` on the values of a row. It can be applied either to 1. all columns (`key=True`), 2. no column (`key=False`), or 3. a subset of columns by passing a callable, which takes column name and r...
keyword[def] identifier[MapFields] ( identifier[function] , identifier[key] = keyword[True] ): literal[string] @ identifier[use_raw_input] keyword[def] identifier[_MapFields] ( identifier[bag] ): keyword[try] : identifier[factory] = identifier[type] ( identifier[bag] ). identifi...
def MapFields(function, key=True): """ Transformation factory that maps `function` on the values of a row. It can be applied either to 1. all columns (`key=True`), 2. no column (`key=False`), or 3. a subset of columns by passing a callable, which takes column name and returns `bool` (same a...
def sparse_mux(sel, vals): """ Mux that avoids instantiating unnecessary mux_2s when possible. :param WireVector sel: Select wire, determines what is selected on a given cycle :param dictionary vals: dictionary of values at mux inputs (of type `{int:WireVector}`) :return: WireVector that signifies ...
def function[sparse_mux, parameter[sel, vals]]: constant[ Mux that avoids instantiating unnecessary mux_2s when possible. :param WireVector sel: Select wire, determines what is selected on a given cycle :param dictionary vals: dictionary of values at mux inputs (of type `{int:WireVector}`) :ret...
keyword[def] identifier[sparse_mux] ( identifier[sel] , identifier[vals] ): literal[string] keyword[import] identifier[numbers] identifier[max_val] = literal[int] ** identifier[len] ( identifier[sel] )- literal[int] keyword[if] identifier[SparseDefault] keyword[in] identifier[vals] : ...
def sparse_mux(sel, vals): """ Mux that avoids instantiating unnecessary mux_2s when possible. :param WireVector sel: Select wire, determines what is selected on a given cycle :param dictionary vals: dictionary of values at mux inputs (of type `{int:WireVector}`) :return: WireVector that signifies ...
def p_sigtypes(self, p): 'sigtypes : sigtypes sigtype' p[0] = p[1] + (p[2],) p.set_lineno(0, p.lineno(1))
def function[p_sigtypes, parameter[self, p]]: constant[sigtypes : sigtypes sigtype] call[name[p]][constant[0]] assign[=] binary_operation[call[name[p]][constant[1]] + tuple[[<ast.Subscript object at 0x7da1b26ada80>]]] call[name[p].set_lineno, parameter[constant[0], call[name[p].lineno, parameter...
keyword[def] identifier[p_sigtypes] ( identifier[self] , identifier[p] ): literal[string] identifier[p] [ literal[int] ]= identifier[p] [ literal[int] ]+( identifier[p] [ literal[int] ],) identifier[p] . identifier[set_lineno] ( literal[int] , identifier[p] . identifier[lineno] ( literal[i...
def p_sigtypes(self, p): """sigtypes : sigtypes sigtype""" p[0] = p[1] + (p[2],) p.set_lineno(0, p.lineno(1))
def transform(self, dstreams, transformFunc): """ Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams. The order of the JavaRDDs in the transform function parameter will be the same as the order of corresponding DStreams in the list....
def function[transform, parameter[self, dstreams, transformFunc]]: constant[ Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams. The order of the JavaRDDs in the transform function parameter will be the same as the order of correspo...
keyword[def] identifier[transform] ( identifier[self] , identifier[dstreams] , identifier[transformFunc] ): literal[string] identifier[jdstreams] =[ identifier[d] . identifier[_jdstream] keyword[for] identifier[d] keyword[in] identifier[dstreams] ] identifier[func] = identifie...
def transform(self, dstreams, transformFunc): """ Create a new DStream in which each RDD is generated by applying a function on RDDs of the DStreams. The order of the JavaRDDs in the transform function parameter will be the same as the order of corresponding DStreams in the list. ...
async def unlock(self, device): """ Unlock the device if not already unlocked. :param device: device object, block device path or mount path :returns: whether the device is unlocked """ device = self._find_device(device) if not self.is_handleable(device) or not d...
<ast.AsyncFunctionDef object at 0x7da20c7c8bb0>
keyword[async] keyword[def] identifier[unlock] ( identifier[self] , identifier[device] ): literal[string] identifier[device] = identifier[self] . identifier[_find_device] ( identifier[device] ) keyword[if] keyword[not] identifier[self] . identifier[is_handleable] ( identifier[device] ) ...
async def unlock(self, device): """ Unlock the device if not already unlocked. :param device: device object, block device path or mount path :returns: whether the device is unlocked """ device = self._find_device(device) if not self.is_handleable(device) or not device.is_cry...
def set_level(self, val): """Set the devive ON LEVEL.""" if val == 0: self.off() else: setlevel = 255 if val < 1: setlevel = val * 100 elif val <= 0xff: setlevel = val set_command = StandardSend( ...
def function[set_level, parameter[self, val]]: constant[Set the devive ON LEVEL.] if compare[name[val] equal[==] constant[0]] begin[:] call[name[self].off, parameter[]]
keyword[def] identifier[set_level] ( identifier[self] , identifier[val] ): literal[string] keyword[if] identifier[val] == literal[int] : identifier[self] . identifier[off] () keyword[else] : identifier[setlevel] = literal[int] keyword[if] identifie...
def set_level(self, val): """Set the devive ON LEVEL.""" if val == 0: self.off() # depends on [control=['if'], data=[]] else: setlevel = 255 if val < 1: setlevel = val * 100 # depends on [control=['if'], data=['val']] elif val <= 255: setlevel = val ...
def delete_assessment_taken(self, assessment_taken_id): """Deletes an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` to remove raise: NotFound - ``assessment_taken_id`` not found raise: NullArgument - ``assessment_t...
def function[delete_assessment_taken, parameter[self, assessment_taken_id]]: constant[Deletes an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` to remove raise: NotFound - ``assessment_taken_id`` not found raise: Nu...
keyword[def] identifier[delete_assessment_taken] ( identifier[self] , identifier[assessment_taken_id] ): literal[string] identifier[collection] = identifier[JSONClientValidated] ( literal[string] , identifier[collection] = literal[string] , identifier[runtime] = ...
def delete_assessment_taken(self, assessment_taken_id): """Deletes an ``AssessmentTaken``. arg: assessment_taken_id (osid.id.Id): the ``Id`` of the ``AssessmentTaken`` to remove raise: NotFound - ``assessment_taken_id`` not found raise: NullArgument - ``assessment_taken...
def __makeShowColumnFunction(self, column_idx): """ Creates a function that shows or hides a column.""" show_column = lambda checked: self.setColumnHidden(column_idx, not checked) return show_column
def function[__makeShowColumnFunction, parameter[self, column_idx]]: constant[ Creates a function that shows or hides a column.] variable[show_column] assign[=] <ast.Lambda object at 0x7da1b04cabf0> return[name[show_column]]
keyword[def] identifier[__makeShowColumnFunction] ( identifier[self] , identifier[column_idx] ): literal[string] identifier[show_column] = keyword[lambda] identifier[checked] : identifier[self] . identifier[setColumnHidden] ( identifier[column_idx] , keyword[not] identifier[checked] ) ke...
def __makeShowColumnFunction(self, column_idx): """ Creates a function that shows or hides a column.""" show_column = lambda checked: self.setColumnHidden(column_idx, not checked) return show_column
def index(): """ Renders the dashboard when the server is initially run. Usage description: The rendered HTML allows the user to select a project and the desired run. :return: Template to render, Object that is taken care by flask. """ # Reset current index values when the page is refreshe...
def function[index, parameter[]]: constant[ Renders the dashboard when the server is initially run. Usage description: The rendered HTML allows the user to select a project and the desired run. :return: Template to render, Object that is taken care by flask. ] for taget[tuple[[<ast...
keyword[def] identifier[index] (): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[current_index] . identifier[items] (): identifier[current_index] [ identifier[k] ]= literal[int] identifier[logging] . identifier[info] ( literal[string] ) ...
def index(): """ Renders the dashboard when the server is initially run. Usage description: The rendered HTML allows the user to select a project and the desired run. :return: Template to render, Object that is taken care by flask. """ # Reset current index values when the page is refreshe...
async def send(self, request: Request, **kwargs) -> Response: """Send request object according to configuration. :param Request request: The request object to be sent. """ if request.context is None: # Should not happen, but make mypy happy and does not hurt request.context...
<ast.AsyncFunctionDef object at 0x7da18c4cf6a0>
keyword[async] keyword[def] identifier[send] ( identifier[self] , identifier[request] : identifier[Request] ,** identifier[kwargs] )-> identifier[Response] : literal[string] keyword[if] identifier[request] . identifier[context] keyword[is] keyword[None] : identifier[request] . iden...
async def send(self, request: Request, **kwargs) -> Response: """Send request object according to configuration. :param Request request: The request object to be sent. """ if request.context is None: # Should not happen, but make mypy happy and does not hurt request.context = self.buil...
def do_import(token, account_uuid, bank_account, since=None): """Import data from teller.io Returns the created StatementImport """ response = requests.get( url="https://api.teller.io/accounts/{}/transactions".format(account_uuid), headers={"Authorization": "Bearer {}".format(token)}, ...
def function[do_import, parameter[token, account_uuid, bank_account, since]]: constant[Import data from teller.io Returns the created StatementImport ] variable[response] assign[=] call[name[requests].get, parameter[]] call[name[response].raise_for_status, parameter[]] variable[...
keyword[def] identifier[do_import] ( identifier[token] , identifier[account_uuid] , identifier[bank_account] , identifier[since] = keyword[None] ): literal[string] identifier[response] = identifier[requests] . identifier[get] ( identifier[url] = literal[string] . identifier[format] ( identifier[accoun...
def do_import(token, account_uuid, bank_account, since=None): """Import data from teller.io Returns the created StatementImport """ response = requests.get(url='https://api.teller.io/accounts/{}/transactions'.format(account_uuid), headers={'Authorization': 'Bearer {}'.format(token)}) response.raise...
def initialize_delete_state_map(self): """This is a mapping of delete result message string to state. """ self.fabric_state_del_map = { fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE, fw_const.OS_IN_NETWORK_DEL_FAIL: fw_const.OS_IN_NETWORK_STATE, ...
def function[initialize_delete_state_map, parameter[self]]: constant[This is a mapping of delete result message string to state. ] name[self].fabric_state_del_map assign[=] dictionary[[<ast.Attribute object at 0x7da1b1c617e0>, <ast.Attribute object at 0x7da1b1c62170>, <ast.Attribute object at 0x7da1b1c6...
keyword[def] identifier[initialize_delete_state_map] ( identifier[self] ): literal[string] identifier[self] . identifier[fabric_state_del_map] ={ identifier[fw_const] . identifier[INIT_STATE_STR] : identifier[fw_const] . identifier[OS_IN_NETWORK_STATE] , identifier[fw_const] . ide...
def initialize_delete_state_map(self): """This is a mapping of delete result message string to state. """ self.fabric_state_del_map = {fw_const.INIT_STATE_STR: fw_const.OS_IN_NETWORK_STATE, fw_const.OS_IN_NETWORK_DEL_FAIL: fw_const.OS_IN_NETWORK_STATE, fw_const.OS_IN_NETWORK_DEL_SUCCESS: fw_const.INIT_STATE, fw...
def write_member(self, data): """Writes the given data as one gzip member. The data can be a string, an iterator that gives strings or a file-like object. """ if isinstance(data, basestring): self.write(data) else: for text in data: ...
def function[write_member, parameter[self, data]]: constant[Writes the given data as one gzip member. The data can be a string, an iterator that gives strings or a file-like object. ] if call[name[isinstance], parameter[name[data], name[basestring]]] begin[:] cal...
keyword[def] identifier[write_member] ( identifier[self] , identifier[data] ): literal[string] keyword[if] identifier[isinstance] ( identifier[data] , identifier[basestring] ): identifier[self] . identifier[write] ( identifier[data] ) keyword[else] : keyword[for]...
def write_member(self, data): """Writes the given data as one gzip member. The data can be a string, an iterator that gives strings or a file-like object. """ if isinstance(data, basestring): self.write(data) # depends on [control=['if'], data=[]] else: for text in ...
def graphql_mutation_from_summary(summary): """ This function returns a graphql mutation corresponding to the provided summary. """ # get the name of the mutation from the summary mutation_name = summary['name'] # print(summary) # the treat the "type" string as a gra input_...
def function[graphql_mutation_from_summary, parameter[summary]]: constant[ This function returns a graphql mutation corresponding to the provided summary. ] variable[mutation_name] assign[=] call[name[summary]][constant[name]] variable[input_name] assign[=] binary_operation[n...
keyword[def] identifier[graphql_mutation_from_summary] ( identifier[summary] ): literal[string] identifier[mutation_name] = identifier[summary] [ literal[string] ] identifier[input_name] = identifier[mutation_name] + literal[string] identifier[input_fields] = identifier[build_na...
def graphql_mutation_from_summary(summary): """ This function returns a graphql mutation corresponding to the provided summary. """ # get the name of the mutation from the summary mutation_name = summary['name'] # print(summary) # the treat the "type" string as a gra input_na...
def check(ctx, meta_model_file, model_file, ignore_case): """ Check validity of meta-model and optionally model. """ debug = ctx.obj['debug'] check_model(meta_model_file, model_file, debug, ignore_case)
def function[check, parameter[ctx, meta_model_file, model_file, ignore_case]]: constant[ Check validity of meta-model and optionally model. ] variable[debug] assign[=] call[name[ctx].obj][constant[debug]] call[name[check_model], parameter[name[meta_model_file], name[model_file], name[deb...
keyword[def] identifier[check] ( identifier[ctx] , identifier[meta_model_file] , identifier[model_file] , identifier[ignore_case] ): literal[string] identifier[debug] = identifier[ctx] . identifier[obj] [ literal[string] ] identifier[check_model] ( identifier[meta_model_file] , identifier[model_file] ...
def check(ctx, meta_model_file, model_file, ignore_case): """ Check validity of meta-model and optionally model. """ debug = ctx.obj['debug'] check_model(meta_model_file, model_file, debug, ignore_case)
async def delete_shade_from_scene(self, shade_id, scene_id): """Delete a shade from a scene.""" return await self.request.delete( self._base_path, params={ATTR_SCENE_ID: scene_id, ATTR_SHADE_ID: shade_id} )
<ast.AsyncFunctionDef object at 0x7da1b09ce7d0>
keyword[async] keyword[def] identifier[delete_shade_from_scene] ( identifier[self] , identifier[shade_id] , identifier[scene_id] ): literal[string] keyword[return] keyword[await] identifier[self] . identifier[request] . identifier[delete] ( identifier[self] . identifier[_base_path] , id...
async def delete_shade_from_scene(self, shade_id, scene_id): """Delete a shade from a scene.""" return await self.request.delete(self._base_path, params={ATTR_SCENE_ID: scene_id, ATTR_SHADE_ID: shade_id})
def interevent_time_recharges(recharges): """ Return the distribution of time between consecutive recharges of the user. """ time_pairs = pairwise(r.datetime for r in recharges) times = [(new - old).total_seconds() for old, new in time_pairs] return summary_stats(times)
def function[interevent_time_recharges, parameter[recharges]]: constant[ Return the distribution of time between consecutive recharges of the user. ] variable[time_pairs] assign[=] call[name[pairwise], parameter[<ast.GeneratorExp object at 0x7da1b0da10c0>]] variable[times] assign[=] ...
keyword[def] identifier[interevent_time_recharges] ( identifier[recharges] ): literal[string] identifier[time_pairs] = identifier[pairwise] ( identifier[r] . identifier[datetime] keyword[for] identifier[r] keyword[in] identifier[recharges] ) identifier[times] =[( identifier[new] - identifier[old] ...
def interevent_time_recharges(recharges): """ Return the distribution of time between consecutive recharges of the user. """ time_pairs = pairwise((r.datetime for r in recharges)) times = [(new - old).total_seconds() for (old, new) in time_pairs] return summary_stats(times)
def model_definition_factory(base_model_definition, **kwargs): """ Provides an iterator over passed-in configuration values, allowing for easy exploration of models. Parameters: ___________ base_model_definition: The base `ModelDefinition` to augment kwargs: Can be any...
def function[model_definition_factory, parameter[base_model_definition]]: constant[ Provides an iterator over passed-in configuration values, allowing for easy exploration of models. Parameters: ___________ base_model_definition: The base `ModelDefinition` to augment kwarg...
keyword[def] identifier[model_definition_factory] ( identifier[base_model_definition] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[kwargs] : keyword[yield] identifier[config] keyword[else] : keyword[for] identifier[param] keyword[in] identifier...
def model_definition_factory(base_model_definition, **kwargs): """ Provides an iterator over passed-in configuration values, allowing for easy exploration of models. Parameters: ___________ base_model_definition: The base `ModelDefinition` to augment kwargs: Can be any...
def file_list(package, **kwargs): ''' List the files that belong to a package. CLI Examples: .. code-block:: bash salt '*' pkg.file_list nginx ''' ret = file_dict(package) files = [] for pkg_files in six.itervalues(ret['files']): files.extend(pkg_files) ret['files'...
def function[file_list, parameter[package]]: constant[ List the files that belong to a package. CLI Examples: .. code-block:: bash salt '*' pkg.file_list nginx ] variable[ret] assign[=] call[name[file_dict], parameter[name[package]]] variable[files] assign[=] list[[]] ...
keyword[def] identifier[file_list] ( identifier[package] ,** identifier[kwargs] ): literal[string] identifier[ret] = identifier[file_dict] ( identifier[package] ) identifier[files] =[] keyword[for] identifier[pkg_files] keyword[in] identifier[six] . identifier[itervalues] ( identifier[ret] [ l...
def file_list(package, **kwargs): """ List the files that belong to a package. CLI Examples: .. code-block:: bash salt '*' pkg.file_list nginx """ ret = file_dict(package) files = [] for pkg_files in six.itervalues(ret['files']): files.extend(pkg_files) # depends on [...
def provider_login_url(parser, token): """ {% provider_login_url "facebook" next=bla %} {% provider_login_url "openid" openid="http://me.yahoo.com" next=bla %} """ bits = token.split_contents() provider_id = bits[1] params = token_kwargs(bits[2:], parser, support_legacy=False) return Pro...
def function[provider_login_url, parameter[parser, token]]: constant[ {% provider_login_url "facebook" next=bla %} {% provider_login_url "openid" openid="http://me.yahoo.com" next=bla %} ] variable[bits] assign[=] call[name[token].split_contents, parameter[]] variable[provider_id] as...
keyword[def] identifier[provider_login_url] ( identifier[parser] , identifier[token] ): literal[string] identifier[bits] = identifier[token] . identifier[split_contents] () identifier[provider_id] = identifier[bits] [ literal[int] ] identifier[params] = identifier[token_kwargs] ( identifier[bits]...
def provider_login_url(parser, token): """ {% provider_login_url "facebook" next=bla %} {% provider_login_url "openid" openid="http://me.yahoo.com" next=bla %} """ bits = token.split_contents() provider_id = bits[1] params = token_kwargs(bits[2:], parser, support_legacy=False) return Pro...
def update_git_devstr(version, path=None): """ Updates the git revision string if and only if the path is being imported directly from a git working copy. This ensures that the revision number in the version string is accurate. """ try: # Quick way to determine if we're in git or not -...
def function[update_git_devstr, parameter[version, path]]: constant[ Updates the git revision string if and only if the path is being imported directly from a git working copy. This ensures that the revision number in the version string is accurate. ] <ast.Try object at 0x7da1b04edab0> ...
keyword[def] identifier[update_git_devstr] ( identifier[version] , identifier[path] = keyword[None] ): literal[string] keyword[try] : identifier[devstr] = identifier[get_git_devstr] ( identifier[sha] = keyword[True] , identifier[show_warning] = keyword[False] , identifier[path] = identifier[...
def update_git_devstr(version, path=None): """ Updates the git revision string if and only if the path is being imported directly from a git working copy. This ensures that the revision number in the version string is accurate. """ try: # Quick way to determine if we're in git or not - ...
def mixture( val: Any, default: Any = RaiseTypeErrorIfNotProvided) -> Sequence[Tuple[float, Any]]: """Return a sequence of tuples representing a probabilistic combination. A mixture is described by an iterable of tuples of the form (probability of object, object) The probability component...
def function[mixture, parameter[val, default]]: constant[Return a sequence of tuples representing a probabilistic combination. A mixture is described by an iterable of tuples of the form (probability of object, object) The probability components of the tuples must sum to 1.0 and be between ...
keyword[def] identifier[mixture] ( identifier[val] : identifier[Any] , identifier[default] : identifier[Any] = identifier[RaiseTypeErrorIfNotProvided] )-> identifier[Sequence] [ identifier[Tuple] [ identifier[float] , identifier[Any] ]]: literal[string] identifier[getter] = identifier[getattr] ( identif...
def mixture(val: Any, default: Any=RaiseTypeErrorIfNotProvided) -> Sequence[Tuple[float, Any]]: """Return a sequence of tuples representing a probabilistic combination. A mixture is described by an iterable of tuples of the form (probability of object, object) The probability components of the tu...
def compute(self, function): """Evaluate the passed function with the supplied data. Stores result in self.out. Parameters ---------- function: str Name of the :mod:`allantools` function to evaluate Returns ------- result: dict T...
def function[compute, parameter[self, function]]: constant[Evaluate the passed function with the supplied data. Stores result in self.out. Parameters ---------- function: str Name of the :mod:`allantools` function to evaluate Returns ------- ...
keyword[def] identifier[compute] ( identifier[self] , identifier[function] ): literal[string] keyword[try] : identifier[func] = identifier[getattr] ( identifier[allantools] , identifier[function] ) keyword[except] identifier[AttributeError] : keyword[raise] iden...
def compute(self, function): """Evaluate the passed function with the supplied data. Stores result in self.out. Parameters ---------- function: str Name of the :mod:`allantools` function to evaluate Returns ------- result: dict The r...
def start(self, daemon = False): """Start the threads.""" self.daemon = daemon self.io_threads = [] self.event_thread = EventDispatcherThread(self.event_dispatcher, daemon = daemon, exc_queue = self.exc_queue) self.event_thread.start() ...
def function[start, parameter[self, daemon]]: constant[Start the threads.] name[self].daemon assign[=] name[daemon] name[self].io_threads assign[=] list[[]] name[self].event_thread assign[=] call[name[EventDispatcherThread], parameter[name[self].event_dispatcher]] call[name[self]...
keyword[def] identifier[start] ( identifier[self] , identifier[daemon] = keyword[False] ): literal[string] identifier[self] . identifier[daemon] = identifier[daemon] identifier[self] . identifier[io_threads] =[] identifier[self] . identifier[event_thread] = identifier[EventDispat...
def start(self, daemon=False): """Start the threads.""" self.daemon = daemon self.io_threads = [] self.event_thread = EventDispatcherThread(self.event_dispatcher, daemon=daemon, exc_queue=self.exc_queue) self.event_thread.start() for handler in self.io_handlers: self._run_io_threads(hand...
def delete_modules(self): ''' Clean up after any modules created by this Document when its session is destroyed. ''' from gc import get_referrers from types import FrameType log.debug("Deleting %s modules for %s" % (len(self._modules), self)) for module in self...
def function[delete_modules, parameter[self]]: constant[ Clean up after any modules created by this Document when its session is destroyed. ] from relative_module[gc] import module[get_referrers] from relative_module[types] import module[FrameType] call[name[log].debug, paramete...
keyword[def] identifier[delete_modules] ( identifier[self] ): literal[string] keyword[from] identifier[gc] keyword[import] identifier[get_referrers] keyword[from] identifier[types] keyword[import] identifier[FrameType] identifier[log] . identifier[debug] ( literal[string]...
def delete_modules(self): """ Clean up after any modules created by this Document when its session is destroyed. """ from gc import get_referrers from types import FrameType log.debug('Deleting %s modules for %s' % (len(self._modules), self)) for module in self._modules: # M...
def score(self, test_X, test_Y): """Compute the mean accuracy over the test set. Parameters ---------- test_X : array_like, shape (n_samples, n_features) Test data. test_Y : array_like, shape (n_samples, n_features) Test labels. Returns ...
def function[score, parameter[self, test_X, test_Y]]: constant[Compute the mean accuracy over the test set. Parameters ---------- test_X : array_like, shape (n_samples, n_features) Test data. test_Y : array_like, shape (n_samples, n_features) Test label...
keyword[def] identifier[score] ( identifier[self] , identifier[test_X] , identifier[test_Y] ): literal[string] keyword[with] identifier[self] . identifier[tf_graph] . identifier[as_default] (): keyword[with] identifier[tf] . identifier[Session] () keyword[as] identifier[self] . iden...
def score(self, test_X, test_Y): """Compute the mean accuracy over the test set. Parameters ---------- test_X : array_like, shape (n_samples, n_features) Test data. test_Y : array_like, shape (n_samples, n_features) Test labels. Returns ---...
def interrupt(self, threadId=None): """ Interrupts the thread at the given id. :param threadId | <int> || None """ back = self.backend() if back: back.interrupt(threadId)
def function[interrupt, parameter[self, threadId]]: constant[ Interrupts the thread at the given id. :param threadId | <int> || None ] variable[back] assign[=] call[name[self].backend, parameter[]] if name[back] begin[:] call[name[back].inter...
keyword[def] identifier[interrupt] ( identifier[self] , identifier[threadId] = keyword[None] ): literal[string] identifier[back] = identifier[self] . identifier[backend] () keyword[if] identifier[back] : identifier[back] . identifier[interrupt] ( identifier[threadId] )
def interrupt(self, threadId=None): """ Interrupts the thread at the given id. :param threadId | <int> || None """ back = self.backend() if back: back.interrupt(threadId) # depends on [control=['if'], data=[]]
def parse_multiple_json(json_file, offset=None): """Parse multiple json records from the given file. Seek to the offset as the start point before parsing if offset set. return empty list if the json file does not exists or exception occurs. Args: json_file (str): File path to be parsed. ...
def function[parse_multiple_json, parameter[json_file, offset]]: constant[Parse multiple json records from the given file. Seek to the offset as the start point before parsing if offset set. return empty list if the json file does not exists or exception occurs. Args: json_file (str): ...
keyword[def] identifier[parse_multiple_json] ( identifier[json_file] , identifier[offset] = keyword[None] ): literal[string] identifier[json_info_list] =[] keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[json_file] ): keyword[return] identifier[...
def parse_multiple_json(json_file, offset=None): """Parse multiple json records from the given file. Seek to the offset as the start point before parsing if offset set. return empty list if the json file does not exists or exception occurs. Args: json_file (str): File path to be parsed. ...
def is_os(name, version_id=None): '''Return True if OS name in /etc/lsb-release of host given by fabric param `-H` is the same as given by argument, False else. If arg version_id is not None only return True if it is the same as in /etc/lsb-release, too. Args: name: 'Debian GNU/Linux', 'Ub...
def function[is_os, parameter[name, version_id]]: constant[Return True if OS name in /etc/lsb-release of host given by fabric param `-H` is the same as given by argument, False else. If arg version_id is not None only return True if it is the same as in /etc/lsb-release, too. Args: nam...
keyword[def] identifier[is_os] ( identifier[name] , identifier[version_id] = keyword[None] ): literal[string] identifier[result] = keyword[False] identifier[os_release_infos] = identifier[_fetch_os_release_infos] () keyword[if] identifier[name] == identifier[os_release_infos] . identifier[get]...
def is_os(name, version_id=None): """Return True if OS name in /etc/lsb-release of host given by fabric param `-H` is the same as given by argument, False else. If arg version_id is not None only return True if it is the same as in /etc/lsb-release, too. Args: name: 'Debian GNU/Linux', 'Ub...
def create_app(object_name): """ An flask application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/ Arguments: object_name: the python path of the config object, e.g. webapp.settings.ProdConfig env: The name of the current environme...
def function[create_app, parameter[object_name]]: constant[ An flask application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/ Arguments: object_name: the python path of the config object, e.g. webapp.settings.ProdConfig env: Th...
keyword[def] identifier[create_app] ( identifier[object_name] ): literal[string] identifier[app] = identifier[Flask] ( identifier[__name__] ) identifier[app] . identifier[config] . identifier[from_object] ( identifier[object_name] ) identifier[cache] . identifier[init_app] ( identifier[app...
def create_app(object_name): """ An flask application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/ Arguments: object_name: the python path of the config object, e.g. webapp.settings.ProdConfig env: The name of the current environme...
def trigger_on_off(request, trigger_id): """ enable/disable the status of the trigger then go back home :param request: request object :param trigger_id: the trigger ID to switch the status to True or False :type request: HttpRequest object :type trigger_id: int :retu...
def function[trigger_on_off, parameter[request, trigger_id]]: constant[ enable/disable the status of the trigger then go back home :param request: request object :param trigger_id: the trigger ID to switch the status to True or False :type request: HttpRequest object :typ...
keyword[def] identifier[trigger_on_off] ( identifier[request] , identifier[trigger_id] ): literal[string] identifier[now] = identifier[arrow] . identifier[utcnow] (). identifier[to] ( identifier[settings] . identifier[TIME_ZONE] ). identifier[format] ( literal[string] ) identifier[trigger] = identifie...
def trigger_on_off(request, trigger_id): """ enable/disable the status of the trigger then go back home :param request: request object :param trigger_id: the trigger ID to switch the status to True or False :type request: HttpRequest object :type trigger_id: int :retu...
def up(self): """ Move this object up one position. """ self.swap(self.get_ordering_queryset().filter(order__lt=self.order).order_by('-order'))
def function[up, parameter[self]]: constant[ Move this object up one position. ] call[name[self].swap, parameter[call[call[call[name[self].get_ordering_queryset, parameter[]].filter, parameter[]].order_by, parameter[constant[-order]]]]]
keyword[def] identifier[up] ( identifier[self] ): literal[string] identifier[self] . identifier[swap] ( identifier[self] . identifier[get_ordering_queryset] (). identifier[filter] ( identifier[order__lt] = identifier[self] . identifier[order] ). identifier[order_by] ( literal[string] ))
def up(self): """ Move this object up one position. """ self.swap(self.get_ordering_queryset().filter(order__lt=self.order).order_by('-order'))
def ReleaseRecords(cls, ids, token): """Release records identified by subjects. Releases any claim on the records identified by ids. Args: ids: A list of ids provided by ClaimRecords. token: The database access token to write with. Raises: LockError: If the queue is not locked. ...
def function[ReleaseRecords, parameter[cls, ids, token]]: constant[Release records identified by subjects. Releases any claim on the records identified by ids. Args: ids: A list of ids provided by ClaimRecords. token: The database access token to write with. Raises: LockError: I...
keyword[def] identifier[ReleaseRecords] ( identifier[cls] , identifier[ids] , identifier[token] ): literal[string] keyword[with] identifier[data_store] . identifier[DB] . identifier[GetMutationPool] () keyword[as] identifier[mutation_pool] : identifier[mutation_pool] . identifier[QueueReleaseRecor...
def ReleaseRecords(cls, ids, token): """Release records identified by subjects. Releases any claim on the records identified by ids. Args: ids: A list of ids provided by ClaimRecords. token: The database access token to write with. Raises: LockError: If the queue is not locked. ...
def get_nearest_points_dirty(self, center_point, radius, unit='km'): """ return approx list of point from circle with given center and radius it uses geohash and return with some error (see GEO_HASH_ERRORS) :param center_point: center of search circle :param radius: radius of sea...
def function[get_nearest_points_dirty, parameter[self, center_point, radius, unit]]: constant[ return approx list of point from circle with given center and radius it uses geohash and return with some error (see GEO_HASH_ERRORS) :param center_point: center of search circle :param...
keyword[def] identifier[get_nearest_points_dirty] ( identifier[self] , identifier[center_point] , identifier[radius] , identifier[unit] = literal[string] ): literal[string] keyword[if] identifier[unit] == literal[string] : identifier[radius] = identifier[utils] . identifier[mi_to_km] ...
def get_nearest_points_dirty(self, center_point, radius, unit='km'): """ return approx list of point from circle with given center and radius it uses geohash and return with some error (see GEO_HASH_ERRORS) :param center_point: center of search circle :param radius: radius of search ...
def rand_crop(*args, padding_mode='reflection', p:float=1.): "Randomized version of `crop_pad`." return crop_pad(*args, **rand_pos, padding_mode=padding_mode, p=p)
def function[rand_crop, parameter[]]: constant[Randomized version of `crop_pad`.] return[call[name[crop_pad], parameter[<ast.Starred object at 0x7da1b202a080>]]]
keyword[def] identifier[rand_crop] (* identifier[args] , identifier[padding_mode] = literal[string] , identifier[p] : identifier[float] = literal[int] ): literal[string] keyword[return] identifier[crop_pad] (* identifier[args] ,** identifier[rand_pos] , identifier[padding_mode] = identifier[padding_mode] ...
def rand_crop(*args, padding_mode='reflection', p: float=1.0): """Randomized version of `crop_pad`.""" return crop_pad(*args, **rand_pos, padding_mode=padding_mode, p=p)
def start(self, hostname=None, port=None, templates_path=None): """ Starts the web interface. Args: hostname (str, optional): host name to listen from. (Default value = None) port (int, optional): port to listen from. (Default value = None) templates_path (str, opt...
def function[start, parameter[self, hostname, port, templates_path]]: constant[ Starts the web interface. Args: hostname (str, optional): host name to listen from. (Default value = None) port (int, optional): port to listen from. (Default value = None) templates_pa...
keyword[def] identifier[start] ( identifier[self] , identifier[hostname] = keyword[None] , identifier[port] = keyword[None] , identifier[templates_path] = keyword[None] ): literal[string] identifier[self] . identifier[hostname] = identifier[hostname] keyword[if] identifier[hostname] keyword[else...
def start(self, hostname=None, port=None, templates_path=None): """ Starts the web interface. Args: hostname (str, optional): host name to listen from. (Default value = None) port (int, optional): port to listen from. (Default value = None) templates_path (str, optiona...
def qps(self, callback=None, errback=None): """ Return the current QPS for this zone :rtype: dict :return: QPS information """ stats = Stats(self.config) return stats.qps(zone=self.zone, callback=callback, errback=errback)
def function[qps, parameter[self, callback, errback]]: constant[ Return the current QPS for this zone :rtype: dict :return: QPS information ] variable[stats] assign[=] call[name[Stats], parameter[name[self].config]] return[call[name[stats].qps, parameter[]]]
keyword[def] identifier[qps] ( identifier[self] , identifier[callback] = keyword[None] , identifier[errback] = keyword[None] ): literal[string] identifier[stats] = identifier[Stats] ( identifier[self] . identifier[config] ) keyword[return] identifier[stats] . identifier[qps] ( identifier[...
def qps(self, callback=None, errback=None): """ Return the current QPS for this zone :rtype: dict :return: QPS information """ stats = Stats(self.config) return stats.qps(zone=self.zone, callback=callback, errback=errback)
def from_dict(cls, d): """ Create an instance from a dictionary. """ execution_request = super(ExecutionRequest, cls).from_dict(d) if isinstance(execution_request.simulation_group, dict): execution_request.simulation_group = SimulationGroup.from_dict(execution_request...
def function[from_dict, parameter[cls, d]]: constant[ Create an instance from a dictionary. ] variable[execution_request] assign[=] call[call[name[super], parameter[name[ExecutionRequest], name[cls]]].from_dict, parameter[name[d]]] if call[name[isinstance], parameter[name[executi...
keyword[def] identifier[from_dict] ( identifier[cls] , identifier[d] ): literal[string] identifier[execution_request] = identifier[super] ( identifier[ExecutionRequest] , identifier[cls] ). identifier[from_dict] ( identifier[d] ) keyword[if] identifier[isinstance] ( identifier[execution_r...
def from_dict(cls, d): """ Create an instance from a dictionary. """ execution_request = super(ExecutionRequest, cls).from_dict(d) if isinstance(execution_request.simulation_group, dict): execution_request.simulation_group = SimulationGroup.from_dict(execution_request.simulation_grou...
def get_hash_of_dirs(directory): """ Recursively hash the contents of the given directory. Args: directory (str): The root directory we want to hash. Returns: A hash of all the contents in the directory. """ import hashlib sha = hashlib.sha512() if not os.path.exists(di...
def function[get_hash_of_dirs, parameter[directory]]: constant[ Recursively hash the contents of the given directory. Args: directory (str): The root directory we want to hash. Returns: A hash of all the contents in the directory. ] import module[hashlib] variable[s...
keyword[def] identifier[get_hash_of_dirs] ( identifier[directory] ): literal[string] keyword[import] identifier[hashlib] identifier[sha] = identifier[hashlib] . identifier[sha512] () keyword[if] keyword[not] identifier[os] . identifier[path] . identifier[exists] ( identifier[directory] ): ...
def get_hash_of_dirs(directory): """ Recursively hash the contents of the given directory. Args: directory (str): The root directory we want to hash. Returns: A hash of all the contents in the directory. """ import hashlib sha = hashlib.sha512() if not os.path.exists(di...
def normalize_likes(sql): """ Normalize and wrap LIKE statements :type sql str :rtype: str """ sql = sql.replace('%', '') # LIKE '%bot' sql = re.sub(r"LIKE '[^\']+'", 'LIKE X', sql) # or all_groups LIKE X or all_groups LIKE X matches = re.finditer(r'(or|and) [^\s]+ LIKE X', sq...
def function[normalize_likes, parameter[sql]]: constant[ Normalize and wrap LIKE statements :type sql str :rtype: str ] variable[sql] assign[=] call[name[sql].replace, parameter[constant[%], constant[]]] variable[sql] assign[=] call[name[re].sub, parameter[constant[LIKE '[^\']+'...
keyword[def] identifier[normalize_likes] ( identifier[sql] ): literal[string] identifier[sql] = identifier[sql] . identifier[replace] ( literal[string] , literal[string] ) identifier[sql] = identifier[re] . identifier[sub] ( literal[string] , literal[string] , identifier[sql] ) identi...
def normalize_likes(sql): """ Normalize and wrap LIKE statements :type sql str :rtype: str """ sql = sql.replace('%', '') # LIKE '%bot' sql = re.sub("LIKE '[^\\']+'", 'LIKE X', sql) # or all_groups LIKE X or all_groups LIKE X matches = re.finditer('(or|and) [^\\s]+ LIKE X', sql,...
def clip_joint_velocities(self, velocities): """ Clips joint velocities into a valid range. """ for i in range(len(velocities)): if velocities[i] >= 1.0: velocities[i] = 1.0 elif velocities[i] <= -1.0: velocities[i] = -1.0 r...
def function[clip_joint_velocities, parameter[self, velocities]]: constant[ Clips joint velocities into a valid range. ] for taget[name[i]] in starred[call[name[range], parameter[call[name[len], parameter[name[velocities]]]]]] begin[:] if compare[call[name[velocities]][na...
keyword[def] identifier[clip_joint_velocities] ( identifier[self] , identifier[velocities] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[len] ( identifier[velocities] )): keyword[if] identifier[velocities] [ identifier[i] ]>= literal[int] ...
def clip_joint_velocities(self, velocities): """ Clips joint velocities into a valid range. """ for i in range(len(velocities)): if velocities[i] >= 1.0: velocities[i] = 1.0 # depends on [control=['if'], data=[]] elif velocities[i] <= -1.0: velocities[i] ...
def read(cls, proto): """ :param proto: capnp TwoGramModelProto message reader """ instance = object.__new__(cls) super(TwoGramModel, instance).__init__(proto=proto.modelBase) instance._logger = opf_utils.initLogger(instance) instance._reset = proto.reset instance._hashToValueDict = {x...
def function[read, parameter[cls, proto]]: constant[ :param proto: capnp TwoGramModelProto message reader ] variable[instance] assign[=] call[name[object].__new__, parameter[name[cls]]] call[call[name[super], parameter[name[TwoGramModel], name[instance]]].__init__, parameter[]] n...
keyword[def] identifier[read] ( identifier[cls] , identifier[proto] ): literal[string] identifier[instance] = identifier[object] . identifier[__new__] ( identifier[cls] ) identifier[super] ( identifier[TwoGramModel] , identifier[instance] ). identifier[__init__] ( identifier[proto] = identifier[proto]...
def read(cls, proto): """ :param proto: capnp TwoGramModelProto message reader """ instance = object.__new__(cls) super(TwoGramModel, instance).__init__(proto=proto.modelBase) instance._logger = opf_utils.initLogger(instance) instance._reset = proto.reset instance._hashToValueDict = {x.h...
def title(self, title): """Prints the title""" title = " What's it like out side {0}? ".format(title) click.secho("{:=^62}".format(title), fg=self.colors.WHITE) click.echo()
def function[title, parameter[self, title]]: constant[Prints the title] variable[title] assign[=] call[constant[ What's it like out side {0}? ].format, parameter[name[title]]] call[name[click].secho, parameter[call[constant[{:=^62}].format, parameter[name[title]]]]] call[name[click].echo...
keyword[def] identifier[title] ( identifier[self] , identifier[title] ): literal[string] identifier[title] = literal[string] . identifier[format] ( identifier[title] ) identifier[click] . identifier[secho] ( literal[string] . identifier[format] ( identifier[title] ), identifier[fg] = ident...
def title(self, title): """Prints the title""" title = " What's it like out side {0}? ".format(title) click.secho('{:=^62}'.format(title), fg=self.colors.WHITE) click.echo()
def gdsii_hash(filename, engine=None): """ Calculate the a hash value for a GDSII file. The hash is generated based only on the contents of the cells in the GDSII library, ignoring any timestamp records present in the file structure. Parameters ---------- filename : string Full...
def function[gdsii_hash, parameter[filename, engine]]: constant[ Calculate the a hash value for a GDSII file. The hash is generated based only on the contents of the cells in the GDSII library, ignoring any timestamp records present in the file structure. Parameters ---------- file...
keyword[def] identifier[gdsii_hash] ( identifier[filename] , identifier[engine] = keyword[None] ): literal[string] keyword[with] identifier[open] ( identifier[filename] , literal[string] ) keyword[as] identifier[fin] : identifier[data] = identifier[fin] . identifier[read] () identifier[cont...
def gdsii_hash(filename, engine=None): """ Calculate the a hash value for a GDSII file. The hash is generated based only on the contents of the cells in the GDSII library, ignoring any timestamp records present in the file structure. Parameters ---------- filename : string Full...
def read_histogram(self): """Read and reset the histogram. The expected return is a dictionary containing the counts per bin, MToF for bins 1, 3, 5, and 7, temperature, pressure, the sampling period, the checksum, PM1, PM2.5, and PM10. **NOTE:** The sampling period for the OPCN1 seems t...
def function[read_histogram, parameter[self]]: constant[Read and reset the histogram. The expected return is a dictionary containing the counts per bin, MToF for bins 1, 3, 5, and 7, temperature, pressure, the sampling period, the checksum, PM1, PM2.5, and PM10. **NOTE:** The sampling p...
keyword[def] identifier[read_histogram] ( identifier[self] ): literal[string] identifier[resp] =[] identifier[data] ={} identifier[command] = literal[int] identifier[self] . identifier[cnxn] . identifier[xfer] ([ identifier[command] ]) ...
def read_histogram(self): """Read and reset the histogram. The expected return is a dictionary containing the counts per bin, MToF for bins 1, 3, 5, and 7, temperature, pressure, the sampling period, the checksum, PM1, PM2.5, and PM10. **NOTE:** The sampling period for the OPCN1 seems to be...
def _print_speed(self): '''Print the current speed.''' if self._bandwidth_meter.num_samples: speed = self._bandwidth_meter.speed() if self._human_format: file_size_str = wpull.string.format_size(speed) else: file_size_str = '{:.1f} b'....
def function[_print_speed, parameter[self]]: constant[Print the current speed.] if name[self]._bandwidth_meter.num_samples begin[:] variable[speed] assign[=] call[name[self]._bandwidth_meter.speed, parameter[]] if name[self]._human_format begin[:] ...
keyword[def] identifier[_print_speed] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[_bandwidth_meter] . identifier[num_samples] : identifier[speed] = identifier[self] . identifier[_bandwidth_meter] . identifier[speed] () keyword[if] ide...
def _print_speed(self): """Print the current speed.""" if self._bandwidth_meter.num_samples: speed = self._bandwidth_meter.speed() if self._human_format: file_size_str = wpull.string.format_size(speed) # depends on [control=['if'], data=[]] else: file_size_str = ...
def _recv_keys(self, keyids, keyserver=None): """Import keys from a keyserver. :param str keyids: A space-delimited string containing the keyids to request. :param str keyserver: The keyserver to request the ``keyids`` from; defaults to `...
def function[_recv_keys, parameter[self, keyids, keyserver]]: constant[Import keys from a keyserver. :param str keyids: A space-delimited string containing the keyids to request. :param str keyserver: The keyserver to request the ``keyids`` from; ...
keyword[def] identifier[_recv_keys] ( identifier[self] , identifier[keyids] , identifier[keyserver] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[keyserver] : identifier[keyserver] = identifier[self] . identifier[keyserver] identifier[args] =[ lite...
def _recv_keys(self, keyids, keyserver=None): """Import keys from a keyserver. :param str keyids: A space-delimited string containing the keyids to request. :param str keyserver: The keyserver to request the ``keyids`` from; defaults to `gnup...
def create_project(self, key, name=None, assignee=None, type="Software", template_name=None): """Create a project with the specified parameters. :param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters. :type: str :param name: If not specif...
def function[create_project, parameter[self, key, name, assignee, type, template_name]]: constant[Create a project with the specified parameters. :param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters. :type: str :param name: If not speci...
keyword[def] identifier[create_project] ( identifier[self] , identifier[key] , identifier[name] = keyword[None] , identifier[assignee] = keyword[None] , identifier[type] = literal[string] , identifier[template_name] = keyword[None] ): literal[string] keyword[if] identifier[assignee] keyword[is] ...
def create_project(self, key, name=None, assignee=None, type='Software', template_name=None): """Create a project with the specified parameters. :param key: Mandatory. Must match JIRA project key requirements, usually only 2-10 uppercase characters. :type: str :param name: If not specified ...
def structure_attrs_fromtuple(self, obj, cl): # type: (Tuple, Type[T]) -> T """Load an attrs class from a sequence (tuple).""" conv_obj = [] # A list of converter parameters. for a, value in zip(cl.__attrs_attrs__, obj): # type: ignore # We detect the type by the metadata. ...
def function[structure_attrs_fromtuple, parameter[self, obj, cl]]: constant[Load an attrs class from a sequence (tuple).] variable[conv_obj] assign[=] list[[]] for taget[tuple[[<ast.Name object at 0x7da20c993310>, <ast.Name object at 0x7da20c9909a0>]]] in starred[call[name[zip], parameter[name[c...
keyword[def] identifier[structure_attrs_fromtuple] ( identifier[self] , identifier[obj] , identifier[cl] ): literal[string] identifier[conv_obj] =[] keyword[for] identifier[a] , identifier[value] keyword[in] identifier[zip] ( identifier[cl] . identifier[__attrs_attrs__] , identifier[ob...
def structure_attrs_fromtuple(self, obj, cl): # type: (Tuple, Type[T]) -> T 'Load an attrs class from a sequence (tuple).' conv_obj = [] # A list of converter parameters. for (a, value) in zip(cl.__attrs_attrs__, obj): # type: ignore # We detect the type by the metadata. converted = se...