code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def get_albums(self, limit=None): """ Return a list of the user's albums. Secret and hidden albums are only returned if this is the logged-in user. """ url = (self._imgur._base_url + "/3/account/{0}/albums/{1}".format(self.name, ...
Return a list of the user's albums. Secret and hidden albums are only returned if this is the logged-in user.
Below is the the instruction that describes the task: ### Input: Return a list of the user's albums. Secret and hidden albums are only returned if this is the logged-in user. ### Response: def get_albums(self, limit=None): """ Return a list of the user's albums. Secret a...
def make_line_segments(x, y, ispath=True): """ Return an (n x 2 x 2) array of n line segments Parameters ---------- x : array-like x points y : array-like y points ispath : bool If True, the points represent a path from one point to the next until the last. I...
Return an (n x 2 x 2) array of n line segments Parameters ---------- x : array-like x points y : array-like y points ispath : bool If True, the points represent a path from one point to the next until the last. If False, then each pair of successive(even-odd ...
Below is the the instruction that describes the task: ### Input: Return an (n x 2 x 2) array of n line segments Parameters ---------- x : array-like x points y : array-like y points ispath : bool If True, the points represent a path from one point to the next unt...
def calc_geo_branches_in_polygon(mv_grid, polygon, mode, proj): """ Calculate geographical branches in polygon. For a given `mv_grid` all branches (edges in the graph of the grid) are tested if they are in the given `polygon`. You can choose different modes and projections for this operation. Para...
Calculate geographical branches in polygon. For a given `mv_grid` all branches (edges in the graph of the grid) are tested if they are in the given `polygon`. You can choose different modes and projections for this operation. Parameters ---------- mv_grid : MVGridDing0 MV Grid object. ...
Below is the the instruction that describes the task: ### Input: Calculate geographical branches in polygon. For a given `mv_grid` all branches (edges in the graph of the grid) are tested if they are in the given `polygon`. You can choose different modes and projections for this operation. Paramet...
def download(supported_tags, date_array, tag, sat_id, ftp_site='cdaweb.gsfc.nasa.gov', data_path=None, user=None, password=None, fake_daily_files_from_monthly=False): """Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrumen...
Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset. Parameters ----------- supported_tags : dict dict of dicts. Keys are supported tag names for download. Value is a dict with 'd...
Below is the the instruction that describes the task: ### Input: Routine to download NASA CDAWeb CDF data. This routine is intended to be used by pysat instrument modules supporting a particular NASA CDAWeb dataset. Parameters ----------- supported_tags : dict dict of dicts. Keys a...
def weighted_random_choice(items): """ Returns a weighted random choice from a list of items. :param items: A list of tuples (object, weight) :return: A random object, whose likelihood is proportional to its weight. """ l = list(items) r = random.random() * sum([i[1] for i in l]) for x, ...
Returns a weighted random choice from a list of items. :param items: A list of tuples (object, weight) :return: A random object, whose likelihood is proportional to its weight.
Below is the the instruction that describes the task: ### Input: Returns a weighted random choice from a list of items. :param items: A list of tuples (object, weight) :return: A random object, whose likelihood is proportional to its weight. ### Response: def weighted_random_choice(items): """ Retu...
def merge(revision, branch_label, message, list_revisions=''): """ Merge two revision together, create new revision file """ alembic_command.merge( config=get_config(), revisions=list_revisions, message=message, branch_label=branch_label, rev_id=revision )
Merge two revision together, create new revision file
Below is the the instruction that describes the task: ### Input: Merge two revision together, create new revision file ### Response: def merge(revision, branch_label, message, list_revisions=''): """ Merge two revision together, create new revision file """ alembic_command.merge( config=get_config(...
def get_dependants(cls, dist): """Yield dependant user packages for a given package name.""" for package in cls.installed_distributions: for requirement_package in package.requires(): requirement_name = requirement_package.project_name # perform case-insensiti...
Yield dependant user packages for a given package name.
Below is the the instruction that describes the task: ### Input: Yield dependant user packages for a given package name. ### Response: def get_dependants(cls, dist): """Yield dependant user packages for a given package name.""" for package in cls.installed_distributions: for requirement...
def _cleanup_resourceprovider(self): """ Calls cleanup for ResourceProvider of this run. :return: Nothing """ # Disable too broad exception warning # pylint: disable=W0703 self.resourceprovider = ResourceProvider(self.args) try: self.resourcep...
Calls cleanup for ResourceProvider of this run. :return: Nothing
Below is the the instruction that describes the task: ### Input: Calls cleanup for ResourceProvider of this run. :return: Nothing ### Response: def _cleanup_resourceprovider(self): """ Calls cleanup for ResourceProvider of this run. :return: Nothing """ # Disable t...
def quit_all(editor, force=False): """ Quit all. """ quit(editor, all_=True, force=force)
Quit all.
Below is the the instruction that describes the task: ### Input: Quit all. ### Response: def quit_all(editor, force=False): """ Quit all. """ quit(editor, all_=True, force=force)
def get_ps(self, field_name, wait_pstate=True): """Get property from PersonaState `See full list of available fields_names <https://github.com/ValvePython/steam/blob/fa8a5127e9bb23185483930da0b6ae85e93055a7/protobufs/steammessages_clientserver_friends.proto#L125-L153>`_ """ if not wait_...
Get property from PersonaState `See full list of available fields_names <https://github.com/ValvePython/steam/blob/fa8a5127e9bb23185483930da0b6ae85e93055a7/protobufs/steammessages_clientserver_friends.proto#L125-L153>`_
Below is the the instruction that describes the task: ### Input: Get property from PersonaState `See full list of available fields_names <https://github.com/ValvePython/steam/blob/fa8a5127e9bb23185483930da0b6ae85e93055a7/protobufs/steammessages_clientserver_friends.proto#L125-L153>`_ ### Response: def get...
def all(cls, path=''): """Return all ocurrences of the item.""" url = urljoin(cls._meta.base_url, path) pq_items = cls._get_items(url=url, **cls._meta._pyquery_kwargs) return [cls(item=i) for i in pq_items.items()]
Return all ocurrences of the item.
Below is the the instruction that describes the task: ### Input: Return all ocurrences of the item. ### Response: def all(cls, path=''): """Return all ocurrences of the item.""" url = urljoin(cls._meta.base_url, path) pq_items = cls._get_items(url=url, **cls._meta._pyquery_kwargs) r...
def remove_artf_evts(times, annot, chan=None, min_dur=0.1): """Correct times to remove events marked 'Artefact'. Parameters ---------- times : list of tuple of float the start and end times of each segment annot : instance of Annotations the annotation file containing events and epo...
Correct times to remove events marked 'Artefact'. Parameters ---------- times : list of tuple of float the start and end times of each segment annot : instance of Annotations the annotation file containing events and epochs chan : str, optional full name of channel on which ...
Below is the the instruction that describes the task: ### Input: Correct times to remove events marked 'Artefact'. Parameters ---------- times : list of tuple of float the start and end times of each segment annot : instance of Annotations the annotation file containing events and e...
def get_transport(name): ''' Return the transport class. ''' try: log.debug('Using %s as transport', name) return TRANSPORT_LOOKUP[name] except KeyError: msg = 'Transport {} is not available. Are the dependencies installed?'.format(name) log.error(msg, exc_info=True) ...
Return the transport class.
Below is the the instruction that describes the task: ### Input: Return the transport class. ### Response: def get_transport(name): ''' Return the transport class. ''' try: log.debug('Using %s as transport', name) return TRANSPORT_LOOKUP[name] except KeyError: msg = 'Tra...
def log(self, *args): """Log a log message. Used for debugging recurring events.""" if _canShortcutLogging(self.logCategory, LOG): return logObject(self.logObjectName(), self.logCategory, *self.logFunction(*args))
Log a log message. Used for debugging recurring events.
Below is the the instruction that describes the task: ### Input: Log a log message. Used for debugging recurring events. ### Response: def log(self, *args): """Log a log message. Used for debugging recurring events.""" if _canShortcutLogging(self.logCategory, LOG): return logO...
def split_path(path, ref=None): """ Split a path into its components. Parameters ---------- path : str absolute or relative path with respect to `ref` ref : str or None reference path if `path` is relative Returns ------- list : str components of the path ...
Split a path into its components. Parameters ---------- path : str absolute or relative path with respect to `ref` ref : str or None reference path if `path` is relative Returns ------- list : str components of the path
Below is the the instruction that describes the task: ### Input: Split a path into its components. Parameters ---------- path : str absolute or relative path with respect to `ref` ref : str or None reference path if `path` is relative Returns ------- list : str ...
def explainParam(self, param): """ Explains a single param and returns its name, doc, and optional default value and user-supplied value in a string. """ param = self._resolveParam(param) values = [] if self.isDefined(param): if param in self._defaultP...
Explains a single param and returns its name, doc, and optional default value and user-supplied value in a string.
Below is the the instruction that describes the task: ### Input: Explains a single param and returns its name, doc, and optional default value and user-supplied value in a string. ### Response: def explainParam(self, param): """ Explains a single param and returns its name, doc, and optiona...
def topological_sort(dependencies, start_nodes): """ Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`. """ retval = [] def edges(node): return dependencies[node][1] def in_degree(node): return dependencies[node][0] def remove_incoming(no...
Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`.
Below is the the instruction that describes the task: ### Input: Perform a topological sort on the dependency graph `dependencies`, starting from list `start_nodes`. ### Response: def topological_sort(dependencies, start_nodes): """ Perform a topological sort on the dependency graph `dependencies`, sta...
def __compose(self): """ Compose the message, pulling together body, attachments etc """ msg = MIMEMultipart() msg['Subject'] = self.config['shutit.core.alerting.emailer.subject'] msg['To'] = self.config['shutit.core.alerting.emailer.mailto'] msg['From'] = self.config['shutit.core.alerting.emailer....
Compose the message, pulling together body, attachments etc
Below is the the instruction that describes the task: ### Input: Compose the message, pulling together body, attachments etc ### Response: def __compose(self): """ Compose the message, pulling together body, attachments etc """ msg = MIMEMultipart() msg['Subject'] = self.config['shutit.core.alerting.email...
def _expand_options(cls, options, backend=None): """ Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) retu...
Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) returns {'Image': {'plot': dict(show_title=False), 'style': ...
Below is the the instruction that describes the task: ### Input: Validates and expands a dictionaries of options indexed by type[.group][.label] keys into separate style, plot, norm and output options. opts._expand_options({'Image': dict(cmap='viridis', show_title=False)}) retu...
def indent(self, space=4): '''Return an indented Newick string, just like ``nw_indent`` in Newick Utilities Args: ``space`` (``int``): The number of spaces a tab should equal Returns: ``str``: An indented Newick string ''' if not isinstance(space,int): ...
Return an indented Newick string, just like ``nw_indent`` in Newick Utilities Args: ``space`` (``int``): The number of spaces a tab should equal Returns: ``str``: An indented Newick string
Below is the the instruction that describes the task: ### Input: Return an indented Newick string, just like ``nw_indent`` in Newick Utilities Args: ``space`` (``int``): The number of spaces a tab should equal Returns: ``str``: An indented Newick string ### Response: def i...
def _process_name_or_alias_filter_directive(filter_operation_info, location, context, parameters): """Return a Filter basic block that checks for a match against an Entity's name or alias. Args: filter_operation_info: FilterOperationInfo object, containing the directive and field info ...
Return a Filter basic block that checks for a match against an Entity's name or alias. Args: filter_operation_info: FilterOperationInfo object, containing the directive and field info of the field where the filter is to be applied. location: Location where this filter...
Below is the the instruction that describes the task: ### Input: Return a Filter basic block that checks for a match against an Entity's name or alias. Args: filter_operation_info: FilterOperationInfo object, containing the directive and field info of the field where the ...
def get_content(identifier, default=None): ''' Returns the DynamicContent instance for the given identifier. If no object is found, a new one will be created. :param identifier: String representing the unique identifier of a ``DynamicContent`` object. :param default: String that should be us...
Returns the DynamicContent instance for the given identifier. If no object is found, a new one will be created. :param identifier: String representing the unique identifier of a ``DynamicContent`` object. :param default: String that should be used in case that no matching ``DynamicContent`` ob...
Below is the the instruction that describes the task: ### Input: Returns the DynamicContent instance for the given identifier. If no object is found, a new one will be created. :param identifier: String representing the unique identifier of a ``DynamicContent`` object. :param default: String tha...
def validate(source): """Validate a Wagon archive. Return True if succeeds, False otherwise. It also prints a list of all validation errors. This will test that some of the metadata is solid, that the required wheels are present within the archives and that the package is installable. Note tha...
Validate a Wagon archive. Return True if succeeds, False otherwise. It also prints a list of all validation errors. This will test that some of the metadata is solid, that the required wheels are present within the archives and that the package is installable. Note that if the metadata file is cor...
Below is the the instruction that describes the task: ### Input: Validate a Wagon archive. Return True if succeeds, False otherwise. It also prints a list of all validation errors. This will test that some of the metadata is solid, that the required wheels are present within the archives and that t...
def print_statements(self): """Print all extracted INDRA Statements.""" logger.info('--- Direct INDRA statements ----------') for i, stmt in enumerate(self.statements): logger.info("%s: %s" % (i, stmt)) logger.info('--- Indirect INDRA statements ----------') for i, st...
Print all extracted INDRA Statements.
Below is the the instruction that describes the task: ### Input: Print all extracted INDRA Statements. ### Response: def print_statements(self): """Print all extracted INDRA Statements.""" logger.info('--- Direct INDRA statements ----------') for i, stmt in enumerate(self.statements): ...
def content(): """Helper method that returns just the content. This method was added so that the text could be reused in the dock_help module. .. versionadded:: 4.1.0 :returns: A message object without brand element. :rtype: safe.messaging.message.Message """ message = m.Message() ...
Helper method that returns just the content. This method was added so that the text could be reused in the dock_help module. .. versionadded:: 4.1.0 :returns: A message object without brand element. :rtype: safe.messaging.message.Message
Below is the the instruction that describes the task: ### Input: Helper method that returns just the content. This method was added so that the text could be reused in the dock_help module. .. versionadded:: 4.1.0 :returns: A message object without brand element. :rtype: safe.messaging.messag...
def iterative_overlap_assembly( variant_sequences, min_overlap_size=MIN_VARIANT_SEQUENCE_ASSEMBLY_OVERLAP_SIZE): """ Assembles longer sequences from reads centered on a variant by between merging all pairs of overlapping sequences and collapsing shorter sequences onto every longer sequen...
Assembles longer sequences from reads centered on a variant by between merging all pairs of overlapping sequences and collapsing shorter sequences onto every longer sequence which contains them. Returns a list of variant sequences, sorted by decreasing read support.
Below is the the instruction that describes the task: ### Input: Assembles longer sequences from reads centered on a variant by between merging all pairs of overlapping sequences and collapsing shorter sequences onto every longer sequence which contains them. Returns a list of variant sequences, sorted...
def show(filename=None, *args, **kwargs): """ Show the current figure. Parameters ---------- filename : :obj:`str` filename to save the image to, for auto-saving """ if filename is None: plt.show(*args, **kwargs) else: plt.save...
Show the current figure. Parameters ---------- filename : :obj:`str` filename to save the image to, for auto-saving
Below is the the instruction that describes the task: ### Input: Show the current figure. Parameters ---------- filename : :obj:`str` filename to save the image to, for auto-saving ### Response: def show(filename=None, *args, **kwargs): """ Show the current figure. ...
def Get(self, interface_name, property_name): '''Standard D-Bus API for getting a property value''' self.log('Get %s.%s' % (interface_name, property_name)) if not interface_name: interface_name = self.interface try: return self.GetAll(interface_name)[property_na...
Standard D-Bus API for getting a property value
Below is the the instruction that describes the task: ### Input: Standard D-Bus API for getting a property value ### Response: def Get(self, interface_name, property_name): '''Standard D-Bus API for getting a property value''' self.log('Get %s.%s' % (interface_name, property_name)) if not...
def get_host_for_command(self, command, args): """Returns the host this command should be executed against.""" return self.get_host_for_key(self.get_key(command, args))
Returns the host this command should be executed against.
Below is the the instruction that describes the task: ### Input: Returns the host this command should be executed against. ### Response: def get_host_for_command(self, command, args): """Returns the host this command should be executed against.""" return self.get_host_for_key(self.get_key(command, ...
def _save_customization(self, widgets): """ Save the complete customization to the activity. :param widgets: The complete set of widgets to be customized """ if len(widgets) > 0: # Get the current customization and only replace the 'ext' part of it custom...
Save the complete customization to the activity. :param widgets: The complete set of widgets to be customized
Below is the the instruction that describes the task: ### Input: Save the complete customization to the activity. :param widgets: The complete set of widgets to be customized ### Response: def _save_customization(self, widgets): """ Save the complete customization to the activity. ...
def get_event_consumer(config, success_channel, error_channel, metrics, **kwargs): """Get a GPSEventConsumer client. A factory function that validates configuration, creates schema validator and parser clients, creates an auth and a pubsub client, and returns an event consumer (:...
Get a GPSEventConsumer client. A factory function that validates configuration, creates schema validator and parser clients, creates an auth and a pubsub client, and returns an event consumer (:interface:`gordon.interfaces. IRunnable` and :interface:`gordon.interfaces.IMessageHandler`) provider. ...
Below is the the instruction that describes the task: ### Input: Get a GPSEventConsumer client. A factory function that validates configuration, creates schema validator and parser clients, creates an auth and a pubsub client, and returns an event consumer (:interface:`gordon.interfaces. IRunnable`...
def solve_discrete_lyapunov(A, B, max_it=50, method="doubling"): r""" Computes the solution to the discrete lyapunov equation .. math:: AXA' - X + B = 0 :math:`X` is computed by using a doubling algorithm. In particular, we iterate to convergence on :math:`X_j` with the following recursio...
r""" Computes the solution to the discrete lyapunov equation .. math:: AXA' - X + B = 0 :math:`X` is computed by using a doubling algorithm. In particular, we iterate to convergence on :math:`X_j` with the following recursions for :math:`j = 1, 2, \dots` starting from :math:`X_0 = B`, :ma...
Below is the the instruction that describes the task: ### Input: r""" Computes the solution to the discrete lyapunov equation .. math:: AXA' - X + B = 0 :math:`X` is computed by using a doubling algorithm. In particular, we iterate to convergence on :math:`X_j` with the following recursio...
def update_changes(changes,newtext,change): "decide whether to compact the newest change into the old last; return new change list. assumes changes is safe to mutate.\ note: newtext MUST be the result of applying change to changes, and is only passed to save doing the computation again." # the criteria for a n...
decide whether to compact the newest change into the old last; return new change list. assumes changes is safe to mutate.\ note: newtext MUST be the result of applying change to changes, and is only passed to save doing the computation again.
Below is the the instruction that describes the task: ### Input: decide whether to compact the newest change into the old last; return new change list. assumes changes is safe to mutate.\ note: newtext MUST be the result of applying change to changes, and is only passed to save doing the computation again. ### R...
def V_vertical_conical(D, a, h): r'''Calculates volume of a vertical tank with a convex conical bottom, according to [1]_. No provision for the top of the tank is made here. .. math:: V_f = \frac{\pi}{4}\left(\frac{Dh}{a}\right)^2\left(\frac{h}{3}\right),\; h < a .. math:: V_f = \frac{...
r'''Calculates volume of a vertical tank with a convex conical bottom, according to [1]_. No provision for the top of the tank is made here. .. math:: V_f = \frac{\pi}{4}\left(\frac{Dh}{a}\right)^2\left(\frac{h}{3}\right),\; h < a .. math:: V_f = \frac{\pi D^2}{4}\left(h - \frac{2a}{3}\rig...
Below is the the instruction that describes the task: ### Input: r'''Calculates volume of a vertical tank with a convex conical bottom, according to [1]_. No provision for the top of the tank is made here. .. math:: V_f = \frac{\pi}{4}\left(\frac{Dh}{a}\right)^2\left(\frac{h}{3}\right),\; h < a ...
def getSiblings(self, retracted=False): """ Return the list of duplicate analyses that share the same Request and are included in the same Worksheet as the current analysis. The current duplicate is excluded from the list. :param retracted: If false, retracted/rejected siblings a...
Return the list of duplicate analyses that share the same Request and are included in the same Worksheet as the current analysis. The current duplicate is excluded from the list. :param retracted: If false, retracted/rejected siblings are dismissed :type retracted: bool :return: ...
Below is the the instruction that describes the task: ### Input: Return the list of duplicate analyses that share the same Request and are included in the same Worksheet as the current analysis. The current duplicate is excluded from the list. :param retracted: If false, retracted/rejected s...
def _build_folder_tree(top_abspath, followsymlinks, file_filter): """ Build a tree of LocalFolder with children based on a path. :param top_abspath: str path to a directory to walk :param followsymlinks: bool should we follow symlinks when walking :param file_filter: FileFilter: include method retur...
Build a tree of LocalFolder with children based on a path. :param top_abspath: str path to a directory to walk :param followsymlinks: bool should we follow symlinks when walking :param file_filter: FileFilter: include method returns True if we should include a file/folder :return: the top node of the tr...
Below is the the instruction that describes the task: ### Input: Build a tree of LocalFolder with children based on a path. :param top_abspath: str path to a directory to walk :param followsymlinks: bool should we follow symlinks when walking :param file_filter: FileFilter: include method returns True i...
def generate(self,rprs=None, mass=None, radius=None, n=2e4, fp_specific=0.01, u1=None, u2=None, starmodel=None, Teff=None, logg=None, rbin_width=0.3, MAfn=None, lhoodcachefile=None): """Generates Population All arguments defined in ``__in...
Generates Population All arguments defined in ``__init__``.
Below is the the instruction that describes the task: ### Input: Generates Population All arguments defined in ``__init__``. ### Response: def generate(self,rprs=None, mass=None, radius=None, n=2e4, fp_specific=0.01, u1=None, u2=None, starmodel=None, Teff=N...
def add_file_group(self, fileGrp): """ Add a new ``mets:fileGrp``. Arguments: fileGrp (string): ``USE`` attribute of the new filegroup. """ el_fileSec = self._tree.getroot().find('mets:fileSec', NS) if el_fileSec is None: el_fileSec = ET.SubElemen...
Add a new ``mets:fileGrp``. Arguments: fileGrp (string): ``USE`` attribute of the new filegroup.
Below is the the instruction that describes the task: ### Input: Add a new ``mets:fileGrp``. Arguments: fileGrp (string): ``USE`` attribute of the new filegroup. ### Response: def add_file_group(self, fileGrp): """ Add a new ``mets:fileGrp``. Arguments: fil...
def set_request_args(self, args): """ Set the Limit parameter into the request args """ if self.scan_limit is not None: args['Limit'] = self.scan_limit elif self.item_limit is not None: args['Limit'] = max(self.item_limit, self.min_scan_limit) else: ar...
Set the Limit parameter into the request args
Below is the the instruction that describes the task: ### Input: Set the Limit parameter into the request args ### Response: def set_request_args(self, args): """ Set the Limit parameter into the request args """ if self.scan_limit is not None: args['Limit'] = self.scan_limit el...
def symbols(names, **args): """ Transform strings into instances of :class:`Symbol` class. :func:`symbols` function returns a sequence of symbols with names taken from ``names`` argument, which can be a comma or whitespace delimited string, or a sequence of strings:: >>> from symengine impor...
Transform strings into instances of :class:`Symbol` class. :func:`symbols` function returns a sequence of symbols with names taken from ``names`` argument, which can be a comma or whitespace delimited string, or a sequence of strings:: >>> from symengine import symbols >>> x, y, z = symbols(...
Below is the the instruction that describes the task: ### Input: Transform strings into instances of :class:`Symbol` class. :func:`symbols` function returns a sequence of symbols with names taken from ``names`` argument, which can be a comma or whitespace delimited string, or a sequence of strings:: ...
def parse_motifs(motifs): """Parse motifs in a variety of formats to return a list of motifs. Parameters ---------- motifs : list or str Filename of motif, list of motifs or single Motif instance. Returns ------- motifs : list List of Motif instances. """ if isin...
Parse motifs in a variety of formats to return a list of motifs. Parameters ---------- motifs : list or str Filename of motif, list of motifs or single Motif instance. Returns ------- motifs : list List of Motif instances.
Below is the the instruction that describes the task: ### Input: Parse motifs in a variety of formats to return a list of motifs. Parameters ---------- motifs : list or str Filename of motif, list of motifs or single Motif instance. Returns ------- motifs : list List of ...
def _set_anycast_rp_ip(self, v, load=False): """ Setter method for anycast_rp_ip, mapped from YANG variable /routing_system/router/hide_pim_holder/pim/anycast_rp_ip (list) If this variable is read-only (config: false) in the source YANG file, then _set_anycast_rp_ip is considered as a private method...
Setter method for anycast_rp_ip, mapped from YANG variable /routing_system/router/hide_pim_holder/pim/anycast_rp_ip (list) If this variable is read-only (config: false) in the source YANG file, then _set_anycast_rp_ip is considered as a private method. Backends looking to populate this variable should d...
Below is the the instruction that describes the task: ### Input: Setter method for anycast_rp_ip, mapped from YANG variable /routing_system/router/hide_pim_holder/pim/anycast_rp_ip (list) If this variable is read-only (config: false) in the source YANG file, then _set_anycast_rp_ip is considered as a privat...
def get_level_values(self, level): """ Return vector of label values for requested level, equal to the length of the index. Parameters ---------- level : int or str ``level`` is either the integer position of the level in the MultiIndex, or the na...
Return vector of label values for requested level, equal to the length of the index. Parameters ---------- level : int or str ``level`` is either the integer position of the level in the MultiIndex, or the name of the level. Returns ------- ...
Below is the the instruction that describes the task: ### Input: Return vector of label values for requested level, equal to the length of the index. Parameters ---------- level : int or str ``level`` is either the integer position of the level in the MultiIn...
def _run_frame(self, executor, limit=False, iteration=0): """ Run single frame of the bot :param source_or_code: path to code to run, or actual code. :param limit: Time a frame should take to run (float - seconds) """ # # Gets a bit complex here... # # No...
Run single frame of the bot :param source_or_code: path to code to run, or actual code. :param limit: Time a frame should take to run (float - seconds)
Below is the the instruction that describes the task: ### Input: Run single frame of the bot :param source_or_code: path to code to run, or actual code. :param limit: Time a frame should take to run (float - seconds) ### Response: def _run_frame(self, executor, limit=False, iteration=0): "...
def get_page_meta(page, language): """ Retrieves all the meta information for the page in the given language :param page: a Page instance :param lang: a language code :return: Meta instance :type: object """ from django.core.cache import cache from meta.views import Meta from ....
Retrieves all the meta information for the page in the given language :param page: a Page instance :param lang: a language code :return: Meta instance :type: object
Below is the the instruction that describes the task: ### Input: Retrieves all the meta information for the page in the given language :param page: a Page instance :param lang: a language code :return: Meta instance :type: object ### Response: def get_page_meta(page, language): """ Retrie...
def digestInSilico(proteinSequence, cleavageRule='[KR]', missedCleavage=0, removeNtermM=True, minLength=5, maxLength=55): """Returns a list of peptide sequences and cleavage information derived from an in silico digestion of a polypeptide. :param proteinSequence: amino acid sequence of t...
Returns a list of peptide sequences and cleavage information derived from an in silico digestion of a polypeptide. :param proteinSequence: amino acid sequence of the poly peptide to be digested :param cleavageRule: cleavage rule expressed in a regular expression, see :attr:`maspy.constants....
Below is the the instruction that describes the task: ### Input: Returns a list of peptide sequences and cleavage information derived from an in silico digestion of a polypeptide. :param proteinSequence: amino acid sequence of the poly peptide to be digested :param cleavageRule: cleavage rule e...
def set_proxy(self, instance, state): """ Change class """ if state in self.state_proxy: state_proxy = self.state_proxy[state] try: app_label, model_name = state_proxy.split(".") except ValueError: # If we can't split, ...
Change class
Below is the the instruction that describes the task: ### Input: Change class ### Response: def set_proxy(self, instance, state): """ Change class """ if state in self.state_proxy: state_proxy = self.state_proxy[state] try: app_label, model_n...
def add_builtin_parameters(parameters): """Add built-in parameters to a dictionary of parameters Parameters ---------- parameters : dict Dictionary of parameters provided by the user """ with_builtin_parameters = { "pm": { "run_uuid": str(uuid4()), "curren...
Add built-in parameters to a dictionary of parameters Parameters ---------- parameters : dict Dictionary of parameters provided by the user
Below is the the instruction that describes the task: ### Input: Add built-in parameters to a dictionary of parameters Parameters ---------- parameters : dict Dictionary of parameters provided by the user ### Response: def add_builtin_parameters(parameters): """Add built-in parameters to a ...
def create_dir(path): """ Creates a directory. Warns, if the directory can't be accessed. Passes, if the directory already exists. modified from http://stackoverflow.com/a/600612 Parameters ---------- path : str path to the directory to be created """ import sys import ...
Creates a directory. Warns, if the directory can't be accessed. Passes, if the directory already exists. modified from http://stackoverflow.com/a/600612 Parameters ---------- path : str path to the directory to be created
Below is the the instruction that describes the task: ### Input: Creates a directory. Warns, if the directory can't be accessed. Passes, if the directory already exists. modified from http://stackoverflow.com/a/600612 Parameters ---------- path : str path to the directory to be created...
def static_sum(values, limit_n=1000): """Example of static sum routine.""" if len(values) < limit_n: return sum(values) else: half = len(values) // 2 return add( static_sum(values[:half], limit_n), static_sum(values[half:], limit_n))
Example of static sum routine.
Below is the the instruction that describes the task: ### Input: Example of static sum routine. ### Response: def static_sum(values, limit_n=1000): """Example of static sum routine.""" if len(values) < limit_n: return sum(values) else: half = len(values) // 2 return add( ...
def generate_img_id(profile, ext=None, label=None, tmp=False): """ Generates img_id. """ if ext and not ext.startswith('.'): ext = '.' + ext if label: label = re.sub(r'[^a-z0-9_\-]', '', label, flags=re.I) label = re.sub(r'_+', '_', label) label = label[:60] retur...
Generates img_id.
Below is the the instruction that describes the task: ### Input: Generates img_id. ### Response: def generate_img_id(profile, ext=None, label=None, tmp=False): """ Generates img_id. """ if ext and not ext.startswith('.'): ext = '.' + ext if label: label = re.sub(r'[^a-z0-9_\-]',...
def to_array(self): """ Serializes this PassportElementErrorReverseSide to a dictionary. :return: dictionary representation of this object. :rtype: dict """ array = super(PassportElementErrorReverseSide, self).to_array() array['source'] = u(self.source) # py2: t...
Serializes this PassportElementErrorReverseSide to a dictionary. :return: dictionary representation of this object. :rtype: dict
Below is the the instruction that describes the task: ### Input: Serializes this PassportElementErrorReverseSide to a dictionary. :return: dictionary representation of this object. :rtype: dict ### Response: def to_array(self): """ Serializes this PassportElementErrorReverseSide to...
def cached(fn, size=32): ''' this decorator creates a type safe lru_cache around the decorated function. Unlike functools.lru_cache, this will not crash when unhashable arguments are passed to the function''' assert callable(fn) assert isinstance(size, int) return overload(fn)(lru_cache(size...
this decorator creates a type safe lru_cache around the decorated function. Unlike functools.lru_cache, this will not crash when unhashable arguments are passed to the function
Below is the the instruction that describes the task: ### Input: this decorator creates a type safe lru_cache around the decorated function. Unlike functools.lru_cache, this will not crash when unhashable arguments are passed to the function ### Response: def cached(fn, size=32): ''' this decorator...
def queue(p_queue, host=None): '''Construct a path to the queue dir for a queue''' if host is not None: return _path(_c.FSQ_QUEUE, root=_path(host, root=hosts(p_queue))) return _path(p_queue, _c.FSQ_QUEUE)
Construct a path to the queue dir for a queue
Below is the the instruction that describes the task: ### Input: Construct a path to the queue dir for a queue ### Response: def queue(p_queue, host=None): '''Construct a path to the queue dir for a queue''' if host is not None: return _path(_c.FSQ_QUEUE, root=_path(host, root=hosts(p_queue))) ...
def iter_otus(nexson, nexson_version=None): """generator over all otus in all otus group elements. yields a tuple of 3 items: otus group ID, otu ID, the otu obj """ if nexson_version is None: nexson_version = detect_nexson_version(nexson) if not _is_by_id_hbf(nexson_v...
generator over all otus in all otus group elements. yields a tuple of 3 items: otus group ID, otu ID, the otu obj
Below is the the instruction that describes the task: ### Input: generator over all otus in all otus group elements. yields a tuple of 3 items: otus group ID, otu ID, the otu obj ### Response: def iter_otus(nexson, nexson_version=None): """generator over all otus in all otus group e...
def subquery(self, name=None): """ The recipe's query as a subquery suitable for use in joins or other queries. """ query = self.query() return query.subquery(name=name)
The recipe's query as a subquery suitable for use in joins or other queries.
Below is the the instruction that describes the task: ### Input: The recipe's query as a subquery suitable for use in joins or other queries. ### Response: def subquery(self, name=None): """ The recipe's query as a subquery suitable for use in joins or other queries. """ que...
def apply(self, mapping): """Apply a mapping of name-value-pairs to a template.""" mapping = {name: self.str(value, tolerant=self.tolerant) for name, value in mapping.items() if value is not None or self.tolerant} if self.tolerant: return self.t...
Apply a mapping of name-value-pairs to a template.
Below is the the instruction that describes the task: ### Input: Apply a mapping of name-value-pairs to a template. ### Response: def apply(self, mapping): """Apply a mapping of name-value-pairs to a template.""" mapping = {name: self.str(value, tolerant=self.tolerant) for name, ...
def fromJSON(value): """loads the GP object from a JSON string """ j = json.loads(value) v = GPLong() if "defaultValue" in j: v.value = j['defaultValue'] else: v.value = j['value'] if 'paramName' in j: v.paramName = j['paramName'] ...
loads the GP object from a JSON string
Below is the the instruction that describes the task: ### Input: loads the GP object from a JSON string ### Response: def fromJSON(value): """loads the GP object from a JSON string """ j = json.loads(value) v = GPLong() if "defaultValue" in j: v.value = j['defaultValue']...
def mapPartitions(self, f, preservesPartitioning=False): """ .. note:: Experimental Returns a new RDD by applying a function to each partition of the wrapped RDD, where tasks are launched together in a barrier stage. The interface is the same as :func:`RDD.mapPartitions`. ...
.. note:: Experimental Returns a new RDD by applying a function to each partition of the wrapped RDD, where tasks are launched together in a barrier stage. The interface is the same as :func:`RDD.mapPartitions`. Please see the API doc there. .. versionadded:: 2.4.0
Below is the the instruction that describes the task: ### Input: .. note:: Experimental Returns a new RDD by applying a function to each partition of the wrapped RDD, where tasks are launched together in a barrier stage. The interface is the same as :func:`RDD.mapPartitions`. Please...
def plot_blandaltman(x, y, agreement=1.96, confidence=.95, figsize=(5, 4), dpi=100, ax=None): """ Generate a Bland-Altman plot to compare two sets of measurements. Parameters ---------- x, y : np.array or list First and second measurements. agreement : float ...
Generate a Bland-Altman plot to compare two sets of measurements. Parameters ---------- x, y : np.array or list First and second measurements. agreement : float Multiple of the standard deviation to plot limit of agreement bounds. The defaults is 1.96. confidence : float ...
Below is the the instruction that describes the task: ### Input: Generate a Bland-Altman plot to compare two sets of measurements. Parameters ---------- x, y : np.array or list First and second measurements. agreement : float Multiple of the standard deviation to plot limit of agree...
def extend(self, protocol: Union[Iterable[Dict], 'Pipeline']) -> 'Pipeline': """Add another pipeline to the end of the current pipeline. :param protocol: An iterable of dictionaries (or another Pipeline) :return: This pipeline for fluid query building Example: >>> p1 = Pipelin...
Add another pipeline to the end of the current pipeline. :param protocol: An iterable of dictionaries (or another Pipeline) :return: This pipeline for fluid query building Example: >>> p1 = Pipeline.from_functions(['enrich_protein_and_rna_origins']) >>> p2 = Pipeline.from_func...
Below is the the instruction that describes the task: ### Input: Add another pipeline to the end of the current pipeline. :param protocol: An iterable of dictionaries (or another Pipeline) :return: This pipeline for fluid query building Example: >>> p1 = Pipeline.from_functions(['...
def _select_row_by_column_value(tree_view, list_store, column, value): """Helper method to select a tree view row :param Gtk.TreeView tree_view: Tree view who's row is to be selected :param Gtk.ListStore list_store: List store of the tree view :param int column: Column in which the valu...
Helper method to select a tree view row :param Gtk.TreeView tree_view: Tree view who's row is to be selected :param Gtk.ListStore list_store: List store of the tree view :param int column: Column in which the value is searched :param value: Value to search for :returns: Row of l...
Below is the the instruction that describes the task: ### Input: Helper method to select a tree view row :param Gtk.TreeView tree_view: Tree view who's row is to be selected :param Gtk.ListStore list_store: List store of the tree view :param int column: Column in which the value is searched...
def _getRole(self, matchedVars): """ :param matchedVars: :return: NULL or the role's integer value """ role = matchedVars.get(ROLE) if role is not None and role.strip() == '': role = NULL else: valid = Authoriser.isValidRoleName(role) ...
:param matchedVars: :return: NULL or the role's integer value
Below is the the instruction that describes the task: ### Input: :param matchedVars: :return: NULL or the role's integer value ### Response: def _getRole(self, matchedVars): """ :param matchedVars: :return: NULL or the role's integer value """ role = matchedVars.get(...
def get_language(self): """\ Returns the language is by the article or the configuration language """ # we don't want to force the target language # so we use the article.meta_lang if self.config.use_meta_language: if self.article.meta_lang: ...
\ Returns the language is by the article or the configuration language
Below is the the instruction that describes the task: ### Input: \ Returns the language is by the article or the configuration language ### Response: def get_language(self): """\ Returns the language is by the article or the configuration language """ # we do...
def buildRootname(filename, ext=None): """ Build a new rootname for an existing file and given extension. Any user supplied extensions to use for searching for file need to be provided as a list of extensions. Examples -------- :: >>> rootname = buildRootname(filename, ext=['_dth...
Build a new rootname for an existing file and given extension. Any user supplied extensions to use for searching for file need to be provided as a list of extensions. Examples -------- :: >>> rootname = buildRootname(filename, ext=['_dth.fits']) # doctest: +SKIP
Below is the the instruction that describes the task: ### Input: Build a new rootname for an existing file and given extension. Any user supplied extensions to use for searching for file need to be provided as a list of extensions. Examples -------- :: >>> rootname = buildRootname(fi...
def display(self, format="png"): """ Return an object that can be used to display this sequence. This is used for IPython Notebook. :param format: "png" or "svg" """ from sebastian.core.transforms import lilypond seq = HSeq(self) | lilypond() lily_output...
Return an object that can be used to display this sequence. This is used for IPython Notebook. :param format: "png" or "svg"
Below is the the instruction that describes the task: ### Input: Return an object that can be used to display this sequence. This is used for IPython Notebook. :param format: "png" or "svg" ### Response: def display(self, format="png"): """ Return an object that can be used to disp...
def playerid_reverse_lookup(player_ids, key_type=None): """Retrieve a table of player information given a list of player ids :param player_ids: list of player ids :type player_ids: list :param key_type: name of the key type being looked up (one of "mlbam", "retro", "bbref", or "fangraphs") :type ke...
Retrieve a table of player information given a list of player ids :param player_ids: list of player ids :type player_ids: list :param key_type: name of the key type being looked up (one of "mlbam", "retro", "bbref", or "fangraphs") :type key_type: str :rtype: :class:`pandas.core.frame.DataFrame`
Below is the the instruction that describes the task: ### Input: Retrieve a table of player information given a list of player ids :param player_ids: list of player ids :type player_ids: list :param key_type: name of the key type being looked up (one of "mlbam", "retro", "bbref", or "fangraphs") :t...
def acquire(self, _filter=None, default=None): """ acquire(_filter=None, default=None) Claims a resource from the pool for manual use. Resources are created as needed when all members of the pool are claimed or the pool is empty. Most of the time you will want to use :me...
acquire(_filter=None, default=None) Claims a resource from the pool for manual use. Resources are created as needed when all members of the pool are claimed or the pool is empty. Most of the time you will want to use :meth:`transaction`. :param _filter: a filter that can be use...
Below is the the instruction that describes the task: ### Input: acquire(_filter=None, default=None) Claims a resource from the pool for manual use. Resources are created as needed when all members of the pool are claimed or the pool is empty. Most of the time you will want to use :...
def read_files(filenames, with_name=False): """Read many files.""" text = [read_file(filename) for filename in filenames] if with_name: return dict(zip(filenames, text)) return text
Read many files.
Below is the the instruction that describes the task: ### Input: Read many files. ### Response: def read_files(filenames, with_name=False): """Read many files.""" text = [read_file(filename) for filename in filenames] if with_name: return dict(zip(filenames, text)) return text
def coord_from_area(self, x, y, lat, lon, width, ground_width): '''return (lat,lon) for a pixel in an area image''' pixel_width = ground_width / float(width) dx = x * pixel_width dy = y * pixel_width return mp_util.gps_offset(lat, lon, dx, -dy)
return (lat,lon) for a pixel in an area image
Below is the the instruction that describes the task: ### Input: return (lat,lon) for a pixel in an area image ### Response: def coord_from_area(self, x, y, lat, lon, width, ground_width): '''return (lat,lon) for a pixel in an area image''' pixel_width = ground_width / float(width) dx = x * pixel_width dy...
def convert_units_to_base_units(units): """Convert a set of units into a set of "base" units. Returns a 2-tuple of `factor, new_units`. """ total_factor = 1 new_units = [] for unit in units: if unit not in BASE_UNIT_CONVERSIONS: continue factor, new_unit = BASE_UNIT...
Convert a set of units into a set of "base" units. Returns a 2-tuple of `factor, new_units`.
Below is the the instruction that describes the task: ### Input: Convert a set of units into a set of "base" units. Returns a 2-tuple of `factor, new_units`. ### Response: def convert_units_to_base_units(units): """Convert a set of units into a set of "base" units. Returns a 2-tuple of `factor, new_u...
def write_24bit_uint(self, n): """ Writes a 24 bit unsigned integer to the stream. @since: 0.4 @param n: 24 bit unsigned integer @type n: C{int} @raise TypeError: Unexpected type for int C{n}. @raise OverflowError: Not in range. """ if type(n) not...
Writes a 24 bit unsigned integer to the stream. @since: 0.4 @param n: 24 bit unsigned integer @type n: C{int} @raise TypeError: Unexpected type for int C{n}. @raise OverflowError: Not in range.
Below is the the instruction that describes the task: ### Input: Writes a 24 bit unsigned integer to the stream. @since: 0.4 @param n: 24 bit unsigned integer @type n: C{int} @raise TypeError: Unexpected type for int C{n}. @raise OverflowError: Not in range. ### Response: d...
def create_instruction( self, parent, instruction, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ Creates an instruction for how data should be labeled. Example: ...
Creates an instruction for how data should be labeled. Example: >>> from google.cloud import datalabeling_v1beta1 >>> >>> client = datalabeling_v1beta1.DataLabelingServiceClient() >>> >>> parent = client.project_path('[PROJECT]') >>> ...
Below is the the instruction that describes the task: ### Input: Creates an instruction for how data should be labeled. Example: >>> from google.cloud import datalabeling_v1beta1 >>> >>> client = datalabeling_v1beta1.DataLabelingServiceClient() >>> ...
def get_uniform_comparator(comparator): """ convert comparator alias to uniform name """ if comparator in ["eq", "equals", "==", "is"]: return "equals" elif comparator in ["lt", "less_than"]: return "less_than" elif comparator in ["le", "less_than_or_equals"]: return "less_th...
convert comparator alias to uniform name
Below is the the instruction that describes the task: ### Input: convert comparator alias to uniform name ### Response: def get_uniform_comparator(comparator): """ convert comparator alias to uniform name """ if comparator in ["eq", "equals", "==", "is"]: return "equals" elif comparator in ...
def detach_from_all(self, bIgnoreExceptions = False): """ Detaches from all processes currently being debugged. @note: To better handle last debugging event, call L{stop} instead. @type bIgnoreExceptions: bool @param bIgnoreExceptions: C{True} to ignore any exceptions that may...
Detaches from all processes currently being debugged. @note: To better handle last debugging event, call L{stop} instead. @type bIgnoreExceptions: bool @param bIgnoreExceptions: C{True} to ignore any exceptions that may be raised when detaching. @raise WindowsError: Raise...
Below is the the instruction that describes the task: ### Input: Detaches from all processes currently being debugged. @note: To better handle last debugging event, call L{stop} instead. @type bIgnoreExceptions: bool @param bIgnoreExceptions: C{True} to ignore any exceptions that may be ...
def confidence_interval_hazard_(self): """ The confidence interval of the hazard. """ return self._compute_confidence_bounds_of_transform(self._hazard, self.alpha, self._ci_labels)
The confidence interval of the hazard.
Below is the the instruction that describes the task: ### Input: The confidence interval of the hazard. ### Response: def confidence_interval_hazard_(self): """ The confidence interval of the hazard. """ return self._compute_confidence_bounds_of_transform(self._hazard, self.alpha, s...
def save(self, *args, **kwargs): ''' Just add "s" if no plural name given. ''' if not self.pluralName: self.pluralName = self.name + 's' super(self.__class__, self).save(*args, **kwargs)
Just add "s" if no plural name given.
Below is the the instruction that describes the task: ### Input: Just add "s" if no plural name given. ### Response: def save(self, *args, **kwargs): ''' Just add "s" if no plural name given. ''' if not self.pluralName: self.pluralName = self.name + 's' super(self.__class__, s...
def reinit_configurations(self, request): """ Re-initialize configuration for resource if it has been changed. This method should be called if resource consumption strategy was changed. """ now = timezone.now() # Step 1. Collect all resources with changed configuration. ...
Re-initialize configuration for resource if it has been changed. This method should be called if resource consumption strategy was changed.
Below is the the instruction that describes the task: ### Input: Re-initialize configuration for resource if it has been changed. This method should be called if resource consumption strategy was changed. ### Response: def reinit_configurations(self, request): """ Re-initialize configuration f...
def add_project_levels(cls, project): """ Add project sub levels extra items """ eitem_path = '' eitem_project_levels = {} if project is not None: subprojects = project.split('.') for i in range(0, len(subprojects)): if i > 0: ...
Add project sub levels extra items
Below is the the instruction that describes the task: ### Input: Add project sub levels extra items ### Response: def add_project_levels(cls, project): """ Add project sub levels extra items """ eitem_path = '' eitem_project_levels = {} if project is not None: subproje...
def _read_points(self, vlrs): """ private function to handle reading of the points record parts of the las file. the header is needed for the point format and number of points the vlrs are need to get the potential laszip vlr as well as the extra bytes vlr """ try: ...
private function to handle reading of the points record parts of the las file. the header is needed for the point format and number of points the vlrs are need to get the potential laszip vlr as well as the extra bytes vlr
Below is the the instruction that describes the task: ### Input: private function to handle reading of the points record parts of the las file. the header is needed for the point format and number of points the vlrs are need to get the potential laszip vlr as well as the extra bytes vlr ###...
def find_readlength(args): # type: (Namespace) -> int """Estimate length of reads based on 10000 first.""" try: bed_file = args.treatment[0] except AttributeError: bed_file = args.infiles[0] filereader = "cat " if bed_file.endswith(".gz") and search("linux", platform, IGNORECAS...
Estimate length of reads based on 10000 first.
Below is the the instruction that describes the task: ### Input: Estimate length of reads based on 10000 first. ### Response: def find_readlength(args): # type: (Namespace) -> int """Estimate length of reads based on 10000 first.""" try: bed_file = args.treatment[0] except AttributeError: ...
def _score_clusters(self, X, y=None): """ Determines the "scores" of the cluster, the metric that determines the size of the cluster visualized on the visualization. """ stype = self.scoring.lower() # scoring method name if stype == "membership": return np.bi...
Determines the "scores" of the cluster, the metric that determines the size of the cluster visualized on the visualization.
Below is the the instruction that describes the task: ### Input: Determines the "scores" of the cluster, the metric that determines the size of the cluster visualized on the visualization. ### Response: def _score_clusters(self, X, y=None): """ Determines the "scores" of the cluster, the me...
def create_seq(self, ): """Create a sequence and store it in the self.sequence :returns: None :rtype: None :raises: None """ name = self.name_le.text() desc = self.desc_pte.toPlainText() try: seq = djadapter.models.Sequence(name=name, project=...
Create a sequence and store it in the self.sequence :returns: None :rtype: None :raises: None
Below is the the instruction that describes the task: ### Input: Create a sequence and store it in the self.sequence :returns: None :rtype: None :raises: None ### Response: def create_seq(self, ): """Create a sequence and store it in the self.sequence :returns: None ...
def values(self): """Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`. """ dtypes = [col.dtype for col in self.columns...
Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`.
Below is the the instruction that describes the task: ### Input: Return data in `self` as a numpy array. If all columns are the same dtype, the resulting array will have this dtype. If there are >1 dtypes in columns, then the resulting array will have dtype `object`. ### Response: def valu...
def download(self, output="", outputFile="", silent=True): """ Downloads the image of the comic onto your computer. Arguments: output: the output directory where comics will be downloaded to. The default argument for 'output is the empty string; if the empty string is passed, it defaults to a "Downloa...
Downloads the image of the comic onto your computer. Arguments: output: the output directory where comics will be downloaded to. The default argument for 'output is the empty string; if the empty string is passed, it defaults to a "Downloads" directory in your home folder (this directory will be cre...
Below is the the instruction that describes the task: ### Input: Downloads the image of the comic onto your computer. Arguments: output: the output directory where comics will be downloaded to. The default argument for 'output is the empty string; if the empty string is passed, it defaults to a "Dow...
def get_freq_tuples(my_list, print_total_threshold): """ Turn a list of errors into frequency-sorted tuples thresholded by a certain total number """ d = {} for token in my_list: d.setdefault(token, 0) d[token] += 1 return sorted(d.items(), key=operator.itemgetter(1), reverse=True)[:prin...
Turn a list of errors into frequency-sorted tuples thresholded by a certain total number
Below is the the instruction that describes the task: ### Input: Turn a list of errors into frequency-sorted tuples thresholded by a certain total number ### Response: def get_freq_tuples(my_list, print_total_threshold): """ Turn a list of errors into frequency-sorted tuples thresholded by a certain total numb...
def touchstone_data(obj): r""" Validate if an object is an :ref:`TouchstoneData` pseudo-type object. :param obj: Object :type obj: any :raises: RuntimeError (Argument \`*[argument_name]*\` is not valid). The token \*[argument_name]\* is replaced by the name of the argument the contract ...
r""" Validate if an object is an :ref:`TouchstoneData` pseudo-type object. :param obj: Object :type obj: any :raises: RuntimeError (Argument \`*[argument_name]*\` is not valid). The token \*[argument_name]\* is replaced by the name of the argument the contract is attached to :rtype: No...
Below is the the instruction that describes the task: ### Input: r""" Validate if an object is an :ref:`TouchstoneData` pseudo-type object. :param obj: Object :type obj: any :raises: RuntimeError (Argument \`*[argument_name]*\` is not valid). The token \*[argument_name]\* is replaced by the ...
def init(textCNN, vocab, model_mode, context, lr): """Initialize parameters.""" textCNN.initialize(mx.init.Xavier(), ctx=context, force_reinit=True) if model_mode != 'rand': textCNN.embedding.weight.set_data(vocab.embedding.idx_to_vec) if model_mode == 'multichannel': textCNN.embedding_...
Initialize parameters.
Below is the the instruction that describes the task: ### Input: Initialize parameters. ### Response: def init(textCNN, vocab, model_mode, context, lr): """Initialize parameters.""" textCNN.initialize(mx.init.Xavier(), ctx=context, force_reinit=True) if model_mode != 'rand': textCNN.embedding....
def validate_subnet(s): """Validate a dotted-quad ip address including a netmask. The string is considered a valid dotted-quad address with netmask if it consists of one to four octets (0-255) seperated by periods (.) followed by a forward slash (/) and a subnet bitmask which is expressed in dotted...
Validate a dotted-quad ip address including a netmask. The string is considered a valid dotted-quad address with netmask if it consists of one to four octets (0-255) seperated by periods (.) followed by a forward slash (/) and a subnet bitmask which is expressed in dotted-quad format. >>> validat...
Below is the the instruction that describes the task: ### Input: Validate a dotted-quad ip address including a netmask. The string is considered a valid dotted-quad address with netmask if it consists of one to four octets (0-255) seperated by periods (.) followed by a forward slash (/) and a subnet bi...
def get_osdb_hash(self): """ Get the hash of this local videofile :return: hash as string """ if self._osdb_hash is None: self._osdb_hash = self._calculate_osdb_hash() return self._osdb_hash
Get the hash of this local videofile :return: hash as string
Below is the the instruction that describes the task: ### Input: Get the hash of this local videofile :return: hash as string ### Response: def get_osdb_hash(self): """ Get the hash of this local videofile :return: hash as string """ if self._osdb_hash is None: ...
def get_selection(self): """ Read text from the X selection Usage: C{clipboard.get_selection()} @return: text contents of the mouse selection @rtype: C{str} @raise Exception: if no text was found in the selection """ Gdk.threads_enter() t...
Read text from the X selection Usage: C{clipboard.get_selection()} @return: text contents of the mouse selection @rtype: C{str} @raise Exception: if no text was found in the selection
Below is the the instruction that describes the task: ### Input: Read text from the X selection Usage: C{clipboard.get_selection()} @return: text contents of the mouse selection @rtype: C{str} @raise Exception: if no text was found in the selection ### Response: def get_se...
def new_program(self, _id, series, title, subtitle, description, mpaaRating, starRating, runTime, year, showType, colorCode, originalAirDate, syndicatedEpisodeNumber, advisories): """Callback run for each new program entry""" if self.__v_program: # [Pro...
Callback run for each new program entry
Below is the the instruction that describes the task: ### Input: Callback run for each new program entry ### Response: def new_program(self, _id, series, title, subtitle, description, mpaaRating, starRating, runTime, year, showType, colorCode, originalAirDate, syndicatedEpisod...
def get_default_config(self): """ Returns the default collector settings """ config = super(DiskUsageCollector, self).get_default_config() config.update({ 'path': 'iostat', 'devices': ('PhysicalDrive[0-9]+$' + '|md[0-9]+$' + ...
Returns the default collector settings
Below is the the instruction that describes the task: ### Input: Returns the default collector settings ### Response: def get_default_config(self): """ Returns the default collector settings """ config = super(DiskUsageCollector, self).get_default_config() config.update({ ...
def taf(wxdata: TafData, units: Units) -> TafTrans: """ Translate the results of taf.parse Keys: Forecast, Min-Temp, Max-Temp Forecast keys: Wind, Visibility, Clouds, Altimeter, Wind-Shear, Turbulance, Icing, Other """ translations = {'forecast': []} # type: ignore for line in wxdata.fore...
Translate the results of taf.parse Keys: Forecast, Min-Temp, Max-Temp Forecast keys: Wind, Visibility, Clouds, Altimeter, Wind-Shear, Turbulance, Icing, Other
Below is the the instruction that describes the task: ### Input: Translate the results of taf.parse Keys: Forecast, Min-Temp, Max-Temp Forecast keys: Wind, Visibility, Clouds, Altimeter, Wind-Shear, Turbulance, Icing, Other ### Response: def taf(wxdata: TafData, units: Units) -> TafTrans: """ Tra...
def import_from_txt( filename_or_fobj, encoding="utf-8", frame_style=FRAME_SENTINEL, *args, **kwargs ): """Return a rows.Table created from imported TXT file.""" # TODO: (maybe) # enable parsing of non-fixed-width-columns # with old algorithm - that would just split columns # at the vertical se...
Return a rows.Table created from imported TXT file.
Below is the the instruction that describes the task: ### Input: Return a rows.Table created from imported TXT file. ### Response: def import_from_txt( filename_or_fobj, encoding="utf-8", frame_style=FRAME_SENTINEL, *args, **kwargs ): """Return a rows.Table created from imported TXT file.""" # TODO: (...
def vdotg(v1, v2, ndim): """ Compute the dot product of two double precision vectors of arbitrary dimension. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdotg_c.html :param v1: First vector in the dot product. :type v1: list[ndim] :param v2: Second vector in the dot product. ...
Compute the dot product of two double precision vectors of arbitrary dimension. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdotg_c.html :param v1: First vector in the dot product. :type v1: list[ndim] :param v2: Second vector in the dot product. :type v2: list[ndim] :param n...
Below is the the instruction that describes the task: ### Input: Compute the dot product of two double precision vectors of arbitrary dimension. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/vdotg_c.html :param v1: First vector in the dot product. :type v1: list[ndim] :param v2: Sec...
def skewer( self, input_fastq1, output_prefix, output_fastq1, log, cpus, adapters, input_fastq2=None, output_fastq2=None): """ Create commands with which to run skewer. :param str input_fastq1: Path to input (read 1) FASTQ file :param str output_prefix: Prefix fo...
Create commands with which to run skewer. :param str input_fastq1: Path to input (read 1) FASTQ file :param str output_prefix: Prefix for output FASTQ file names :param str output_fastq1: Path to (read 1) output FASTQ file :param str log: Path to file to which to write logging informati...
Below is the the instruction that describes the task: ### Input: Create commands with which to run skewer. :param str input_fastq1: Path to input (read 1) FASTQ file :param str output_prefix: Prefix for output FASTQ file names :param str output_fastq1: Path to (read 1) output FASTQ file ...
def close(self): """Close the notification.""" with self.selenium.context(self.selenium.CONTEXT_CHROME): self.find_close_button().click() self.window.wait_for_notification(None)
Close the notification.
Below is the the instruction that describes the task: ### Input: Close the notification. ### Response: def close(self): """Close the notification.""" with self.selenium.context(self.selenium.CONTEXT_CHROME): self.find_close_button().click() self.window.wait_for_notification(None...
def get_resolution(self) -> list: '''Show device resolution.''' output, _ = self._execute('-s', self.device_sn, 'shell', 'wm', 'size') return output.split()[2].split('x')
Show device resolution.
Below is the the instruction that describes the task: ### Input: Show device resolution. ### Response: def get_resolution(self) -> list: '''Show device resolution.''' output, _ = self._execute('-s', self.device_sn, 'shell', 'wm', 'size') return output.split()[2].split('x')
def buscar_por_id(self, id_direito): """Obtém os direitos de um grupo de usuário e um grupo de equipamento. :param id_direito: Identificador do direito grupo equipamento. :return: Dicionário com a seguinte estrutura: :: {'direito_grupo_equipamento': {'id_grupo...
Obtém os direitos de um grupo de usuário e um grupo de equipamento. :param id_direito: Identificador do direito grupo equipamento. :return: Dicionário com a seguinte estrutura: :: {'direito_grupo_equipamento': {'id_grupo_equipamento': < id_grupo_equipamento >, ...
Below is the the instruction that describes the task: ### Input: Obtém os direitos de um grupo de usuário e um grupo de equipamento. :param id_direito: Identificador do direito grupo equipamento. :return: Dicionário com a seguinte estrutura: :: {'direito_grupo_equipamento': ...