code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def reply(self, connection, reply, orig_req): """Send an asynchronous reply to an earlier request. Parameters ---------- connection : ClientConnection object The client to send the reply to. reply : Message object The reply message to send. orig_r...
Send an asynchronous reply to an earlier request. Parameters ---------- connection : ClientConnection object The client to send the reply to. reply : Message object The reply message to send. orig_req : Message object The request message being...
Below is the the instruction that describes the task: ### Input: Send an asynchronous reply to an earlier request. Parameters ---------- connection : ClientConnection object The client to send the reply to. reply : Message object The reply message to send. ...
def route(obj, rule, *args, **kwargs): """Decorator for the View classes.""" def decorator(cls): endpoint = kwargs.get('endpoint', camel_to_snake(cls.__name__)) kwargs['view_func'] = cls.as_view(endpoint) obj.add_url_rule(rule, *args, **kwargs) return cls return decorator
Decorator for the View classes.
Below is the the instruction that describes the task: ### Input: Decorator for the View classes. ### Response: def route(obj, rule, *args, **kwargs): """Decorator for the View classes.""" def decorator(cls): endpoint = kwargs.get('endpoint', camel_to_snake(cls.__name__)) kwargs['view_func']...
def scan_url(self, this_url): """ Submit a URL to be scanned by VirusTotal. :param this_url: The URL that should be scanned. This parameter accepts a list of URLs (up to 4 with the standard request rate) so as to perform a batch scanning request with one single call. The ...
Submit a URL to be scanned by VirusTotal. :param this_url: The URL that should be scanned. This parameter accepts a list of URLs (up to 4 with the standard request rate) so as to perform a batch scanning request with one single call. The URLs must be separated ...
Below is the the instruction that describes the task: ### Input: Submit a URL to be scanned by VirusTotal. :param this_url: The URL that should be scanned. This parameter accepts a list of URLs (up to 4 with the standard request rate) so as to perform a batch scanning request with ...
def get_institute_graph_url(start, end): """ Pie chart comparing institutes usage. """ filename = get_institute_graph_filename(start, end) urls = { 'graph_url': urlparse.urljoin(GRAPH_URL, filename + ".png"), 'data_url': urlparse.urljoin(GRAPH_URL, filename + ".csv"), } return urls
Pie chart comparing institutes usage.
Below is the the instruction that describes the task: ### Input: Pie chart comparing institutes usage. ### Response: def get_institute_graph_url(start, end): """ Pie chart comparing institutes usage. """ filename = get_institute_graph_filename(start, end) urls = { 'graph_url': urlparse.urljoin...
def sendGame(self, chat_id, game_short_name, disable_notification=None, reply_to_message_id=None, reply_markup=None): """ See: https://core.telegram.org/bots/api#sendgame """ p = _strip(locals()) return self._api_request('sendGame', _rectify(p))
See: https://core.telegram.org/bots/api#sendgame
Below is the the instruction that describes the task: ### Input: See: https://core.telegram.org/bots/api#sendgame ### Response: def sendGame(self, chat_id, game_short_name, disable_notification=None, reply_to_message_id=None, reply_markup=None): """ See: h...
def status(self): """Nome amigável do campo ``ESTADO_OPERACAO``, conforme a "Tabela de Informações do Status do SAT". """ for valor, rotulo in ESTADOS_OPERACAO: if self.ESTADO_OPERACAO == valor: return rotulo return u'(desconhecido: {})'.format(self.ES...
Nome amigável do campo ``ESTADO_OPERACAO``, conforme a "Tabela de Informações do Status do SAT".
Below is the the instruction that describes the task: ### Input: Nome amigável do campo ``ESTADO_OPERACAO``, conforme a "Tabela de Informações do Status do SAT". ### Response: def status(self): """Nome amigável do campo ``ESTADO_OPERACAO``, conforme a "Tabela de Informações do Status do SAT...
def _arc(self, prom, sig): """ Computes the in-zodiaco and in-mundo arcs between a promissor and a significator. """ arcm = arc(prom['ra'], prom['decl'], sig['ra'], sig['decl'], self.mcRA, self.lat) arcz = arc(prom['raZ'], prom['d...
Computes the in-zodiaco and in-mundo arcs between a promissor and a significator.
Below is the the instruction that describes the task: ### Input: Computes the in-zodiaco and in-mundo arcs between a promissor and a significator. ### Response: def _arc(self, prom, sig): """ Computes the in-zodiaco and in-mundo arcs between a promissor and a significator. ...
def to_python(self): '''A :class:`datetime.datetime` object is returned.''' if self.data is None: return None # don't parse data that is already native if isinstance(self.data, datetime.datetime): return self.data elif self.use_int: return da...
A :class:`datetime.datetime` object is returned.
Below is the the instruction that describes the task: ### Input: A :class:`datetime.datetime` object is returned. ### Response: def to_python(self): '''A :class:`datetime.datetime` object is returned.''' if self.data is None: return None # don't parse data that is already nati...
def replace_refs_factory(references, use_cleveref_default, use_eqref, plusname, starname, target): """Returns replace_refs(key, value, fmt, meta) action that replaces references with format-specific content. The content is determined using the 'references' dict, which associates re...
Returns replace_refs(key, value, fmt, meta) action that replaces references with format-specific content. The content is determined using the 'references' dict, which associates reference labels with numbers or string tags (e.g., { 'fig:1':1, 'fig:2':2, ...}). If 'use_cleveref_default' is True, or if ...
Below is the the instruction that describes the task: ### Input: Returns replace_refs(key, value, fmt, meta) action that replaces references with format-specific content. The content is determined using the 'references' dict, which associates reference labels with numbers or string tags (e.g., { 'fig:1...
def socket_read(fp): """Buffered read from socket. Reads all data available from socket. @fp: File pointer for socket. @return: String of characters read from buffer. """ response = '' oldlen = 0 newlen = 0 while True: response += fp.read(buffSize) newlen = ...
Buffered read from socket. Reads all data available from socket. @fp: File pointer for socket. @return: String of characters read from buffer.
Below is the the instruction that describes the task: ### Input: Buffered read from socket. Reads all data available from socket. @fp: File pointer for socket. @return: String of characters read from buffer. ### Response: def socket_read(fp): """Buffered read from socket. Reads all data availa...
def get_client(host, userid, password, port=443, auth_method='basic', client_timeout=60, **kwargs): """get SCCI command partial function This function returns SCCI command partial function :param host: hostname or IP of iRMC :param userid: userid for iRMC with administrator privileges ...
get SCCI command partial function This function returns SCCI command partial function :param host: hostname or IP of iRMC :param userid: userid for iRMC with administrator privileges :param password: password for userid :param port: port number of iRMC :param auth_method: irmc_username :par...
Below is the the instruction that describes the task: ### Input: get SCCI command partial function This function returns SCCI command partial function :param host: hostname or IP of iRMC :param userid: userid for iRMC with administrator privileges :param password: password for userid :param por...
def _update_pipeline_status(self): """Parses the .nextflow.log file for signatures of pipeline status. It sets the :attr:`status_info` attribute. """ with open(self.log_file) as fh: try: first_line = next(fh) except: raise eh.Insp...
Parses the .nextflow.log file for signatures of pipeline status. It sets the :attr:`status_info` attribute.
Below is the the instruction that describes the task: ### Input: Parses the .nextflow.log file for signatures of pipeline status. It sets the :attr:`status_info` attribute. ### Response: def _update_pipeline_status(self): """Parses the .nextflow.log file for signatures of pipeline status. I...
def device_query_list(self, **kwargs): # noqa: E501 """List device queries. # noqa: E501 List all device queries. The result will be paged into pages of 100. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asynch...
List device queries. # noqa: E501 List all device queries. The result will be paged into pages of 100. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass asynchronous=True >>> thread = api.device_query_list(asynchron...
Below is the the instruction that describes the task: ### Input: List device queries. # noqa: E501 List all device queries. The result will be paged into pages of 100. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass a...
def _is_dir(self, f): '''Check if the given in-dap file is a directory''' return self._tar.getmember(f).type == tarfile.DIRTYPE
Check if the given in-dap file is a directory
Below is the the instruction that describes the task: ### Input: Check if the given in-dap file is a directory ### Response: def _is_dir(self, f): '''Check if the given in-dap file is a directory''' return self._tar.getmember(f).type == tarfile.DIRTYPE
def from_lines(lines: Iterable[str], **kwargs) -> BELGraph: """Load a BEL graph from an iterable over the lines of a BEL script. :param lines: An iterable of strings (the lines in a BEL script) The remaining keyword arguments are passed to :func:`pybel.io.line_utils.parse_lines`. """ graph = BELGr...
Load a BEL graph from an iterable over the lines of a BEL script. :param lines: An iterable of strings (the lines in a BEL script) The remaining keyword arguments are passed to :func:`pybel.io.line_utils.parse_lines`.
Below is the the instruction that describes the task: ### Input: Load a BEL graph from an iterable over the lines of a BEL script. :param lines: An iterable of strings (the lines in a BEL script) The remaining keyword arguments are passed to :func:`pybel.io.line_utils.parse_lines`. ### Response: def from...
def managed(name, users=None, defaults=None): ''' Manages the configuration of the users on the device, as specified in the state SLS file. Users not defined in that file will be remove whilst users not configured on the device, will be added. SLS Example: .. code-block:: yaml netusers_e...
Manages the configuration of the users on the device, as specified in the state SLS file. Users not defined in that file will be remove whilst users not configured on the device, will be added. SLS Example: .. code-block:: yaml netusers_example: netusers.managed: - us...
Below is the the instruction that describes the task: ### Input: Manages the configuration of the users on the device, as specified in the state SLS file. Users not defined in that file will be remove whilst users not configured on the device, will be added. SLS Example: .. code-block:: yaml ...
def register_incoming_conn(self, conn): """Add incoming connection into the heap.""" assert conn, "conn is required" conn.set_outbound_pending_change_callback(self._on_conn_change) self.connections.appendleft(conn) self._set_on_close_cb(conn) self._on_conn_change()
Add incoming connection into the heap.
Below is the the instruction that describes the task: ### Input: Add incoming connection into the heap. ### Response: def register_incoming_conn(self, conn): """Add incoming connection into the heap.""" assert conn, "conn is required" conn.set_outbound_pending_change_callback(self._on_conn_...
def status(name=None, id=None): ''' List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.status ...
List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash salt '*' vmctl.status # to list all VMs salt '*' vmctl...
Below is the the instruction that describes the task: ### Input: List VMs running on the host, or only the VM specified by ``id``. When both a name and id are provided, the id is ignored. name: Name of the defined VM. id: VM id. CLI Example: .. code-block:: bash sal...
def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = self._fsapfs_file_entry.get_modification_time_as_integer() return dfdatetime_apfs_time.APFSTime(timestamp=timestamp)
dfdatetime.DateTimeValues: modification time or None if not available.
Below is the the instruction that describes the task: ### Input: dfdatetime.DateTimeValues: modification time or None if not available. ### Response: def modification_time(self): """dfdatetime.DateTimeValues: modification time or None if not available.""" timestamp = self._fsapfs_file_entry.get_modificatio...
def add_plugin(self, plugin, call): """Add plugin to list of plugins. Will be added if it has the attribute I'm bound to. """ meth = getattr(plugin, call, None) if meth is not None: self.plugins.append((plugin, meth))
Add plugin to list of plugins. Will be added if it has the attribute I'm bound to.
Below is the the instruction that describes the task: ### Input: Add plugin to list of plugins. Will be added if it has the attribute I'm bound to. ### Response: def add_plugin(self, plugin, call): """Add plugin to list of plugins. Will be added if it has the attribute I'm bound to. ...
def delete_file(self, file_id): '''Delete a file. Args: file_id (str): The UUID of the file to delete. Returns: None Raises: StorageArgumentException: Invalid arguments StorageForbiddenException: Server response code 403 Stor...
Delete a file. Args: file_id (str): The UUID of the file to delete. Returns: None Raises: StorageArgumentException: Invalid arguments StorageForbiddenException: Server response code 403 StorageNotFoundException: Server response code ...
Below is the the instruction that describes the task: ### Input: Delete a file. Args: file_id (str): The UUID of the file to delete. Returns: None Raises: StorageArgumentException: Invalid arguments StorageForbiddenException: Server response...
def key_gen(self, key_name, type, size=2048, **kwargs): """Adds a new public key that can be used for name_publish. .. code-block:: python >>> c.key_gen('example_key_name') {'Name': 'example_key_name', 'Id': 'QmQLaT5ZrCfSkXTH6rUKtVidcxj8jrW3X2h75Lug1AV7g8'} ...
Adds a new public key that can be used for name_publish. .. code-block:: python >>> c.key_gen('example_key_name') {'Name': 'example_key_name', 'Id': 'QmQLaT5ZrCfSkXTH6rUKtVidcxj8jrW3X2h75Lug1AV7g8'} Parameters ---------- key_name : str ...
Below is the the instruction that describes the task: ### Input: Adds a new public key that can be used for name_publish. .. code-block:: python >>> c.key_gen('example_key_name') {'Name': 'example_key_name', 'Id': 'QmQLaT5ZrCfSkXTH6rUKtVidcxj8jrW3X2h75Lug1AV7g8'} ...
def get_custom_value(self, field_name): """ Get a value for a specified custom field field_name - Name of the custom field you want. """ custom_field = self.get_custom_field(field_name) return CustomFieldValue.objects.get_or_create( field=custom_field, object_id=self....
Get a value for a specified custom field field_name - Name of the custom field you want.
Below is the the instruction that describes the task: ### Input: Get a value for a specified custom field field_name - Name of the custom field you want. ### Response: def get_custom_value(self, field_name): """ Get a value for a specified custom field field_name - Name of the custom field ...
def _validate(self, qobj): """Semantic validations of the qobj which cannot be done via schemas.""" n_qubits = qobj.config.n_qubits max_qubits = self.configuration().n_qubits if n_qubits > max_qubits: raise BasicAerError('Number of qubits {} '.format(n_qubits) + ...
Semantic validations of the qobj which cannot be done via schemas.
Below is the the instruction that describes the task: ### Input: Semantic validations of the qobj which cannot be done via schemas. ### Response: def _validate(self, qobj): """Semantic validations of the qobj which cannot be done via schemas.""" n_qubits = qobj.config.n_qubits max_qubits = ...
def get_notification_language(user): """ Returns site-specific notification language for this user. Raises LanguageStoreNotAvailable if this site does not use translated notifications. """ if getattr(settings, "NOTIFICATION_LANGUAGE_MODULE", False): try: app_label, model_name...
Returns site-specific notification language for this user. Raises LanguageStoreNotAvailable if this site does not use translated notifications.
Below is the the instruction that describes the task: ### Input: Returns site-specific notification language for this user. Raises LanguageStoreNotAvailable if this site does not use translated notifications. ### Response: def get_notification_language(user): """ Returns site-specific notification ...
def pretty_template_plot(template, size=(10.5, 7.5), background=False, picks=False, **kwargs): """ Plot of a single template, possibly within background data. :type template: obspy.core.stream.Stream :param template: Template stream to plot :type size: tuple :param size...
Plot of a single template, possibly within background data. :type template: obspy.core.stream.Stream :param template: Template stream to plot :type size: tuple :param size: tuple of plot size :type background: obspy.core.stream.stream :param background: Stream to plot the template within. :...
Below is the the instruction that describes the task: ### Input: Plot of a single template, possibly within background data. :type template: obspy.core.stream.Stream :param template: Template stream to plot :type size: tuple :param size: tuple of plot size :type background: obspy.core.stream.st...
def pay_with_alias(amount: Money, alias_registration_id: str, client_ref: str) -> Payment: """ Charges money using datatrans, given a previously registered credit card alias. :param amount: The amount and currency we want to charge :param alias_registration_id: The alias registration to use :param ...
Charges money using datatrans, given a previously registered credit card alias. :param amount: The amount and currency we want to charge :param alias_registration_id: The alias registration to use :param client_ref: A unique reference for this charge :return: a Payment (either successful or not)
Below is the the instruction that describes the task: ### Input: Charges money using datatrans, given a previously registered credit card alias. :param amount: The amount and currency we want to charge :param alias_registration_id: The alias registration to use :param client_ref: A unique reference for...
def toggleglobalsitepackages_cmd(argv): """Toggle the current virtualenv between having and not having access to the global site-packages.""" quiet = argv == ['-q'] site = sitepackages_dir() ngsp_file = site.parent / 'no-global-site-packages.txt' if ngsp_file.exists(): ngsp_file.unlink() ...
Toggle the current virtualenv between having and not having access to the global site-packages.
Below is the the instruction that describes the task: ### Input: Toggle the current virtualenv between having and not having access to the global site-packages. ### Response: def toggleglobalsitepackages_cmd(argv): """Toggle the current virtualenv between having and not having access to the global site-package...
def _prepare_for_cross_validation(self, corr, clf): """Prepare data for voxelwise cross validation. If the classifier is sklearn.svm.SVC with precomputed kernel, the kernel matrix of each voxel is computed, otherwise do nothing. Parameters ---------- corr: 3D array in s...
Prepare data for voxelwise cross validation. If the classifier is sklearn.svm.SVC with precomputed kernel, the kernel matrix of each voxel is computed, otherwise do nothing. Parameters ---------- corr: 3D array in shape [num_processed_voxels, num_epochs, num_voxels] ...
Below is the the instruction that describes the task: ### Input: Prepare data for voxelwise cross validation. If the classifier is sklearn.svm.SVC with precomputed kernel, the kernel matrix of each voxel is computed, otherwise do nothing. Parameters ---------- corr: 3D arra...
def sortLocations(locations): """ Sort the locations by ranking: 1. all on-axis points 2. all off-axis points which project onto on-axis points these would be involved in master to master interpolations necessary for patching. Projecting off-axis masters hav...
Sort the locations by ranking: 1. all on-axis points 2. all off-axis points which project onto on-axis points these would be involved in master to master interpolations necessary for patching. Projecting off-axis masters have at least one coordin...
Below is the the instruction that describes the task: ### Input: Sort the locations by ranking: 1. all on-axis points 2. all off-axis points which project onto on-axis points these would be involved in master to master interpolations necessary for patching. ...
def id_range(self): """Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned. """ if len(self._anchor_points) == 0: return (0, 0) return (self._a...
Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned.
Below is the the instruction that describes the task: ### Input: Get the range of archor reading_ids. Returns: (int, int): The lowest and highest reading ids. If no reading ids have been loaded, (0, 0) is returned. ### Response: def id_range(self): """Get the range of arch...
def get_expectations_config(self, discard_failed_expectations=True, discard_result_format_kwargs=True, discard_include_configs_kwargs=True, discard_catch_exceptions_kwargs=True, ...
Returns _expectation_config as a JSON object, and perform some cleaning along the way. Args: discard_failed_expectations (boolean): \ Only include expectations with success_on_last_run=True in the exported config. Defaults to `True`. discard_result_format_kwargs (boolea...
Below is the the instruction that describes the task: ### Input: Returns _expectation_config as a JSON object, and perform some cleaning along the way. Args: discard_failed_expectations (boolean): \ Only include expectations with success_on_last_run=True in the exported config. ...
def _get_wrapper_args(routine): """ Returns code for the parameters of the wrapper method for the stored routine. :param dict[str,*] routine: The routine metadata. :rtype: str """ ret = '' for parameter_info in routine['parameters']: if ret: ...
Returns code for the parameters of the wrapper method for the stored routine. :param dict[str,*] routine: The routine metadata. :rtype: str
Below is the the instruction that describes the task: ### Input: Returns code for the parameters of the wrapper method for the stored routine. :param dict[str,*] routine: The routine metadata. :rtype: str ### Response: def _get_wrapper_args(routine): """ Returns code for the param...
def pie(n_labels=5,mode=None): """ Returns a DataFrame with the required format for a pie plot Parameters: ----------- n_labels : int Number of labels mode : string Format for each item 'abc' for alphabet columns 'stocks' for random stock names """ return pd.DataFrame({'values':np.random.ra...
Returns a DataFrame with the required format for a pie plot Parameters: ----------- n_labels : int Number of labels mode : string Format for each item 'abc' for alphabet columns 'stocks' for random stock names
Below is the the instruction that describes the task: ### Input: Returns a DataFrame with the required format for a pie plot Parameters: ----------- n_labels : int Number of labels mode : string Format for each item 'abc' for alphabet columns 'stocks' for random stock names ### Response: de...
def overlap(args): """ %prog overlap best.contains iid Visualize overlaps for a given fragment. Must be run in 4-unitigger. All overlaps for iid were retrieved, excluding the ones matching best.contains. """ from jcvi.apps.console import green p = OptionParser(overlap.__doc__) p.add_op...
%prog overlap best.contains iid Visualize overlaps for a given fragment. Must be run in 4-unitigger. All overlaps for iid were retrieved, excluding the ones matching best.contains.
Below is the the instruction that describes the task: ### Input: %prog overlap best.contains iid Visualize overlaps for a given fragment. Must be run in 4-unitigger. All overlaps for iid were retrieved, excluding the ones matching best.contains. ### Response: def overlap(args): """ %prog overlap b...
def get_stream_action_type(stream_arn): """Returns the awacs Action for a stream type given an arn Args: stream_arn (str): The Arn of the stream. Returns: :class:`awacs.aws.Action`: The appropriate stream type awacs Action class Raises: ValueError: If the stream ty...
Returns the awacs Action for a stream type given an arn Args: stream_arn (str): The Arn of the stream. Returns: :class:`awacs.aws.Action`: The appropriate stream type awacs Action class Raises: ValueError: If the stream type doesn't match kinesis or dynamodb.
Below is the the instruction that describes the task: ### Input: Returns the awacs Action for a stream type given an arn Args: stream_arn (str): The Arn of the stream. Returns: :class:`awacs.aws.Action`: The appropriate stream type awacs Action class Raises: ValueE...
def cf_encoder(variables, attributes): """ A function which takes a dicts of variables and attributes and encodes them to conform to CF conventions as much as possible. This includes masking, scaling, character array handling, and CF-time encoding. Decode a set of CF encoded variables and attr...
A function which takes a dicts of variables and attributes and encodes them to conform to CF conventions as much as possible. This includes masking, scaling, character array handling, and CF-time encoding. Decode a set of CF encoded variables and attributes. See Also, decode_cf_variable Para...
Below is the the instruction that describes the task: ### Input: A function which takes a dicts of variables and attributes and encodes them to conform to CF conventions as much as possible. This includes masking, scaling, character array handling, and CF-time encoding. Decode a set of CF encoded ...
def update(gandi, resource, name, algorithm, ssl_enable, ssl_disable): """Update a webaccelerator""" result = gandi.webacc.update(resource, name, algorithm, ssl_enable, ssl_disable) return result
Update a webaccelerator
Below is the the instruction that describes the task: ### Input: Update a webaccelerator ### Response: def update(gandi, resource, name, algorithm, ssl_enable, ssl_disable): """Update a webaccelerator""" result = gandi.webacc.update(resource, name, algorithm, ssl_enable, ss...
def import_class(name): """Load class from fully-qualified python module name. ex: import_class('bulbs.content.models.Content') """ module, _, klass = name.rpartition('.') mod = import_module(module) return getattr(mod, klass)
Load class from fully-qualified python module name. ex: import_class('bulbs.content.models.Content')
Below is the the instruction that describes the task: ### Input: Load class from fully-qualified python module name. ex: import_class('bulbs.content.models.Content') ### Response: def import_class(name): """Load class from fully-qualified python module name. ex: import_class('bulbs.content.models.Con...
def get_deposit(self, deposit_id, **params): """https://developers.coinbase.com/api/v2#show-a-deposit""" return self.api_client.get_deposit(self.id, deposit_id, **params)
https://developers.coinbase.com/api/v2#show-a-deposit
Below is the the instruction that describes the task: ### Input: https://developers.coinbase.com/api/v2#show-a-deposit ### Response: def get_deposit(self, deposit_id, **params): """https://developers.coinbase.com/api/v2#show-a-deposit""" return self.api_client.get_deposit(self.id, deposit_id, **par...
def do_longlist(self, arg): """longlist | ll List the whole source code for the current function or frame. """ filename = self.curframe.f_code.co_filename breaklist = self.get_file_breaks(filename) try: lines, lineno = getsourcelines(self.curframe, ...
longlist | ll List the whole source code for the current function or frame.
Below is the the instruction that describes the task: ### Input: longlist | ll List the whole source code for the current function or frame. ### Response: def do_longlist(self, arg): """longlist | ll List the whole source code for the current function or frame. """ filename ...
def apply_pagination(self, q): """ Filters the query so that a given page is returned. The record count must be set in advance. :param q: Query to be paged. :return: Paged query. """ # type: (Query)->Query assert self.record_count >= 0, "Record count must ...
Filters the query so that a given page is returned. The record count must be set in advance. :param q: Query to be paged. :return: Paged query.
Below is the the instruction that describes the task: ### Input: Filters the query so that a given page is returned. The record count must be set in advance. :param q: Query to be paged. :return: Paged query. ### Response: def apply_pagination(self, q): """ Filters the query...
def prune_tree(path): """ Like shutil.rmtree(), but log errors rather than discard them, and do not waste multiple os.stat() calls discovering whether the object can be deleted, just try deleting it instead. """ try: os.unlink(path) return except OSError: e = sys.exc_...
Like shutil.rmtree(), but log errors rather than discard them, and do not waste multiple os.stat() calls discovering whether the object can be deleted, just try deleting it instead.
Below is the the instruction that describes the task: ### Input: Like shutil.rmtree(), but log errors rather than discard them, and do not waste multiple os.stat() calls discovering whether the object can be deleted, just try deleting it instead. ### Response: def prune_tree(path): """ Like shutil....
def pdf(self, d, n=None): r'''Computes the probability density function of a continuous particle size distribution at a specified particle diameter, an optionally in a specified basis. The evaluation function varies with the distribution chosen. The interconversion between distribution ...
r'''Computes the probability density function of a continuous particle size distribution at a specified particle diameter, an optionally in a specified basis. The evaluation function varies with the distribution chosen. The interconversion between distribution orders is performed using ...
Below is the the instruction that describes the task: ### Input: r'''Computes the probability density function of a continuous particle size distribution at a specified particle diameter, an optionally in a specified basis. The evaluation function varies with the distribution chosen. The int...
def _set_size_code(self): """Set the code for a size operation. """ if not self._op.startswith(self.SIZE): self._size_code = None return if len(self._op) == len(self.SIZE): self._size_code = self.SZ_EQ else: suffix = self._op[len(s...
Set the code for a size operation.
Below is the the instruction that describes the task: ### Input: Set the code for a size operation. ### Response: def _set_size_code(self): """Set the code for a size operation. """ if not self._op.startswith(self.SIZE): self._size_code = None return if len(...
def digest(self): """Terminate the message-digest computation and return digest. Return the digest of the strings passed to the update() method so far. This is a 16-byte string which may contain non-ASCII characters, including null bytes. """ A = self.A B = self.B C = self.C D = se...
Terminate the message-digest computation and return digest. Return the digest of the strings passed to the update() method so far. This is a 16-byte string which may contain non-ASCII characters, including null bytes.
Below is the the instruction that describes the task: ### Input: Terminate the message-digest computation and return digest. Return the digest of the strings passed to the update() method so far. This is a 16-byte string which may contain non-ASCII characters, including null bytes. ### Response: def d...
def dispatch_pure( request: str, methods: Methods, *, context: Any, convert_camel_case: bool, debug: bool, ) -> Response: """ Pure version of dispatch - no logging, no optional parameters. Does two things: 1. Deserializes and validates the string. 2. Calls each reque...
Pure version of dispatch - no logging, no optional parameters. Does two things: 1. Deserializes and validates the string. 2. Calls each request. Args: request: The incoming request string. methods: Collection of methods that can be called. context: If specified, will be...
Below is the the instruction that describes the task: ### Input: Pure version of dispatch - no logging, no optional parameters. Does two things: 1. Deserializes and validates the string. 2. Calls each request. Args: request: The incoming request string. methods: Collection ...
def create_hls_profile(apps, schema_editor): """ Create hls profile """ Profile = apps.get_model("edxval", "Profile") Profile.objects.get_or_create(profile_name=HLS_PROFILE)
Create hls profile
Below is the the instruction that describes the task: ### Input: Create hls profile ### Response: def create_hls_profile(apps, schema_editor): """ Create hls profile """ Profile = apps.get_model("edxval", "Profile") Profile.objects.get_or_create(profile_name=HLS_PROFILE)
def _set_operable_view(self, session): """Sets the underlying operable views to match current view""" for obj_name in self._operable_views: if self._operable_views[obj_name] == ACTIVE: try: getattr(session, 'use_active_' + obj_name + '_view')() ...
Sets the underlying operable views to match current view
Below is the the instruction that describes the task: ### Input: Sets the underlying operable views to match current view ### Response: def _set_operable_view(self, session): """Sets the underlying operable views to match current view""" for obj_name in self._operable_views: if self._op...
def normalize_hostname(hostname): '''Normalizes a hostname so that it is ASCII and valid domain name.''' try: new_hostname = hostname.encode('idna').decode('ascii').lower() except UnicodeError as error: raise UnicodeError('Hostname {} rejected: {}'.format(hostname, error)) from error if...
Normalizes a hostname so that it is ASCII and valid domain name.
Below is the the instruction that describes the task: ### Input: Normalizes a hostname so that it is ASCII and valid domain name. ### Response: def normalize_hostname(hostname): '''Normalizes a hostname so that it is ASCII and valid domain name.''' try: new_hostname = hostname.encode('idna').decode...
def marker(self, marker_name=None, label=None, color=None, retina=False): """Returns a single marker image without any background map. Parameters ---------- marker_name : str The marker's shape and size. label : str, optional T...
Returns a single marker image without any background map. Parameters ---------- marker_name : str The marker's shape and size. label : str, optional The marker's alphanumeric label. Options are a through z, 0 through 99, or the ...
Below is the the instruction that describes the task: ### Input: Returns a single marker image without any background map. Parameters ---------- marker_name : str The marker's shape and size. label : str, optional The marker's alphanumeric label. ...
def format_underline(s, char="=", indents=0): """ Traces a dashed line below string Args: s: string char: indents: number of leading intenting spaces Returns: list >>> print("\\n".join(format_underline("Life of João da Silva", "^", 2))) Life of João da Si...
Traces a dashed line below string Args: s: string char: indents: number of leading intenting spaces Returns: list >>> print("\\n".join(format_underline("Life of João da Silva", "^", 2))) Life of João da Silva ^^^^^^^^^^^^^^^^^^^^^
Below is the the instruction that describes the task: ### Input: Traces a dashed line below string Args: s: string char: indents: number of leading intenting spaces Returns: list >>> print("\\n".join(format_underline("Life of João da Silva", "^", 2))) Life of J...
def lpd_to_noaa(D, wds_url, lpd_url, version, path=""): """ Convert a LiPD format to NOAA format :param dict D: Metadata :return dict D: Metadata """ logger_noaa.info("enter process_lpd") d = D try: dsn = get_dsn(D) # Remove all the characters that are not allowed here. ...
Convert a LiPD format to NOAA format :param dict D: Metadata :return dict D: Metadata
Below is the the instruction that describes the task: ### Input: Convert a LiPD format to NOAA format :param dict D: Metadata :return dict D: Metadata ### Response: def lpd_to_noaa(D, wds_url, lpd_url, version, path=""): """ Convert a LiPD format to NOAA format :param dict D: Metadata :re...
def load_module(self, name): """ If we get this far, then there are hooks waiting to be called on import of this module. We manually load the module and then run the hooks. @param name: The name of the module to import. """ self.loaded_modules.append(name) ...
If we get this far, then there are hooks waiting to be called on import of this module. We manually load the module and then run the hooks. @param name: The name of the module to import.
Below is the the instruction that describes the task: ### Input: If we get this far, then there are hooks waiting to be called on import of this module. We manually load the module and then run the hooks. @param name: The name of the module to import. ### Response: def load_module(self, na...
def _make_request(self, opener, request, timeout=None): """Make the API call and return the response. This is separated into it's own function, so we can mock it easily for testing. :param opener: :type opener: :param request: url payload to request :type request: url...
Make the API call and return the response. This is separated into it's own function, so we can mock it easily for testing. :param opener: :type opener: :param request: url payload to request :type request: urllib.Request object :param timeout: timeout value or None ...
Below is the the instruction that describes the task: ### Input: Make the API call and return the response. This is separated into it's own function, so we can mock it easily for testing. :param opener: :type opener: :param request: url payload to request :type request: u...
def _set_bookmarks(self, bookmarks): """ Set the bookmarks stored on the server. """ storage = bookmark_xso.Storage() storage.bookmarks[:] = bookmarks yield from self._private_xml.set_private_xml(storage)
Set the bookmarks stored on the server.
Below is the the instruction that describes the task: ### Input: Set the bookmarks stored on the server. ### Response: def _set_bookmarks(self, bookmarks): """ Set the bookmarks stored on the server. """ storage = bookmark_xso.Storage() storage.bookmarks[:] = bookmarks ...
def transform_courserun_description(self, content_metadata_item): """ Return the description of the courserun content item. """ description_with_locales = [] content_metadata_language_code = transform_language_code(content_metadata_item.get('content_language', '')) for lo...
Return the description of the courserun content item.
Below is the the instruction that describes the task: ### Input: Return the description of the courserun content item. ### Response: def transform_courserun_description(self, content_metadata_item): """ Return the description of the courserun content item. """ description_with_local...
def participate(self): """Finish reading and send text""" try: while True: left = WebDriverWait(self.driver, 10).until( EC.element_to_be_clickable((By.ID, "left_button")) ) right = WebDriverWait(self.driver, 10).until( ...
Finish reading and send text
Below is the the instruction that describes the task: ### Input: Finish reading and send text ### Response: def participate(self): """Finish reading and send text""" try: while True: left = WebDriverWait(self.driver, 10).until( EC.element_to_be_clicka...
def release_lock(self, lock, force=False): ''' Frees a lock ''' pid = os.getpid() caller = inspect.stack()[0][3] # try: # rl = redlock.Redlock([{"host": settings.REDIS_SERVERS['std_redis']['host'], "port": settings.REDIS_SERVERS['std_redis']['port'], "db": settings.REDIS_S...
Frees a lock
Below is the the instruction that describes the task: ### Input: Frees a lock ### Response: def release_lock(self, lock, force=False): ''' Frees a lock ''' pid = os.getpid() caller = inspect.stack()[0][3] # try: # rl = redlock.Redlock([{"host": settings.REDIS_SERVERS[...
def bind_unix_socket(path): """ Returns a unix file socket bound on (path). """ assert path bindsocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: os.unlink(path) except OSError: if os.path.exists(path): raise try: bindsocket.bind(path) excep...
Returns a unix file socket bound on (path).
Below is the the instruction that describes the task: ### Input: Returns a unix file socket bound on (path). ### Response: def bind_unix_socket(path): """ Returns a unix file socket bound on (path). """ assert path bindsocket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) try: os.unli...
def p_field_optional2_5(self, p): """ field : alias name directives """ p[0] = Field(name=p[2], alias=p[1], directives=p[3])
field : alias name directives
Below is the the instruction that describes the task: ### Input: field : alias name directives ### Response: def p_field_optional2_5(self, p): """ field : alias name directives """ p[0] = Field(name=p[2], alias=p[1], directives=p[3])
def read_byte(self, address): """Reads unadressed byte from a device. """ LOGGER.debug("Reading byte from device %s!", hex(address)) return self.driver.read_byte(address)
Reads unadressed byte from a device.
Below is the the instruction that describes the task: ### Input: Reads unadressed byte from a device. ### Response: def read_byte(self, address): """Reads unadressed byte from a device. """ LOGGER.debug("Reading byte from device %s!", hex(address)) return self.driver.read_byte(address)
def get_word_at(self, coordinates): """Return word at *coordinates* (QPoint)""" cursor = self.cursorForPosition(coordinates) cursor.select(QTextCursor.WordUnderCursor) return to_text_string(cursor.selectedText())
Return word at *coordinates* (QPoint)
Below is the the instruction that describes the task: ### Input: Return word at *coordinates* (QPoint) ### Response: def get_word_at(self, coordinates): """Return word at *coordinates* (QPoint)""" cursor = self.cursorForPosition(coordinates) cursor.select(QTextCursor.WordUnderCursor) ...
def cached_class(klass): """ Decorator to cache class instances by constructor arguments. This results in a class that behaves like a singleton for each set of constructor arguments, ensuring efficiency. Note that this should be used for *immutable classes only*. Having a cached mutable class ...
Decorator to cache class instances by constructor arguments. This results in a class that behaves like a singleton for each set of constructor arguments, ensuring efficiency. Note that this should be used for *immutable classes only*. Having a cached mutable class makes very little sense. For efficie...
Below is the the instruction that describes the task: ### Input: Decorator to cache class instances by constructor arguments. This results in a class that behaves like a singleton for each set of constructor arguments, ensuring efficiency. Note that this should be used for *immutable classes only*. Ha...
def _fromdata(self, code, dtype, count, value, name=None): """Initialize instance from arguments.""" self.code = int(code) self.name = name if name else str(code) self.dtype = TIFF_DATA_TYPES[dtype] self.count = int(count) self.value = value
Initialize instance from arguments.
Below is the the instruction that describes the task: ### Input: Initialize instance from arguments. ### Response: def _fromdata(self, code, dtype, count, value, name=None): """Initialize instance from arguments.""" self.code = int(code) self.name = name if name else str(code) self....
def remove_member_data_in(self, leaderboard_name, member): ''' Remove the optional member data for a given member in the named leaderboard. @param leaderboard_name [String] Name of the leaderboard. @param member [String] Member name. ''' self.redis_connection.hdel( ...
Remove the optional member data for a given member in the named leaderboard. @param leaderboard_name [String] Name of the leaderboard. @param member [String] Member name.
Below is the the instruction that describes the task: ### Input: Remove the optional member data for a given member in the named leaderboard. @param leaderboard_name [String] Name of the leaderboard. @param member [String] Member name. ### Response: def remove_member_data_in(self, leaderboard_name...
def memory_usage(method): """Log memory usage before and after a method.""" def wrapper(*args, **kwargs): logging.info('Memory before method %s is %s.', method.__name__, runtime.memory_usage().current()) result = method(*args, **kwargs) logging.info('Memory after method %s is %s', ...
Log memory usage before and after a method.
Below is the the instruction that describes the task: ### Input: Log memory usage before and after a method. ### Response: def memory_usage(method): """Log memory usage before and after a method.""" def wrapper(*args, **kwargs): logging.info('Memory before method %s is %s.', method.__name_...
def pipe_strconcat(context=None, _INPUT=None, conf=None, **kwargs): """A string module that builds a string. Loopable. Parameters ---------- context : pipe2py.Context object _INPUT : pipeforever pipe or an iterable of items conf : { 'part': [ {'value': '<img src="'}, ...
A string module that builds a string. Loopable. Parameters ---------- context : pipe2py.Context object _INPUT : pipeforever pipe or an iterable of items conf : { 'part': [ {'value': '<img src="'}, {'subkey': 'img.src'}, {'value': '">'} ] } ...
Below is the the instruction that describes the task: ### Input: A string module that builds a string. Loopable. Parameters ---------- context : pipe2py.Context object _INPUT : pipeforever pipe or an iterable of items conf : { 'part': [ {'value': '<img src="'}, {...
def _download_files(self, client, flow_id): """Download files from the specified flow. Args: client: GRR Client object to which to download flow data from. flow_id: GRR flow ID. Returns: str: path of downloaded files. """ output_file_path = os.path.join( self.output_path,...
Download files from the specified flow. Args: client: GRR Client object to which to download flow data from. flow_id: GRR flow ID. Returns: str: path of downloaded files.
Below is the the instruction that describes the task: ### Input: Download files from the specified flow. Args: client: GRR Client object to which to download flow data from. flow_id: GRR flow ID. Returns: str: path of downloaded files. ### Response: def _download_files(self, client, flo...
def from_soup(self,author,soup): """ Factory Pattern. Fetches contact data from given soup and builds the object """ email = soup.find('span',class_='icon icon-mail').findParent('a').get('href').split(':')[-1] if soup.find('span',class_='icon icon-mail') else '' facebook = soup.find('span',class_='icon ico...
Factory Pattern. Fetches contact data from given soup and builds the object
Below is the the instruction that describes the task: ### Input: Factory Pattern. Fetches contact data from given soup and builds the object ### Response: def from_soup(self,author,soup): """ Factory Pattern. Fetches contact data from given soup and builds the object """ email = soup.find('span',class_='...
def define_as_input(self, pin, pullup=False): """Set the input or output mode for a specified pin. Mode should be either GPIO.OUT or GPIO.IN. """ self._validate_channel(pin) # Set bit to 1 for input or 0 for output. self.iodir[int(pin/8)] |= 1 << (int(pin%8)) sel...
Set the input or output mode for a specified pin. Mode should be either GPIO.OUT or GPIO.IN.
Below is the the instruction that describes the task: ### Input: Set the input or output mode for a specified pin. Mode should be either GPIO.OUT or GPIO.IN. ### Response: def define_as_input(self, pin, pullup=False): """Set the input or output mode for a specified pin. Mode should be eit...
def get_runnable_effects(self) -> List[Effect]: """ Returns all runnable effects in the project. :return: List of all runnable effects """ return [effect for name, effect in self._effects.items() if effect.runnable]
Returns all runnable effects in the project. :return: List of all runnable effects
Below is the the instruction that describes the task: ### Input: Returns all runnable effects in the project. :return: List of all runnable effects ### Response: def get_runnable_effects(self) -> List[Effect]: """ Returns all runnable effects in the project. :return: List of...
def get_float(self, input_string): """ Return float type user input """ if input_string == '--training_fraction': # was the flag set? try: index = self.args.index(input_string) + 1 except ValueError: # it wasn't, it's optional, so...
Return float type user input
Below is the the instruction that describes the task: ### Input: Return float type user input ### Response: def get_float(self, input_string): """ Return float type user input """ if input_string == '--training_fraction': # was the flag set? try: index ...
def keys(self): """ Access the keys :returns: twilio.rest.api.v2010.account.key.KeyList :rtype: twilio.rest.api.v2010.account.key.KeyList """ if self._keys is None: self._keys = KeyList(self._version, account_sid=self._solution['sid'], ) return self._...
Access the keys :returns: twilio.rest.api.v2010.account.key.KeyList :rtype: twilio.rest.api.v2010.account.key.KeyList
Below is the the instruction that describes the task: ### Input: Access the keys :returns: twilio.rest.api.v2010.account.key.KeyList :rtype: twilio.rest.api.v2010.account.key.KeyList ### Response: def keys(self): """ Access the keys :returns: twilio.rest.api.v2010.account....
def copy_root_log_to_file(filename: str, fmt: str = LOG_FORMAT, datefmt: str = LOG_DATEFMT) -> None: """ Copy all currently configured logs to the specified file. Should ONLY be called from the ``if __name__ == 'main'`` script; see https://docs.python...
Copy all currently configured logs to the specified file. Should ONLY be called from the ``if __name__ == 'main'`` script; see https://docs.python.org/3.4/howto/logging.html#library-config.
Below is the the instruction that describes the task: ### Input: Copy all currently configured logs to the specified file. Should ONLY be called from the ``if __name__ == 'main'`` script; see https://docs.python.org/3.4/howto/logging.html#library-config. ### Response: def copy_root_log_to_file(filename: s...
def discover(path, filter_specs=filter_specs): """ Discover all of the specs recursively inside ``path``. Successively yields the (full) relative paths to each spec. """ for dirpath, _, filenames in os.walk(path): for spec in filter_specs(filenames): yield os.path.join(dirpath...
Discover all of the specs recursively inside ``path``. Successively yields the (full) relative paths to each spec.
Below is the the instruction that describes the task: ### Input: Discover all of the specs recursively inside ``path``. Successively yields the (full) relative paths to each spec. ### Response: def discover(path, filter_specs=filter_specs): """ Discover all of the specs recursively inside ``path``. ...
def LeaseFlowForProcessing(self, client_id, flow_id, processing_time): """Marks a flow as being processed on this worker and returns it.""" rdf_flow = self.ReadFlowObject(client_id, flow_id) # TODO(user): remove the check for a legacy hunt prefix as soon as # AFF4 is gone. if rdf_flow.parent_hunt_id...
Marks a flow as being processed on this worker and returns it.
Below is the the instruction that describes the task: ### Input: Marks a flow as being processed on this worker and returns it. ### Response: def LeaseFlowForProcessing(self, client_id, flow_id, processing_time): """Marks a flow as being processed on this worker and returns it.""" rdf_flow = self.ReadFlowO...
def generate_docker_compose(self): """ Generate a sample docker compose """ example = {} example['app'] = {} example['app']['environment'] = [] for key in sorted(list(self.spec.keys())): if self.spec[key]['type'] in (dict, list): value = f"\'{j...
Generate a sample docker compose
Below is the the instruction that describes the task: ### Input: Generate a sample docker compose ### Response: def generate_docker_compose(self): """ Generate a sample docker compose """ example = {} example['app'] = {} example['app']['environment'] = [] for key in ...
def parse_response(self, info, sformat="", state="", **kwargs): """ This the start of a pipeline that will: 1 Deserializes a response into it's response message class. Or :py:class:`oidcmsg.oauth2.ErrorResponse` if it's an error message 2 verifies the...
This the start of a pipeline that will: 1 Deserializes a response into it's response message class. Or :py:class:`oidcmsg.oauth2.ErrorResponse` if it's an error message 2 verifies the correctness of the response by running the verify method belonging to...
Below is the the instruction that describes the task: ### Input: This the start of a pipeline that will: 1 Deserializes a response into it's response message class. Or :py:class:`oidcmsg.oauth2.ErrorResponse` if it's an error message 2 verifies the correctness of...
def _unique_resource_identifier_from_kwargs(**kwargs): """Chooses an identifier given different choices The unique identifier in BIG-IP's REST API at the time of this writing is called 'name'. This is in contrast to the unique identifier that is used by iWorkflow and BIG-IQ which at some times is 'name...
Chooses an identifier given different choices The unique identifier in BIG-IP's REST API at the time of this writing is called 'name'. This is in contrast to the unique identifier that is used by iWorkflow and BIG-IQ which at some times is 'name' and other times is 'uuid'. For example, in iWorkflo...
Below is the the instruction that describes the task: ### Input: Chooses an identifier given different choices The unique identifier in BIG-IP's REST API at the time of this writing is called 'name'. This is in contrast to the unique identifier that is used by iWorkflow and BIG-IQ which at some times i...
def digest_file(fname): """ Digest files using SHA-2 (256-bit) TESTING Produces identical output to `openssl sha256 FILE` for the following: * on all source .py files and some binary pyc files in parent dir * empty files with different names * 3.3GB DNAse Hypersensitive file * ...
Digest files using SHA-2 (256-bit) TESTING Produces identical output to `openssl sha256 FILE` for the following: * on all source .py files and some binary pyc files in parent dir * empty files with different names * 3.3GB DNAse Hypersensitive file * empty file, file with one space, fil...
Below is the the instruction that describes the task: ### Input: Digest files using SHA-2 (256-bit) TESTING Produces identical output to `openssl sha256 FILE` for the following: * on all source .py files and some binary pyc files in parent dir * empty files with different names * 3.3GB D...
def bitpos(self, key, bit, start=None, end=None): """ Return the position of the first bit set to 1 or 0 in a string. ``start`` and ``end`` difines search range. The range is interpreted as a range of bytes and not a range of bits, so start=0 and end=2 means to look at the first ...
Return the position of the first bit set to 1 or 0 in a string. ``start`` and ``end`` difines search range. The range is interpreted as a range of bytes and not a range of bits, so start=0 and end=2 means to look at the first three bytes.
Below is the the instruction that describes the task: ### Input: Return the position of the first bit set to 1 or 0 in a string. ``start`` and ``end`` difines search range. The range is interpreted as a range of bytes and not a range of bits, so start=0 and end=2 means to look at the first t...
def enrichrgram(self, lib, axis='row'): ''' Add Enrichr gene enrichment results to your visualization (where your rows are genes). Run enrichrgram before clustering to incldue enrichment results as row categories. Enrichrgram can also be run on the front-end using the Enrichr logo at the top left. ...
Add Enrichr gene enrichment results to your visualization (where your rows are genes). Run enrichrgram before clustering to incldue enrichment results as row categories. Enrichrgram can also be run on the front-end using the Enrichr logo at the top left. Set lib to the Enrichr library that you want to ...
Below is the the instruction that describes the task: ### Input: Add Enrichr gene enrichment results to your visualization (where your rows are genes). Run enrichrgram before clustering to incldue enrichment results as row categories. Enrichrgram can also be run on the front-end using the Enrichr logo a...
def _set_telnet(self, v, load=False): """ Setter method for telnet, mapped from YANG variable /rbridge_id/telnet (container) If this variable is read-only (config: false) in the source YANG file, then _set_telnet is considered as a private method. Backends looking to populate this variable should ...
Setter method for telnet, mapped from YANG variable /rbridge_id/telnet (container) If this variable is read-only (config: false) in the source YANG file, then _set_telnet is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._set_telnet() directly...
Below is the the instruction that describes the task: ### Input: Setter method for telnet, mapped from YANG variable /rbridge_id/telnet (container) If this variable is read-only (config: false) in the source YANG file, then _set_telnet is considered as a private method. Backends looking to populate this...
def campaign(self, name, owner=None, **kwargs): """ Create the Campaign TI object. Args: owner: name: **kwargs: Return: """ return Campaign(self.tcex, name, owner=owner, **kwargs)
Create the Campaign TI object. Args: owner: name: **kwargs: Return:
Below is the the instruction that describes the task: ### Input: Create the Campaign TI object. Args: owner: name: **kwargs: Return: ### Response: def campaign(self, name, owner=None, **kwargs): """ Create the Campaign TI object. Args: ...
def read_command(self): """ Attempt to read the next command from the editor/server :return: boolean. Did we actually read a command? """ # Do a non-blocking read here so the demo can keep running if there is no data comm = self.reader.byte(blocking=False) if comm...
Attempt to read the next command from the editor/server :return: boolean. Did we actually read a command?
Below is the the instruction that describes the task: ### Input: Attempt to read the next command from the editor/server :return: boolean. Did we actually read a command? ### Response: def read_command(self): """ Attempt to read the next command from the editor/server :return: boole...
def convert(sk_obj, input_features = None, output_feature_names = None): """ Convert scikit-learn pipeline, classifier, or regressor to Core ML format. Parameters ---------- sk_obj: model | [model] of scikit-learn format. Scikit learn model(s) to convert to a Core ML format. ...
Convert scikit-learn pipeline, classifier, or regressor to Core ML format. Parameters ---------- sk_obj: model | [model] of scikit-learn format. Scikit learn model(s) to convert to a Core ML format. The input model may be a single scikit learn model, a scikit learn pipeline model, ...
Below is the the instruction that describes the task: ### Input: Convert scikit-learn pipeline, classifier, or regressor to Core ML format. Parameters ---------- sk_obj: model | [model] of scikit-learn format. Scikit learn model(s) to convert to a Core ML format. The input model may be...
def can_manage_groups(cls, user): """ For use with user_passes_test decorator. Check if the user can manage groups. Either has the auth.group_management permission or is a leader of at least one group and is also a Member. :param user: django.contrib.auth.models.User for ...
For use with user_passes_test decorator. Check if the user can manage groups. Either has the auth.group_management permission or is a leader of at least one group and is also a Member. :param user: django.contrib.auth.models.User for the request :return: bool True if user can man...
Below is the the instruction that describes the task: ### Input: For use with user_passes_test decorator. Check if the user can manage groups. Either has the auth.group_management permission or is a leader of at least one group and is also a Member. :param user: django.contrib.auth.m...
def merge_variables(variables, name=None, **kwargs): '''Merge/concatenate a list of variables along the row axis. Parameters ---------- variables : :obj:`list` A list of Variables to merge. name : :obj:`str` Optional name to assign to the output Variable. By default, uses the ...
Merge/concatenate a list of variables along the row axis. Parameters ---------- variables : :obj:`list` A list of Variables to merge. name : :obj:`str` Optional name to assign to the output Variable. By default, uses the same name as the input variables. kwargs Optio...
Below is the the instruction that describes the task: ### Input: Merge/concatenate a list of variables along the row axis. Parameters ---------- variables : :obj:`list` A list of Variables to merge. name : :obj:`str` Optional name to assign to the output Variable. By default, uses t...
def pprint(self): """Returns: text: a stream information text summary """ s = u"ASF (%s) %d bps, %s Hz, %d channels, %.2f seconds" % ( self.codec_type or self.codec_name or u"???", self.bitrate, self.sample_rate, self.channels, self.length) return s
Returns: text: a stream information text summary
Below is the the instruction that describes the task: ### Input: Returns: text: a stream information text summary ### Response: def pprint(self): """Returns: text: a stream information text summary """ s = u"ASF (%s) %d bps, %s Hz, %d channels, %.2f seconds" % ( ...
def grad_named(fun, argname): '''Takes gradients with respect to a named argument. Doesn't work on *args or **kwargs.''' arg_index = getargspec(fun).args.index(argname) return grad(fun, arg_index)
Takes gradients with respect to a named argument. Doesn't work on *args or **kwargs.
Below is the the instruction that describes the task: ### Input: Takes gradients with respect to a named argument. Doesn't work on *args or **kwargs. ### Response: def grad_named(fun, argname): '''Takes gradients with respect to a named argument. Doesn't work on *args or **kwargs.''' arg_inde...
def mel(sr, n_dft, n_mels=128, fmin=0.0, fmax=None, htk=False, norm=1): """[np] create a filterbank matrix to combine stft bins into mel-frequency bins use Slaney (said Librosa) n_mels: numbre of mel bands fmin : lowest frequency [Hz] fmax : highest frequency [Hz] If `None`, use `sr / 2.0` ...
[np] create a filterbank matrix to combine stft bins into mel-frequency bins use Slaney (said Librosa) n_mels: numbre of mel bands fmin : lowest frequency [Hz] fmax : highest frequency [Hz] If `None`, use `sr / 2.0`
Below is the the instruction that describes the task: ### Input: [np] create a filterbank matrix to combine stft bins into mel-frequency bins use Slaney (said Librosa) n_mels: numbre of mel bands fmin : lowest frequency [Hz] fmax : highest frequency [Hz] If `None`, use `sr / 2.0` ### Respon...
def _get_conn(ret): ''' Return a mongodb connection object ''' _options = _get_options(ret) host = _options.get('host') port = _options.get('port') db_ = _options.get('db') user = _options.get('user') password = _options.get('password') indexes = _options.get('indexes', False) ...
Return a mongodb connection object
Below is the the instruction that describes the task: ### Input: Return a mongodb connection object ### Response: def _get_conn(ret): ''' Return a mongodb connection object ''' _options = _get_options(ret) host = _options.get('host') port = _options.get('port') db_ = _options.get('db')...
def generate_imports_for_referenced_namespaces( backend, namespace, insert_type_ignore=False): # type: (Backend, ApiNamespace, bool) -> None """ Both the true Python backend and the Python PEP 484 Type Stub backend have to perform the same imports. :param insert_type_ignore: add a MyPy type...
Both the true Python backend and the Python PEP 484 Type Stub backend have to perform the same imports. :param insert_type_ignore: add a MyPy type-ignore comment to the imports in the except: clause.
Below is the the instruction that describes the task: ### Input: Both the true Python backend and the Python PEP 484 Type Stub backend have to perform the same imports. :param insert_type_ignore: add a MyPy type-ignore comment to the imports in the except: clause. ### Response: def generate_import...
def get_user(self): """Access basic account information.""" method = 'GET' endpoint = '/rest/v1/users/{}'.format(self.client.sauce_username) return self.client.request(method, endpoint)
Access basic account information.
Below is the the instruction that describes the task: ### Input: Access basic account information. ### Response: def get_user(self): """Access basic account information.""" method = 'GET' endpoint = '/rest/v1/users/{}'.format(self.client.sauce_username) return self.client.request(me...
def get(self, path, params=None): """Perform GET request""" r = requests.get(url=self.url + path, params=params, timeout=self.timeout) r.raise_for_status() return r.json()
Perform GET request
Below is the the instruction that describes the task: ### Input: Perform GET request ### Response: def get(self, path, params=None): """Perform GET request""" r = requests.get(url=self.url + path, params=params, timeout=self.timeout) r.raise_for_status() return r.json()
def get_jac(self): """ Derives the jacobian from ``self.exprs`` and ``self.dep``. """ if self._jac is True: if self.sparse is True: self._jac, self._colptrs, self._rowvals = self.be.sparse_jacobian_csc(self.exprs, self.dep) elif self.band is not None: # Banded ...
Derives the jacobian from ``self.exprs`` and ``self.dep``.
Below is the the instruction that describes the task: ### Input: Derives the jacobian from ``self.exprs`` and ``self.dep``. ### Response: def get_jac(self): """ Derives the jacobian from ``self.exprs`` and ``self.dep``. """ if self._jac is True: if self.sparse is True: s...
def _set_names(self, names, level=None, validate=True): """ Set new names on index. Each name has to be a hashable type. Parameters ---------- values : str or sequence name(s) to set level : int, level name, or sequence of int/level names (default None) ...
Set new names on index. Each name has to be a hashable type. Parameters ---------- values : str or sequence name(s) to set level : int, level name, or sequence of int/level names (default None) If the index is a MultiIndex (hierarchical), level(s) to set (None ...
Below is the the instruction that describes the task: ### Input: Set new names on index. Each name has to be a hashable type. Parameters ---------- values : str or sequence name(s) to set level : int, level name, or sequence of int/level names (default None) ...
def method_repr_string(inst_str, meth_str, arg_strs=None, allow_mixed_seps=True): r"""Return a repr string for a method that respects line width. This function is useful to generate a ``repr`` string for a derived class that is created through a method, for instance :: funct...
r"""Return a repr string for a method that respects line width. This function is useful to generate a ``repr`` string for a derived class that is created through a method, for instance :: functional.translated(x) as a better way of representing :: FunctionalTranslation(functional, x) ...
Below is the the instruction that describes the task: ### Input: r"""Return a repr string for a method that respects line width. This function is useful to generate a ``repr`` string for a derived class that is created through a method, for instance :: functional.translated(x) as a better way...
def focusWindow(self, hwnd): """ Brings specified window to the front """ Debug.log(3, "Focusing window: " + str(hwnd)) SW_RESTORE = 9 if ctypes.windll.user32.IsIconic(hwnd): ctypes.windll.user32.ShowWindow(hwnd, SW_RESTORE) ctypes.windll.user32.SetForegroundWindow(hw...
Brings specified window to the front
Below is the the instruction that describes the task: ### Input: Brings specified window to the front ### Response: def focusWindow(self, hwnd): """ Brings specified window to the front """ Debug.log(3, "Focusing window: " + str(hwnd)) SW_RESTORE = 9 if ctypes.windll.user32.IsIconic...