code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def links(self): """ 解析页面上所有的链接并返回一个生成器 """ ass = self.xpath('//a') for a in ass: text = a.xpath('./text()').extract_first() url = a.xpath('./@href').extract_first() link = Link(text, url) yield link
def function[links, parameter[self]]: constant[ 解析页面上所有的链接并返回一个生成器 ] variable[ass] assign[=] call[name[self].xpath, parameter[constant[//a]]] for taget[name[a]] in starred[name[ass]] begin[:] variable[text] assign[=] call[call[name[a].xpath, parameter[constant[./t...
keyword[def] identifier[links] ( identifier[self] ): literal[string] identifier[ass] = identifier[self] . identifier[xpath] ( literal[string] ) keyword[for] identifier[a] keyword[in] identifier[ass] : identifier[text] = identifier[a] . identifier[xpath] ( literal[string] )....
def links(self): """ 解析页面上所有的链接并返回一个生成器 """ ass = self.xpath('//a') for a in ass: text = a.xpath('./text()').extract_first() url = a.xpath('./@href').extract_first() link = Link(text, url) yield link # depends on [control=['for'], data=['a']]
def data_validation(self, in_nc): """Check the necessary dimensions and variables in the input netcdf data""" data_nc = Dataset(in_nc) dims = list(data_nc.dimensions) if dims not in self.dims_oi: data_nc.close() raise Exception("{0} {1}".format(...
def function[data_validation, parameter[self, in_nc]]: constant[Check the necessary dimensions and variables in the input netcdf data] variable[data_nc] assign[=] call[name[Dataset], parameter[name[in_nc]]] variable[dims] assign[=] call[name[list], parameter[name[data_nc].dimensions]] ...
keyword[def] identifier[data_validation] ( identifier[self] , identifier[in_nc] ): literal[string] identifier[data_nc] = identifier[Dataset] ( identifier[in_nc] ) identifier[dims] = identifier[list] ( identifier[data_nc] . identifier[dimensions] ) keyword[if] identifier[d...
def data_validation(self, in_nc): """Check the necessary dimensions and variables in the input netcdf data""" data_nc = Dataset(in_nc) dims = list(data_nc.dimensions) if dims not in self.dims_oi: data_nc.close() raise Exception('{0} {1}'.format(self.error_messages[1], dims)) # d...
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimens...
def function[hist, parameter[self, dimension, num_bins, bin_range, adjoin]]: constant[Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimension(s) to comp...
keyword[def] identifier[hist] ( identifier[self] , identifier[dimension] = keyword[None] , identifier[num_bins] = literal[int] , identifier[bin_range] = keyword[None] , identifier[adjoin] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[from] .. identifier[operation] keyword[impo...
def hist(self, dimension=None, num_bins=20, bin_range=None, adjoin=True, **kwargs): """Computes and adjoins histogram along specified dimension(s). Defaults to first value dimension if present otherwise falls back to first key dimension. Args: dimension: Dimension(s) to compute...
def get_column(column_name, node, context): """Get a column by name from the selectable. Args: column_name: str, name of the column to retrieve. node: SqlNode, the node the column is being retrieved for. context: CompilationContext, compilation specific metadata. Returns: c...
def function[get_column, parameter[column_name, node, context]]: constant[Get a column by name from the selectable. Args: column_name: str, name of the column to retrieve. node: SqlNode, the node the column is being retrieved for. context: CompilationContext, compilation specific me...
keyword[def] identifier[get_column] ( identifier[column_name] , identifier[node] , identifier[context] ): literal[string] identifier[column] = identifier[try_get_column] ( identifier[column_name] , identifier[node] , identifier[context] ) keyword[if] identifier[column] keyword[is] keyword[None] : ...
def get_column(column_name, node, context): """Get a column by name from the selectable. Args: column_name: str, name of the column to retrieve. node: SqlNode, the node the column is being retrieved for. context: CompilationContext, compilation specific metadata. Returns: c...
def store(self, filename=None, label=None, desc=None, date=None): """Store object to mat-file. TODO: determine format specification """ date = date if date else datetime.now() date = date.replace(microsecond=0).isoformat() filename = filename if filename else date + '.mat' ...
def function[store, parameter[self, filename, label, desc, date]]: constant[Store object to mat-file. TODO: determine format specification ] variable[date] assign[=] <ast.IfExp object at 0x7da20c794a00> variable[date] assign[=] call[call[name[date].replace, parameter[]].isoformat, parame...
keyword[def] identifier[store] ( identifier[self] , identifier[filename] = keyword[None] , identifier[label] = keyword[None] , identifier[desc] = keyword[None] , identifier[date] = keyword[None] ): literal[string] identifier[date] = identifier[date] keyword[if] identifier[date] keyword[else] id...
def store(self, filename=None, label=None, desc=None, date=None): """Store object to mat-file. TODO: determine format specification """ date = date if date else datetime.now() date = date.replace(microsecond=0).isoformat() filename = filename if filename else date + '.mat' matfile = {'model'...
def additions_remove(**kwargs): ''' Remove VirtualBox Guest Additions. Firstly it tries to uninstall itself by executing '/opt/VBoxGuestAdditions-VERSION/uninstall.run uninstall'. It uses the CD, connected by VirtualBox if it failes. CLI Example: .. code-block:: bash salt '*' vbo...
def function[additions_remove, parameter[]]: constant[ Remove VirtualBox Guest Additions. Firstly it tries to uninstall itself by executing '/opt/VBoxGuestAdditions-VERSION/uninstall.run uninstall'. It uses the CD, connected by VirtualBox if it failes. CLI Example: .. code-block:: bas...
keyword[def] identifier[additions_remove] (** identifier[kwargs] ): literal[string] identifier[kernel] = identifier[__grains__] . identifier[get] ( literal[string] , literal[string] ) keyword[if] identifier[kernel] == literal[string] : identifier[ret] = identifier[_additions_remove_linux] ()...
def additions_remove(**kwargs): """ Remove VirtualBox Guest Additions. Firstly it tries to uninstall itself by executing '/opt/VBoxGuestAdditions-VERSION/uninstall.run uninstall'. It uses the CD, connected by VirtualBox if it failes. CLI Example: .. code-block:: bash salt '*' vbo...
def num_samples(input_filepath): ''' Show number of samples (0 if unavailable). Parameters ---------- input_filepath : str Path to audio file. Returns ------- n_samples : int total number of samples in audio file. Returns 0 if empty or unavailable ''' va...
def function[num_samples, parameter[input_filepath]]: constant[ Show number of samples (0 if unavailable). Parameters ---------- input_filepath : str Path to audio file. Returns ------- n_samples : int total number of samples in audio file. Returns 0 if empt...
keyword[def] identifier[num_samples] ( identifier[input_filepath] ): literal[string] identifier[validate_input_file] ( identifier[input_filepath] ) identifier[output] = identifier[soxi] ( identifier[input_filepath] , literal[string] ) keyword[if] identifier[output] == literal[string] : ...
def num_samples(input_filepath): """ Show number of samples (0 if unavailable). Parameters ---------- input_filepath : str Path to audio file. Returns ------- n_samples : int total number of samples in audio file. Returns 0 if empty or unavailable """ va...
def get_all_activities(self, autoscale_group, activity_ids=None, max_records=None, next_token=None): """ Get all activities for the given autoscaling group. This action supports pagination by returning a token if there are more pages to retrieve. To get the ne...
def function[get_all_activities, parameter[self, autoscale_group, activity_ids, max_records, next_token]]: constant[ Get all activities for the given autoscaling group. This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call t...
keyword[def] identifier[get_all_activities] ( identifier[self] , identifier[autoscale_group] , identifier[activity_ids] = keyword[None] , identifier[max_records] = keyword[None] , identifier[next_token] = keyword[None] ): literal[string] identifier[name] = identifier[autoscale_group] key...
def get_all_activities(self, autoscale_group, activity_ids=None, max_records=None, next_token=None): """ Get all activities for the given autoscaling group. This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again...
def save_to_folders(self, parameter_space, folder_name, runs): """ Save results to a folder structure. """ self.space_to_folders(self.db.get_results(), {}, parameter_space, runs, folder_name)
def function[save_to_folders, parameter[self, parameter_space, folder_name, runs]]: constant[ Save results to a folder structure. ] call[name[self].space_to_folders, parameter[call[name[self].db.get_results, parameter[]], dictionary[[], []], name[parameter_space], name[runs], name[folder...
keyword[def] identifier[save_to_folders] ( identifier[self] , identifier[parameter_space] , identifier[folder_name] , identifier[runs] ): literal[string] identifier[self] . identifier[space_to_folders] ( identifier[self] . identifier[db] . identifier[get_results] (),{}, identifier[parameter_space] ...
def save_to_folders(self, parameter_space, folder_name, runs): """ Save results to a folder structure. """ self.space_to_folders(self.db.get_results(), {}, parameter_space, runs, folder_name)
def parse_msg_sender(filename, sender_known=True): """Given a filename returns the sender and the message. Here the message is assumed to be a whole MIME message or just message body. >>> sender, msg = parse_msg_sender('msg.eml') >>> sender, msg = parse_msg_sender('msg_body') If you don't wan...
def function[parse_msg_sender, parameter[filename, sender_known]]: constant[Given a filename returns the sender and the message. Here the message is assumed to be a whole MIME message or just message body. >>> sender, msg = parse_msg_sender('msg.eml') >>> sender, msg = parse_msg_sender('msg_bo...
keyword[def] identifier[parse_msg_sender] ( identifier[filename] , identifier[sender_known] = keyword[True] ): literal[string] keyword[import] identifier[sys] identifier[kwargs] ={} keyword[if] identifier[sys] . identifier[version_info] >( literal[int] , literal[int] ): identifier[kwa...
def parse_msg_sender(filename, sender_known=True): """Given a filename returns the sender and the message. Here the message is assumed to be a whole MIME message or just message body. >>> sender, msg = parse_msg_sender('msg.eml') >>> sender, msg = parse_msg_sender('msg_body') If you don't wan...
def dict_to_qs(dct): """ Takes a dictionary and uses it to create a query string. """ itms = ["%s=%s" % (key, val) for key, val in list(dct.items()) if val is not None] return "&".join(itms)
def function[dict_to_qs, parameter[dct]]: constant[ Takes a dictionary and uses it to create a query string. ] variable[itms] assign[=] <ast.ListComp object at 0x7da1b0528a30> return[call[constant[&].join, parameter[name[itms]]]]
keyword[def] identifier[dict_to_qs] ( identifier[dct] ): literal[string] identifier[itms] =[ literal[string] %( identifier[key] , identifier[val] ) keyword[for] identifier[key] , identifier[val] keyword[in] identifier[list] ( identifier[dct] . identifier[items] ()) keyword[if] identifier[val] key...
def dict_to_qs(dct): """ Takes a dictionary and uses it to create a query string. """ itms = ['%s=%s' % (key, val) for (key, val) in list(dct.items()) if val is not None] return '&'.join(itms)
def MaxPooling( inputs, pool_size, strides=None, padding='valid', data_format='channels_last'): """ Same as `tf.layers.MaxPooling2D`. Default strides is equal to pool_size. """ if strides is None: strides = pool_size layer = tf.layers.MaxPooling2D(pool...
def function[MaxPooling, parameter[inputs, pool_size, strides, padding, data_format]]: constant[ Same as `tf.layers.MaxPooling2D`. Default strides is equal to pool_size. ] if compare[name[strides] is constant[None]] begin[:] variable[strides] assign[=] name[pool_size] var...
keyword[def] identifier[MaxPooling] ( identifier[inputs] , identifier[pool_size] , identifier[strides] = keyword[None] , identifier[padding] = literal[string] , identifier[data_format] = literal[string] ): literal[string] keyword[if] identifier[strides] keyword[is] keyword[None] : identifi...
def MaxPooling(inputs, pool_size, strides=None, padding='valid', data_format='channels_last'): """ Same as `tf.layers.MaxPooling2D`. Default strides is equal to pool_size. """ if strides is None: strides = pool_size # depends on [control=['if'], data=['strides']] layer = tf.layers.MaxPoolin...
def write(bar, offset, data): """Write data to PCI board. Parameters ---------- bar : BaseAddressRegister BAR to write. offset : int Address offset in BAR to write. data : bytes Data to write. Returns ------- None Examples ...
def function[write, parameter[bar, offset, data]]: constant[Write data to PCI board. Parameters ---------- bar : BaseAddressRegister BAR to write. offset : int Address offset in BAR to write. data : bytes Data to write. Returns ------- ...
keyword[def] identifier[write] ( identifier[bar] , identifier[offset] , identifier[data] ): literal[string] keyword[if] identifier[type] ( identifier[data] ) keyword[not] keyword[in] [ identifier[bytes] , identifier[bytearray] ]: identifier[msg] = literal[string] keyword[raise] identi...
def write(bar, offset, data): """Write data to PCI board. Parameters ---------- bar : BaseAddressRegister BAR to write. offset : int Address offset in BAR to write. data : bytes Data to write. Returns ------- None Examples ...
def _writeSuperLinks(self, superLinks, fileObject): """ Write SuperLinks to File Method """ for slink in superLinks: fileObject.write('SLINK %s %s\n' % ( slink.slinkNumber, slink.numPipes)) for node in slink.superNodes: ...
def function[_writeSuperLinks, parameter[self, superLinks, fileObject]]: constant[ Write SuperLinks to File Method ] for taget[name[slink]] in starred[name[superLinks]] begin[:] call[name[fileObject].write, parameter[binary_operation[constant[SLINK %s %s ] <ast.Mod...
keyword[def] identifier[_writeSuperLinks] ( identifier[self] , identifier[superLinks] , identifier[fileObject] ): literal[string] keyword[for] identifier[slink] keyword[in] identifier[superLinks] : identifier[fileObject] . identifier[write] ( literal[string] %( identifi...
def _writeSuperLinks(self, superLinks, fileObject): """ Write SuperLinks to File Method """ for slink in superLinks: fileObject.write('SLINK %s %s\n' % (slink.slinkNumber, slink.numPipes)) for node in slink.superNodes: fileObject.write('NODE %s %.2f %.2f %....
def _consumers(self): """ Gets consumer's map from app config :return: consumers map """ app_config = self.lti_kwargs['app'].config config = app_config.get('PYLTI_CONFIG', dict()) consumers = config.get('consumers', dict()) return consumers
def function[_consumers, parameter[self]]: constant[ Gets consumer's map from app config :return: consumers map ] variable[app_config] assign[=] call[name[self].lti_kwargs][constant[app]].config variable[config] assign[=] call[name[app_config].get, parameter[constant[PYL...
keyword[def] identifier[_consumers] ( identifier[self] ): literal[string] identifier[app_config] = identifier[self] . identifier[lti_kwargs] [ literal[string] ]. identifier[config] identifier[config] = identifier[app_config] . identifier[get] ( literal[string] , identifier[dict] ()) ...
def _consumers(self): """ Gets consumer's map from app config :return: consumers map """ app_config = self.lti_kwargs['app'].config config = app_config.get('PYLTI_CONFIG', dict()) consumers = config.get('consumers', dict()) return consumers
def submit(self): """Submit this torrent and create a new task""" if self.api._req_lixian_add_task_bt(self): self.submitted = True return True return False
def function[submit, parameter[self]]: constant[Submit this torrent and create a new task] if call[name[self].api._req_lixian_add_task_bt, parameter[name[self]]] begin[:] name[self].submitted assign[=] constant[True] return[constant[True]] return[constant[False]]
keyword[def] identifier[submit] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[api] . identifier[_req_lixian_add_task_bt] ( identifier[self] ): identifier[self] . identifier[submitted] = keyword[True] keyword[return] keyword[True] ...
def submit(self): """Submit this torrent and create a new task""" if self.api._req_lixian_add_task_bt(self): self.submitted = True return True # depends on [control=['if'], data=[]] return False
def get_event_iter_returns(self, jid, minions, timeout=None): ''' Gather the return data from the event system, break hard when timeout is reached. ''' log.trace('entered - function get_event_iter_returns()') if timeout is None: timeout = self.opts['timeout'] ...
def function[get_event_iter_returns, parameter[self, jid, minions, timeout]]: constant[ Gather the return data from the event system, break hard when timeout is reached. ] call[name[log].trace, parameter[constant[entered - function get_event_iter_returns()]]] if compare[n...
keyword[def] identifier[get_event_iter_returns] ( identifier[self] , identifier[jid] , identifier[minions] , identifier[timeout] = keyword[None] ): literal[string] identifier[log] . identifier[trace] ( literal[string] ) keyword[if] identifier[timeout] keyword[is] keyword[None] : ...
def get_event_iter_returns(self, jid, minions, timeout=None): """ Gather the return data from the event system, break hard when timeout is reached. """ log.trace('entered - function get_event_iter_returns()') if timeout is None: timeout = self.opts['timeout'] # depends on [c...
def get_last_commit_modifying_files(repo: Repo, *files) -> str: """ Returns the hash of the last commit which modified some of the files (or files in those folders). :param repo: The repo to check in. :param files: List of files to check :return: Commit hash. """ return repo.git.log(*files, n=1...
def function[get_last_commit_modifying_files, parameter[repo]]: constant[ Returns the hash of the last commit which modified some of the files (or files in those folders). :param repo: The repo to check in. :param files: List of files to check :return: Commit hash. ] return[call[name[repo]....
keyword[def] identifier[get_last_commit_modifying_files] ( identifier[repo] : identifier[Repo] ,* identifier[files] )-> identifier[str] : literal[string] keyword[return] identifier[repo] . identifier[git] . identifier[log] (* identifier[files] , identifier[n] = literal[int] , identifier[format] = literal[...
def get_last_commit_modifying_files(repo: Repo, *files) -> str: """ Returns the hash of the last commit which modified some of the files (or files in those folders). :param repo: The repo to check in. :param files: List of files to check :return: Commit hash. """ return repo.git.log(*files, n=1...
def run(self): """ Run the plugin. """ worker_builds = self.workflow.build_result.annotations['worker-builds'] has_v1_image_id = None repo_tags = {} for platform in worker_builds: build_info = get_worker_build_info(self.workflow, platform) ...
def function[run, parameter[self]]: constant[ Run the plugin. ] variable[worker_builds] assign[=] call[name[self].workflow.build_result.annotations][constant[worker-builds]] variable[has_v1_image_id] assign[=] constant[None] variable[repo_tags] assign[=] dictionary[[], []...
keyword[def] identifier[run] ( identifier[self] ): literal[string] identifier[worker_builds] = identifier[self] . identifier[workflow] . identifier[build_result] . identifier[annotations] [ literal[string] ] identifier[has_v1_image_id] = keyword[None] identifier[repo_tags] ={} ...
def run(self): """ Run the plugin. """ worker_builds = self.workflow.build_result.annotations['worker-builds'] has_v1_image_id = None repo_tags = {} for platform in worker_builds: build_info = get_worker_build_info(self.workflow, platform) annotations = build_info.bui...
def d_deta_from_phalf(arr, pfull_coord): """Compute pressure level thickness from half level pressures.""" d_deta = arr.diff(dim=internal_names.PHALF_STR, n=1) return replace_coord(d_deta, internal_names.PHALF_STR, internal_names.PFULL_STR, pfull_coord)
def function[d_deta_from_phalf, parameter[arr, pfull_coord]]: constant[Compute pressure level thickness from half level pressures.] variable[d_deta] assign[=] call[name[arr].diff, parameter[]] return[call[name[replace_coord], parameter[name[d_deta], name[internal_names].PHALF_STR, name[internal_name...
keyword[def] identifier[d_deta_from_phalf] ( identifier[arr] , identifier[pfull_coord] ): literal[string] identifier[d_deta] = identifier[arr] . identifier[diff] ( identifier[dim] = identifier[internal_names] . identifier[PHALF_STR] , identifier[n] = literal[int] ) keyword[return] identifier[replace_...
def d_deta_from_phalf(arr, pfull_coord): """Compute pressure level thickness from half level pressures.""" d_deta = arr.diff(dim=internal_names.PHALF_STR, n=1) return replace_coord(d_deta, internal_names.PHALF_STR, internal_names.PFULL_STR, pfull_coord)
def add(self, visualization): """ Creates a new visualization :param visualization: instance of Visualization :return: """ res = self.es.create(index=self.index, id=visualization.id or str(uuid.uuid1()), doc_type=s...
def function[add, parameter[self, visualization]]: constant[ Creates a new visualization :param visualization: instance of Visualization :return: ] variable[res] assign[=] call[name[self].es.create, parameter[]] return[name[res]]
keyword[def] identifier[add] ( identifier[self] , identifier[visualization] ): literal[string] identifier[res] = identifier[self] . identifier[es] . identifier[create] ( identifier[index] = identifier[self] . identifier[index] , identifier[id] = identifier[visualization] . identifier[id] ...
def add(self, visualization): """ Creates a new visualization :param visualization: instance of Visualization :return: """ res = self.es.create(index=self.index, id=visualization.id or str(uuid.uuid1()), doc_type=self.doc_type, body=visualization.to_kibana(), refresh=True) re...
def Add_text(self, s): """ Add text to measurement data window. """ self.logger.DeleteAllItems() FONT_RATIO = self.GUI_RESOLUTION + (self.GUI_RESOLUTION - 1) * 5 if self.GUI_RESOLUTION > 1.1: font1 = wx.Font(11, wx.SWISS, wx.NORMAL, ...
def function[Add_text, parameter[self, s]]: constant[ Add text to measurement data window. ] call[name[self].logger.DeleteAllItems, parameter[]] variable[FONT_RATIO] assign[=] binary_operation[name[self].GUI_RESOLUTION + binary_operation[binary_operation[name[self].GUI_RESOLUTION...
keyword[def] identifier[Add_text] ( identifier[self] , identifier[s] ): literal[string] identifier[self] . identifier[logger] . identifier[DeleteAllItems] () identifier[FONT_RATIO] = identifier[self] . identifier[GUI_RESOLUTION] +( identifier[self] . identifier[GUI_RESOLUTION] - literal[in...
def Add_text(self, s): """ Add text to measurement data window. """ self.logger.DeleteAllItems() FONT_RATIO = self.GUI_RESOLUTION + (self.GUI_RESOLUTION - 1) * 5 if self.GUI_RESOLUTION > 1.1: font1 = wx.Font(11, wx.SWISS, wx.NORMAL, wx.NORMAL, False, self.font_type) # depends on...
def _stick_device(self): """ Discovers the filename of the evdev device that represents the Sense HAT's joystick. """ for evdev in glob.glob('/sys/class/input/event*'): try: with io.open(os.path.join(evdev, 'device', 'name'), 'r') as f: ...
def function[_stick_device, parameter[self]]: constant[ Discovers the filename of the evdev device that represents the Sense HAT's joystick. ] for taget[name[evdev]] in starred[call[name[glob].glob, parameter[constant[/sys/class/input/event*]]]] begin[:] <ast.Try object a...
keyword[def] identifier[_stick_device] ( identifier[self] ): literal[string] keyword[for] identifier[evdev] keyword[in] identifier[glob] . identifier[glob] ( literal[string] ): keyword[try] : keyword[with] identifier[io] . identifier[open] ( identifier[os] . identi...
def _stick_device(self): """ Discovers the filename of the evdev device that represents the Sense HAT's joystick. """ for evdev in glob.glob('/sys/class/input/event*'): try: with io.open(os.path.join(evdev, 'device', 'name'), 'r') as f: if f.read().str...
def blob_services(self): """Instance depends on the API version: * 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': ...
def function[blob_services, parameter[self]]: constant[Instance depends on the API version: * 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>` ] variable[api_version] assign[=] call[name[self]._get_api_version, parameter[co...
keyword[def] identifier[blob_services] ( identifier[self] ): literal[string] identifier[api_version] = identifier[self] . identifier[_get_api_version] ( literal[string] ) keyword[if] identifier[api_version] == literal[string] : keyword[from] . identifier[v2018_07_01] . identi...
def blob_services(self): """Instance depends on the API version: * 2018-07-01: :class:`BlobServicesOperations<azure.mgmt.storage.v2018_07_01.operations.BlobServicesOperations>` """ api_version = self._get_api_version('blob_services') if api_version == '2018-07-01': from .v2018_07...
def is_admin(self, send, nick, required_role='admin'): """Checks if a nick is a admin. If NickServ hasn't responded yet, then the admin is unverified, so assume they aren't a admin. """ # If the required role is None, bypass checks. if not required_role: ret...
def function[is_admin, parameter[self, send, nick, required_role]]: constant[Checks if a nick is a admin. If NickServ hasn't responded yet, then the admin is unverified, so assume they aren't a admin. ] if <ast.UnaryOp object at 0x7da1b209df30> begin[:] return[constant[...
keyword[def] identifier[is_admin] ( identifier[self] , identifier[send] , identifier[nick] , identifier[required_role] = literal[string] ): literal[string] keyword[if] keyword[not] identifier[required_role] : keyword[return] keyword[True] keyword[with...
def is_admin(self, send, nick, required_role='admin'): """Checks if a nick is a admin. If NickServ hasn't responded yet, then the admin is unverified, so assume they aren't a admin. """ # If the required role is None, bypass checks. if not required_role: return True # depe...
def bind_cache_grant(app, provider, current_user, config_prefix='OAUTH2'): """Configures an :class:`OAuth2Provider` instance to use various caching systems to get and set the grant token. This removes the need to register :func:`grantgetter` and :func:`grantsetter` yourself. :param app: Flask applicati...
def function[bind_cache_grant, parameter[app, provider, current_user, config_prefix]]: constant[Configures an :class:`OAuth2Provider` instance to use various caching systems to get and set the grant token. This removes the need to register :func:`grantgetter` and :func:`grantsetter` yourself. :para...
keyword[def] identifier[bind_cache_grant] ( identifier[app] , identifier[provider] , identifier[current_user] , identifier[config_prefix] = literal[string] ): literal[string] identifier[cache] = identifier[Cache] ( identifier[app] , identifier[config_prefix] ) @ identifier[provider] . identifier[grant...
def bind_cache_grant(app, provider, current_user, config_prefix='OAUTH2'): """Configures an :class:`OAuth2Provider` instance to use various caching systems to get and set the grant token. This removes the need to register :func:`grantgetter` and :func:`grantsetter` yourself. :param app: Flask applicati...
def _print(self, msg, flush=False, end="\n"): """Helper function to print connection status messages when in verbose mode.""" if self._verbose: print2(msg, end=end, flush=flush)
def function[_print, parameter[self, msg, flush, end]]: constant[Helper function to print connection status messages when in verbose mode.] if name[self]._verbose begin[:] call[name[print2], parameter[name[msg]]]
keyword[def] identifier[_print] ( identifier[self] , identifier[msg] , identifier[flush] = keyword[False] , identifier[end] = literal[string] ): literal[string] keyword[if] identifier[self] . identifier[_verbose] : identifier[print2] ( identifier[msg] , identifier[end] = identifier[en...
def _print(self, msg, flush=False, end='\n'): """Helper function to print connection status messages when in verbose mode.""" if self._verbose: print2(msg, end=end, flush=flush) # depends on [control=['if'], data=[]]
def move_application(self, app_id, queue): """Move an application to a different queue. Parameters ---------- app_id : str The id of the application to move. queue : str The queue to move the application to. """ self._call('moveApplication...
def function[move_application, parameter[self, app_id, queue]]: constant[Move an application to a different queue. Parameters ---------- app_id : str The id of the application to move. queue : str The queue to move the application to. ] ca...
keyword[def] identifier[move_application] ( identifier[self] , identifier[app_id] , identifier[queue] ): literal[string] identifier[self] . identifier[_call] ( literal[string] , identifier[proto] . identifier[MoveRequest] ( identifier[id] = identifier[app_id] , identifier[queue] = identifier[queue]...
def move_application(self, app_id, queue): """Move an application to a different queue. Parameters ---------- app_id : str The id of the application to move. queue : str The queue to move the application to. """ self._call('moveApplication', proto...
def get_unique_counter(self, redis_conn=None, host='localhost', port=6379, key='unique_counter', cycle_time=5, start_time=None, window=SECONDS_1_HOUR, roll=True, keep_max=12): ''' Generate a new UniqueCounter. Useful for exactly counting uniq...
def function[get_unique_counter, parameter[self, redis_conn, host, port, key, cycle_time, start_time, window, roll, keep_max]]: constant[ Generate a new UniqueCounter. Useful for exactly counting unique objects @param redis_conn: A premade redis connection (overrides host and port) ...
keyword[def] identifier[get_unique_counter] ( identifier[self] , identifier[redis_conn] = keyword[None] , identifier[host] = literal[string] , identifier[port] = literal[int] , identifier[key] = literal[string] , identifier[cycle_time] = literal[int] , identifier[start_time] = keyword[None] , identifier[window] = i...
def get_unique_counter(self, redis_conn=None, host='localhost', port=6379, key='unique_counter', cycle_time=5, start_time=None, window=SECONDS_1_HOUR, roll=True, keep_max=12): """ Generate a new UniqueCounter. Useful for exactly counting unique objects @param redis_conn: A premade redis con...
def _show(self, message, indent=0, enable_verbose=True): # pragma: no cover """Message printer. """ if enable_verbose: print(" " * indent + message)
def function[_show, parameter[self, message, indent, enable_verbose]]: constant[Message printer. ] if name[enable_verbose] begin[:] call[name[print], parameter[binary_operation[binary_operation[constant[ ] * name[indent]] + name[message]]]]
keyword[def] identifier[_show] ( identifier[self] , identifier[message] , identifier[indent] = literal[int] , identifier[enable_verbose] = keyword[True] ): literal[string] keyword[if] identifier[enable_verbose] : identifier[print] ( literal[string] * identifier[indent] + identifier[me...
def _show(self, message, indent=0, enable_verbose=True): # pragma: no cover 'Message printer.\n ' if enable_verbose: print(' ' * indent + message) # depends on [control=['if'], data=[]]
def rand_sub(arr,*args,**kwargs): ''' arr = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment'] rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr) rand_sub(arr) rand_sub(arr) ''' arr = copy.deepcopy(...
def function[rand_sub, parameter[arr]]: constant[ arr = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment'] rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr) rand_sub(arr) rand_sub(arr) ] va...
keyword[def] identifier[rand_sub] ( identifier[arr] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[arr] = identifier[copy] . identifier[deepcopy] ( identifier[arr] ) identifier[lngth] = identifier[arr] . identifier[__len__] () identifier[args] = identifier[list] ( identi...
def rand_sub(arr, *args, **kwargs): """ arr = ['scheme', 'username', 'password', 'hostname', 'port', 'path', 'params', 'query', 'fragment'] rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr,3) rand_sub(arr) rand_sub(arr) rand_sub(arr) """ arr = copy.deepcop...
def Unbind(method): # pylint: disable=C0103 """ The ``@Unbind`` callback decorator is called when a component dependency is unbound. The decorated method must accept the injected service object and its :class:`~pelix.framework.ServiceReference` as arguments:: @Unbind def unbind_m...
def function[Unbind, parameter[method]]: constant[ The ``@Unbind`` callback decorator is called when a component dependency is unbound. The decorated method must accept the injected service object and its :class:`~pelix.framework.ServiceReference` as arguments:: @Unbind def unbin...
keyword[def] identifier[Unbind] ( identifier[method] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[method] , identifier[types] . identifier[FunctionType] ): keyword[raise] identifier[TypeError] ( literal[string] ) identifier[validate_method_arit...
def Unbind(method): # pylint: disable=C0103 "\n The ``@Unbind`` callback decorator is called when a component dependency is\n unbound.\n\n The decorated method must accept the injected service object and its\n :class:`~pelix.framework.ServiceReference` as arguments::\n\n @Unbind\n def un...
def analysis_set_properties(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /analysis-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fanalysis-xxxx%2FsetProperties """ return DXHT...
def function[analysis_set_properties, parameter[object_id, input_params, always_retry]]: constant[ Invokes the /analysis-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fanalysis-xxxx%2FsetProperties ] ...
keyword[def] identifier[analysis_set_properties] ( identifier[object_id] , identifier[input_params] ={}, identifier[always_retry] = keyword[True] ,** identifier[kwargs] ): literal[string] keyword[return] identifier[DXHTTPRequest] ( literal[string] % identifier[object_id] , identifier[input_params] , ident...
def analysis_set_properties(object_id, input_params={}, always_retry=True, **kwargs): """ Invokes the /analysis-xxxx/setProperties API method. For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Workflows-and-Analyses#API-method%3A-%2Fanalysis-xxxx%2FsetProperties """ return DXHT...
def onKey(self, event): """ Copy selection if control down and 'c' """ if event.CmdDown() or event.ControlDown(): if event.GetKeyCode() == 67: self.onCopySelection(None)
def function[onKey, parameter[self, event]]: constant[ Copy selection if control down and 'c' ] if <ast.BoolOp object at 0x7da18bccb9a0> begin[:] if compare[call[name[event].GetKeyCode, parameter[]] equal[==] constant[67]] begin[:] call[name[self]....
keyword[def] identifier[onKey] ( identifier[self] , identifier[event] ): literal[string] keyword[if] identifier[event] . identifier[CmdDown] () keyword[or] identifier[event] . identifier[ControlDown] (): keyword[if] identifier[event] . identifier[GetKeyCode] ()== literal[int] : ...
def onKey(self, event): """ Copy selection if control down and 'c' """ if event.CmdDown() or event.ControlDown(): if event.GetKeyCode() == 67: self.onCopySelection(None) # depends on [control=['if'], data=[]] # depends on [control=['if'], data=[]]
def generate_xliff(entry_dict): """ Given a dictionary with keys = ids and values equals to strings generates and xliff file to send to unbabel. Example: {"123": "This is blue car", "234": "This house is yellow" } returns <xliff version = "1.2"> <file original = "...
def function[generate_xliff, parameter[entry_dict]]: constant[ Given a dictionary with keys = ids and values equals to strings generates and xliff file to send to unbabel. Example: {"123": "This is blue car", "234": "This house is yellow" } returns <xliff version = "1.2...
keyword[def] identifier[generate_xliff] ( identifier[entry_dict] ): literal[string] identifier[entries] = literal[string] keyword[for] identifier[key] , identifier[value] keyword[in] identifier[entry_dict] . identifier[iteritems] (): identifier[entries] += identifier[create_trans_unit] ( ...
def generate_xliff(entry_dict): """ Given a dictionary with keys = ids and values equals to strings generates and xliff file to send to unbabel. Example: {"123": "This is blue car", "234": "This house is yellow" } returns <xliff version = "1.2"> <file original = "...
def inject(self): """ Recursively inject aXe into all iframes and the top level document. :param script_url: location of the axe-core script. :type script_url: string """ with open(self.script_url, "r", encoding="utf8") as f: self.selenium.execute_script(f.re...
def function[inject, parameter[self]]: constant[ Recursively inject aXe into all iframes and the top level document. :param script_url: location of the axe-core script. :type script_url: string ] with call[name[open], parameter[name[self].script_url, constant[r]]] begin[...
keyword[def] identifier[inject] ( identifier[self] ): literal[string] keyword[with] identifier[open] ( identifier[self] . identifier[script_url] , literal[string] , identifier[encoding] = literal[string] ) keyword[as] identifier[f] : identifier[self] . identifier[selenium] . identifi...
def inject(self): """ Recursively inject aXe into all iframes and the top level document. :param script_url: location of the axe-core script. :type script_url: string """ with open(self.script_url, 'r', encoding='utf8') as f: self.selenium.execute_script(f.read()) # dep...
def header(self, name, default=None): """ Returns the value of the HTTP header identified by `name`. """ wsgi_header = "HTTP_{0}".format(name.upper()) try: return self.env_raw[wsgi_header] except KeyError: return default
def function[header, parameter[self, name, default]]: constant[ Returns the value of the HTTP header identified by `name`. ] variable[wsgi_header] assign[=] call[constant[HTTP_{0}].format, parameter[call[name[name].upper, parameter[]]]] <ast.Try object at 0x7da1b0f203d0>
keyword[def] identifier[header] ( identifier[self] , identifier[name] , identifier[default] = keyword[None] ): literal[string] identifier[wsgi_header] = literal[string] . identifier[format] ( identifier[name] . identifier[upper] ()) keyword[try] : keyword[return] identifier[...
def header(self, name, default=None): """ Returns the value of the HTTP header identified by `name`. """ wsgi_header = 'HTTP_{0}'.format(name.upper()) try: return self.env_raw[wsgi_header] # depends on [control=['try'], data=[]] except KeyError: return default # depends...
def load_meta_data(self, path=None, recursively=True): """Load meta data of state machine model from the file system The meta data of the state machine model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the meta data of root st...
def function[load_meta_data, parameter[self, path, recursively]]: constant[Load meta data of state machine model from the file system The meta data of the state machine model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the met...
keyword[def] identifier[load_meta_data] ( identifier[self] , identifier[path] = keyword[None] , identifier[recursively] = keyword[True] ): literal[string] identifier[meta_data_path] = identifier[path] keyword[if] identifier[path] keyword[is] keyword[not] keyword[None] keyword[else] identifie...
def load_meta_data(self, path=None, recursively=True): """Load meta data of state machine model from the file system The meta data of the state machine model is loaded from the file system and stored in the meta property of the model. Existing meta data is removed. Also the meta data of root state ...
def style(font): """Determine font style from canonical filename.""" from fontbakery.constants import STATIC_STYLE_NAMES filename = os.path.basename(font) if '-' in filename: stylename = os.path.splitext(filename)[0].split('-')[1] if stylename in [name.replace(' ', '') for name in STATIC_STYLE_NAMES]: ...
def function[style, parameter[font]]: constant[Determine font style from canonical filename.] from relative_module[fontbakery.constants] import module[STATIC_STYLE_NAMES] variable[filename] assign[=] call[name[os].path.basename, parameter[name[font]]] if compare[constant[-] in name[filename]...
keyword[def] identifier[style] ( identifier[font] ): literal[string] keyword[from] identifier[fontbakery] . identifier[constants] keyword[import] identifier[STATIC_STYLE_NAMES] identifier[filename] = identifier[os] . identifier[path] . identifier[basename] ( identifier[font] ) keyword[if] literal[st...
def style(font): """Determine font style from canonical filename.""" from fontbakery.constants import STATIC_STYLE_NAMES filename = os.path.basename(font) if '-' in filename: stylename = os.path.splitext(filename)[0].split('-')[1] if stylename in [name.replace(' ', '') for name in STATIC...
def from_date(self, value: date) -> datetime: """ Initializes from the given date value """ assert isinstance(value, date) #self.value = datetime.combine(value, time.min) self.value = datetime(value.year, value.month, value.day) return self.value
def function[from_date, parameter[self, value]]: constant[ Initializes from the given date value ] assert[call[name[isinstance], parameter[name[value], name[date]]]] name[self].value assign[=] call[name[datetime], parameter[name[value].year, name[value].month, name[value].day]] return[name[self]...
keyword[def] identifier[from_date] ( identifier[self] , identifier[value] : identifier[date] )-> identifier[datetime] : literal[string] keyword[assert] identifier[isinstance] ( identifier[value] , identifier[date] ) identifier[self] . identifier[value] = identifier[datetime] ( i...
def from_date(self, value: date) -> datetime: """ Initializes from the given date value """ assert isinstance(value, date) #self.value = datetime.combine(value, time.min) self.value = datetime(value.year, value.month, value.day) return self.value
def get(self): """ Get a JSON-ready representation of this Mail object. :returns: This Mail object, ready for use in a request body. :rtype: dict """ mail = { 'from': self._get_or_none(self.from_email), 'subject': self._get_or_none(self.subject), ...
def function[get, parameter[self]]: constant[ Get a JSON-ready representation of this Mail object. :returns: This Mail object, ready for use in a request body. :rtype: dict ] variable[mail] assign[=] dictionary[[<ast.Constant object at 0x7da1b23461a0>, <ast.Constant obje...
keyword[def] identifier[get] ( identifier[self] ): literal[string] identifier[mail] ={ literal[string] : identifier[self] . identifier[_get_or_none] ( identifier[self] . identifier[from_email] ), literal[string] : identifier[self] . identifier[_get_or_none] ( identifier[self] . id...
def get(self): """ Get a JSON-ready representation of this Mail object. :returns: This Mail object, ready for use in a request body. :rtype: dict """ mail = {'from': self._get_or_none(self.from_email), 'subject': self._get_or_none(self.subject), 'personalizations': [p.get() for ...
def __get_note_award_emoji(self, item_type, item_id, note_id): """Fetch emojis for a note of an issue/merge request""" emojis = [] group_emojis = self.client.note_emojis(item_type, item_id, note_id) try: for raw_emojis in group_emojis: for emoji in json.loa...
def function[__get_note_award_emoji, parameter[self, item_type, item_id, note_id]]: constant[Fetch emojis for a note of an issue/merge request] variable[emojis] assign[=] list[[]] variable[group_emojis] assign[=] call[name[self].client.note_emojis, parameter[name[item_type], name[item_id], name[...
keyword[def] identifier[__get_note_award_emoji] ( identifier[self] , identifier[item_type] , identifier[item_id] , identifier[note_id] ): literal[string] identifier[emojis] =[] identifier[group_emojis] = identifier[self] . identifier[client] . identifier[note_emojis] ( identifier[item_ty...
def __get_note_award_emoji(self, item_type, item_id, note_id): """Fetch emojis for a note of an issue/merge request""" emojis = [] group_emojis = self.client.note_emojis(item_type, item_id, note_id) try: for raw_emojis in group_emojis: for emoji in json.loads(raw_emojis): ...
def ClearAllVar(self): """Clear this Value.""" self.value = None # Call OnClearAllVar on options. _ = [option.OnClearAllVar() for option in self.options]
def function[ClearAllVar, parameter[self]]: constant[Clear this Value.] name[self].value assign[=] constant[None] variable[_] assign[=] <ast.ListComp object at 0x7da1b17d4c10>
keyword[def] identifier[ClearAllVar] ( identifier[self] ): literal[string] identifier[self] . identifier[value] = keyword[None] identifier[_] =[ identifier[option] . identifier[OnClearAllVar] () keyword[for] identifier[option] keyword[in] identifier[self] . identifier[options] ]
def ClearAllVar(self): """Clear this Value.""" self.value = None # Call OnClearAllVar on options. _ = [option.OnClearAllVar() for option in self.options]
def roll_up( df, levels: List[str], groupby_vars: List[str], extra_groupby_cols: List[str] = None, var_name: str = 'type', value_name: str = 'value', agg_func: str = 'sum', drop_levels: List[str] = None ): """ Creates aggregates following a given h...
def function[roll_up, parameter[df, levels, groupby_vars, extra_groupby_cols, var_name, value_name, agg_func, drop_levels]]: constant[ Creates aggregates following a given hierarchy --- ### Parameters *mandatory :* - `levels` (*list of str*): name of the columns composing the hierarchy (f...
keyword[def] identifier[roll_up] ( identifier[df] , identifier[levels] : identifier[List] [ identifier[str] ], identifier[groupby_vars] : identifier[List] [ identifier[str] ], identifier[extra_groupby_cols] : identifier[List] [ identifier[str] ]= keyword[None] , identifier[var_name] : identifier[str] = literal[s...
def roll_up(df, levels: List[str], groupby_vars: List[str], extra_groupby_cols: List[str]=None, var_name: str='type', value_name: str='value', agg_func: str='sum', drop_levels: List[str]=None): """ Creates aggregates following a given hierarchy --- ### Parameters *mandatory :* - `levels` (*li...
def to_python(self): """Decode this KeyValueTable object to standard Python types.""" mapping = {} for row in self.rows: mapping[row[0]] = _format_python_value(row[1]) return mapping
def function[to_python, parameter[self]]: constant[Decode this KeyValueTable object to standard Python types.] variable[mapping] assign[=] dictionary[[], []] for taget[name[row]] in starred[name[self].rows] begin[:] call[name[mapping]][call[name[row]][constant[0]]] assign[=] call...
keyword[def] identifier[to_python] ( identifier[self] ): literal[string] identifier[mapping] ={} keyword[for] identifier[row] keyword[in] identifier[self] . identifier[rows] : identifier[mapping] [ identifier[row] [ literal[int] ]]= identifier[_format_python_value] ( identi...
def to_python(self): """Decode this KeyValueTable object to standard Python types.""" mapping = {} for row in self.rows: mapping[row[0]] = _format_python_value(row[1]) # depends on [control=['for'], data=['row']] return mapping
def get_facts_by_name_and_value(api_url=None, fact_name=None, fact_value=None, verify=False, cert=list()): """ Returns facts by name and value :param api_url: Base PuppetDB API url :param fact_name: Name of fact :param fact_value: Value of fact """ return utils._make_api_request(api_url, '...
def function[get_facts_by_name_and_value, parameter[api_url, fact_name, fact_value, verify, cert]]: constant[ Returns facts by name and value :param api_url: Base PuppetDB API url :param fact_name: Name of fact :param fact_value: Value of fact ] return[call[name[utils]._make_api_reques...
keyword[def] identifier[get_facts_by_name_and_value] ( identifier[api_url] = keyword[None] , identifier[fact_name] = keyword[None] , identifier[fact_value] = keyword[None] , identifier[verify] = keyword[False] , identifier[cert] = identifier[list] ()): literal[string] keyword[return] identifier[utils] . i...
def get_facts_by_name_and_value(api_url=None, fact_name=None, fact_value=None, verify=False, cert=list()): """ Returns facts by name and value :param api_url: Base PuppetDB API url :param fact_name: Name of fact :param fact_value: Value of fact """ return utils._make_api_request(api_url, '...
def encodeDNA(seq_vec, maxlen=None, seq_align="start"): """Convert the DNA sequence into 1-hot-encoding numpy array # Arguments seq_vec: list of chars List of sequences that can have different lengths maxlen: int or None, Should we trim (subset) the resulting sequence. ...
def function[encodeDNA, parameter[seq_vec, maxlen, seq_align]]: constant[Convert the DNA sequence into 1-hot-encoding numpy array # Arguments seq_vec: list of chars List of sequences that can have different lengths maxlen: int or None, Should we trim (subset) the re...
keyword[def] identifier[encodeDNA] ( identifier[seq_vec] , identifier[maxlen] = keyword[None] , identifier[seq_align] = literal[string] ): literal[string] keyword[return] identifier[encodeSequence] ( identifier[seq_vec] , identifier[vocab] = identifier[DNA] , identifier[neutral_vocab] = literal[...
def encodeDNA(seq_vec, maxlen=None, seq_align='start'): """Convert the DNA sequence into 1-hot-encoding numpy array # Arguments seq_vec: list of chars List of sequences that can have different lengths maxlen: int or None, Should we trim (subset) the resulting sequence. ...
def logout(self): """ Safely logs out the client :param timeout: See `requests timeout <http://docs.python-requests.org/en/master/user/advanced/#timeouts>`_ :return: True if the action was successful :rtype: bool """ if not hasattr(self, "_fb_h"): h_r...
def function[logout, parameter[self]]: constant[ Safely logs out the client :param timeout: See `requests timeout <http://docs.python-requests.org/en/master/user/advanced/#timeouts>`_ :return: True if the action was successful :rtype: bool ] if <ast.UnaryOp objec...
keyword[def] identifier[logout] ( identifier[self] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[self] , literal[string] ): identifier[h_r] = identifier[self] . identifier[_post] ( identifier[self] . identifier[req_url] . identifier[MODERN_SETTINGS_MENU...
def logout(self): """ Safely logs out the client :param timeout: See `requests timeout <http://docs.python-requests.org/en/master/user/advanced/#timeouts>`_ :return: True if the action was successful :rtype: bool """ if not hasattr(self, '_fb_h'): h_r = self._pos...
def load_source_vocabs(folder: str) -> List[Vocab]: """ Loads source vocabularies from folder. The first element in the list is the primary source vocabulary. Other elements correspond to optional additional source factor vocabularies found in folder. :param folder: Source folder. :return: List of ...
def function[load_source_vocabs, parameter[folder]]: constant[ Loads source vocabularies from folder. The first element in the list is the primary source vocabulary. Other elements correspond to optional additional source factor vocabularies found in folder. :param folder: Source folder. :retur...
keyword[def] identifier[load_source_vocabs] ( identifier[folder] : identifier[str] )-> identifier[List] [ identifier[Vocab] ]: literal[string] keyword[return] [ identifier[vocab_from_json] ( identifier[os] . identifier[path] . identifier[join] ( identifier[folder] , identifier[fname] )) keyword[for] ident...
def load_source_vocabs(folder: str) -> List[Vocab]: """ Loads source vocabularies from folder. The first element in the list is the primary source vocabulary. Other elements correspond to optional additional source factor vocabularies found in folder. :param folder: Source folder. :return: List of ...
def reindex(self, new_index_name: str, identifier_key: str, **kwargs) -> 'ElasticIndex': """Reindex the entire index. Scrolls the old index and bulk indexes all data into the new index. :param new_index_name: :param identifier_key: :param kwargs: Overwrite ElasticIndex...
def function[reindex, parameter[self, new_index_name, identifier_key]]: constant[Reindex the entire index. Scrolls the old index and bulk indexes all data into the new index. :param new_index_name: :param identifier_key: :param kwargs: Overwrite ElasticIndex __init__ p...
keyword[def] identifier[reindex] ( identifier[self] , identifier[new_index_name] : identifier[str] , identifier[identifier_key] : identifier[str] ,** identifier[kwargs] )-> literal[string] : literal[string] keyword[if] literal[string] keyword[not] keyword[in] identifier[kwargs] : i...
def reindex(self, new_index_name: str, identifier_key: str, **kwargs) -> 'ElasticIndex': """Reindex the entire index. Scrolls the old index and bulk indexes all data into the new index. :param new_index_name: :param identifier_key: :param kwargs: Overwrite ElasticIndex __i...
def register(scheme): """ Registers a new scheme to the urlparser. :param schema | <str> """ scheme = nstr(scheme) urlparse.uses_fragment.append(scheme) urlparse.uses_netloc.append(scheme) urlparse.uses_params.append(scheme) urlparse.uses_query.append(scheme) urlparse.u...
def function[register, parameter[scheme]]: constant[ Registers a new scheme to the urlparser. :param schema | <str> ] variable[scheme] assign[=] call[name[nstr], parameter[name[scheme]]] call[name[urlparse].uses_fragment.append, parameter[name[scheme]]] call[name[ur...
keyword[def] identifier[register] ( identifier[scheme] ): literal[string] identifier[scheme] = identifier[nstr] ( identifier[scheme] ) identifier[urlparse] . identifier[uses_fragment] . identifier[append] ( identifier[scheme] ) identifier[urlparse] . identifier[uses_netloc] . identifier[append] (...
def register(scheme): """ Registers a new scheme to the urlparser. :param schema | <str> """ scheme = nstr(scheme) urlparse.uses_fragment.append(scheme) urlparse.uses_netloc.append(scheme) urlparse.uses_params.append(scheme) urlparse.uses_query.append(scheme) urlparse.u...
def list_env(self, key=None): """ Displays a list of environment key/value pairs. """ for k, v in sorted(self.genv.items(), key=lambda o: o[0]): if key and k != key: continue print('%s ' % (k,)) pprint(v, indent=4)
def function[list_env, parameter[self, key]]: constant[ Displays a list of environment key/value pairs. ] for taget[tuple[[<ast.Name object at 0x7da1b00e0790>, <ast.Name object at 0x7da1b00e1930>]]] in starred[call[name[sorted], parameter[call[name[self].genv.items, parameter[]]]]] begin...
keyword[def] identifier[list_env] ( identifier[self] , identifier[key] = keyword[None] ): literal[string] keyword[for] identifier[k] , identifier[v] keyword[in] identifier[sorted] ( identifier[self] . identifier[genv] . identifier[items] (), identifier[key] = keyword[lambda] identifier[o] : ide...
def list_env(self, key=None): """ Displays a list of environment key/value pairs. """ for (k, v) in sorted(self.genv.items(), key=lambda o: o[0]): if key and k != key: continue # depends on [control=['if'], data=[]] print('%s ' % (k,)) pprint(v, indent=4) # ...
def vol_per_rev_3_stop(color="", inner_diameter=0): """Return the volume per revolution of an Ismatec 6 roller pump given the inner diameter (ID) of 3-stop tubing. The calculation is interpolated from the table found at http://www.ismatec.com/int_e/pumps/t_mini_s_ms_ca/tubing_msca2.htm. Note: 1...
def function[vol_per_rev_3_stop, parameter[color, inner_diameter]]: constant[Return the volume per revolution of an Ismatec 6 roller pump given the inner diameter (ID) of 3-stop tubing. The calculation is interpolated from the table found at http://www.ismatec.com/int_e/pumps/t_mini_s_ms_ca/tubing_m...
keyword[def] identifier[vol_per_rev_3_stop] ( identifier[color] = literal[string] , identifier[inner_diameter] = literal[int] ): literal[string] keyword[if] identifier[color] != literal[string] : identifier[inner_diameter] = identifier[ID_colored_tube] ( identifier[color] ) identifier[term1]...
def vol_per_rev_3_stop(color='', inner_diameter=0): """Return the volume per revolution of an Ismatec 6 roller pump given the inner diameter (ID) of 3-stop tubing. The calculation is interpolated from the table found at http://www.ismatec.com/int_e/pumps/t_mini_s_ms_ca/tubing_msca2.htm. Note: 1...
def mu(self, lp, dist): """ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu Parameters ---------- lp : array-like of legth n dist : Distribution instance Returns ------- mu : np.arr...
def function[mu, parameter[self, lp, dist]]: constant[ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu Parameters ---------- lp : array-like of legth n dist : Distribution instance Returns ...
keyword[def] identifier[mu] ( identifier[self] , identifier[lp] , identifier[dist] ): literal[string] identifier[elp] = identifier[np] . identifier[exp] ( identifier[lp] ) keyword[return] identifier[dist] . identifier[levels] * identifier[elp] /( identifier[elp] + literal[int] )
def mu(self, lp, dist): """ glm mean function, ie inverse of link function this is useful for going from the linear prediction to mu Parameters ---------- lp : array-like of legth n dist : Distribution instance Returns ------- mu : np.array o...
def send_output_report(self, data): """Send input/output/feature report ID = report_id, data should be a c_ubyte object with included the required report data """ assert( self.is_opened() ) #make sure we have c_ubyte array storage if not ( isinstance(data, ctypes.Ar...
def function[send_output_report, parameter[self, data]]: constant[Send input/output/feature report ID = report_id, data should be a c_ubyte object with included the required report data ] assert[call[name[self].is_opened, parameter[]]] if <ast.UnaryOp object at 0x7da1b06bc5b0> begin[...
keyword[def] identifier[send_output_report] ( identifier[self] , identifier[data] ): literal[string] keyword[assert] ( identifier[self] . identifier[is_opened] ()) keyword[if] keyword[not] ( identifier[isinstance] ( identifier[data] , identifier[ctypes] . identifier[Array] ) ...
def send_output_report(self, data): """Send input/output/feature report ID = report_id, data should be a c_ubyte object with included the required report data """ assert self.is_opened() #make sure we have c_ubyte array storage if not (isinstance(data, ctypes.Array) and issubclass(data._typ...
def deserialize(data): """ Deserialize `data` to an exception instance. If the `exc_path` value matches an exception registered as ``deserializable``, return an instance of that exception type. Otherwise, return a `RemoteError` instance describing the exception that occurred. """ key = data...
def function[deserialize, parameter[data]]: constant[ Deserialize `data` to an exception instance. If the `exc_path` value matches an exception registered as ``deserializable``, return an instance of that exception type. Otherwise, return a `RemoteError` instance describing the exception that o...
keyword[def] identifier[deserialize] ( identifier[data] ): literal[string] identifier[key] = identifier[data] . identifier[get] ( literal[string] ) keyword[if] identifier[key] keyword[in] identifier[registry] : identifier[exc_args] = identifier[data] . identifier[get] ( literal[string] ,()...
def deserialize(data): """ Deserialize `data` to an exception instance. If the `exc_path` value matches an exception registered as ``deserializable``, return an instance of that exception type. Otherwise, return a `RemoteError` instance describing the exception that occurred. """ key = data...
def calc2dcoords(mol): """ Calculate optimal 2D coordinates of chemical structure """ topology.recognize(mol) g = set(i for i, _ in mol.atoms_iter()) # 1: get nodes in scaffolds scaffolds = [] belongs = {} for i, rkeys in enumerate(sorted(mol.scaffolds, key=len)): scf = [] ...
def function[calc2dcoords, parameter[mol]]: constant[ Calculate optimal 2D coordinates of chemical structure ] call[name[topology].recognize, parameter[name[mol]]] variable[g] assign[=] call[name[set], parameter[<ast.GeneratorExp object at 0x7da1b24e2290>]] variable[scaffolds] assign...
keyword[def] identifier[calc2dcoords] ( identifier[mol] ): literal[string] identifier[topology] . identifier[recognize] ( identifier[mol] ) identifier[g] = identifier[set] ( identifier[i] keyword[for] identifier[i] , identifier[_] keyword[in] identifier[mol] . identifier[atoms_iter] ()) ...
def calc2dcoords(mol): """ Calculate optimal 2D coordinates of chemical structure """ topology.recognize(mol) g = set((i for (i, _) in mol.atoms_iter())) # 1: get nodes in scaffolds scaffolds = [] belongs = {} for (i, rkeys) in enumerate(sorted(mol.scaffolds, key=len)): scf = [] ...
def tile_sprite(self, out_format="sprite.json", out_folder=None): """ This resource returns sprite image and metadata """ url = "{url}/resources/sprites/{f}".format(url=self._url, f=out_format) if out_folder is None: ...
def function[tile_sprite, parameter[self, out_format, out_folder]]: constant[ This resource returns sprite image and metadata ] variable[url] assign[=] call[constant[{url}/resources/sprites/{f}].format, parameter[]] if compare[name[out_folder] is constant[None]] begin[:] ...
keyword[def] identifier[tile_sprite] ( identifier[self] , identifier[out_format] = literal[string] , identifier[out_folder] = keyword[None] ): literal[string] identifier[url] = literal[string] . identifier[format] ( identifier[url] = identifier[self] . identifier[_url] , identifier[f] = id...
def tile_sprite(self, out_format='sprite.json', out_folder=None): """ This resource returns sprite image and metadata """ url = '{url}/resources/sprites/{f}'.format(url=self._url, f=out_format) if out_folder is None: out_folder = tempfile.gettempdir() # depends on [control=['if'], d...
def extract(self, file_obj, extractOnly=True, handler='update/extract', **kwargs): """ POSTs a file to the Solr ExtractingRequestHandler so rich content can be processed using Apache Tika. See the Solr wiki for details: http://wiki.apache.org/solr/ExtractingRequestHandler T...
def function[extract, parameter[self, file_obj, extractOnly, handler]]: constant[ POSTs a file to the Solr ExtractingRequestHandler so rich content can be processed using Apache Tika. See the Solr wiki for details: http://wiki.apache.org/solr/ExtractingRequestHandler The Ex...
keyword[def] identifier[extract] ( identifier[self] , identifier[file_obj] , identifier[extractOnly] = keyword[True] , identifier[handler] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[if] keyword[not] identifier[hasattr] ( identifier[file_obj] , literal[string] ): ...
def extract(self, file_obj, extractOnly=True, handler='update/extract', **kwargs): """ POSTs a file to the Solr ExtractingRequestHandler so rich content can be processed using Apache Tika. See the Solr wiki for details: http://wiki.apache.org/solr/ExtractingRequestHandler The E...
def dmstodd(self, dms): """ convert dms to dd""" size = len(dms) letters = 'WENS' is_annotated = False try: float(dms) except ValueError: for letter in letters: if letter in dms.upper(): is_annotated = True ...
def function[dmstodd, parameter[self, dms]]: constant[ convert dms to dd] variable[size] assign[=] call[name[len], parameter[name[dms]]] variable[letters] assign[=] constant[WENS] variable[is_annotated] assign[=] constant[False] <ast.Try object at 0x7da1b10e7010> variable[is_...
keyword[def] identifier[dmstodd] ( identifier[self] , identifier[dms] ): literal[string] identifier[size] = identifier[len] ( identifier[dms] ) identifier[letters] = literal[string] identifier[is_annotated] = keyword[False] keyword[try] : identifier[float]...
def dmstodd(self, dms): """ convert dms to dd""" size = len(dms) letters = 'WENS' is_annotated = False try: float(dms) # depends on [control=['try'], data=[]] except ValueError: for letter in letters: if letter in dms.upper(): is_annotated = True ...
def handle(self, *args, **options): """Command handle.""" verbosity = int(options['verbosity']) skip_mapping = options['skip_mapping'] if self.has_filter(options): self.filter_indices(options, verbosity, skip_mapping=skip_mapping) else: # Process all indi...
def function[handle, parameter[self]]: constant[Command handle.] variable[verbosity] assign[=] call[name[int], parameter[call[name[options]][constant[verbosity]]]] variable[skip_mapping] assign[=] call[name[options]][constant[skip_mapping]] if call[name[self].has_filter, parameter[name[o...
keyword[def] identifier[handle] ( identifier[self] ,* identifier[args] ,** identifier[options] ): literal[string] identifier[verbosity] = identifier[int] ( identifier[options] [ literal[string] ]) identifier[skip_mapping] = identifier[options] [ literal[string] ] keyword[if] ide...
def handle(self, *args, **options): """Command handle.""" verbosity = int(options['verbosity']) skip_mapping = options['skip_mapping'] if self.has_filter(options): self.filter_indices(options, verbosity, skip_mapping=skip_mapping) # depends on [control=['if'], data=[]] else: # Proce...
async def listen(self): """Listen for messages on the backwards channel. This method only returns when the connection has been closed due to an error. """ retries = 0 # Number of retries attempted so far need_new_sid = True # whether a new SID is needed while ...
<ast.AsyncFunctionDef object at 0x7da20c6c4880>
keyword[async] keyword[def] identifier[listen] ( identifier[self] ): literal[string] identifier[retries] = literal[int] identifier[need_new_sid] = keyword[True] keyword[while] identifier[retries] <= identifier[self] . identifier[_max_retries] : ...
async def listen(self): """Listen for messages on the backwards channel. This method only returns when the connection has been closed due to an error. """ retries = 0 # Number of retries attempted so far need_new_sid = True # whether a new SID is needed while retries <= self._...
def enrichment_score(gene_list, correl_vector, gene_set, weighted_score_type=1, nperm=1000, rs=np.random.RandomState(), single=False, scale=False): """This is the most important function of GSEApy. It has the same algorithm with GSEA and ssGSEA. :param gene_list: The ordered gene li...
def function[enrichment_score, parameter[gene_list, correl_vector, gene_set, weighted_score_type, nperm, rs, single, scale]]: constant[This is the most important function of GSEApy. It has the same algorithm with GSEA and ssGSEA. :param gene_list: The ordered gene list gene_name_list, rank_metric.ind...
keyword[def] identifier[enrichment_score] ( identifier[gene_list] , identifier[correl_vector] , identifier[gene_set] , identifier[weighted_score_type] = literal[int] , identifier[nperm] = literal[int] , identifier[rs] = identifier[np] . identifier[random] . identifier[RandomState] (), identifier[single] = keyword[Fa...
def enrichment_score(gene_list, correl_vector, gene_set, weighted_score_type=1, nperm=1000, rs=np.random.RandomState(), single=False, scale=False): """This is the most important function of GSEApy. It has the same algorithm with GSEA and ssGSEA. :param gene_list: The ordered gene list gene_name_list, ran...
def create_kubernetes_role(self, name, bound_service_account_names, bound_service_account_namespaces, ttl="", max_ttl="", period="", policies=None, mount_point='kubernetes'): """POST /auth/<mount_point>/role/:name :param name: Name of the role. :type name: str. ...
def function[create_kubernetes_role, parameter[self, name, bound_service_account_names, bound_service_account_namespaces, ttl, max_ttl, period, policies, mount_point]]: constant[POST /auth/<mount_point>/role/:name :param name: Name of the role. :type name: str. :param bound_service_acco...
keyword[def] identifier[create_kubernetes_role] ( identifier[self] , identifier[name] , identifier[bound_service_account_names] , identifier[bound_service_account_namespaces] , identifier[ttl] = literal[string] , identifier[max_ttl] = literal[string] , identifier[period] = literal[string] , identifier[policies] = ke...
def create_kubernetes_role(self, name, bound_service_account_names, bound_service_account_namespaces, ttl='', max_ttl='', period='', policies=None, mount_point='kubernetes'): """POST /auth/<mount_point>/role/:name :param name: Name of the role. :type name: str. :param bound_service_account_...
def device_time_str(self, resp, indent=" "): """Convenience to string method. """ time = resp.time uptime = resp.uptime downtime = resp.downtime time_s = datetime.datetime.utcfromtimestamp(time/1000000000) if time != None else None uptime_s = round(nanosec_to_hou...
def function[device_time_str, parameter[self, resp, indent]]: constant[Convenience to string method. ] variable[time] assign[=] name[resp].time variable[uptime] assign[=] name[resp].uptime variable[downtime] assign[=] name[resp].downtime variable[time_s] assign[=] <ast.If...
keyword[def] identifier[device_time_str] ( identifier[self] , identifier[resp] , identifier[indent] = literal[string] ): literal[string] identifier[time] = identifier[resp] . identifier[time] identifier[uptime] = identifier[resp] . identifier[uptime] identifier[downtime] = ident...
def device_time_str(self, resp, indent=' '): """Convenience to string method. """ time = resp.time uptime = resp.uptime downtime = resp.downtime time_s = datetime.datetime.utcfromtimestamp(time / 1000000000) if time != None else None uptime_s = round(nanosec_to_hours(uptime), 2) if upti...
def add_permute(self, name, dim, input_name, output_name): """ Add a permute layer. Assumes that the input has dimensions in the order [Seq, C, H, W] Parameters ---------- name: str The name of this layer. dim: tuple The order in which to permute ...
def function[add_permute, parameter[self, name, dim, input_name, output_name]]: constant[ Add a permute layer. Assumes that the input has dimensions in the order [Seq, C, H, W] Parameters ---------- name: str The name of this layer. dim: tuple The...
keyword[def] identifier[add_permute] ( identifier[self] , identifier[name] , identifier[dim] , identifier[input_name] , identifier[output_name] ): literal[string] identifier[spec] = identifier[self] . identifier[spec] identifier[nn_spec] = identifier[self] . identifier[nn_spec] ...
def add_permute(self, name, dim, input_name, output_name): """ Add a permute layer. Assumes that the input has dimensions in the order [Seq, C, H, W] Parameters ---------- name: str The name of this layer. dim: tuple The order in which to permute the ...
def dispatch_write(self, buf): """There is new stuff to write when possible""" if self.state != STATE_DEAD and self.enabled: super().dispatch_write(buf) return True return False
def function[dispatch_write, parameter[self, buf]]: constant[There is new stuff to write when possible] if <ast.BoolOp object at 0x7da20cabef50> begin[:] call[call[name[super], parameter[]].dispatch_write, parameter[name[buf]]] return[constant[True]] return[constant[False]]
keyword[def] identifier[dispatch_write] ( identifier[self] , identifier[buf] ): literal[string] keyword[if] identifier[self] . identifier[state] != identifier[STATE_DEAD] keyword[and] identifier[self] . identifier[enabled] : identifier[super] (). identifier[dispatch_write] ( identif...
def dispatch_write(self, buf): """There is new stuff to write when possible""" if self.state != STATE_DEAD and self.enabled: super().dispatch_write(buf) return True # depends on [control=['if'], data=[]] return False
def requireCompatibleAPI(): """If PyQt4's API should be configured to be compatible with PySide's (i.e. QString and QVariant should not be explicitly exported, cf. documentation of sip.setapi()), call this function to check that the PyQt4 was properly imported. (It will always be config...
def function[requireCompatibleAPI, parameter[]]: constant[If PyQt4's API should be configured to be compatible with PySide's (i.e. QString and QVariant should not be explicitly exported, cf. documentation of sip.setapi()), call this function to check that the PyQt4 was properly imported....
keyword[def] identifier[requireCompatibleAPI] (): literal[string] keyword[if] literal[string] keyword[in] identifier[sys] . identifier[modules] : keyword[import] identifier[sip] keyword[for] identifier[api] keyword[in] ( literal[string] , literal[string] ): ...
def requireCompatibleAPI(): """If PyQt4's API should be configured to be compatible with PySide's (i.e. QString and QVariant should not be explicitly exported, cf. documentation of sip.setapi()), call this function to check that the PyQt4 was properly imported. (It will always be configured...
def sample_conditional(self, y, t, size=1): """ Draw samples from the predictive conditional distribution. You must call :func:`GP.compute` before this function. :param y: ``(nsamples, )`` The observations to condition the model on. :param t: ``(ntest, )`` or ``(nte...
def function[sample_conditional, parameter[self, y, t, size]]: constant[ Draw samples from the predictive conditional distribution. You must call :func:`GP.compute` before this function. :param y: ``(nsamples, )`` The observations to condition the model on. :param t...
keyword[def] identifier[sample_conditional] ( identifier[self] , identifier[y] , identifier[t] , identifier[size] = literal[int] ): literal[string] identifier[mu] , identifier[cov] = identifier[self] . identifier[predict] ( identifier[y] , identifier[t] ) keyword[return] identifier[multiv...
def sample_conditional(self, y, t, size=1): """ Draw samples from the predictive conditional distribution. You must call :func:`GP.compute` before this function. :param y: ``(nsamples, )`` The observations to condition the model on. :param t: ``(ntest, )`` or ``(ntest, ...
def learn(self, msg, learnas): """Learn message as spam/ham or forget""" if not isinstance(learnas, types.StringTypes): raise SpamCError('The learnas option is invalid') if learnas.lower() == 'forget': resp = self.tell(msg, 'forget') else: resp = self....
def function[learn, parameter[self, msg, learnas]]: constant[Learn message as spam/ham or forget] if <ast.UnaryOp object at 0x7da1b0bb0610> begin[:] <ast.Raise object at 0x7da204566b60> if compare[call[name[learnas].lower, parameter[]] equal[==] constant[forget]] begin[:] ...
keyword[def] identifier[learn] ( identifier[self] , identifier[msg] , identifier[learnas] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[learnas] , identifier[types] . identifier[StringTypes] ): keyword[raise] identifier[SpamCError] ( literal[string]...
def learn(self, msg, learnas): """Learn message as spam/ham or forget""" if not isinstance(learnas, types.StringTypes): raise SpamCError('The learnas option is invalid') # depends on [control=['if'], data=[]] if learnas.lower() == 'forget': resp = self.tell(msg, 'forget') # depends on [con...
def time_range(self,flag=None): ''' time range of the current dataset :keyword flag: use a flag array to know the time range of an indexed slice of the object ''' if self.count==0: return [[None,None],[None,None]] if flag is None : return cnes_co...
def function[time_range, parameter[self, flag]]: constant[ time range of the current dataset :keyword flag: use a flag array to know the time range of an indexed slice of the object ] if compare[name[self].count equal[==] constant[0]] begin[:] return[list[[<ast.L...
keyword[def] identifier[time_range] ( identifier[self] , identifier[flag] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[count] == literal[int] : keyword[return] [[ keyword[None] , keyword[None] ],[ keyword[None] , keyword[None] ]] keyword[if] identifie...
def time_range(self, flag=None): """ time range of the current dataset :keyword flag: use a flag array to know the time range of an indexed slice of the object """ if self.count == 0: return [[None, None], [None, None]] # depends on [control=['if'], data=[]] if flag...
def pair_strings_sum_formatter(a, b): """ Formats the sum of a and b. Note ---- Both inputs are numbers already converted to strings. """ if b[:1] == "-": return "{0} - {1}".format(a, b[1:]) return "{0} + {1}".format(a, b)
def function[pair_strings_sum_formatter, parameter[a, b]]: constant[ Formats the sum of a and b. Note ---- Both inputs are numbers already converted to strings. ] if compare[call[name[b]][<ast.Slice object at 0x7da1b069a590>] equal[==] constant[-]] begin[:] return[call[constant[{0} -...
keyword[def] identifier[pair_strings_sum_formatter] ( identifier[a] , identifier[b] ): literal[string] keyword[if] identifier[b] [: literal[int] ]== literal[string] : keyword[return] literal[string] . identifier[format] ( identifier[a] , identifier[b] [ literal[int] :]) keyword[return] literal[strin...
def pair_strings_sum_formatter(a, b): """ Formats the sum of a and b. Note ---- Both inputs are numbers already converted to strings. """ if b[:1] == '-': return '{0} - {1}'.format(a, b[1:]) # depends on [control=['if'], data=[]] return '{0} + {1}'.format(a, b)
def uninstall(self, name: str, force: bool = False, noprune: bool = False ) -> None: """ Attempts to uninstall a given Docker image. Parameters: name: the name of the Docker image. force: a flag indi...
def function[uninstall, parameter[self, name, force, noprune]]: constant[ Attempts to uninstall a given Docker image. Parameters: name: the name of the Docker image. force: a flag indicating whether or not an exception should be thrown if the image associ...
keyword[def] identifier[uninstall] ( identifier[self] , identifier[name] : identifier[str] , identifier[force] : identifier[bool] = keyword[False] , identifier[noprune] : identifier[bool] = keyword[False] )-> keyword[None] : literal[string] keyword[try] : identifier[self] . identif...
def uninstall(self, name: str, force: bool=False, noprune: bool=False) -> None: """ Attempts to uninstall a given Docker image. Parameters: name: the name of the Docker image. force: a flag indicating whether or not an exception should be thrown if the image ...
def token(self, value): """ Set the Token of the message. :type value: String :param value: the Token :raise AttributeError: if value is longer than 256 """ if value is None: self._token = value return if not isinstance(value, str)...
def function[token, parameter[self, value]]: constant[ Set the Token of the message. :type value: String :param value: the Token :raise AttributeError: if value is longer than 256 ] if compare[name[value] is constant[None]] begin[:] name[self]._to...
keyword[def] identifier[token] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] keyword[is] keyword[None] : identifier[self] . identifier[_token] = identifier[value] keyword[return] keyword[if] keyword[not] identifier[...
def token(self, value): """ Set the Token of the message. :type value: String :param value: the Token :raise AttributeError: if value is longer than 256 """ if value is None: self._token = value return # depends on [control=['if'], data=['value']] if...
def _config_win32_domain(self, domain): """Configure a Domain registry entry.""" # we call str() on domain to convert it from unicode to ascii self.domain = dns.name.from_text(str(domain))
def function[_config_win32_domain, parameter[self, domain]]: constant[Configure a Domain registry entry.] name[self].domain assign[=] call[name[dns].name.from_text, parameter[call[name[str], parameter[name[domain]]]]]
keyword[def] identifier[_config_win32_domain] ( identifier[self] , identifier[domain] ): literal[string] identifier[self] . identifier[domain] = identifier[dns] . identifier[name] . identifier[from_text] ( identifier[str] ( identifier[domain] ))
def _config_win32_domain(self, domain): """Configure a Domain registry entry.""" # we call str() on domain to convert it from unicode to ascii self.domain = dns.name.from_text(str(domain))
def reads(text, fmt, as_version=4, **kwargs): """Read a notebook from a string""" fmt = copy(fmt) fmt = long_form_one_format(fmt) ext = fmt['extension'] if ext == '.ipynb': return nbformat.reads(text, as_version, **kwargs) format_name = read_format_from_metadata(text, ext) or fmt.get('...
def function[reads, parameter[text, fmt, as_version]]: constant[Read a notebook from a string] variable[fmt] assign[=] call[name[copy], parameter[name[fmt]]] variable[fmt] assign[=] call[name[long_form_one_format], parameter[name[fmt]]] variable[ext] assign[=] call[name[fmt]][constant[ex...
keyword[def] identifier[reads] ( identifier[text] , identifier[fmt] , identifier[as_version] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[fmt] = identifier[copy] ( identifier[fmt] ) identifier[fmt] = identifier[long_form_one_format] ( identifier[fmt] ) identifier[ext] = ide...
def reads(text, fmt, as_version=4, **kwargs): """Read a notebook from a string""" fmt = copy(fmt) fmt = long_form_one_format(fmt) ext = fmt['extension'] if ext == '.ipynb': return nbformat.reads(text, as_version, **kwargs) # depends on [control=['if'], data=[]] format_name = read_format...
def set_metadata(self, metadata_dict): """ Set the metadata on a dataset **metadata_dict**: A dictionary of metadata key-vals. Transforms this dict into an array of metadata objects for storage in the DB. """ if metadata_dict is None: ...
def function[set_metadata, parameter[self, metadata_dict]]: constant[ Set the metadata on a dataset **metadata_dict**: A dictionary of metadata key-vals. Transforms this dict into an array of metadata objects for storage in the DB. ] if compare[na...
keyword[def] identifier[set_metadata] ( identifier[self] , identifier[metadata_dict] ): literal[string] keyword[if] identifier[metadata_dict] keyword[is] keyword[None] : keyword[return] identifier[existing_metadata] =[] keyword[for] identifier[m] keyword[in] i...
def set_metadata(self, metadata_dict): """ Set the metadata on a dataset **metadata_dict**: A dictionary of metadata key-vals. Transforms this dict into an array of metadata objects for storage in the DB. """ if metadata_dict is None: return # de...
def add(self, id, obj, criteria={}, force=False, _check_id=True): """ Add a :class:`Component <cqparts.Component>` instance to the database. :param id: unique id of entry, can be anything :type id: :class:`str` :param obj: component to be serialized, then added to the catalogue ...
def function[add, parameter[self, id, obj, criteria, force, _check_id]]: constant[ Add a :class:`Component <cqparts.Component>` instance to the database. :param id: unique id of entry, can be anything :type id: :class:`str` :param obj: component to be serialized, then added to t...
keyword[def] identifier[add] ( identifier[self] , identifier[id] , identifier[obj] , identifier[criteria] ={}, identifier[force] = keyword[False] , identifier[_check_id] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[isinstance] ( identifier[obj] , identifier[Comp...
def add(self, id, obj, criteria={}, force=False, _check_id=True): """ Add a :class:`Component <cqparts.Component>` instance to the database. :param id: unique id of entry, can be anything :type id: :class:`str` :param obj: component to be serialized, then added to the catalogue ...
def _format_param_value(key, value): """Wraps string values in quotes, and returns as 'key=value'. """ if isinstance(value, str): value = "'{}'".format(value) return "{}={}".format(key, value)
def function[_format_param_value, parameter[key, value]]: constant[Wraps string values in quotes, and returns as 'key=value'. ] if call[name[isinstance], parameter[name[value], name[str]]] begin[:] variable[value] assign[=] call[constant['{}'].format, parameter[name[value]]] retu...
keyword[def] identifier[_format_param_value] ( identifier[key] , identifier[value] ): literal[string] keyword[if] identifier[isinstance] ( identifier[value] , identifier[str] ): identifier[value] = literal[string] . identifier[format] ( identifier[value] ) keyword[return] literal[string] . ...
def _format_param_value(key, value): """Wraps string values in quotes, and returns as 'key=value'. """ if isinstance(value, str): value = "'{}'".format(value) # depends on [control=['if'], data=[]] return '{}={}'.format(key, value)
def getinputfile(self, outputfile, loadmetadata=True, client=None,requiremetadata=False): """Grabs one input file for the specified output filename (raises a KeyError exception if there is no such output, StopIteration if there are no input files for it). Shortcut for getinputfiles()""" if isinstance(ou...
def function[getinputfile, parameter[self, outputfile, loadmetadata, client, requiremetadata]]: constant[Grabs one input file for the specified output filename (raises a KeyError exception if there is no such output, StopIteration if there are no input files for it). Shortcut for getinputfiles()] if cal...
keyword[def] identifier[getinputfile] ( identifier[self] , identifier[outputfile] , identifier[loadmetadata] = keyword[True] , identifier[client] = keyword[None] , identifier[requiremetadata] = keyword[False] ): literal[string] keyword[if] identifier[isinstance] ( identifier[outputfile] , identifi...
def getinputfile(self, outputfile, loadmetadata=True, client=None, requiremetadata=False): """Grabs one input file for the specified output filename (raises a KeyError exception if there is no such output, StopIteration if there are no input files for it). Shortcut for getinputfiles()""" if isinstance(outputfil...
def switch_keystone_provider(request, keystone_provider=None, redirect_field_name=auth.REDIRECT_FIELD_NAME): """Switches the user's keystone provider using K2K Federation If keystone_provider is given then we switch the user to the keystone provider using K2K federation. Otherw...
def function[switch_keystone_provider, parameter[request, keystone_provider, redirect_field_name]]: constant[Switches the user's keystone provider using K2K Federation If keystone_provider is given then we switch the user to the keystone provider using K2K federation. Otherwise if keystone_provider ...
keyword[def] identifier[switch_keystone_provider] ( identifier[request] , identifier[keystone_provider] = keyword[None] , identifier[redirect_field_name] = identifier[auth] . identifier[REDIRECT_FIELD_NAME] ): literal[string] identifier[base_token] = identifier[request] . identifier[session] . identifier[...
def switch_keystone_provider(request, keystone_provider=None, redirect_field_name=auth.REDIRECT_FIELD_NAME): """Switches the user's keystone provider using K2K Federation If keystone_provider is given then we switch the user to the keystone provider using K2K federation. Otherwise if keystone_provider ...
def rating_count(obj): """ Total amount of users who have submitted a positive rating for this object. Usage: {% rating_count obj %} """ count = Rating.objects.filter( object_id=obj.pk, content_type=ContentType.objects.get_for_model(obj), ).exclude(rating=0).count() ...
def function[rating_count, parameter[obj]]: constant[ Total amount of users who have submitted a positive rating for this object. Usage: {% rating_count obj %} ] variable[count] assign[=] call[call[call[name[Rating].objects.filter, parameter[]].exclude, parameter[]].count, parameter...
keyword[def] identifier[rating_count] ( identifier[obj] ): literal[string] identifier[count] = identifier[Rating] . identifier[objects] . identifier[filter] ( identifier[object_id] = identifier[obj] . identifier[pk] , identifier[content_type] = identifier[ContentType] . identifier[objects] . iden...
def rating_count(obj): """ Total amount of users who have submitted a positive rating for this object. Usage: {% rating_count obj %} """ count = Rating.objects.filter(object_id=obj.pk, content_type=ContentType.objects.get_for_model(obj)).exclude(rating=0).count() return count
async def text(self, *, encoding: Optional[str]=None) -> str: """Like read(), but assumes that body part contains text data.""" data = await self.read(decode=True) # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA # and https://dvcs.w3.org/hg/xhr/...
<ast.AsyncFunctionDef object at 0x7da1b1f75210>
keyword[async] keyword[def] identifier[text] ( identifier[self] ,*, identifier[encoding] : identifier[Optional] [ identifier[str] ]= keyword[None] )-> identifier[str] : literal[string] identifier[data] = keyword[await] identifier[self] . identifier[read] ( identifier[decode] = keyword[True] ) ...
async def text(self, *, encoding: Optional[str]=None) -> str: """Like read(), but assumes that body part contains text data.""" data = await self.read(decode=True) # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Ove...
def handle_cmd(self, command, application): """Handle running a given dot command from a user. :type command: str :param command: The full dot command string, e.g. ``.edit``, of ``.profile prod``. :type application: AWSShell :param application: The application objec...
def function[handle_cmd, parameter[self, command, application]]: constant[Handle running a given dot command from a user. :type command: str :param command: The full dot command string, e.g. ``.edit``, of ``.profile prod``. :type application: AWSShell :param applica...
keyword[def] identifier[handle_cmd] ( identifier[self] , identifier[command] , identifier[application] ): literal[string] identifier[parts] = identifier[command] . identifier[split] () identifier[cmd_name] = identifier[parts] [ literal[int] ][ literal[int] :] keyword[if] identifi...
def handle_cmd(self, command, application): """Handle running a given dot command from a user. :type command: str :param command: The full dot command string, e.g. ``.edit``, of ``.profile prod``. :type application: AWSShell :param application: The application object. ...
def flush_pending(function): """Attempt to acquire any pending locks. """ s = boto3.Session() client = s.client('lambda') results = client.invoke( FunctionName=function, Payload=json.dumps({'detail-type': 'Scheduled Event'}) ) content = results.pop('Payload').read() pprin...
def function[flush_pending, parameter[function]]: constant[Attempt to acquire any pending locks. ] variable[s] assign[=] call[name[boto3].Session, parameter[]] variable[client] assign[=] call[name[s].client, parameter[constant[lambda]]] variable[results] assign[=] call[name[client].i...
keyword[def] identifier[flush_pending] ( identifier[function] ): literal[string] identifier[s] = identifier[boto3] . identifier[Session] () identifier[client] = identifier[s] . identifier[client] ( literal[string] ) identifier[results] = identifier[client] . identifier[invoke] ( identifier[F...
def flush_pending(function): """Attempt to acquire any pending locks. """ s = boto3.Session() client = s.client('lambda') results = client.invoke(FunctionName=function, Payload=json.dumps({'detail-type': 'Scheduled Event'})) content = results.pop('Payload').read() pprint.pprint(results) ...
def _iter_keys(key): """! Iterate over subkeys of a key """ for i in range(winreg.QueryInfoKey(key)[0]): yield winreg.OpenKey(key, winreg.EnumKey(key, i))
def function[_iter_keys, parameter[key]]: constant[! Iterate over subkeys of a key ] for taget[name[i]] in starred[call[name[range], parameter[call[call[name[winreg].QueryInfoKey, parameter[name[key]]]][constant[0]]]]] begin[:] <ast.Yield object at 0x7da18ede5570>
keyword[def] identifier[_iter_keys] ( identifier[key] ): literal[string] keyword[for] identifier[i] keyword[in] identifier[range] ( identifier[winreg] . identifier[QueryInfoKey] ( identifier[key] )[ literal[int] ]): keyword[yield] identifier[winreg] . identifier[OpenKey] ( identifier[key] , id...
def _iter_keys(key): """! Iterate over subkeys of a key """ for i in range(winreg.QueryInfoKey(key)[0]): yield winreg.OpenKey(key, winreg.EnumKey(key, i)) # depends on [control=['for'], data=['i']]
def setup_interpreter(distributions, interpreter=None): """Return an interpreter configured with vendored distributions as extras. Any distributions that are present in the vendored set will be added to the interpreter as extras. :param distributions: The names of distributions to setup the interpreter with. ...
def function[setup_interpreter, parameter[distributions, interpreter]]: constant[Return an interpreter configured with vendored distributions as extras. Any distributions that are present in the vendored set will be added to the interpreter as extras. :param distributions: The names of distributions to se...
keyword[def] identifier[setup_interpreter] ( identifier[distributions] , identifier[interpreter] = keyword[None] ): literal[string] keyword[from] identifier[pex] . identifier[interpreter] keyword[import] identifier[PythonInterpreter] identifier[interpreter] = identifier[interpreter] keyword[or] ident...
def setup_interpreter(distributions, interpreter=None): """Return an interpreter configured with vendored distributions as extras. Any distributions that are present in the vendored set will be added to the interpreter as extras. :param distributions: The names of distributions to setup the interpreter with. ...
def load(): """Read data from a text file on disk.""" # Get the data file relative to this file's location... datadir = os.path.dirname(__file__) filename = os.path.join(datadir, 'angelier_data.txt') data = [] with open(filename, 'r') as infile: for line in infile: # Skip co...
def function[load, parameter[]]: constant[Read data from a text file on disk.] variable[datadir] assign[=] call[name[os].path.dirname, parameter[name[__file__]]] variable[filename] assign[=] call[name[os].path.join, parameter[name[datadir], constant[angelier_data.txt]]] variable[data] as...
keyword[def] identifier[load] (): literal[string] identifier[datadir] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[__file__] ) identifier[filename] = identifier[os] . identifier[path] . identifier[join] ( identifier[datadir] , literal[string] ) identifier[data] =[]...
def load(): """Read data from a text file on disk.""" # Get the data file relative to this file's location... datadir = os.path.dirname(__file__) filename = os.path.join(datadir, 'angelier_data.txt') data = [] with open(filename, 'r') as infile: for line in infile: # Skip com...
def page_prev(self): """Go to the previous page.""" window_start = (self.parent.value('window_start') - self.parent.value('window_length')) if window_start < 0: return self.parent.overview.update_position(window_start)
def function[page_prev, parameter[self]]: constant[Go to the previous page.] variable[window_start] assign[=] binary_operation[call[name[self].parent.value, parameter[constant[window_start]]] - call[name[self].parent.value, parameter[constant[window_length]]]] if compare[name[window_start] less[...
keyword[def] identifier[page_prev] ( identifier[self] ): literal[string] identifier[window_start] =( identifier[self] . identifier[parent] . identifier[value] ( literal[string] )- identifier[self] . identifier[parent] . identifier[value] ( literal[string] )) keyword[if] identifie...
def page_prev(self): """Go to the previous page.""" window_start = self.parent.value('window_start') - self.parent.value('window_length') if window_start < 0: return # depends on [control=['if'], data=[]] self.parent.overview.update_position(window_start)
def cut_range(string): """ A custom argparse 'type' to deal with sequences ranges such as 5:500. Returns a 0-based slice corresponding to the selection defined by the slice """ value_range = string.split(':') if len(value_range) == 1: start = int(value_range[0]) stop = start ...
def function[cut_range, parameter[string]]: constant[ A custom argparse 'type' to deal with sequences ranges such as 5:500. Returns a 0-based slice corresponding to the selection defined by the slice ] variable[value_range] assign[=] call[name[string].split, parameter[constant[:]]] ...
keyword[def] identifier[cut_range] ( identifier[string] ): literal[string] identifier[value_range] = identifier[string] . identifier[split] ( literal[string] ) keyword[if] identifier[len] ( identifier[value_range] )== literal[int] : identifier[start] = identifier[int] ( identifier[value_rang...
def cut_range(string): """ A custom argparse 'type' to deal with sequences ranges such as 5:500. Returns a 0-based slice corresponding to the selection defined by the slice """ value_range = string.split(':') if len(value_range) == 1: start = int(value_range[0]) stop = start # ...
def node_from_ini(ini_file, nodefactory=Node, root_name='ini'): """ Convert a .ini file into a Node object. :param ini_file: a filename or a file like object in read mode """ fileobj = open(ini_file) if isinstance(ini_file, str) else ini_file cfp = configparser.RawConfigParser() cfp.read_fi...
def function[node_from_ini, parameter[ini_file, nodefactory, root_name]]: constant[ Convert a .ini file into a Node object. :param ini_file: a filename or a file like object in read mode ] variable[fileobj] assign[=] <ast.IfExp object at 0x7da207f02da0> variable[cfp] assign[=] call[...
keyword[def] identifier[node_from_ini] ( identifier[ini_file] , identifier[nodefactory] = identifier[Node] , identifier[root_name] = literal[string] ): literal[string] identifier[fileobj] = identifier[open] ( identifier[ini_file] ) keyword[if] identifier[isinstance] ( identifier[ini_file] , identifier[str...
def node_from_ini(ini_file, nodefactory=Node, root_name='ini'): """ Convert a .ini file into a Node object. :param ini_file: a filename or a file like object in read mode """ fileobj = open(ini_file) if isinstance(ini_file, str) else ini_file cfp = configparser.RawConfigParser() cfp.read_fi...
def vee_map(skew): """Return the vee map of a vector """ vec = 1/2 * np.array([skew[2,1] - skew[1,2], skew[0,2] - skew[2,0], skew[1,0] - skew[0,1]]) return vec
def function[vee_map, parameter[skew]]: constant[Return the vee map of a vector ] variable[vec] assign[=] binary_operation[binary_operation[constant[1] / constant[2]] * call[name[np].array, parameter[list[[<ast.BinOp object at 0x7da1b1a77c10>, <ast.BinOp object at 0x7da1b1b0d2d0>, <ast.BinOp object...
keyword[def] identifier[vee_map] ( identifier[skew] ): literal[string] identifier[vec] = literal[int] / literal[int] * identifier[np] . identifier[array] ([ identifier[skew] [ literal[int] , literal[int] ]- identifier[skew] [ literal[int] , literal[int] ], identifier[skew] [ literal[int] , literal[in...
def vee_map(skew): """Return the vee map of a vector """ vec = 1 / 2 * np.array([skew[2, 1] - skew[1, 2], skew[0, 2] - skew[2, 0], skew[1, 0] - skew[0, 1]]) return vec
def find_duplicates(filenames, max_size): """Find duplicates in a list of files, comparing up to `max_size` bytes. Returns a 2-tuple of two values: ``(duplicate_groups, errors)``. `duplicate_groups` is a (possibly empty) list of lists: the names of files that have at least two copies, grouped together...
def function[find_duplicates, parameter[filenames, max_size]]: constant[Find duplicates in a list of files, comparing up to `max_size` bytes. Returns a 2-tuple of two values: ``(duplicate_groups, errors)``. `duplicate_groups` is a (possibly empty) list of lists: the names of files that have at lea...
keyword[def] identifier[find_duplicates] ( identifier[filenames] , identifier[max_size] ): literal[string] identifier[errors] =[] keyword[if] identifier[len] ( identifier[filenames] )< literal[int] : keyword[return] [], identifier[errors] keyword[if] identifier[max_siz...
def find_duplicates(filenames, max_size): """Find duplicates in a list of files, comparing up to `max_size` bytes. Returns a 2-tuple of two values: ``(duplicate_groups, errors)``. `duplicate_groups` is a (possibly empty) list of lists: the names of files that have at least two copies, grouped together...
def matches(self, stream): """Check if this selector matches the given stream Args: stream (DataStream): The stream to check Returns: bool: True if this selector matches the stream """ if self.match_type != stream.stream_type: return False ...
def function[matches, parameter[self, stream]]: constant[Check if this selector matches the given stream Args: stream (DataStream): The stream to check Returns: bool: True if this selector matches the stream ] if compare[name[self].match_type not_equal[!...
keyword[def] identifier[matches] ( identifier[self] , identifier[stream] ): literal[string] keyword[if] identifier[self] . identifier[match_type] != identifier[stream] . identifier[stream_type] : keyword[return] keyword[False] keyword[if] identifier[self] . identifier[ma...
def matches(self, stream): """Check if this selector matches the given stream Args: stream (DataStream): The stream to check Returns: bool: True if this selector matches the stream """ if self.match_type != stream.stream_type: return False # depends on ...
def delay(self, methodname, *args, **kwargs): """调用但不要求返回结果,而是通过系统方法getresult来获取. Parameters: methodname (str): - 要调用的方法名 args (Any): - 要调用的方法的位置参数 kwargs (Any): - 要调用的方法的关键字参数 """ ID = str(uuid.uuid4()) self.send_query(ID, methodname, False,...
def function[delay, parameter[self, methodname]]: constant[调用但不要求返回结果,而是通过系统方法getresult来获取. Parameters: methodname (str): - 要调用的方法名 args (Any): - 要调用的方法的位置参数 kwargs (Any): - 要调用的方法的关键字参数 ] variable[ID] assign[=] call[name[str], parameter[call[name[uu...
keyword[def] identifier[delay] ( identifier[self] , identifier[methodname] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[ID] = identifier[str] ( identifier[uuid] . identifier[uuid4] ()) identifier[self] . identifier[send_query] ( identifier[ID] , identifier[metho...
def delay(self, methodname, *args, **kwargs): """调用但不要求返回结果,而是通过系统方法getresult来获取. Parameters: methodname (str): - 要调用的方法名 args (Any): - 要调用的方法的位置参数 kwargs (Any): - 要调用的方法的关键字参数 """ ID = str(uuid.uuid4()) self.send_query(ID, methodname, False, *args, **kw...
def individual_dict(self, ind_ids): """Return a dict with ind_id as key and Individual as values.""" ind_dict = {ind.ind_id: ind for ind in self.individuals(ind_ids=ind_ids)} return ind_dict
def function[individual_dict, parameter[self, ind_ids]]: constant[Return a dict with ind_id as key and Individual as values.] variable[ind_dict] assign[=] <ast.DictComp object at 0x7da2044c1a80> return[name[ind_dict]]
keyword[def] identifier[individual_dict] ( identifier[self] , identifier[ind_ids] ): literal[string] identifier[ind_dict] ={ identifier[ind] . identifier[ind_id] : identifier[ind] keyword[for] identifier[ind] keyword[in] identifier[self] . identifier[individuals] ( identifier[ind_ids] = identif...
def individual_dict(self, ind_ids): """Return a dict with ind_id as key and Individual as values.""" ind_dict = {ind.ind_id: ind for ind in self.individuals(ind_ids=ind_ids)} return ind_dict
def is_collection(self, path, environ): """Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first. """ res = self.get_resource_inst(path, envir...
def function[is_collection, parameter[self, path, environ]]: constant[Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first. ] variable[res] a...
keyword[def] identifier[is_collection] ( identifier[self] , identifier[path] , identifier[environ] ): literal[string] identifier[res] = identifier[self] . identifier[get_resource_inst] ( identifier[path] , identifier[environ] ) keyword[return] identifier[res] keyword[and] identifier[res...
def is_collection(self, path, environ): """Return True, if path maps to an existing collection resource. This method should only be used, if no other information is queried for <path>. Otherwise a _DAVResource should be created first. """ res = self.get_resource_inst(path, environ) ...
def entity_type(self, entity_type): """Sets the entity_type of this SavedSearch. The Wavefront entity type over which to search # noqa: E501 :param entity_type: The entity_type of this SavedSearch. # noqa: E501 :type: str """ if entity_type is None: raise ...
def function[entity_type, parameter[self, entity_type]]: constant[Sets the entity_type of this SavedSearch. The Wavefront entity type over which to search # noqa: E501 :param entity_type: The entity_type of this SavedSearch. # noqa: E501 :type: str ] if compare[name[e...
keyword[def] identifier[entity_type] ( identifier[self] , identifier[entity_type] ): literal[string] keyword[if] identifier[entity_type] keyword[is] keyword[None] : keyword[raise] identifier[ValueError] ( literal[string] ) identifier[allowed_values] =[ literal[string] , li...
def entity_type(self, entity_type): """Sets the entity_type of this SavedSearch. The Wavefront entity type over which to search # noqa: E501 :param entity_type: The entity_type of this SavedSearch. # noqa: E501 :type: str """ if entity_type is None: raise ValueError('...
def reset_tip_tracking(self): """ Resets the :any:`Pipette` tip tracking, "refilling" the tip racks """ self.current_tip(None) self.tip_rack_iter = iter([]) if self.has_tip_rack(): iterables = self.tip_racks if self.channels > 1: ...
def function[reset_tip_tracking, parameter[self]]: constant[ Resets the :any:`Pipette` tip tracking, "refilling" the tip racks ] call[name[self].current_tip, parameter[constant[None]]] name[self].tip_rack_iter assign[=] call[name[iter], parameter[list[[]]]] if call[name[s...
keyword[def] identifier[reset_tip_tracking] ( identifier[self] ): literal[string] identifier[self] . identifier[current_tip] ( keyword[None] ) identifier[self] . identifier[tip_rack_iter] = identifier[iter] ([]) keyword[if] identifier[self] . identifier[has_tip_rack] (): ...
def reset_tip_tracking(self): """ Resets the :any:`Pipette` tip tracking, "refilling" the tip racks """ self.current_tip(None) self.tip_rack_iter = iter([]) if self.has_tip_rack(): iterables = self.tip_racks if self.channels > 1: iterables = [c for rack in sel...
def loader(schema, validator=CerberusValidator, update=None): """Create a load function based on schema dict and Validator class. :param schema: a Cerberus schema dict. :param validator: the validator class which must be a subclass of more.cerberus.CerberusValidator which is the default. :param...
def function[loader, parameter[schema, validator, update]]: constant[Create a load function based on schema dict and Validator class. :param schema: a Cerberus schema dict. :param validator: the validator class which must be a subclass of more.cerberus.CerberusValidator which is the default. ...
keyword[def] identifier[loader] ( identifier[schema] , identifier[validator] = identifier[CerberusValidator] , identifier[update] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[issubclass] ( identifier[validator] , identifier[CerberusValidator] ): keyword[raise] identifi...
def loader(schema, validator=CerberusValidator, update=None): """Create a load function based on schema dict and Validator class. :param schema: a Cerberus schema dict. :param validator: the validator class which must be a subclass of more.cerberus.CerberusValidator which is the default. :param...