code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def id_request(self): """The Force.com Identity Service (return type dict of text_type)""" # https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_2.0_at_Salesforce.com?language=en&language=en#The_Force.com_Identity_Service if 'id' in self.oauth: url = self.oauth['id'] ...
The Force.com Identity Service (return type dict of text_type)
Below is the the instruction that describes the task: ### Input: The Force.com Identity Service (return type dict of text_type) ### Response: def id_request(self): """The Force.com Identity Service (return type dict of text_type)""" # https://developer.salesforce.com/page/Digging_Deeper_into_OAuth_...
def endpoint(self, endpoint): """Like :meth:`Flask.endpoint` but for a blueprint. This does not prefix the endpoint with the blueprint name, this has to be done explicitly by the user of this method. If the endpoint is prefixed with a `.` it will be registered to the current blueprint,...
Like :meth:`Flask.endpoint` but for a blueprint. This does not prefix the endpoint with the blueprint name, this has to be done explicitly by the user of this method. If the endpoint is prefixed with a `.` it will be registered to the current blueprint, otherwise it's an application in...
Below is the the instruction that describes the task: ### Input: Like :meth:`Flask.endpoint` but for a blueprint. This does not prefix the endpoint with the blueprint name, this has to be done explicitly by the user of this method. If the endpoint is prefixed with a `.` it will be register...
def delete_user(self, recipient_email): """ Remove user from encryption """ emailid_list = self.list_user_emails() if recipient_email not in emailid_list: raise Exception("User {0} not present!".format(recipient_email)) else: emailid_list.remove(re...
Remove user from encryption
Below is the the instruction that describes the task: ### Input: Remove user from encryption ### Response: def delete_user(self, recipient_email): """ Remove user from encryption """ emailid_list = self.list_user_emails() if recipient_email not in emailid_list: r...
def some(args): """ %prog some bedfile idsfile > newbedfile Retrieve a subset of bed features given a list of ids. """ from jcvi.formats.base import SetFile from jcvi.utils.cbook import gene_name p = OptionParser(some.__doc__) p.add_option("-v", dest="inverse", default=False, action="s...
%prog some bedfile idsfile > newbedfile Retrieve a subset of bed features given a list of ids.
Below is the the instruction that describes the task: ### Input: %prog some bedfile idsfile > newbedfile Retrieve a subset of bed features given a list of ids. ### Response: def some(args): """ %prog some bedfile idsfile > newbedfile Retrieve a subset of bed features given a list of ids. """ ...
def running(name, **kwargs): r''' Defines and starts a new VM with specified arguments, or restart a VM (or group of VMs). (Runs ``vagrant up``.) :param name: the Salt_id node name you wish your VM to have. If ``name`` contains a "?" or "*" then it will re-start a group of VMs which have been...
r''' Defines and starts a new VM with specified arguments, or restart a VM (or group of VMs). (Runs ``vagrant up``.) :param name: the Salt_id node name you wish your VM to have. If ``name`` contains a "?" or "*" then it will re-start a group of VMs which have been paused or stopped. Each mac...
Below is the the instruction that describes the task: ### Input: r''' Defines and starts a new VM with specified arguments, or restart a VM (or group of VMs). (Runs ``vagrant up``.) :param name: the Salt_id node name you wish your VM to have. If ``name`` contains a "?" or "*" then it will re-star...
def solve_venn2_circles(venn_areas): ''' Given the list of "venn areas" (as output from compute_venn2_areas, i.e. [A, B, AB]), finds the positions and radii of the two circles. The return value is a tuple (coords, radii), where coords is a 2x2 array of coordinates and radii is a 2x1 array of circle ...
Given the list of "venn areas" (as output from compute_venn2_areas, i.e. [A, B, AB]), finds the positions and radii of the two circles. The return value is a tuple (coords, radii), where coords is a 2x2 array of coordinates and radii is a 2x1 array of circle radii. Assumes the input values to be nonneg...
Below is the the instruction that describes the task: ### Input: Given the list of "venn areas" (as output from compute_venn2_areas, i.e. [A, B, AB]), finds the positions and radii of the two circles. The return value is a tuple (coords, radii), where coords is a 2x2 array of coordinates and radii is a ...
def send(self, data, room=None, skip_sid=None, namespace=None, callback=None): """Send a message to one or more connected clients. The only difference with the :func:`socketio.Server.send` method is that when the ``namespace`` argument is not given the namespace associated ...
Send a message to one or more connected clients. The only difference with the :func:`socketio.Server.send` method is that when the ``namespace`` argument is not given the namespace associated with the class is used.
Below is the the instruction that describes the task: ### Input: Send a message to one or more connected clients. The only difference with the :func:`socketio.Server.send` method is that when the ``namespace`` argument is not given the namespace associated with the class is used. ### Respon...
def build_rects(tmxmap, layer, tileset=None, real_gid=None): """generate a set of non-overlapping rects that represents the distribution of the specified gid. useful for generating rects for use in collision detection Use at your own risk: this is experimental...will change in future GID Note:...
generate a set of non-overlapping rects that represents the distribution of the specified gid. useful for generating rects for use in collision detection Use at your own risk: this is experimental...will change in future GID Note: You will need to add 1 to the GID reported by Tiled. :param tm...
Below is the the instruction that describes the task: ### Input: generate a set of non-overlapping rects that represents the distribution of the specified gid. useful for generating rects for use in collision detection Use at your own risk: this is experimental...will change in future GID Note...
def add_item(self, query_params=None): ''' Add an item to this checklist. Returns a dictionary of values of new item. ''' return self.fetch_json( uri_path=self.base_uri + '/checkItems', http_method='POST', query_params=query_params or {} ...
Add an item to this checklist. Returns a dictionary of values of new item.
Below is the the instruction that describes the task: ### Input: Add an item to this checklist. Returns a dictionary of values of new item. ### Response: def add_item(self, query_params=None): ''' Add an item to this checklist. Returns a dictionary of values of new item. '''...
def _parse_config_file_impl(filename): """ Format for the file is: credentials: project_id: ... access_token: ... api_domain: ... :param filename: The filename to parse :return: A tuple with: - project_id - access_...
Format for the file is: credentials: project_id: ... access_token: ... api_domain: ... :param filename: The filename to parse :return: A tuple with: - project_id - access_token - api_domain
Below is the the instruction that describes the task: ### Input: Format for the file is: credentials: project_id: ... access_token: ... api_domain: ... :param filename: The filename to parse :return: A tuple with: - project_id ...
def AddEventSource(self, event_source): """Adds an event source. Args: event_source (EventSource): event source. Raises: IOError: when the storage file is closed or read-only. OSError: when the storage file is closed or read-only. """ self._RaiseIfNotWritable() self._AddAttr...
Adds an event source. Args: event_source (EventSource): event source. Raises: IOError: when the storage file is closed or read-only. OSError: when the storage file is closed or read-only.
Below is the the instruction that describes the task: ### Input: Adds an event source. Args: event_source (EventSource): event source. Raises: IOError: when the storage file is closed or read-only. OSError: when the storage file is closed or read-only. ### Response: def AddEventSource(s...
def shift_by_n_processors(self, x, mesh_axis, offset, wrap): """Receive the slice from processor pcoord - offset. Args: x: a LaidOutTensor mesh_axis: an integer offset: an integer wrap: a boolean. If True, then wrap around. Otherwise, pad with zeros. """ n = self.shape[mesh_axis...
Receive the slice from processor pcoord - offset. Args: x: a LaidOutTensor mesh_axis: an integer offset: an integer wrap: a boolean. If True, then wrap around. Otherwise, pad with zeros.
Below is the the instruction that describes the task: ### Input: Receive the slice from processor pcoord - offset. Args: x: a LaidOutTensor mesh_axis: an integer offset: an integer wrap: a boolean. If True, then wrap around. Otherwise, pad with zeros. ### Response: def shift_by_n_proce...
def _create_search_filter(filter_by): """ :param filter_by: :return: dict """ return ",".join( [ "{0}:{1}".format(key, value) for key, value in filter_by.items() if value is not None ] )
:param filter_by: :return: dict
Below is the the instruction that describes the task: ### Input: :param filter_by: :return: dict ### Response: def _create_search_filter(filter_by): """ :param filter_by: :return: dict """ return ",".join( [ "{0}:{1}".format(key, value) ...
def _get_area(self): """ Subclasses may override this method. """ from fontTools.pens.areaPen import AreaPen pen = AreaPen(self.layer) self.draw(pen) return abs(pen.value)
Subclasses may override this method.
Below is the the instruction that describes the task: ### Input: Subclasses may override this method. ### Response: def _get_area(self): """ Subclasses may override this method. """ from fontTools.pens.areaPen import AreaPen pen = AreaPen(self.layer) self.draw(pen) ...
def get_pfam(pdb_id): """Return PFAM annotations of given PDB_ID Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest Returns ------- out : dict A dictionary containing the PFAM annotations for the specified PDB ID Examples --...
Return PFAM annotations of given PDB_ID Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest Returns ------- out : dict A dictionary containing the PFAM annotations for the specified PDB ID Examples -------- >>> pfam_info = g...
Below is the the instruction that describes the task: ### Input: Return PFAM annotations of given PDB_ID Parameters ---------- pdb_id : string A 4 character string giving a pdb entry of interest Returns ------- out : dict A dictionary containing the PFAM annotations for t...
def db_group(self): '''str: database system group (defaults to :attr:`db_user <tmdeploy.config.AnsibleHostVariableSection.db_user>`) ''' if self._db_group is None: self._db_group = self.db_user return self._db_group
str: database system group (defaults to :attr:`db_user <tmdeploy.config.AnsibleHostVariableSection.db_user>`)
Below is the the instruction that describes the task: ### Input: str: database system group (defaults to :attr:`db_user <tmdeploy.config.AnsibleHostVariableSection.db_user>`) ### Response: def db_group(self): '''str: database system group (defaults to :attr:`db_user <tmdeploy.config.Ansible...
def openlines(image, linelength=10, dAngle=10, mask=None): """ Do a morphological opening along lines of different angles. Return difference between max and min response to different angles for each pixel. This effectively removes dots and only keeps lines. image - pixel image to operate on le...
Do a morphological opening along lines of different angles. Return difference between max and min response to different angles for each pixel. This effectively removes dots and only keeps lines. image - pixel image to operate on length - length of the structural element angluar_resolution - angle ...
Below is the the instruction that describes the task: ### Input: Do a morphological opening along lines of different angles. Return difference between max and min response to different angles for each pixel. This effectively removes dots and only keeps lines. image - pixel image to operate on leng...
def _get_event_source_obj(awsclient, evt_source): """ Given awsclient, event_source dictionary item create an event_source object of the appropriate event type to schedule this event, and return the object. """ event_source_map = { 'dynamodb': event_source.dynamodb_stream.DynamoDBStreamE...
Given awsclient, event_source dictionary item create an event_source object of the appropriate event type to schedule this event, and return the object.
Below is the the instruction that describes the task: ### Input: Given awsclient, event_source dictionary item create an event_source object of the appropriate event type to schedule this event, and return the object. ### Response: def _get_event_source_obj(awsclient, evt_source): """ Given awsclie...
def _altair_line_num_(self, xfield, yfield, opts, style, encode): """ Get a line + text number chart """ try: c = self._altair_chart_num_("line", xfield, yfield, opts, style, encode) except Exception as e: self.er...
Get a line + text number chart
Below is the the instruction that describes the task: ### Input: Get a line + text number chart ### Response: def _altair_line_num_(self, xfield, yfield, opts, style, encode): """ Get a line + text number chart """ try: c = self._altair_chart_num_("line", xfield, ...
def epochs(steps=None, epoch_steps=1): """Iterator over epochs until steps is reached. 1-indexed. Args: steps: int, total number of steps. Infinite if None. epoch_steps: int, number of steps per epoch. Can also be an iterable<int> to enable variable length epochs. Yields: (epoch: int, epoch id...
Iterator over epochs until steps is reached. 1-indexed. Args: steps: int, total number of steps. Infinite if None. epoch_steps: int, number of steps per epoch. Can also be an iterable<int> to enable variable length epochs. Yields: (epoch: int, epoch id, epoch_steps: int, number of steps in this ...
Below is the the instruction that describes the task: ### Input: Iterator over epochs until steps is reached. 1-indexed. Args: steps: int, total number of steps. Infinite if None. epoch_steps: int, number of steps per epoch. Can also be an iterable<int> to enable variable length epochs. Yields: ...
def config_prov(config): """Read providers from configfile and de-duplicate it.""" try: providers = [e.strip() for e in (config['info'] ['providers']).split(',')] except KeyError as e: print("Error reading config item: {}".format(e)) sys.exit(...
Read providers from configfile and de-duplicate it.
Below is the the instruction that describes the task: ### Input: Read providers from configfile and de-duplicate it. ### Response: def config_prov(config): """Read providers from configfile and de-duplicate it.""" try: providers = [e.strip() for e in (config['info'] ...
def update(self, friendly_name=values.unset, unique_name=values.unset): """ Update the FieldTypeInstance :param unicode friendly_name: A string to describe the resource :param unicode unique_name: An application-defined string that uniquely identifies the resource :returns: Upd...
Update the FieldTypeInstance :param unicode friendly_name: A string to describe the resource :param unicode unique_name: An application-defined string that uniquely identifies the resource :returns: Updated FieldTypeInstance :rtype: twilio.rest.autopilot.v1.assistant.field_type.FieldTy...
Below is the the instruction that describes the task: ### Input: Update the FieldTypeInstance :param unicode friendly_name: A string to describe the resource :param unicode unique_name: An application-defined string that uniquely identifies the resource :returns: Updated FieldTypeInstance ...
def czdivide(a, b, null=0): ''' czdivide(a, b) returns the quotient a / b as a numpy array object. Like numpy's divide function or a/b syntax, czdivide will thread over the latest dimension possible. Unlike numpy's divide, czdivide works with sparse matrices. Additionally, czdivide multiplies a by t...
czdivide(a, b) returns the quotient a / b as a numpy array object. Like numpy's divide function or a/b syntax, czdivide will thread over the latest dimension possible. Unlike numpy's divide, czdivide works with sparse matrices. Additionally, czdivide multiplies a by the zinv of b, so divide-by-zero en...
Below is the the instruction that describes the task: ### Input: czdivide(a, b) returns the quotient a / b as a numpy array object. Like numpy's divide function or a/b syntax, czdivide will thread over the latest dimension possible. Unlike numpy's divide, czdivide works with sparse matrices. Additionall...
def _post_run_hook(self, runtime): ''' generates a report showing slices from each axis of an arbitrary volume of in_file, with the resulting binary brain mask overlaid ''' self._anat_file = self.inputs.in_file self._mask_file = self.aggregate_outputs(runtime=runtime).mask_file ...
generates a report showing slices from each axis of an arbitrary volume of in_file, with the resulting binary brain mask overlaid
Below is the the instruction that describes the task: ### Input: generates a report showing slices from each axis of an arbitrary volume of in_file, with the resulting binary brain mask overlaid ### Response: def _post_run_hook(self, runtime): ''' generates a report showing slices from each axis of...
def _determine_ctxt(self): """Determines the Volume API endpoint information. Determines the appropriate version of the API that should be used as well as the catalog_info string that would be supplied. Returns a dict containing the volume_api_version and the volume_catalog_info. ...
Determines the Volume API endpoint information. Determines the appropriate version of the API that should be used as well as the catalog_info string that would be supplied. Returns a dict containing the volume_api_version and the volume_catalog_info.
Below is the the instruction that describes the task: ### Input: Determines the Volume API endpoint information. Determines the appropriate version of the API that should be used as well as the catalog_info string that would be supplied. Returns a dict containing the volume_api_version and ...
def sample_less_than_condition(choices_in, condition): """Creates a random sample from choices without replacement, subject to the condition that each element of the output is greater than the corresponding element of the condition array. condition should be in ascending order. """ output = np....
Creates a random sample from choices without replacement, subject to the condition that each element of the output is greater than the corresponding element of the condition array. condition should be in ascending order.
Below is the the instruction that describes the task: ### Input: Creates a random sample from choices without replacement, subject to the condition that each element of the output is greater than the corresponding element of the condition array. condition should be in ascending order. ### Response: de...
def transform_folder(args): """ Transform all the files in the source dataset for the given command and save the results as a single pickle file in the destination dataset :param args: tuple with the following arguments: - the command name: 'zero', 'one', 'two', ... - transforms to...
Transform all the files in the source dataset for the given command and save the results as a single pickle file in the destination dataset :param args: tuple with the following arguments: - the command name: 'zero', 'one', 'two', ... - transforms to apply to wav file - ...
Below is the the instruction that describes the task: ### Input: Transform all the files in the source dataset for the given command and save the results as a single pickle file in the destination dataset :param args: tuple with the following arguments: - the command name: 'zero', 'one', 'two', ....
def _set_statistics_oam(self, v, load=False): """ Setter method for statistics_oam, mapped from YANG variable /mpls_state/statistics_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_statistics_oam is considered as a private method. Backends looking to ...
Setter method for statistics_oam, mapped from YANG variable /mpls_state/statistics_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_statistics_oam is considered as a private method. Backends looking to populate this variable should do so via calling thisOb...
Below is the the instruction that describes the task: ### Input: Setter method for statistics_oam, mapped from YANG variable /mpls_state/statistics_oam (container) If this variable is read-only (config: false) in the source YANG file, then _set_statistics_oam is considered as a private method. Backends ...
def delete(self, **kwargs): """Delete a notification.""" url = self.base_url + '/%s' % kwargs['notification_id'] resp = self.client.delete(url=url) return resp
Delete a notification.
Below is the the instruction that describes the task: ### Input: Delete a notification. ### Response: def delete(self, **kwargs): """Delete a notification.""" url = self.base_url + '/%s' % kwargs['notification_id'] resp = self.client.delete(url=url) return resp
def close(self): """ Close and upload local log file to remote storage Wasb. """ # When application exit, system shuts down all handlers by # calling close method. Here we check if logger is already # closed to prevent uploading the log to remote storage multiple ...
Close and upload local log file to remote storage Wasb.
Below is the the instruction that describes the task: ### Input: Close and upload local log file to remote storage Wasb. ### Response: def close(self): """ Close and upload local log file to remote storage Wasb. """ # When application exit, system shuts down all handlers by ...
def upsert_pending_licensors(cursor, document_id): """Update or insert records for pending license acceptors.""" cursor.execute("""\ SELECT "uuid", "metadata" FROM pending_documents WHERE id = %s""", (document_id,)) uuid_, metadata = cursor.fetchone() acceptors = set([uid for uid, type_ in _dissect_role...
Update or insert records for pending license acceptors.
Below is the the instruction that describes the task: ### Input: Update or insert records for pending license acceptors. ### Response: def upsert_pending_licensors(cursor, document_id): """Update or insert records for pending license acceptors.""" cursor.execute("""\ SELECT "uuid", "metadata" FROM pending_...
def get_ipv4(hostname): """Get list of ipv4 addresses for hostname """ addrinfo = socket.getaddrinfo(hostname, None, socket.AF_INET, socket.SOCK_STREAM) return [addrinfo[x][4][0] for x in range(len(addrinfo))]
Get list of ipv4 addresses for hostname
Below is the the instruction that describes the task: ### Input: Get list of ipv4 addresses for hostname ### Response: def get_ipv4(hostname): """Get list of ipv4 addresses for hostname """ addrinfo = socket.getaddrinfo(hostname, None, socket.AF_INET, socket.SOCK_STRE...
def set_api_version(self, major, minor): """Set the API version this module was designed for. Each module must declare the mib12 API version it was compiled with as a 2 byte major.minor number. This information is used by the pic12_executive to decide whether the application is compati...
Set the API version this module was designed for. Each module must declare the mib12 API version it was compiled with as a 2 byte major.minor number. This information is used by the pic12_executive to decide whether the application is compatible.
Below is the the instruction that describes the task: ### Input: Set the API version this module was designed for. Each module must declare the mib12 API version it was compiled with as a 2 byte major.minor number. This information is used by the pic12_executive to decide whether the appli...
def show_more(context, label=None, loading=settings.LOADING): """Show the link to get the next page in a Twitter-like pagination. Usage:: {% show_more %} Alternatively you can override the label passed to the default template:: {% show_more "even more" %} You can override the loadin...
Show the link to get the next page in a Twitter-like pagination. Usage:: {% show_more %} Alternatively you can override the label passed to the default template:: {% show_more "even more" %} You can override the loading text too:: {% show_more "even more" "working" %} Must...
Below is the the instruction that describes the task: ### Input: Show the link to get the next page in a Twitter-like pagination. Usage:: {% show_more %} Alternatively you can override the label passed to the default template:: {% show_more "even more" %} You can override the loadin...
def remove_group(self, name, swap_group=None): """ Delete a group by given group parameter If you delete a group and content is restricted to that group, the content will be hidden from all users To prevent this, use this parameter to specify a different group to transfer the restriction...
Delete a group by given group parameter If you delete a group and content is restricted to that group, the content will be hidden from all users To prevent this, use this parameter to specify a different group to transfer the restrictions (comments and worklogs only) to :param name: str...
Below is the the instruction that describes the task: ### Input: Delete a group by given group parameter If you delete a group and content is restricted to that group, the content will be hidden from all users To prevent this, use this parameter to specify a different group to transfer the restricti...
def enable_process_breakpoints(self, dwProcessId): """ Enables all disabled breakpoints for the given process. @type dwProcessId: int @param dwProcessId: Process global ID. """ # enable code breakpoints for bp in self.get_process_code_breakpoints(dwProcessId): ...
Enables all disabled breakpoints for the given process. @type dwProcessId: int @param dwProcessId: Process global ID.
Below is the the instruction that describes the task: ### Input: Enables all disabled breakpoints for the given process. @type dwProcessId: int @param dwProcessId: Process global ID. ### Response: def enable_process_breakpoints(self, dwProcessId): """ Enables all disabled breakpoi...
def get_base(self, option): """ Parse the base command option. Can be supplied as a 3 character code or a settings variable name If base is not supplied, looks for settings CURRENCIES_BASE and SHOP_DEFAULT_CURRENCY """ if option: if option.isupper(): i...
Parse the base command option. Can be supplied as a 3 character code or a settings variable name If base is not supplied, looks for settings CURRENCIES_BASE and SHOP_DEFAULT_CURRENCY
Below is the the instruction that describes the task: ### Input: Parse the base command option. Can be supplied as a 3 character code or a settings variable name If base is not supplied, looks for settings CURRENCIES_BASE and SHOP_DEFAULT_CURRENCY ### Response: def get_base(self, option): """ ...
def gen_columns(obj) -> Generator[Tuple[str, Column], None, None]: """ Asks a SQLAlchemy ORM object: "what are your SQLAlchemy columns?" Yields tuples of ``(attr_name, Column)`` from an SQLAlchemy ORM object instance. Also works with the corresponding SQLAlchemy ORM class. Examples: .. code-block:...
Asks a SQLAlchemy ORM object: "what are your SQLAlchemy columns?" Yields tuples of ``(attr_name, Column)`` from an SQLAlchemy ORM object instance. Also works with the corresponding SQLAlchemy ORM class. Examples: .. code-block:: python from sqlalchemy.ext.declarative import declarative_base ...
Below is the the instruction that describes the task: ### Input: Asks a SQLAlchemy ORM object: "what are your SQLAlchemy columns?" Yields tuples of ``(attr_name, Column)`` from an SQLAlchemy ORM object instance. Also works with the corresponding SQLAlchemy ORM class. Examples: .. code-block:: python ...
def generate_output_csv(evaluation_results, filename='results.csv'): """Generate the evaluation results in the format Parameters ---------- evaluation_results : list of dictionaries Each dictionary contains the keys 'filename' and 'results', where 'results' itself is a list of dictionar...
Generate the evaluation results in the format Parameters ---------- evaluation_results : list of dictionaries Each dictionary contains the keys 'filename' and 'results', where 'results' itself is a list of dictionaries. Each of the results has the keys 'latex' and 'probability' ...
Below is the the instruction that describes the task: ### Input: Generate the evaluation results in the format Parameters ---------- evaluation_results : list of dictionaries Each dictionary contains the keys 'filename' and 'results', where 'results' itself is a list of dictionaries. Ea...
def T(self, T): """ Set the temperature of the stream to the specified value, and recalculate it's enthalpy. :param T: Temperature. [°C] """ self._T = T self._Hfr = self._calculate_Hfr(T)
Set the temperature of the stream to the specified value, and recalculate it's enthalpy. :param T: Temperature. [°C]
Below is the the instruction that describes the task: ### Input: Set the temperature of the stream to the specified value, and recalculate it's enthalpy. :param T: Temperature. [°C] ### Response: def T(self, T): """ Set the temperature of the stream to the specified value, and ...
def update_payload(self, fields=None): """Wrap submitted data within an extra dict.""" payload = super(DiscoveryRule, self).update_payload(fields) if 'search_' in payload: payload['search'] = payload.pop('search_') return {u'discovery_rule': payload}
Wrap submitted data within an extra dict.
Below is the the instruction that describes the task: ### Input: Wrap submitted data within an extra dict. ### Response: def update_payload(self, fields=None): """Wrap submitted data within an extra dict.""" payload = super(DiscoveryRule, self).update_payload(fields) if 'search_' in payload...
def line_rate(self, filename=None): """ Return the global line rate of the coverage report. If the `filename` file is given, return the line rate of the file. """ if filename is None: el = self.xml else: el = self._get_class_element_by_filename(fil...
Return the global line rate of the coverage report. If the `filename` file is given, return the line rate of the file.
Below is the the instruction that describes the task: ### Input: Return the global line rate of the coverage report. If the `filename` file is given, return the line rate of the file. ### Response: def line_rate(self, filename=None): """ Return the global line rate of the coverage report. I...
def uifile(self): """ Returns the uifile for this scaffold. :return <str> """ output = '' # build from a zip file if zipfile.is_zipfile(self.source()): zfile = zipfile.ZipFile(self.source(), 'r') if 'properties.ui' in zfile.na...
Returns the uifile for this scaffold. :return <str>
Below is the the instruction that describes the task: ### Input: Returns the uifile for this scaffold. :return <str> ### Response: def uifile(self): """ Returns the uifile for this scaffold. :return <str> """ output = '' # build fro...
def uninstall_handler(self, event_type, handler, user_handle=None): """Uninstalls handlers for events in this resource. :param event_type: Logical event identifier. :param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application. :param user_handl...
Uninstalls handlers for events in this resource. :param event_type: Logical event identifier. :param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application. :param user_handle: The user handle (ctypes object or None) returned by install_handler.
Below is the the instruction that describes the task: ### Input: Uninstalls handlers for events in this resource. :param event_type: Logical event identifier. :param handler: Interpreted as a valid reference to a handler to be uninstalled by a client application. :param user_handle: The use...
def view(tilesets): ''' Create a higlass viewer that displays the specified tilesets Parameters: ----------- Returns ------- Nothing ''' from .server import Server from .client import View curr_view = View() server = Server() server.start(tilesets) for ts ...
Create a higlass viewer that displays the specified tilesets Parameters: ----------- Returns ------- Nothing
Below is the the instruction that describes the task: ### Input: Create a higlass viewer that displays the specified tilesets Parameters: ----------- Returns ------- Nothing ### Response: def view(tilesets): ''' Create a higlass viewer that displays the specified tilesets Par...
def get_info( self, userSpecifier, **kwargs ): """ Fetch the user information for the specified user. This endpoint is intended to be used by the user themself to obtain their own information. Args: userSpecifier: The User ...
Fetch the user information for the specified user. This endpoint is intended to be used by the user themself to obtain their own information. Args: userSpecifier: The User Specifier Returns: v20.response.Response containing the results from submi...
Below is the the instruction that describes the task: ### Input: Fetch the user information for the specified user. This endpoint is intended to be used by the user themself to obtain their own information. Args: userSpecifier: The User Specifier Returns...
def tree_diff(a, b, n=5, sort=False): """Dump any data-structure or object, traverse it depth-first in-order and apply a unified diff. Depth-first in-order is just like structure would be printed. :param a: data_structure a :param b: data_structure b :param ...
Dump any data-structure or object, traverse it depth-first in-order and apply a unified diff. Depth-first in-order is just like structure would be printed. :param a: data_structure a :param b: data_structure b :param n: lines of context :type n:...
Below is the the instruction that describes the task: ### Input: Dump any data-structure or object, traverse it depth-first in-order and apply a unified diff. Depth-first in-order is just like structure would be printed. :param a: data_structure a :param b: data_structure b...
def _temporary_filenames(total): """Context manager to create temporary files and remove them after use.""" temp_files = [_get_temporary_filename('optimage-') for i in range(total)] yield temp_files for temp_file in temp_files: try: os.remove(temp_file) except OSError: ...
Context manager to create temporary files and remove them after use.
Below is the the instruction that describes the task: ### Input: Context manager to create temporary files and remove them after use. ### Response: def _temporary_filenames(total): """Context manager to create temporary files and remove them after use.""" temp_files = [_get_temporary_filename('optimage-') ...
def get_compound_afrs(self): """ Determine the amount flow rates of all the compounds. :returns: List of amount flow rates. [kmol/h] """ result = self._compound_mfrs * 1.0 for compound in self.material.compounds: index = self.material.get_compound_index(comp...
Determine the amount flow rates of all the compounds. :returns: List of amount flow rates. [kmol/h]
Below is the the instruction that describes the task: ### Input: Determine the amount flow rates of all the compounds. :returns: List of amount flow rates. [kmol/h] ### Response: def get_compound_afrs(self): """ Determine the amount flow rates of all the compounds. :returns: List ...
def show(self): """ Display (with a pretty print) this object """ off = 0 for n, i in enumerate(self.get_instructions()): print("{:8d} (0x{:08x}) {:04x} {:30} {}".format(n, off, i.get_op_value(), i.get_name(), i.get_output(self.idx))) off += i.get_length()
Display (with a pretty print) this object
Below is the the instruction that describes the task: ### Input: Display (with a pretty print) this object ### Response: def show(self): """ Display (with a pretty print) this object """ off = 0 for n, i in enumerate(self.get_instructions()): print("{:8d} (0x{:08...
def histogram_cumulative(data,**kwargs): r''' Compute cumulative histogram. See `numpy.histrogram <https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html>`_ :extra options: **return_edges** ([``True``] | [``False``]) Return the bin edges if set to ``True``, return their midpoints otherwise....
r''' Compute cumulative histogram. See `numpy.histrogram <https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html>`_ :extra options: **return_edges** ([``True``] | [``False``]) Return the bin edges if set to ``True``, return their midpoints otherwise. **normalize** ([``False``] | ``True``) ...
Below is the the instruction that describes the task: ### Input: r''' Compute cumulative histogram. See `numpy.histrogram <https://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram.html>`_ :extra options: **return_edges** ([``True``] | [``False``]) Return the bin edges if set to ``True``, return ...
def unindent(self): """ Un-indents text at cursor position. """ _logger().debug('unindent') cursor = self.editor.textCursor() _logger().debug('cursor has selection %r', cursor.hasSelection()) if cursor.hasSelection(): cursor.beginEditBlock() ...
Un-indents text at cursor position.
Below is the the instruction that describes the task: ### Input: Un-indents text at cursor position. ### Response: def unindent(self): """ Un-indents text at cursor position. """ _logger().debug('unindent') cursor = self.editor.textCursor() _logger().debug('cursor h...
def process_json_response(self, response): """For a json response, check if there was any error and throw exception. Otherwise, create a housecanary.response.Response.""" response_json = response.json() # handle errors code_key = "code" if code_key in response_json and ...
For a json response, check if there was any error and throw exception. Otherwise, create a housecanary.response.Response.
Below is the the instruction that describes the task: ### Input: For a json response, check if there was any error and throw exception. Otherwise, create a housecanary.response.Response. ### Response: def process_json_response(self, response): """For a json response, check if there was any error an...
def destroy(self): """ A reimplemented destructor that cancels the dialog before destroying. """ dialog = self.dialog if dialog: #: Clear the dismiss listener #: (or we get an error during the callback) dialog.setOnDismissListener(No...
A reimplemented destructor that cancels the dialog before destroying.
Below is the the instruction that describes the task: ### Input: A reimplemented destructor that cancels the dialog before destroying. ### Response: def destroy(self): """ A reimplemented destructor that cancels the dialog before destroying. """ dialog = self.dia...
def _get_fully_qualified_name(self): "return full parents name + self name (useful as key)" parent_name = self._get_parent_name() if not parent_name: return self._name else: return "%s.%s" % (parent_name, self._name)
return full parents name + self name (useful as key)
Below is the the instruction that describes the task: ### Input: return full parents name + self name (useful as key) ### Response: def _get_fully_qualified_name(self): "return full parents name + self name (useful as key)" parent_name = self._get_parent_name() if not parent_name: ...
def _resolve_hostname(name): """Returns resolved hostname using the ssh config""" if env.ssh_config is None: return name elif not os.path.exists(os.path.join("nodes", name + ".json")): resolved_name = env.ssh_config.lookup(name)['hostname'] if os.path.exists(os.path.join("nodes", res...
Returns resolved hostname using the ssh config
Below is the the instruction that describes the task: ### Input: Returns resolved hostname using the ssh config ### Response: def _resolve_hostname(name): """Returns resolved hostname using the ssh config""" if env.ssh_config is None: return name elif not os.path.exists(os.path.join("nodes", na...
def set_bn_eval(m:nn.Module)->None: "Set bn layers in eval mode for all recursive children of `m`." for l in m.children(): if isinstance(l, bn_types) and not next(l.parameters()).requires_grad: l.eval() set_bn_eval(l)
Set bn layers in eval mode for all recursive children of `m`.
Below is the the instruction that describes the task: ### Input: Set bn layers in eval mode for all recursive children of `m`. ### Response: def set_bn_eval(m:nn.Module)->None: "Set bn layers in eval mode for all recursive children of `m`." for l in m.children(): if isinstance(l, bn_types) and not ...
def __get_award_emoji(self, item_type, item_id): """Get award emojis for issue/merge request""" emojis = [] group_emojis = self.client.emojis(item_type, item_id) for raw_emojis in group_emojis: for emoji in json.loads(raw_emojis): emojis.append(emoji) ...
Get award emojis for issue/merge request
Below is the the instruction that describes the task: ### Input: Get award emojis for issue/merge request ### Response: def __get_award_emoji(self, item_type, item_id): """Get award emojis for issue/merge request""" emojis = [] group_emojis = self.client.emojis(item_type, item_id) ...
def process_response(self, request, response): """ Disconnects the signal receiver to prevent it from staying active. """ if hasattr(threadlocal, 'auditlog'): pre_save.disconnect(sender=LogEntry, dispatch_uid=threadlocal.auditlog['signal_duid']) return response
Disconnects the signal receiver to prevent it from staying active.
Below is the the instruction that describes the task: ### Input: Disconnects the signal receiver to prevent it from staying active. ### Response: def process_response(self, request, response): """ Disconnects the signal receiver to prevent it from staying active. """ if hasattr(thre...
def get_reference_end_from_cigar(reference_start, cigar): ''' This returns the coordinate just past the last aligned base. This matches the behavior of pysam's reference_end method ''' reference_end = reference_start # iterate through cigartuple for i in ...
This returns the coordinate just past the last aligned base. This matches the behavior of pysam's reference_end method
Below is the the instruction that describes the task: ### Input: This returns the coordinate just past the last aligned base. This matches the behavior of pysam's reference_end method ### Response: def get_reference_end_from_cigar(reference_start, cigar): ''' This returns the coordinate jus...
def resolve_redirection(self, request, context): """Check for redirections.""" current_page = context['current_page'] lang = context['lang'] if current_page.redirect_to_url: return HttpResponsePermanentRedirect(current_page.redirect_to_url) if current_page.redirect_t...
Check for redirections.
Below is the the instruction that describes the task: ### Input: Check for redirections. ### Response: def resolve_redirection(self, request, context): """Check for redirections.""" current_page = context['current_page'] lang = context['lang'] if current_page.redirect_to_url: ...
def get_projected_player_game_stats_by_team(self, season, week, team_id): """ Projected Player Game Stats by Team """ result = self._method_call("PlayerGameProjectionStatsByTeam/{season}/{week}/{team_id}", "projections", season=season, week=week, team_id=team_id) return result
Projected Player Game Stats by Team
Below is the the instruction that describes the task: ### Input: Projected Player Game Stats by Team ### Response: def get_projected_player_game_stats_by_team(self, season, week, team_id): """ Projected Player Game Stats by Team """ result = self._method_call("PlayerGameProjectionSt...
def _shuffle(y, labels, random_state): """Return a shuffled copy of y eventually shuffle among same labels.""" if labels is None: ind = random_state.permutation(len(y)) else: ind = np.arange(len(labels)) for label in np.unique(labels): this_mask = (labels == label) ...
Return a shuffled copy of y eventually shuffle among same labels.
Below is the the instruction that describes the task: ### Input: Return a shuffled copy of y eventually shuffle among same labels. ### Response: def _shuffle(y, labels, random_state): """Return a shuffled copy of y eventually shuffle among same labels.""" if labels is None: ind = random_state.permu...
def radiance2tb(rad, wavelength): """ Get the Tb from the radiance using the Planck function rad: Radiance in SI units wavelength: Wavelength in SI units (meter) """ from pyspectral.blackbody import blackbody_rad2temp as rad2temp return rad2temp(wavelength, rad)
Get the Tb from the radiance using the Planck function rad: Radiance in SI units wavelength: Wavelength in SI units (meter)
Below is the the instruction that describes the task: ### Input: Get the Tb from the radiance using the Planck function rad: Radiance in SI units wavelength: Wavelength in SI units (meter) ### Response: def radiance2tb(rad, wavelength): """ Get the Tb from the radiance using the Pl...
def led_changed(self, addr, group, val): """Capture a change to the LED for this button.""" _LOGGER.debug("Button %d LED changed from %d to %d", self._group, self._value, val) led_on = bool(val) if led_on != bool(self._value): self._update_subscribers(in...
Capture a change to the LED for this button.
Below is the the instruction that describes the task: ### Input: Capture a change to the LED for this button. ### Response: def led_changed(self, addr, group, val): """Capture a change to the LED for this button.""" _LOGGER.debug("Button %d LED changed from %d to %d", self._gr...
def server_poweroff(host=None, admin_username=None, admin_password=None, module=None): ''' Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password ...
Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to power off on the chassis such as a blade. If not provided, the chassis ...
Below is the the instruction that describes the task: ### Input: Powers down the managed server. host The chassis host. admin_username The username used to access the chassis. admin_password The password used to access the chassis. module The element to power off ...
def _apply_replace_backrefs(m, repl=None, flags=0): """Expand with either the `ReplaceTemplate` or compile on the fly, or return None.""" if m is None: raise ValueError("Match is None!") else: if isinstance(repl, ReplaceTemplate): return repl.expand(m) elif isinstance(re...
Expand with either the `ReplaceTemplate` or compile on the fly, or return None.
Below is the the instruction that describes the task: ### Input: Expand with either the `ReplaceTemplate` or compile on the fly, or return None. ### Response: def _apply_replace_backrefs(m, repl=None, flags=0): """Expand with either the `ReplaceTemplate` or compile on the fly, or return None.""" if m is N...
def buildMaskImage(rootname, bitvalue, output, extname='DQ', extver=1): """ Builds mask image from rootname's DQ array If there is no valid 'DQ' array in image, then return an empty string. """ # If no bitvalue is set or rootname given, assume no mask is desired # However, this name wou...
Builds mask image from rootname's DQ array If there is no valid 'DQ' array in image, then return an empty string.
Below is the the instruction that describes the task: ### Input: Builds mask image from rootname's DQ array If there is no valid 'DQ' array in image, then return an empty string. ### Response: def buildMaskImage(rootname, bitvalue, output, extname='DQ', extver=1): """ Builds mask image from roo...
def visitEncapsulatedShape(self, ctx: ShExDocParser.EncapsulatedShapeContext): """ encapsulatedShape: '(' innerShape ')' cardinality? annotation* semanticActions """ enc_shape = ShexOneOfShapeParser(self.context) enc_shape.visit(ctx.innerShape()) self.expression = enc_shape.expression ...
encapsulatedShape: '(' innerShape ')' cardinality? annotation* semanticActions
Below is the the instruction that describes the task: ### Input: encapsulatedShape: '(' innerShape ')' cardinality? annotation* semanticActions ### Response: def visitEncapsulatedShape(self, ctx: ShExDocParser.EncapsulatedShapeContext): """ encapsulatedShape: '(' innerShape ')' cardinality? annotation* sem...
def iter_blobs(self, predicate=lambda t: True): """ :return: Iterator yielding tuples of Blob objects and stages, tuple(stage, Blob) :param predicate: Function(t) returning True if tuple(stage, Blob) should be yielded by the iterator. A default filter, the BlobFilter, al...
:return: Iterator yielding tuples of Blob objects and stages, tuple(stage, Blob) :param predicate: Function(t) returning True if tuple(stage, Blob) should be yielded by the iterator. A default filter, the BlobFilter, allows you to yield blobs only if they match a given list ...
Below is the the instruction that describes the task: ### Input: :return: Iterator yielding tuples of Blob objects and stages, tuple(stage, Blob) :param predicate: Function(t) returning True if tuple(stage, Blob) should be yielded by the iterator. A default filter, the BlobFilter, a...
def main(arguments=None): # suppress(unused-function) """Entry point for the linter.""" result = _parse_arguments(arguments) linter_funcs = _ordered(linter_functions_from_filters, result.whitelist, result.blacklist) global_options = vars(result) ...
Entry point for the linter.
Below is the the instruction that describes the task: ### Input: Entry point for the linter. ### Response: def main(arguments=None): # suppress(unused-function) """Entry point for the linter.""" result = _parse_arguments(arguments) linter_funcs = _ordered(linter_functions_from_filters, ...
def schedule_telegram_message(message, to, sender=None, priority=None): """Schedules Telegram message for delivery. :param str message: text to send. :param list|str|unicode to: recipients addresses or Django User model heir instances with `telegram` attributes. :param User sender: User model heir inst...
Schedules Telegram message for delivery. :param str message: text to send. :param list|str|unicode to: recipients addresses or Django User model heir instances with `telegram` attributes. :param User sender: User model heir instance :param int priority: number describing message priority. If set overri...
Below is the the instruction that describes the task: ### Input: Schedules Telegram message for delivery. :param str message: text to send. :param list|str|unicode to: recipients addresses or Django User model heir instances with `telegram` attributes. :param User sender: User model heir instance :...
def classify(self, dataset, missing_value_action='auto'): """ Return a classification, for each example in the ``dataset``, using the trained random forest model. The output SFrame contains predictions as class labels (0 or 1) and probabilities associated with the the example. P...
Return a classification, for each example in the ``dataset``, using the trained random forest model. The output SFrame contains predictions as class labels (0 or 1) and probabilities associated with the the example. Parameters ---------- dataset : SFrame Dataset of n...
Below is the the instruction that describes the task: ### Input: Return a classification, for each example in the ``dataset``, using the trained random forest model. The output SFrame contains predictions as class labels (0 or 1) and probabilities associated with the the example. Parameters...
def __check_command_completion(self, testsemicolon=True): """Check for command(s) completion This function should be called each time a new argument is seen by the parser in order to check a command is complete. As not only one command can be ended when receiving a new argument ...
Check for command(s) completion This function should be called each time a new argument is seen by the parser in order to check a command is complete. As not only one command can be ended when receiving a new argument (nested commands case), we apply the same work to parent comm...
Below is the the instruction that describes the task: ### Input: Check for command(s) completion This function should be called each time a new argument is seen by the parser in order to check a command is complete. As not only one command can be ended when receiving a new argument ...
def unirange(a, b): """Returns a regular expression string to match the given non-BMP range.""" if b < a: raise ValueError("Bad character range") if a < 0x10000 or b < 0x10000: raise ValueError("unirange is only defined for non-BMP ranges") if sys.maxunicode > 0xffff: # wide bui...
Returns a regular expression string to match the given non-BMP range.
Below is the the instruction that describes the task: ### Input: Returns a regular expression string to match the given non-BMP range. ### Response: def unirange(a, b): """Returns a regular expression string to match the given non-BMP range.""" if b < a: raise ValueError("Bad character range") ...
def calculate_activity_rate(self, strain_data, cumulative=False, in_seconds=False): ''' Main function to calculate the activity rate (for each of the magnitudes in target_magnitudes) for all of the cells specified in the input strain model file :p...
Main function to calculate the activity rate (for each of the magnitudes in target_magnitudes) for all of the cells specified in the input strain model file :param strain_data: Strain model as an instance of :class: openquake.hmtk.strain.geodetic_strain.GeodeticStrain ...
Below is the the instruction that describes the task: ### Input: Main function to calculate the activity rate (for each of the magnitudes in target_magnitudes) for all of the cells specified in the input strain model file :param strain_data: Strain model as an instance of :class...
def is_twss(self, phrase): """ The magic function- this accepts a phrase and tells you if it classifies as an entendre """ featureset = self.extract_features(phrase) return self.classifier.classify(featureset)
The magic function- this accepts a phrase and tells you if it classifies as an entendre
Below is the the instruction that describes the task: ### Input: The magic function- this accepts a phrase and tells you if it classifies as an entendre ### Response: def is_twss(self, phrase): """ The magic function- this accepts a phrase and tells you if it classifies as an entend...
def stub_main(): """setuptools blah: it still can't run a module as a script entry_point""" from google.apputils import run_script_module import butcher.main run_script_module.RunScriptModule(butcher.main)
setuptools blah: it still can't run a module as a script entry_point
Below is the the instruction that describes the task: ### Input: setuptools blah: it still can't run a module as a script entry_point ### Response: def stub_main(): """setuptools blah: it still can't run a module as a script entry_point""" from google.apputils import run_script_module import butcher.ma...
def update(self, client=None, unique_writer_identity=False): """API call: update sink configuration via a PUT request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update :type client: :class:`~google.cloud.logging.client.Client` or ...
API call: update sink configuration via a PUT request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update :type client: :class:`~google.cloud.logging.client.Client` or ``NoneType`` :param client: the client to use. If not passed,...
Below is the the instruction that describes the task: ### Input: API call: update sink configuration via a PUT request See https://cloud.google.com/logging/docs/reference/v2/rest/v2/projects.sinks/update :type client: :class:`~google.cloud.logging.client.Client` or `...
def _template(node_id, value=None): "Check if a template is assigned to it and render that with the value" result = [] select_template_from_node = fetch_query_string('select_template_from_node.sql') try: result = db.execute(text(select_template_from_node), node_id=node_id) template_resul...
Check if a template is assigned to it and render that with the value
Below is the the instruction that describes the task: ### Input: Check if a template is assigned to it and render that with the value ### Response: def _template(node_id, value=None): "Check if a template is assigned to it and render that with the value" result = [] select_template_from_node = fetch_qu...
def _set_bcpIn(self, value): """ Subclasses may override this method. """ x, y = absoluteBCPIn(self.anchor, value) segment = self._segment if segment.type == "move" and value != (0, 0): raise FontPartsError(("Cannot set the bcpIn for the first " ...
Subclasses may override this method.
Below is the the instruction that describes the task: ### Input: Subclasses may override this method. ### Response: def _set_bcpIn(self, value): """ Subclasses may override this method. """ x, y = absoluteBCPIn(self.anchor, value) segment = self._segment if segment.t...
def set_(key, value, profile=None): ''' Set a key/value pair in memcached ''' conn = salt.utils.memcached.get_conn(profile) time = profile.get('expire', DEFAULT_EXPIRATION) return salt.utils.memcached.set_(conn, key, value, time=time)
Set a key/value pair in memcached
Below is the the instruction that describes the task: ### Input: Set a key/value pair in memcached ### Response: def set_(key, value, profile=None): ''' Set a key/value pair in memcached ''' conn = salt.utils.memcached.get_conn(profile) time = profile.get('expire', DEFAULT_EXPIRATION) retur...
async def connect(self, conn_id, connection_string): """Connect to a device. See :meth:`AbstractDeviceAdapter.connect`. """ self._ensure_connection(conn_id, False) msg = dict(connection_string=connection_string) await self._send_command(OPERATIONS.CONNECT, msg, COMMAND...
Connect to a device. See :meth:`AbstractDeviceAdapter.connect`.
Below is the the instruction that describes the task: ### Input: Connect to a device. See :meth:`AbstractDeviceAdapter.connect`. ### Response: async def connect(self, conn_id, connection_string): """Connect to a device. See :meth:`AbstractDeviceAdapter.connect`. """ self....
def process_results(self, results=None, **value): """take results list of all events and put them in a dict""" channels = [] for res in results: channels.extend(res.pop('channels', '').split()) value.update(res) value['channels'] = channels value['success'...
take results list of all events and put them in a dict
Below is the the instruction that describes the task: ### Input: take results list of all events and put them in a dict ### Response: def process_results(self, results=None, **value): """take results list of all events and put them in a dict""" channels = [] for res in results: ...
def new_output(output_type=None, output_text=None, output_png=None, output_html=None, output_svg=None, output_latex=None, output_json=None, output_javascript=None, output_jpeg=None, prompt_number=None, etype=None, evalue=None, traceback=None): """Create a new code cell with input and output""" outpu...
Create a new code cell with input and output
Below is the the instruction that describes the task: ### Input: Create a new code cell with input and output ### Response: def new_output(output_type=None, output_text=None, output_png=None, output_html=None, output_svg=None, output_latex=None, output_json=None, output_javascript=None, output_jpeg=None, p...
def parse_qualifier(parser, event, node): #pylint: disable=unused-argument """Parse CIM/XML QUALIFIER element and return CIMQualifier""" name = _get_required_attribute(node, 'NAME') cim_type = _get_required_attribute(node, 'TYPE') # TODO 2/16 KS: Why is propagated not used? propagated = _get_attrib...
Parse CIM/XML QUALIFIER element and return CIMQualifier
Below is the the instruction that describes the task: ### Input: Parse CIM/XML QUALIFIER element and return CIMQualifier ### Response: def parse_qualifier(parser, event, node): #pylint: disable=unused-argument """Parse CIM/XML QUALIFIER element and return CIMQualifier""" name = _get_required_attribute(nod...
def digital_write(pin_num, value, hardware_addr=0): """Writes the value to the input pin specified. .. note:: This function is for familiarality with users of other types of IO board. Consider accessing the ``output_pins`` attribute of a PiFaceDigital object: >>> pfd = PiFaceDigital(hardw...
Writes the value to the input pin specified. .. note:: This function is for familiarality with users of other types of IO board. Consider accessing the ``output_pins`` attribute of a PiFaceDigital object: >>> pfd = PiFaceDigital(hardware_addr) >>> pfd.output_pins[pin_num].value = 1 ...
Below is the the instruction that describes the task: ### Input: Writes the value to the input pin specified. .. note:: This function is for familiarality with users of other types of IO board. Consider accessing the ``output_pins`` attribute of a PiFaceDigital object: >>> pfd = PiFaceDig...
def color(self, key=None): """ Returns the color for this data set. :return <QColor> """ if key is not None: return self._colorMap.get(nativestring(key), self._color) return self._color
Returns the color for this data set. :return <QColor>
Below is the the instruction that describes the task: ### Input: Returns the color for this data set. :return <QColor> ### Response: def color(self, key=None): """ Returns the color for this data set. :return <QColor> """ if key is n...
def get_downloader(session, class_name, args): """ Decides which downloader to use. """ external = { 'wget': WgetDownloader, 'curl': CurlDownloader, 'aria2': Aria2Downloader, 'axel': AxelDownloader, } for bin, class_ in iteritems(external): if getattr(ar...
Decides which downloader to use.
Below is the the instruction that describes the task: ### Input: Decides which downloader to use. ### Response: def get_downloader(session, class_name, args): """ Decides which downloader to use. """ external = { 'wget': WgetDownloader, 'curl': CurlDownloader, 'aria2': Aria...
def _verify_sector_identifier(self, request): """ Verify `sector_identifier_uri` is reachable and that it contains `redirect_uri`s. :param request: Provider registration request :return: si_redirects, sector_id :raises: InvalidSectorIdentifier """ si_url...
Verify `sector_identifier_uri` is reachable and that it contains `redirect_uri`s. :param request: Provider registration request :return: si_redirects, sector_id :raises: InvalidSectorIdentifier
Below is the the instruction that describes the task: ### Input: Verify `sector_identifier_uri` is reachable and that it contains `redirect_uri`s. :param request: Provider registration request :return: si_redirects, sector_id :raises: InvalidSectorIdentifier ### Response: def _ver...
def traverse_nodes(self, qids, up=True, down=False, **args): """ Traverse (optionally) up and (optionally) down from an input set of nodes Arguments --------- qids : list[str] list of seed node IDs to start from up : bool if True, include ancestor...
Traverse (optionally) up and (optionally) down from an input set of nodes Arguments --------- qids : list[str] list of seed node IDs to start from up : bool if True, include ancestors down : bool if True, include descendants relations ...
Below is the the instruction that describes the task: ### Input: Traverse (optionally) up and (optionally) down from an input set of nodes Arguments --------- qids : list[str] list of seed node IDs to start from up : bool if True, include ancestors do...
def __draw_canvas_cluster(self, ax, dimension, cluster_descr): """! @brief Draw canvas cluster descriptor. @param[in] ax (Axis): Axis of the canvas where canvas cluster descriptor should be displayed. @param[in] dimension (uint): Canvas dimension. @param[in] cluster_descr ...
! @brief Draw canvas cluster descriptor. @param[in] ax (Axis): Axis of the canvas where canvas cluster descriptor should be displayed. @param[in] dimension (uint): Canvas dimension. @param[in] cluster_descr (canvas_cluster_descr): Canvas cluster descriptor that should be displayed....
Below is the the instruction that describes the task: ### Input: ! @brief Draw canvas cluster descriptor. @param[in] ax (Axis): Axis of the canvas where canvas cluster descriptor should be displayed. @param[in] dimension (uint): Canvas dimension. @param[in] cluster_descr (canva...
def from_dict(input_dict, data=None): """ Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_dict method. ...
Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_dict method. :type data: tuple(:class:`np.ndarray`, :class:`np....
Below is the the instruction that describes the task: ### Input: Instantiate an SparseGPClassification object using the information in input_dict (built by the to_dict method). :param data: It is used to provide X and Y for the case when the model was saved using save_data=False in to_di...
def update_repository(self, repository_form=None): """Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in an updat...
Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in an update transaction :raise: ``InvalidArgument`` -- the form ...
Below is the the instruction that describes the task: ### Input: Updates an existing repository. :param repository_form: the form containing the elements to be updated :type repository_form: ``osid.repository.RepositoryForm`` :raise: ``IllegalState`` -- ``repository_form`` already used in a...
def list_cmd(argv=sys.argv[1:]): # pragma: no cover """\ List information about available models. Uses the 'model_persister' from the configuration to display a list of models and their metadata. Usage: pld-list [options] Options: -h --help Show this screen. """ docopt(list_cmd.__doc__,...
\ List information about available models. Uses the 'model_persister' from the configuration to display a list of models and their metadata. Usage: pld-list [options] Options: -h --help Show this screen.
Below is the the instruction that describes the task: ### Input: \ List information about available models. Uses the 'model_persister' from the configuration to display a list of models and their metadata. Usage: pld-list [options] Options: -h --help Show this screen. ### Response: def list...
def extend_selection_to_next(self, what='word', direction='left'): """ Extend selection to next *what* ('word' or 'character') toward *direction* ('left' or 'right') """ self.__move_cursor_anchor(what, direction, QTextCursor.KeepAnchor)
Extend selection to next *what* ('word' or 'character') toward *direction* ('left' or 'right')
Below is the the instruction that describes the task: ### Input: Extend selection to next *what* ('word' or 'character') toward *direction* ('left' or 'right') ### Response: def extend_selection_to_next(self, what='word', direction='left'): """ Extend selection to next *what* ('word' or ...
def draw_rivers_on_image(world, target, factor=1): """Draw only the rivers, it expect the background to be in place """ for y in range(world.height): for x in range(world.width): if world.is_land((x, y)) and (world.layers['river_map'].data[y, x] > 0.0): for dx in range(f...
Draw only the rivers, it expect the background to be in place
Below is the the instruction that describes the task: ### Input: Draw only the rivers, it expect the background to be in place ### Response: def draw_rivers_on_image(world, target, factor=1): """Draw only the rivers, it expect the background to be in place """ for y in range(world.height): for...
def _shru16(ins): ''' Logical right shift 16bit unsigned integer. The result is pushed onto the stack. Optimizations: * If 2nd op is 0 then do nothing * If 2nd op is 1 Shift Right Arithmetic ''' op1, op2 = tuple(ins.quad[2:]) if is_int(op2): op = int16(op2) ...
Logical right shift 16bit unsigned integer. The result is pushed onto the stack. Optimizations: * If 2nd op is 0 then do nothing * If 2nd op is 1 Shift Right Arithmetic
Below is the the instruction that describes the task: ### Input: Logical right shift 16bit unsigned integer. The result is pushed onto the stack. Optimizations: * If 2nd op is 0 then do nothing * If 2nd op is 1 Shift Right Arithmetic ### Response: def _shru16(ins): ''' Log...
def append_known_secrets(self): # type: () -> None """ Read key-value pair files with secrets. For example, .conf and .ini files. :return: """ for file_name in self.files: if "~" in file_name: file_name = os.path.expanduser(file_name) if n...
Read key-value pair files with secrets. For example, .conf and .ini files. :return:
Below is the the instruction that describes the task: ### Input: Read key-value pair files with secrets. For example, .conf and .ini files. :return: ### Response: def append_known_secrets(self): # type: () -> None """ Read key-value pair files with secrets. For example, .conf and .ini file...
def p_do_loop_while(p): """ statement : do_start program_co label_loop WHILE expr | do_start label_loop WHILE expr | DO label_loop WHILE expr """ if len(p) == 6: q = make_block(p[2], p[3]) r = p[5] else: q = p[2] r = p[4] if p[1] =...
statement : do_start program_co label_loop WHILE expr | do_start label_loop WHILE expr | DO label_loop WHILE expr
Below is the the instruction that describes the task: ### Input: statement : do_start program_co label_loop WHILE expr | do_start label_loop WHILE expr | DO label_loop WHILE expr ### Response: def p_do_loop_while(p): """ statement : do_start program_co label_loop WHILE expr ...