code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def calc_parent(self, i, j, h): """ Returns get_big_array and end of span of parent sequence that contains given child. """ N = self.repo.array_size c_i = i c_j = j c_h = h # Calculate the number of the sequence in its row (sequences # with same he...
Returns get_big_array and end of span of parent sequence that contains given child.
Below is the the instruction that describes the task: ### Input: Returns get_big_array and end of span of parent sequence that contains given child. ### Response: def calc_parent(self, i, j, h): """ Returns get_big_array and end of span of parent sequence that contains given child. """ ...
def setns(fd, nstype): """ Reassociate thread with a namespace :param fd int: The file descriptor referreing to one of the namespace entries in a :directory::`/proc/<pid>/ns/` directory. :param nstype int: The type of namespace the calling thread should be reasscoiated with. """ ...
Reassociate thread with a namespace :param fd int: The file descriptor referreing to one of the namespace entries in a :directory::`/proc/<pid>/ns/` directory. :param nstype int: The type of namespace the calling thread should be reasscoiated with.
Below is the the instruction that describes the task: ### Input: Reassociate thread with a namespace :param fd int: The file descriptor referreing to one of the namespace entries in a :directory::`/proc/<pid>/ns/` directory. :param nstype int: The type of namespace the calling thread should be ...
def autobuild_trub_script(file_name, slot_assignments=None, os_info=None, sensor_graph=None, app_info=None, use_safeupdate=False): """Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or...
Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or "controller", firmware_image_name) The output of this autobuild action will be a trub script in build/output/<file_name> that assigns the given firmware t...
Below is the the instruction that describes the task: ### Input: Build a trub script that loads given firmware into the given slots. slot_assignments should be a list of tuples in the following form: ("slot X" or "controller", firmware_image_name) The output of this autobuild action will be a trub scr...
def _handle_get(self, transaction): """ Handle GET requests :type transaction: Transaction :param transaction: the transaction that owns the request :rtype : Transaction :return: the edited transaction with the response to the request """ path = str("/" +...
Handle GET requests :type transaction: Transaction :param transaction: the transaction that owns the request :rtype : Transaction :return: the edited transaction with the response to the request
Below is the the instruction that describes the task: ### Input: Handle GET requests :type transaction: Transaction :param transaction: the transaction that owns the request :rtype : Transaction :return: the edited transaction with the response to the request ### Response: def _han...
def zsh_complete(self, path, cmd, *cmds, sourceable=False): """Write zsh compdef script. Args: path (path-like): desired path of the compdef script. cmd (str): command name that should be completed. cmds (str): extra command names that should be completed. ...
Write zsh compdef script. Args: path (path-like): desired path of the compdef script. cmd (str): command name that should be completed. cmds (str): extra command names that should be completed. sourceable (bool): if True, the generated file will contain an ...
Below is the the instruction that describes the task: ### Input: Write zsh compdef script. Args: path (path-like): desired path of the compdef script. cmd (str): command name that should be completed. cmds (str): extra command names that should be completed. ...
def add(self, text, checked=False, sort=None): """Add a new sub item to the list. This item must already be attached to a list. Args: text (str): The text. checked (bool): Whether this item is checked. sort (int): Item id for sorting. """ if self.pare...
Add a new sub item to the list. This item must already be attached to a list. Args: text (str): The text. checked (bool): Whether this item is checked. sort (int): Item id for sorting.
Below is the the instruction that describes the task: ### Input: Add a new sub item to the list. This item must already be attached to a list. Args: text (str): The text. checked (bool): Whether this item is checked. sort (int): Item id for sorting. ### Response: def ad...
def find_xor_mask(data, alphabet=None, max_depth=3, min_depth=0, iv=None): """ Produce a series of bytestrings that when XORed together end up being equal to ``data`` and only contain characters from the giving ``alphabet``. The initial state (or previous state) can be given as ``iv``. Argument...
Produce a series of bytestrings that when XORed together end up being equal to ``data`` and only contain characters from the giving ``alphabet``. The initial state (or previous state) can be given as ``iv``. Arguments: data (bytes): The data to recreate as a series of XOR operations. al...
Below is the the instruction that describes the task: ### Input: Produce a series of bytestrings that when XORed together end up being equal to ``data`` and only contain characters from the giving ``alphabet``. The initial state (or previous state) can be given as ``iv``. Arguments: data (b...
def _get_dir(toml_config_setting, sawtooth_home_dir, windows_dir, default_dir): """Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (s...
Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (str): The directory under the SAWTOOTH_HOME environment variable. For examp...
Below is the the instruction that describes the task: ### Input: Determines the directory path based on configuration. Arguments: toml_config_setting (str): The name of the config setting related to the directory which will appear in path.toml. sawtooth_home_dir (str): The directory...
def sort_idx(m, reverse=False): """Return the indices of m in sorted order (default: ascending order)""" return sorted(range(len(m)), key=lambda k: m[k], reverse=reverse)
Return the indices of m in sorted order (default: ascending order)
Below is the the instruction that describes the task: ### Input: Return the indices of m in sorted order (default: ascending order) ### Response: def sort_idx(m, reverse=False): """Return the indices of m in sorted order (default: ascending order)""" return sorted(range(len(m)), key=lambda k: m[k], reverse...
def meta(self): """Data for loading later""" mount_points = [] for overlay in self.overlays: mount_points.append(overlay.mount_point) return [self.end_dir, self.start_dir, mount_points]
Data for loading later
Below is the the instruction that describes the task: ### Input: Data for loading later ### Response: def meta(self): """Data for loading later""" mount_points = [] for overlay in self.overlays: mount_points.append(overlay.mount_point) return [self.end_dir, self.start_di...
def _WriteFileChunk(self, chunk): """Yields binary chunks, respecting archive file headers and footers. Args: chunk: the StreamedFileChunk to be written """ if chunk.chunk_index == 0: # Make sure size of the original file is passed. It's required # when output_writer is StreamingTarWr...
Yields binary chunks, respecting archive file headers and footers. Args: chunk: the StreamedFileChunk to be written
Below is the the instruction that describes the task: ### Input: Yields binary chunks, respecting archive file headers and footers. Args: chunk: the StreamedFileChunk to be written ### Response: def _WriteFileChunk(self, chunk): """Yields binary chunks, respecting archive file headers and footers. ...
def dispatch_hook(cls, _pkt=None, *args, **kargs): """ Returns the right RadiusAttribute class for the given data. """ if _pkt: attr_type = orb(_pkt[0]) return cls.registered_attributes.get(attr_type, cls) return cls
Returns the right RadiusAttribute class for the given data.
Below is the the instruction that describes the task: ### Input: Returns the right RadiusAttribute class for the given data. ### Response: def dispatch_hook(cls, _pkt=None, *args, **kargs): """ Returns the right RadiusAttribute class for the given data. """ if _pkt: att...
def count_cores_in_state(self, state, app_id): """Count the number of cores in a given state. .. warning:: In current implementations of SARK, signals (which are used to determine the state of cores) are highly likely to arrive but this is not guaranteed (especially ...
Count the number of cores in a given state. .. warning:: In current implementations of SARK, signals (which are used to determine the state of cores) are highly likely to arrive but this is not guaranteed (especially when the system's network is heavily utilised)...
Below is the the instruction that describes the task: ### Input: Count the number of cores in a given state. .. warning:: In current implementations of SARK, signals (which are used to determine the state of cores) are highly likely to arrive but this is not guaranteed (...
def program(self, prog, offset = 0): """ .. _program: Write the content of the iterable ``prog`` starting with the optional offset ``offset`` to the device. Invokes program_word_. """ for addr, word in enumerate(prog): self.program_word(offset + addr, word)
.. _program: Write the content of the iterable ``prog`` starting with the optional offset ``offset`` to the device. Invokes program_word_.
Below is the the instruction that describes the task: ### Input: .. _program: Write the content of the iterable ``prog`` starting with the optional offset ``offset`` to the device. Invokes program_word_. ### Response: def program(self, prog, offset = 0): """ .. _program: Write the content of the ite...
def configure_app(app): """Configure Flask/Celery application. * Rio will find environment variable `RIO_SETTINGS` first:: $ export RIO_SETTINGS=/path/to/settings.cfg $ rio worker * If `RIO_SETTINGS` is missing, Rio will try to load configuration module in `rio.settings` according t...
Configure Flask/Celery application. * Rio will find environment variable `RIO_SETTINGS` first:: $ export RIO_SETTINGS=/path/to/settings.cfg $ rio worker * If `RIO_SETTINGS` is missing, Rio will try to load configuration module in `rio.settings` according to another environment var...
Below is the the instruction that describes the task: ### Input: Configure Flask/Celery application. * Rio will find environment variable `RIO_SETTINGS` first:: $ export RIO_SETTINGS=/path/to/settings.cfg $ rio worker * If `RIO_SETTINGS` is missing, Rio will try to load configuration ...
def get_daemon_stats(self, details=False): """Send a HTTP request to the satellite (GET /get_daemon_stats) :return: Daemon statistics :rtype: dict """ logger.debug("Get daemon statistics for %s, %s %s", self.name, self.alive, self.reachable) return self.con.get('stats%s'...
Send a HTTP request to the satellite (GET /get_daemon_stats) :return: Daemon statistics :rtype: dict
Below is the the instruction that describes the task: ### Input: Send a HTTP request to the satellite (GET /get_daemon_stats) :return: Daemon statistics :rtype: dict ### Response: def get_daemon_stats(self, details=False): """Send a HTTP request to the satellite (GET /get_daemon_stats) ...
def get_logger(name): """Get a logger with the specified name.""" logger = logging.getLogger(name) logger.setLevel(getenv('LOGLEVEL', 'INFO')) return logger
Get a logger with the specified name.
Below is the the instruction that describes the task: ### Input: Get a logger with the specified name. ### Response: def get_logger(name): """Get a logger with the specified name.""" logger = logging.getLogger(name) logger.setLevel(getenv('LOGLEVEL', 'INFO')) return logger
def add_func(self, transmute_func, transmute_context): """ add a transmute function's swagger definition to the spec """ swagger_path = transmute_func.get_swagger_path(transmute_context) for p in transmute_func.paths: self.add_path(p, swagger_path)
add a transmute function's swagger definition to the spec
Below is the the instruction that describes the task: ### Input: add a transmute function's swagger definition to the spec ### Response: def add_func(self, transmute_func, transmute_context): """ add a transmute function's swagger definition to the spec """ swagger_path = transmute_func.get_swagger...
def create_container_instance_group(access_token, subscription_id, resource_group, container_group_name, container_list, location, ostype='Linux', port=80, iptype='public'): '''Create a new container group with a list of containers specifified ...
Create a new container group with a list of containers specifified by container_list. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure resource group name. container_group_name (str): Name of cont...
Below is the the instruction that describes the task: ### Input: Create a new container group with a list of containers specifified by container_list. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure ...
def to_glyphs_family_user_data_from_ufo(self, ufo): """Set the GSFont userData from the UFO family-wide lib data.""" target_user_data = self.font.userData try: for key, value in ufo.lib[FONT_USER_DATA_KEY].items(): # Existing values taken from the designspace lib take precedence ...
Set the GSFont userData from the UFO family-wide lib data.
Below is the the instruction that describes the task: ### Input: Set the GSFont userData from the UFO family-wide lib data. ### Response: def to_glyphs_family_user_data_from_ufo(self, ufo): """Set the GSFont userData from the UFO family-wide lib data.""" target_user_data = self.font.userData try: ...
def _safe_copy_proto_list_values(dst_proto_list, src_proto_list, get_key): """Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_...
Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_list` has the same key as an existing element in `dst_proto_list`, then the el...
Below is the the instruction that describes the task: ### Input: Safely merge values from `src_proto_list` into `dst_proto_list`. Each element in `dst_proto_list` must be mapped by `get_key` to a key value that is unique within that list; likewise for `src_proto_list`. If an element of `src_proto_list` has t...
def modify_attached_policies(self, role_name, new_policies): """Make sure this role has just the new policies""" parts = role_name.split('/', 1) if len(parts) == 2: prefix, name = parts prefix = "/{0}/".format(prefix) else: prefix = "/" nam...
Make sure this role has just the new policies
Below is the the instruction that describes the task: ### Input: Make sure this role has just the new policies ### Response: def modify_attached_policies(self, role_name, new_policies): """Make sure this role has just the new policies""" parts = role_name.split('/', 1) if len(parts) == 2: ...
def on_touch_down(self, touch): """Tell my parent if I've been touched""" if self.parent is None: return if self.collide_point(*touch.pos): self.parent.bar_touched(self, touch)
Tell my parent if I've been touched
Below is the the instruction that describes the task: ### Input: Tell my parent if I've been touched ### Response: def on_touch_down(self, touch): """Tell my parent if I've been touched""" if self.parent is None: return if self.collide_point(*touch.pos): self.parent....
def calc_av_uv_v1(self): """Calculate the flown through area and the wetted perimeter of both forelands. Note that the each foreland lies between the main channel and one outer embankment and that water flowing exactly above the a foreland is contributing to |AV|. The theoretical surface seperatin...
Calculate the flown through area and the wetted perimeter of both forelands. Note that the each foreland lies between the main channel and one outer embankment and that water flowing exactly above the a foreland is contributing to |AV|. The theoretical surface seperating water above the main chann...
Below is the the instruction that describes the task: ### Input: Calculate the flown through area and the wetted perimeter of both forelands. Note that the each foreland lies between the main channel and one outer embankment and that water flowing exactly above the a foreland is contributing to |AV...
def gopro_set_response_send(self, cmd_id, status, force_mavlink1=False): ''' Response from a GOPRO_COMMAND set request cmd_id : Command ID (uint8_t) status : Status (uint8_t) ''' retur...
Response from a GOPRO_COMMAND set request cmd_id : Command ID (uint8_t) status : Status (uint8_t)
Below is the the instruction that describes the task: ### Input: Response from a GOPRO_COMMAND set request cmd_id : Command ID (uint8_t) status : Status (uint8_t) ### Response: def gopro_set_response_send(self, cmd_id, status, force_mavlink1=Fa...
def avg_gate_fidelity(self, reference_unitary): """ Compute the average gate fidelity of the estimated process with respect to a unitary process. See `Chow et al., 2012, <https://doi.org/10.1103/PhysRevLett.109.060501>`_ :param (qutip.Qobj|matrix-like) reference_unitary: A unitary oper...
Compute the average gate fidelity of the estimated process with respect to a unitary process. See `Chow et al., 2012, <https://doi.org/10.1103/PhysRevLett.109.060501>`_ :param (qutip.Qobj|matrix-like) reference_unitary: A unitary operator that induces a process as `rho -> other*rho*other.dag(...
Below is the the instruction that describes the task: ### Input: Compute the average gate fidelity of the estimated process with respect to a unitary process. See `Chow et al., 2012, <https://doi.org/10.1103/PhysRevLett.109.060501>`_ :param (qutip.Qobj|matrix-like) reference_unitary: A unitary ope...
def simple_prot(x, start): """Find the first peak to the right of start""" # start must b >= 1 for i in range(start,len(x)-1): a,b,c = x[i-1], x[i], x[i+1] if b - a > 0 and b -c >= 0: return i else: return None
Find the first peak to the right of start
Below is the the instruction that describes the task: ### Input: Find the first peak to the right of start ### Response: def simple_prot(x, start): """Find the first peak to the right of start""" # start must b >= 1 for i in range(start,len(x)-1): a,b,c = x[i-1], x[i], x[i+1] if b - ...
def _qnwcheb1(n, a, b): """ Compute univariate Guass-Checbychev quadrature nodes and weights Parameters ---------- n : int The number of nodes a : int The lower endpoint b : int The upper endpoint Returns ------- nodes : np.ndarray(dtype=float) ...
Compute univariate Guass-Checbychev quadrature nodes and weights Parameters ---------- n : int The number of nodes a : int The lower endpoint b : int The upper endpoint Returns ------- nodes : np.ndarray(dtype=float) An n element array of nodes no...
Below is the the instruction that describes the task: ### Input: Compute univariate Guass-Checbychev quadrature nodes and weights Parameters ---------- n : int The number of nodes a : int The lower endpoint b : int The upper endpoint Returns ------- nodes ...
def check_field_multiplicity(tag, previous_tags): """ Check the multiplicity of a 'field' for an object. """ fail = False #If the field is single if not tag.field.multiple: #If the tag is being created... if not tag.id: #... and the new field was already included in t...
Check the multiplicity of a 'field' for an object.
Below is the the instruction that describes the task: ### Input: Check the multiplicity of a 'field' for an object. ### Response: def check_field_multiplicity(tag, previous_tags): """ Check the multiplicity of a 'field' for an object. """ fail = False #If the field is single if not tag.fiel...
def records(self): """ Returns a list of records in SORT_KEY order """ return [self._records[i] for i in range(len(self._records))]
Returns a list of records in SORT_KEY order
Below is the the instruction that describes the task: ### Input: Returns a list of records in SORT_KEY order ### Response: def records(self): """ Returns a list of records in SORT_KEY order """ return [self._records[i] for i in range(len(self._records))]
def _get_options_group(group=None): """Get a specific group of options which are allowed.""" #: These expect a hexidecimal keyid as their argument, and can be parsed #: with :func:`_is_hex`. hex_options = frozenset(['--check-sigs', '--default-key', ...
Get a specific group of options which are allowed.
Below is the the instruction that describes the task: ### Input: Get a specific group of options which are allowed. ### Response: def _get_options_group(group=None): """Get a specific group of options which are allowed.""" #: These expect a hexidecimal keyid as their argument, and can be parsed #: wit...
def to_json(self): """ Returns the JSON representation of the webhook. """ result = super(Webhook, self).to_json() result.update({ 'name': self.name, 'url': self.url, 'topics': self.topics, 'httpBasicUsername': self.http_basic_user...
Returns the JSON representation of the webhook.
Below is the the instruction that describes the task: ### Input: Returns the JSON representation of the webhook. ### Response: def to_json(self): """ Returns the JSON representation of the webhook. """ result = super(Webhook, self).to_json() result.update({ 'nam...
def set_data(self, data, invsigma=None): """Set the data to be modeled. Returns *self*. """ self.data = np.array(data, dtype=np.float, ndmin=1) if invsigma is None: self.invsigma = np.ones(self.data.shape) else: i = np.array(invsigma, dtype=np.f...
Set the data to be modeled. Returns *self*.
Below is the the instruction that describes the task: ### Input: Set the data to be modeled. Returns *self*. ### Response: def set_data(self, data, invsigma=None): """Set the data to be modeled. Returns *self*. """ self.data = np.array(data, dtype=np.float, ndmin=1) ...
def get(interface, method, version=1, apihost=DEFAULT_PARAMS['apihost'], https=DEFAULT_PARAMS['https'], caller=None, session=None, params=None): """Send GET request to an API endpoint .. versionadded:: 0.8.3 :param interface: interface name :type interface: str :param method: metho...
Send GET request to an API endpoint .. versionadded:: 0.8.3 :param interface: interface name :type interface: str :param method: method name :type method: str :param version: method version :type version: int :param apihost: API hostname :type apihost: str :param https: whether...
Below is the the instruction that describes the task: ### Input: Send GET request to an API endpoint .. versionadded:: 0.8.3 :param interface: interface name :type interface: str :param method: method name :type method: str :param version: method version :type version: int :param a...
def move_user_data(primary, secondary): ''' Moves all submissions and other data linked to the secondary user into the primary user. Nothing is deleted here, we just modify foreign user keys. ''' # Update all submission authorships of the secondary to the primary submissions = Submission...
Moves all submissions and other data linked to the secondary user into the primary user. Nothing is deleted here, we just modify foreign user keys.
Below is the the instruction that describes the task: ### Input: Moves all submissions and other data linked to the secondary user into the primary user. Nothing is deleted here, we just modify foreign user keys. ### Response: def move_user_data(primary, secondary): ''' Moves all submissions an...
def build_chvatal_graph(): """Makes a new Chvatal graph. Ref: http://mathworld.wolfram.com/ChvatalGraph.html""" # The easiest way to build the Chvatal graph is to start # with C12 and add the additional 12 edges graph = build_cycle_graph(12) edge_tpls = [ (1,7), (1,9), (2,5), (2,11),...
Makes a new Chvatal graph. Ref: http://mathworld.wolfram.com/ChvatalGraph.html
Below is the the instruction that describes the task: ### Input: Makes a new Chvatal graph. Ref: http://mathworld.wolfram.com/ChvatalGraph.html ### Response: def build_chvatal_graph(): """Makes a new Chvatal graph. Ref: http://mathworld.wolfram.com/ChvatalGraph.html""" # The easiest way to bu...
def get_container_list(self) -> list: """Get list of containers. Returns: list, all the ids of containers """ # Initialising empty list containers = [] containers_list = self._client.containers.list() for c_list in containers_list: conta...
Get list of containers. Returns: list, all the ids of containers
Below is the the instruction that describes the task: ### Input: Get list of containers. Returns: list, all the ids of containers ### Response: def get_container_list(self) -> list: """Get list of containers. Returns: list, all the ids of containers """ ...
def gen_signature(self, privkey, pubkey, sig_path): ''' Generate master public-key-signature ''' return salt.crypt.gen_signature(privkey, pubkey, sig_path, self.passphr...
Generate master public-key-signature
Below is the the instruction that describes the task: ### Input: Generate master public-key-signature ### Response: def gen_signature(self, privkey, pubkey, sig_path): ''' Generate master public-key-signature ''' return salt.crypt.gen_signature(privkey, ...
def _compile(self, parselet_node, level=0): """ Build part of the abstract Parsley extraction tree Arguments: parselet_node (dict) -- part of the Parsley tree to compile (can be the root dict/node) level (int) -- current recursion depth (...
Build part of the abstract Parsley extraction tree Arguments: parselet_node (dict) -- part of the Parsley tree to compile (can be the root dict/node) level (int) -- current recursion depth (used for debug)
Below is the the instruction that describes the task: ### Input: Build part of the abstract Parsley extraction tree Arguments: parselet_node (dict) -- part of the Parsley tree to compile (can be the root dict/node) level (int) -- current recursion de...
def overlap_add(blk_sig, size=None, hop=None, wnd=None, normalize=True): """ Overlap-add algorithm using Numpy arrays. Parameters ---------- blk_sig : An iterable of blocks (sequences), such as the ``Stream.blocks`` result. size : Block size for each ``blk_sig`` element, in samples. hop : Num...
Overlap-add algorithm using Numpy arrays. Parameters ---------- blk_sig : An iterable of blocks (sequences), such as the ``Stream.blocks`` result. size : Block size for each ``blk_sig`` element, in samples. hop : Number of samples for two adjacent blocks (defaults to the size). wnd : Window...
Below is the the instruction that describes the task: ### Input: Overlap-add algorithm using Numpy arrays. Parameters ---------- blk_sig : An iterable of blocks (sequences), such as the ``Stream.blocks`` result. size : Block size for each ``blk_sig`` element, in samples. hop : Number of sampl...
def cancellation_fee(self, percentage): ''' Generates an invoice with a cancellation fee, and applies credit to the invoice. percentage (Decimal): The percentage of the credit note to turn into a cancellation fee. Must be 0 <= percentage <= 100. ''' # Local import to fi...
Generates an invoice with a cancellation fee, and applies credit to the invoice. percentage (Decimal): The percentage of the credit note to turn into a cancellation fee. Must be 0 <= percentage <= 100.
Below is the the instruction that describes the task: ### Input: Generates an invoice with a cancellation fee, and applies credit to the invoice. percentage (Decimal): The percentage of the credit note to turn into a cancellation fee. Must be 0 <= percentage <= 100. ### Response: def cance...
def delete_container_service(access_token, subscription_id, resource_group, service_name): '''Delete a named container. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure resource group name. se...
Delete a named container. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure resource group name. service_name (str): Name of container service. Returns: HTTP response.
Below is the the instruction that describes the task: ### Input: Delete a named container. Args: access_token (str): A valid Azure authentication token. subscription_id (str): Azure subscription id. resource_group (str): Azure resource group name. service_name (str): Name of con...
def tag_image(self, repository=None, tag=None): """ Apply additional tags to the image or even add a new name :param repository: str, see constructor :param tag: str, see constructor :return: instance of DockerImage """ if not (repository or tag): rai...
Apply additional tags to the image or even add a new name :param repository: str, see constructor :param tag: str, see constructor :return: instance of DockerImage
Below is the the instruction that describes the task: ### Input: Apply additional tags to the image or even add a new name :param repository: str, see constructor :param tag: str, see constructor :return: instance of DockerImage ### Response: def tag_image(self, repository=None, tag=None):...
def run_somaticsniper_full(job, tumor_bam, normal_bam, univ_options, somaticsniper_options): """ Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal...
Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools :param dict somaticsniper_options: Options specific to SomaticSnipe...
Below is the the instruction that describes the task: ### Input: Run SomaticSniper on the DNA bams. :param dict tumor_bam: Dict of bam and bai for tumor DNA-Seq :param dict normal_bam: Dict of bam and bai for normal DNA-Seq :param dict univ_options: Dict of universal options used by almost all tools ...
def _xml_namespace_strip(root): # type: (ET.Element) -> None """Strip the XML namespace prefix from all element tags under the given root Element.""" if '}' not in root.tag: return # Nothing to do, no namespace present for element in root.iter(): if '}' in element.tag: elem...
Strip the XML namespace prefix from all element tags under the given root Element.
Below is the the instruction that describes the task: ### Input: Strip the XML namespace prefix from all element tags under the given root Element. ### Response: def _xml_namespace_strip(root): # type: (ET.Element) -> None """Strip the XML namespace prefix from all element tags under the given root Element...
def parse(self, rrstr): # type: (bytes) -> None ''' Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ''' if self._initialized: raise pycdlibe...
Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing.
Below is the the instruction that describes the task: ### Input: Parse a Rock Ridge Extensions Reference record out of a string. Parameters: rrstr - The string to parse the record out of. Returns: Nothing. ### Response: def parse(self, rrstr): # type: (bytes) -> None ...
def get_exp_dir_num(parent_dir: str) -> int: """ Gets the number of the current experiment directory.""" return max([int(fn.split(".")[0]) for fn in os.listdir(parent_dir) if fn.split(".")[0].isdigit()] + [-1])
Gets the number of the current experiment directory.
Below is the the instruction that describes the task: ### Input: Gets the number of the current experiment directory. ### Response: def get_exp_dir_num(parent_dir: str) -> int: """ Gets the number of the current experiment directory.""" return max([int(fn.split(".")[0]) for fn in os.listdir...
def double_click(self, on_element=None): """ Double-clicks an element. :Args: - on_element: The element to double-click. If None, clicks on current mouse position. """ if on_element: self.move_to_element(on_element) if self._driver.w3c: ...
Double-clicks an element. :Args: - on_element: The element to double-click. If None, clicks on current mouse position.
Below is the the instruction that describes the task: ### Input: Double-clicks an element. :Args: - on_element: The element to double-click. If None, clicks on current mouse position. ### Response: def double_click(self, on_element=None): """ Double-clicks an element. ...
def listener(self, event, *args, **kwargs): """Create a listener from a decorated function. :param event: Event to listen to. :type event: str :param args: captures all of the positional arguments passed in :type args: tuple(Any) :param kwargs: captures the keyword argume...
Create a listener from a decorated function. :param event: Event to listen to. :type event: str :param args: captures all of the positional arguments passed in :type args: tuple(Any) :param kwargs: captures the keyword arguments passed in :type kwargs: dict(Any) :...
Below is the the instruction that describes the task: ### Input: Create a listener from a decorated function. :param event: Event to listen to. :type event: str :param args: captures all of the positional arguments passed in :type args: tuple(Any) :param kwargs: captures the ...
def FUNCTION_DECL(self, cursor): """Handles function declaration""" # FIXME to UT name = self.get_unique_name(cursor) if self.is_registered(name): return self.get_registered(name) returns = self.parse_cursor_type(cursor.type.get_result()) attributes = [] ...
Handles function declaration
Below is the the instruction that describes the task: ### Input: Handles function declaration ### Response: def FUNCTION_DECL(self, cursor): """Handles function declaration""" # FIXME to UT name = self.get_unique_name(cursor) if self.is_registered(name): return self.get_...
def _strip_object(key): """ Strips branch and version info if the given key supports those attributes. """ if hasattr(key, 'version_agnostic') and hasattr(key, 'for_branch'): return key.for_branch(None).version_agnostic() else: return key
Strips branch and version info if the given key supports those attributes.
Below is the the instruction that describes the task: ### Input: Strips branch and version info if the given key supports those attributes. ### Response: def _strip_object(key): """ Strips branch and version info if the given key supports those attributes. """ if hasattr(key, 'version_agnostic') an...
def list_policy_versions(policy_name, region=None, key=None, keyid=None, profile=None): ''' List versions of a policy. CLI Example: .. code-block:: bash salt myminion boto_iam.list_policy_versions mypolicy ''' conn = _get_conn(region=region, key=key, keyid=keyid, pro...
List versions of a policy. CLI Example: .. code-block:: bash salt myminion boto_iam.list_policy_versions mypolicy
Below is the the instruction that describes the task: ### Input: List versions of a policy. CLI Example: .. code-block:: bash salt myminion boto_iam.list_policy_versions mypolicy ### Response: def list_policy_versions(policy_name, region=None, key=None, keyid=None, profile=None...
def process_tokens( tokens: Sequence[Token], *, end: str = "\n", sep: str = " " ) -> Tuple[str, str]: """ Returns two strings from a list of tokens. One containing ASCII escape codes, the other only the 'normal' characters """ # Flatten the list of tokens in case some of them are of # class...
Returns two strings from a list of tokens. One containing ASCII escape codes, the other only the 'normal' characters
Below is the the instruction that describes the task: ### Input: Returns two strings from a list of tokens. One containing ASCII escape codes, the other only the 'normal' characters ### Response: def process_tokens( tokens: Sequence[Token], *, end: str = "\n", sep: str = " " ) -> Tuple[str, str]: "...
def execute(self): """Resolves the specified confs for the configured targets and returns an iterator over tuples of (conf, jar path). """ if JvmResolveSubsystem.global_instance().get_options().resolver != 'ivy': return compile_classpath = self.context.products.get_data('compile_classpath', ...
Resolves the specified confs for the configured targets and returns an iterator over tuples of (conf, jar path).
Below is the the instruction that describes the task: ### Input: Resolves the specified confs for the configured targets and returns an iterator over tuples of (conf, jar path). ### Response: def execute(self): """Resolves the specified confs for the configured targets and returns an iterator over tupl...
def _start_local_queue_process(self): """ TODO: docstring """ comm_q = Queue(maxsize=10) self.queue_proc = Process(target=interchange.starter, args=(comm_q,), kwargs={"client_ports": (self.outgoing_q.port, ...
TODO: docstring
Below is the the instruction that describes the task: ### Input: TODO: docstring ### Response: def _start_local_queue_process(self): """ TODO: docstring """ comm_q = Queue(maxsize=10) self.queue_proc = Process(target=interchange.starter, args=(comm_q,), ...
def build_path(levels): """ make a linear directory structure from a list of path levels names levels = ["chefdir", "trees", "test"] builds ./chefdir/trees/test/ """ path = os.path.join(*levels) if not dir_exists(path): os.makedirs(path) return path
make a linear directory structure from a list of path levels names levels = ["chefdir", "trees", "test"] builds ./chefdir/trees/test/
Below is the the instruction that describes the task: ### Input: make a linear directory structure from a list of path levels names levels = ["chefdir", "trees", "test"] builds ./chefdir/trees/test/ ### Response: def build_path(levels): """ make a linear directory structure from a list of path leve...
def displayable_path(path, separator=u'; '): """Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`. """ if isinstance(path, (list, tuple)): return separat...
Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`.
Below is the the instruction that describes the task: ### Input: Attempts to decode a bytestring path to a unicode object for the purpose of displaying it to the user. If the `path` argument is a list or a tuple, the elements are joined with `separator`. ### Response: def displayable_path(path, separator=u...
def remove_item(self, *args, **kwargs): """Pass through to provider methods.""" try: self._get_provider_session('assessment_basic_authoring_session').remove_item(*args, **kwargs) except InvalidArgument: self._get_sub_package_provider_session( 'assessment_a...
Pass through to provider methods.
Below is the the instruction that describes the task: ### Input: Pass through to provider methods. ### Response: def remove_item(self, *args, **kwargs): """Pass through to provider methods.""" try: self._get_provider_session('assessment_basic_authoring_session').remove_item(*args, **kwa...
def find_eigen(hint=None): r''' Try to find the Eigen library. If successful the include directory is returned. ''' # search with pkgconfig # --------------------- try: import pkgconfig if pkgconfig.installed('eigen3','>3.0.0'): return pkgconfig.parse('eigen3')['include_dirs'][0] except: ...
r''' Try to find the Eigen library. If successful the include directory is returned.
Below is the the instruction that describes the task: ### Input: r''' Try to find the Eigen library. If successful the include directory is returned. ### Response: def find_eigen(hint=None): r''' Try to find the Eigen library. If successful the include directory is returned. ''' # search with pkgconfig # ...
def _url_lookup_builder(id=None, artist_amg_id=None, upc=None, country='US', media='music', entity=None, attribute=None, limit=50): """ Builds the URL to perform the lookup based on the provided data :param id: String. iTunes ID of the artist, album, track, ebook or software :par...
Builds the URL to perform the lookup based on the provided data :param id: String. iTunes ID of the artist, album, track, ebook or software :param artist_amg_id: String. All Music Guide ID of the artist :param upc: String. UPCs/EANs :param country: String. The two-letter country code for the store you w...
Below is the the instruction that describes the task: ### Input: Builds the URL to perform the lookup based on the provided data :param id: String. iTunes ID of the artist, album, track, ebook or software :param artist_amg_id: String. All Music Guide ID of the artist :param upc: String. UPCs/EANs :p...
def options_help(): """Help message for options dialog. .. versionadded:: 3.2.1 :returns: A message object containing helpful information. :rtype: messaging.message.Message """ message = m.Message() message.add(m.Brand()) message.add(heading()) message.add(content()) return me...
Help message for options dialog. .. versionadded:: 3.2.1 :returns: A message object containing helpful information. :rtype: messaging.message.Message
Below is the the instruction that describes the task: ### Input: Help message for options dialog. .. versionadded:: 3.2.1 :returns: A message object containing helpful information. :rtype: messaging.message.Message ### Response: def options_help(): """Help message for options dialog. .. vers...
def get_previous_scheduled_dagrun(self, session=None): """The previous, SCHEDULED DagRun, if there is one""" dag = self.get_dag() return session.query(DagRun).filter( DagRun.dag_id == self.dag_id, DagRun.execution_date == dag.previous_schedule(self.execution_date) ...
The previous, SCHEDULED DagRun, if there is one
Below is the the instruction that describes the task: ### Input: The previous, SCHEDULED DagRun, if there is one ### Response: def get_previous_scheduled_dagrun(self, session=None): """The previous, SCHEDULED DagRun, if there is one""" dag = self.get_dag() return session.query(DagRun).filt...
def decorate_fn_with_doc(new_fn, old_fn, additional_text=""): """Make new_fn have old_fn's doc string. This is particularly useful for the do_... commands that hook into the help system. Adapted from from a comp.lang.python posting by Duncan Booth.""" def wrapper(*args, **kw): return new_fn(...
Make new_fn have old_fn's doc string. This is particularly useful for the do_... commands that hook into the help system. Adapted from from a comp.lang.python posting by Duncan Booth.
Below is the the instruction that describes the task: ### Input: Make new_fn have old_fn's doc string. This is particularly useful for the do_... commands that hook into the help system. Adapted from from a comp.lang.python posting by Duncan Booth. ### Response: def decorate_fn_with_doc(new_fn, old_fn,...
def _register_token_network_without_limits( self, token_registry_abi: Dict, token_registry_address: str, token_address: str, channel_participant_deposit_limit: Optional[int], token_network_deposit_limit: Optional[int], ): """Register to...
Register token with a TokenNetworkRegistry contract with a contracts-version that doesn't require deposit limits in the TokenNetwork constructor.
Below is the the instruction that describes the task: ### Input: Register token with a TokenNetworkRegistry contract with a contracts-version that doesn't require deposit limits in the TokenNetwork constructor. ### Response: def _register_token_network_without_limits( self, ...
def _send(key, value, metric_type): """Send the specified value to the statsd daemon via UDP without a direct socket connection. :param str value: The properly formatted statsd counter value """ if STATSD_PREFIX: key = '.'.join([STATSD_PREFIX, key]) try: STATSD_SOCKET.sendto('{...
Send the specified value to the statsd daemon via UDP without a direct socket connection. :param str value: The properly formatted statsd counter value
Below is the the instruction that describes the task: ### Input: Send the specified value to the statsd daemon via UDP without a direct socket connection. :param str value: The properly formatted statsd counter value ### Response: def _send(key, value, metric_type): """Send the specified value to the ...
def sample_surface(mesh, count): """ Sample the surface of a mesh, returning the specified number of points For individual triangle sampling uses this method: http://mathworld.wolfram.com/TrianglePointPicking.html Parameters --------- mesh: Trimesh object count: number of points to...
Sample the surface of a mesh, returning the specified number of points For individual triangle sampling uses this method: http://mathworld.wolfram.com/TrianglePointPicking.html Parameters --------- mesh: Trimesh object count: number of points to return Returns --------- sample...
Below is the the instruction that describes the task: ### Input: Sample the surface of a mesh, returning the specified number of points For individual triangle sampling uses this method: http://mathworld.wolfram.com/TrianglePointPicking.html Parameters --------- mesh: Trimesh object co...
def _init_metadata(self): """stub""" TextAnswerFormRecord._init_metadata(self) FilesAnswerFormRecord._init_metadata(self) super(AnswerTextAndFilesMixin, self)._init_metadata()
stub
Below is the the instruction that describes the task: ### Input: stub ### Response: def _init_metadata(self): """stub""" TextAnswerFormRecord._init_metadata(self) FilesAnswerFormRecord._init_metadata(self) super(AnswerTextAndFilesMixin, self)._init_metadata()
def rzz(self, theta, qubit1, qubit2): """Apply RZZ to circuit.""" return self.append(RZZGate(theta), [qubit1, qubit2], [])
Apply RZZ to circuit.
Below is the the instruction that describes the task: ### Input: Apply RZZ to circuit. ### Response: def rzz(self, theta, qubit1, qubit2): """Apply RZZ to circuit.""" return self.append(RZZGate(theta), [qubit1, qubit2], [])
def visitArrayExpr(self, ctx: jsgParser.ArrayExprContext): """ arrayExpr: OBRACKET valueType (BAR valueType)* ebnfSuffix? CBRACKET; """ from pyjsg.parser_impl.jsg_ebnf_parser import JSGEbnf from pyjsg.parser_impl.jsg_valuetype_parser import JSGValueType self._types = [JSGValueType(self....
arrayExpr: OBRACKET valueType (BAR valueType)* ebnfSuffix? CBRACKET;
Below is the the instruction that describes the task: ### Input: arrayExpr: OBRACKET valueType (BAR valueType)* ebnfSuffix? CBRACKET; ### Response: def visitArrayExpr(self, ctx: jsgParser.ArrayExprContext): """ arrayExpr: OBRACKET valueType (BAR valueType)* ebnfSuffix? CBRACKET; """ from pyjsg.pars...
def first_address(self, skip_network_address=True): """ Return the first IP address of this network :param skip_network_address: this flag specifies whether this function returns address of the network \ or returns address that follows address of the network (address, that a host could have) :return: WIPV4Addr...
Return the first IP address of this network :param skip_network_address: this flag specifies whether this function returns address of the network \ or returns address that follows address of the network (address, that a host could have) :return: WIPV4Address
Below is the the instruction that describes the task: ### Input: Return the first IP address of this network :param skip_network_address: this flag specifies whether this function returns address of the network \ or returns address that follows address of the network (address, that a host could have) :return...
def onNicknameChange( self, mid=None, author_id=None, changed_for=None, new_nickname=None, thread_id=None, thread_type=ThreadType.USER, ts=None, metadata=None, msg=None, ): """ Called when the client is listening, and so...
Called when the client is listening, and somebody changes the nickname of a person :param mid: The action ID :param author_id: The ID of the person who changed the nickname :param changed_for: The ID of the person whom got their nickname changed :param new_nickname: The new nickname ...
Below is the the instruction that describes the task: ### Input: Called when the client is listening, and somebody changes the nickname of a person :param mid: The action ID :param author_id: The ID of the person who changed the nickname :param changed_for: The ID of the person whom got the...
def wrap_exception(func: Callable) -> Callable: """Decorator to wrap pygatt exceptions into BluetoothBackendException.""" try: # only do the wrapping if pygatt is installed. # otherwise it's pointless anyway from pygatt.backends.bgapi.exceptions import BGAPIError from pygatt.exce...
Decorator to wrap pygatt exceptions into BluetoothBackendException.
Below is the the instruction that describes the task: ### Input: Decorator to wrap pygatt exceptions into BluetoothBackendException. ### Response: def wrap_exception(func: Callable) -> Callable: """Decorator to wrap pygatt exceptions into BluetoothBackendException.""" try: # only do the wrapping if...
def create_boxcar(aryCnd, aryOns, aryDrt, varTr, varNumVol, aryExclCnd=None, varTmpOvsmpl=1000.): """ Creation of condition time courses in temporally upsampled space. Parameters ---------- aryCnd : np.array 1D array with condition identifiers (every condition has its own...
Creation of condition time courses in temporally upsampled space. Parameters ---------- aryCnd : np.array 1D array with condition identifiers (every condition has its own int) aryOns : np.array, same len as aryCnd 1D array with condition onset times in seconds. aryDrt : np.array, s...
Below is the the instruction that describes the task: ### Input: Creation of condition time courses in temporally upsampled space. Parameters ---------- aryCnd : np.array 1D array with condition identifiers (every condition has its own int) aryOns : np.array, same len as aryCnd 1D ...
def _loadData(self, data): """ Load attribute values from Plex XML response. """ self._data = data self.id = utils.cast(int, data.attrib.get('id')) self.serverId = utils.cast(int, data.attrib.get('serverId')) self.machineIdentifier = data.attrib.get('machineIdentifier') s...
Load attribute values from Plex XML response.
Below is the the instruction that describes the task: ### Input: Load attribute values from Plex XML response. ### Response: def _loadData(self, data): """ Load attribute values from Plex XML response. """ self._data = data self.id = utils.cast(int, data.attrib.get('id')) self.serve...
def ensure_started(self): """ Start a server and waits (blocking wait) until it is fully started. """ # server is either starting or stopping (or error) if self.state in ['maintenance', 'error']: self._wait_for_state_change(['stopped', 'started']) if self.sta...
Start a server and waits (blocking wait) until it is fully started.
Below is the the instruction that describes the task: ### Input: Start a server and waits (blocking wait) until it is fully started. ### Response: def ensure_started(self): """ Start a server and waits (blocking wait) until it is fully started. """ # server is either starting or sto...
def kdeconf(kde,conf=0.683,xmin=None,xmax=None,npts=500, shortest=True,conftol=0.001,return_max=False): """ Returns desired confidence interval for provided KDE object """ if xmin is None: xmin = kde.dataset.min() if xmax is None: xmax = kde.dataset.max() x = np.linsp...
Returns desired confidence interval for provided KDE object
Below is the the instruction that describes the task: ### Input: Returns desired confidence interval for provided KDE object ### Response: def kdeconf(kde,conf=0.683,xmin=None,xmax=None,npts=500, shortest=True,conftol=0.001,return_max=False): """ Returns desired confidence interval for provided...
def from_row(row): '''Create an advice from a CSV row''' subject = (row[5][0].upper() + row[5][1:]) if row[5] else row[5] return Advice.objects.create( id=row[0], administration=cleanup(row[1]), type=row[2], session=datetime.strptime(row[4], '%d/%m/%Y'), subject=clean...
Create an advice from a CSV row
Below is the the instruction that describes the task: ### Input: Create an advice from a CSV row ### Response: def from_row(row): '''Create an advice from a CSV row''' subject = (row[5][0].upper() + row[5][1:]) if row[5] else row[5] return Advice.objects.create( id=row[0], administratio...
def get_class_students(self, xqdm, kcdm, jxbh): """ 教学班查询, 查询指定教学班的所有学生 @structure {'学期': str, '班级名称': str, '学生': [{'姓名': str, '学号': int}]} :param xqdm: 学期代码 :param kcdm: 课程代码 :param jxbh: 教学班号 """ return self.query(GetClassStudents(xqdm, kcdm, jxbh))
教学班查询, 查询指定教学班的所有学生 @structure {'学期': str, '班级名称': str, '学生': [{'姓名': str, '学号': int}]} :param xqdm: 学期代码 :param kcdm: 课程代码 :param jxbh: 教学班号
Below is the the instruction that describes the task: ### Input: 教学班查询, 查询指定教学班的所有学生 @structure {'学期': str, '班级名称': str, '学生': [{'姓名': str, '学号': int}]} :param xqdm: 学期代码 :param kcdm: 课程代码 :param jxbh: 教学班号 ### Response: def get_class_students(self, xqdm, kcdm, jxbh): """ ...
def increase_indent(func): """Decorator for makin """ def wrapper(*args, **kwargs): global _debug_indent _debug_indent += 1 result = func(*args, **kwargs) _debug_indent -= 1 return result return wrapper
Decorator for makin
Below is the the instruction that describes the task: ### Input: Decorator for makin ### Response: def increase_indent(func): """Decorator for makin """ def wrapper(*args, **kwargs): global _debug_indent _debug_indent += 1 result = func(*args, **kwargs) _debug_indent -= 1 ...
def move(self, target, home_flagged_axes=False): ''' Move to the `target` Smoothieware coordinate, along any of the size axes, XYZABC. target: dict dict setting the coordinate that Smoothieware will be at when `move()` returns. `target` keys are the axis in upper...
Move to the `target` Smoothieware coordinate, along any of the size axes, XYZABC. target: dict dict setting the coordinate that Smoothieware will be at when `move()` returns. `target` keys are the axis in upper-case, and the values are the coordinate in millimeters (...
Below is the the instruction that describes the task: ### Input: Move to the `target` Smoothieware coordinate, along any of the size axes, XYZABC. target: dict dict setting the coordinate that Smoothieware will be at when `move()` returns. `target` keys are the axis in upper...
def find_last(fileobj, serial): """Find the last page of the stream 'serial'. If the file is not multiplexed this function is fast. If it is, it must read the whole the stream. This finds the last page in the actual file object, or the last page in the stream (with eos set), wh...
Find the last page of the stream 'serial'. If the file is not multiplexed this function is fast. If it is, it must read the whole the stream. This finds the last page in the actual file object, or the last page in the stream (with eos set), whichever comes first.
Below is the the instruction that describes the task: ### Input: Find the last page of the stream 'serial'. If the file is not multiplexed this function is fast. If it is, it must read the whole the stream. This finds the last page in the actual file object, or the last page in the...
def setMood(self, mood): """ Update the activity message for the current user. Args: mood (str): new mood message """ self.conn("POST", "{0}/users/{1}/profile/partial".format(SkypeConnection.API_USER, self.userId), auth=SkypeConnection.Auth.SkypeTok...
Update the activity message for the current user. Args: mood (str): new mood message
Below is the the instruction that describes the task: ### Input: Update the activity message for the current user. Args: mood (str): new mood message ### Response: def setMood(self, mood): """ Update the activity message for the current user. Args: mood (st...
def configs_for_writer(writer=None, ppp_config_dir=None): """Generator of writer configuration files for one or more writers Args: writer (Optional[str]): Yield configs only for this writer ppp_config_dir (Optional[str]): Additional configuration directory to search for writer confi...
Generator of writer configuration files for one or more writers Args: writer (Optional[str]): Yield configs only for this writer ppp_config_dir (Optional[str]): Additional configuration directory to search for writer configuration files. Returns: Generator of lists of configuration...
Below is the the instruction that describes the task: ### Input: Generator of writer configuration files for one or more writers Args: writer (Optional[str]): Yield configs only for this writer ppp_config_dir (Optional[str]): Additional configuration directory to search for writer c...
def update_expenditure_entry(database, entry): """Update a record of a expenditure report in the provided database. @param db: The MongoDB database to operate on. The expenditures collection will be used from this database. @type db: pymongo.database.Database @param entry: The entry to insert i...
Update a record of a expenditure report in the provided database. @param db: The MongoDB database to operate on. The expenditures collection will be used from this database. @type db: pymongo.database.Database @param entry: The entry to insert into the database, updating the entry with the ...
Below is the the instruction that describes the task: ### Input: Update a record of a expenditure report in the provided database. @param db: The MongoDB database to operate on. The expenditures collection will be used from this database. @type db: pymongo.database.Database @param entry: The en...
def absl_flags(): """ Extracts absl-py flags that the user has specified and outputs their key-value mapping. By default, extracts only those flags in the current __package__ and mainfile. Useful to put into a trial's param_map. """ # TODO: need same thing for argparse flags_dict =...
Extracts absl-py flags that the user has specified and outputs their key-value mapping. By default, extracts only those flags in the current __package__ and mainfile. Useful to put into a trial's param_map.
Below is the the instruction that describes the task: ### Input: Extracts absl-py flags that the user has specified and outputs their key-value mapping. By default, extracts only those flags in the current __package__ and mainfile. Useful to put into a trial's param_map. ### Response: def absl_fl...
def initialize(self): """Start pydoc server""" QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) QApplication.processEvents() self.start_server()
Start pydoc server
Below is the the instruction that describes the task: ### Input: Start pydoc server ### Response: def initialize(self): """Start pydoc server""" QApplication.setOverrideCursor(QCursor(Qt.WaitCursor)) QApplication.processEvents() self.start_server()
def _decrypt_data_key( self, encrypted_data_key: EncryptedDataKey, algorithm: AlgorithmSuite, encryption_context: Dict[Text, Text] ) -> DataKey: """Decrypt an encrypted data key and return the plaintext. :param data_key: Encrypted data key :type data_key: aws_encryption_sdk.structur...
Decrypt an encrypted data key and return the plaintext. :param data_key: Encrypted data key :type data_key: aws_encryption_sdk.structures.EncryptedDataKey :param algorithm: Algorithm object which directs how this Master Key will encrypt the data key :type algorithm: aws_encryption_sdk.i...
Below is the the instruction that describes the task: ### Input: Decrypt an encrypted data key and return the plaintext. :param data_key: Encrypted data key :type data_key: aws_encryption_sdk.structures.EncryptedDataKey :param algorithm: Algorithm object which directs how this Master Key wi...
def json_normalize(data, record_path=None, meta=None, meta_prefix=None, record_prefix=None, errors='raise', sep='.'): """ Normalize semi-structured JSON data into a flat table. Parameters ---------- data : dict or list of d...
Normalize semi-structured JSON data into a flat table. Parameters ---------- data : dict or list of dicts Unserialized JSON objects record_path : string or list of strings, default None Path in each object to list of records. If not passed, data will be assumed to be an array of...
Below is the the instruction that describes the task: ### Input: Normalize semi-structured JSON data into a flat table. Parameters ---------- data : dict or list of dicts Unserialized JSON objects record_path : string or list of strings, default None Path in each object to list of r...
def start(self): """ Make an HTTP request with a specific method """ # TODO : Use Timeout here and _ignore_request_idle from .nurest_session import NURESTSession session = NURESTSession.get_current_session() if self.async: thread = threading.Thread(target=self._make...
Make an HTTP request with a specific method
Below is the the instruction that describes the task: ### Input: Make an HTTP request with a specific method ### Response: def start(self): """ Make an HTTP request with a specific method """ # TODO : Use Timeout here and _ignore_request_idle from .nurest_session import NURESTSession ...
def _ls_sites(path): """ List only sites in the domain_sites() to ensure we co-exist with other projects """ with cd(path): sites = run('ls').split('\n') doms = [d.name for d in domain_sites()] dom_sites = [] for s in sites: ds = s.split('-')[0] d...
List only sites in the domain_sites() to ensure we co-exist with other projects
Below is the the instruction that describes the task: ### Input: List only sites in the domain_sites() to ensure we co-exist with other projects ### Response: def _ls_sites(path): """ List only sites in the domain_sites() to ensure we co-exist with other projects """ with cd(path): sites = ...
def daemonize(): """ Daemonize the program, ie. make it run in the "background", detach it from its controlling terminal and from its controlling process group session. NOTES: - This function also umask(0) and chdir("/") - stdin, stdout, and stderr are redirected from/to /dev/null ...
Daemonize the program, ie. make it run in the "background", detach it from its controlling terminal and from its controlling process group session. NOTES: - This function also umask(0) and chdir("/") - stdin, stdout, and stderr are redirected from/to /dev/null SEE ALSO: http://...
Below is the the instruction that describes the task: ### Input: Daemonize the program, ie. make it run in the "background", detach it from its controlling terminal and from its controlling process group session. NOTES: - This function also umask(0) and chdir("/") - stdin, stdout, and s...
def get_instance(self, payload): """ Build an instance of WorkflowRealTimeStatisticsInstance :param dict payload: Payload response from the API :returns: twilio.rest.taskrouter.v1.workspace.workflow.workflow_real_time_statistics.WorkflowRealTimeStatisticsInstance :rtype: twilio...
Build an instance of WorkflowRealTimeStatisticsInstance :param dict payload: Payload response from the API :returns: twilio.rest.taskrouter.v1.workspace.workflow.workflow_real_time_statistics.WorkflowRealTimeStatisticsInstance :rtype: twilio.rest.taskrouter.v1.workspace.workflow.workflow_real_...
Below is the the instruction that describes the task: ### Input: Build an instance of WorkflowRealTimeStatisticsInstance :param dict payload: Payload response from the API :returns: twilio.rest.taskrouter.v1.workspace.workflow.workflow_real_time_statistics.WorkflowRealTimeStatisticsInstance ...
def is_transaction_invalidated(transaction, state_change): """ True if the `transaction` is made invalid by `state_change`. Some transactions will fail due to race conditions. The races are: - Another transaction which has the same side effect is executed before. - Another transaction which *invalidat...
True if the `transaction` is made invalid by `state_change`. Some transactions will fail due to race conditions. The races are: - Another transaction which has the same side effect is executed before. - Another transaction which *invalidates* the state of the smart contract required by the local trans...
Below is the the instruction that describes the task: ### Input: True if the `transaction` is made invalid by `state_change`. Some transactions will fail due to race conditions. The races are: - Another transaction which has the same side effect is executed before. - Another transaction which *invalid...
def _construct_role(self, managed_policy_map): """Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole """ execution_role = IAMRole(self.logical_id + 'Role', attributes=self.get_passthrough_...
Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole
Below is the the instruction that describes the task: ### Input: Constructs a Lambda execution role based on this SAM function's Policies property. :returns: the generated IAM Role :rtype: model.iam.IAMRole ### Response: def _construct_role(self, managed_policy_map): """Constructs a Lambda...
def _tosubs(self, ixlist): """Maps a list of integer indices to sub-indices. ixlist can contain repeated indices and does not need to be sorted. Returns pair (ss, ms) where ss is a list of subsim numbers and ms is a list of lists of subindices m (one list for each subsim in ss). ...
Maps a list of integer indices to sub-indices. ixlist can contain repeated indices and does not need to be sorted. Returns pair (ss, ms) where ss is a list of subsim numbers and ms is a list of lists of subindices m (one list for each subsim in ss).
Below is the the instruction that describes the task: ### Input: Maps a list of integer indices to sub-indices. ixlist can contain repeated indices and does not need to be sorted. Returns pair (ss, ms) where ss is a list of subsim numbers and ms is a list of lists of subindices m (one list f...
def map_fit(interface, state, label, inp): """ Function counts occurrences of feature values for every row in given data chunk. For continuous features it returns number of values and it calculates mean and variance for every feature. For discrete features it counts occurrences of labels and values for ...
Function counts occurrences of feature values for every row in given data chunk. For continuous features it returns number of values and it calculates mean and variance for every feature. For discrete features it counts occurrences of labels and values for every feature. It returns occurrences of pairs: lab...
Below is the the instruction that describes the task: ### Input: Function counts occurrences of feature values for every row in given data chunk. For continuous features it returns number of values and it calculates mean and variance for every feature. For discrete features it counts occurrences of labels a...
def simplify_other(major, minor, dist): """ Simplify the point featurecollection of poi with another point features accoording by distance. Attention: point featurecollection only Keyword arguments: major -- major geojson minor -- minor geojson dist -- distance return a geoj...
Simplify the point featurecollection of poi with another point features accoording by distance. Attention: point featurecollection only Keyword arguments: major -- major geojson minor -- minor geojson dist -- distance return a geojson featurecollection with two parts of featurecolle...
Below is the the instruction that describes the task: ### Input: Simplify the point featurecollection of poi with another point features accoording by distance. Attention: point featurecollection only Keyword arguments: major -- major geojson minor -- minor geojson dist -- distance ...
def _get_id(owner, date, content): """ Generate an unique Atom id for the given content """ h = hashlib.sha256() # Hash still contains the original project url, keep as is h.update("github.com/spacetelescope/asv".encode('utf-8')) for x in content: if x is None: h.update("...
Generate an unique Atom id for the given content
Below is the the instruction that describes the task: ### Input: Generate an unique Atom id for the given content ### Response: def _get_id(owner, date, content): """ Generate an unique Atom id for the given content """ h = hashlib.sha256() # Hash still contains the original project url, keep a...
def lsfiles(root=".", **kwargs): """ Return only files from a directory listing. Arguments: root (str): Path to directory. Can be relative or absolute. **kwargs: Any additional arguments to be passed to ls(). Returns: list of str: A list of file paths. Raises: O...
Return only files from a directory listing. Arguments: root (str): Path to directory. Can be relative or absolute. **kwargs: Any additional arguments to be passed to ls(). Returns: list of str: A list of file paths. Raises: OSError: If root directory does not exist.
Below is the the instruction that describes the task: ### Input: Return only files from a directory listing. Arguments: root (str): Path to directory. Can be relative or absolute. **kwargs: Any additional arguments to be passed to ls(). Returns: list of str: A list of file paths....
def run(self): """ Run the schedule """ self.main_task.thread.start() self.main_task.thread.join()
Run the schedule
Below is the the instruction that describes the task: ### Input: Run the schedule ### Response: def run(self): """ Run the schedule """ self.main_task.thread.start() self.main_task.thread.join()