code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def MSTORE8(self, address, value): """Save byte to memory""" if istainted(self.pc): for taint in get_taints(self.pc): value = taint_with(value, taint) self._allocate(address, 1) self._store(address, Operators.EXTRACT(value, 0, 8), 1)
Save byte to memory
Below is the the instruction that describes the task: ### Input: Save byte to memory ### Response: def MSTORE8(self, address, value): """Save byte to memory""" if istainted(self.pc): for taint in get_taints(self.pc): value = taint_with(value, taint) self._allocat...
def augmentTextWithCONLLstr( conll_str_array, text ): ''' Augments given Text object with the information from Maltparser's output. More specifically, adds information about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token in the Text object; ''' j = 0 for sentence in text.divide( laye...
Augments given Text object with the information from Maltparser's output. More specifically, adds information about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token in the Text object;
Below is the the instruction that describes the task: ### Input: Augments given Text object with the information from Maltparser's output. More specifically, adds information about SYNTAX_LABEL, SYNTAX_HEAD and DEPREL to each token in the Text object; ### Response: def augmentTextWithCONLLstr( conl...
def execute(self, sensor_graph, scope_stack): """Execute this statement on the sensor_graph given the current scope tree. This function will likely modify the sensor_graph and will possibly also add to or remove from the scope_tree. If there are children nodes they will be called after...
Execute this statement on the sensor_graph given the current scope tree. This function will likely modify the sensor_graph and will possibly also add to or remove from the scope_tree. If there are children nodes they will be called after execute_before and before execute_after, allowin...
Below is the the instruction that describes the task: ### Input: Execute this statement on the sensor_graph given the current scope tree. This function will likely modify the sensor_graph and will possibly also add to or remove from the scope_tree. If there are children nodes they will be ...
def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: _dict['nodes_visited'] = [x._to_dict() for x in self.nodes_visited] if hasattr(self, 'log_messages') and self.log_messa...
Return a json dictionary representing this model.
Below is the the instruction that describes the task: ### Input: Return a json dictionary representing this model. ### Response: def _to_dict(self): """Return a json dictionary representing this model.""" _dict = {} if hasattr(self, 'nodes_visited') and self.nodes_visited is not None: ...
def _add_value_to_dophot_table( self): """*add value to dophot table* """ self.log.info('starting the ``_add_value_to_dophot_table`` method') # ADD SEPARATION RANK TO DOPHOT TABLE sqlQuery = """ UPDATE dophot_photometry a, (SELECT t.primaryId, ...
*add value to dophot table*
Below is the the instruction that describes the task: ### Input: *add value to dophot table* ### Response: def _add_value_to_dophot_table( self): """*add value to dophot table* """ self.log.info('starting the ``_add_value_to_dophot_table`` method') # ADD SEPARATION RANK...
def bind(self, container): """ Get an instance of this Extension to bind to `container`. """ def clone(prototype): if prototype.is_bound(): raise RuntimeError('Cannot `bind` a bound extension.') cls = type(prototype) args, kwargs = prototype....
Get an instance of this Extension to bind to `container`.
Below is the the instruction that describes the task: ### Input: Get an instance of this Extension to bind to `container`. ### Response: def bind(self, container): """ Get an instance of this Extension to bind to `container`. """ def clone(prototype): if prototype.is_bound(): ...
def _show_no_gui(): """Popup with information about how to register a new GUI In the event of no GUI being registered or available, this information dialog will appear to guide the user through how to get set up with one. """ messagebox = QtWidgets.QMessageBox() messagebox.setIcon(message...
Popup with information about how to register a new GUI In the event of no GUI being registered or available, this information dialog will appear to guide the user through how to get set up with one.
Below is the the instruction that describes the task: ### Input: Popup with information about how to register a new GUI In the event of no GUI being registered or available, this information dialog will appear to guide the user through how to get set up with one. ### Response: def _show_no_gui(): ...
def m2m_callback(sender, instance, action, reverse, model, pk_set, using, **kwargs): """ Many 2 Many relationship signall receivver. Detect Many 2 Many relationship changes and append these to existing model or create if needed. These get not recorded from the pre_save or post_save method and must ther...
Many 2 Many relationship signall receivver. Detect Many 2 Many relationship changes and append these to existing model or create if needed. These get not recorded from the pre_save or post_save method and must therefor be received from another method. This method to be precise.
Below is the the instruction that describes the task: ### Input: Many 2 Many relationship signall receivver. Detect Many 2 Many relationship changes and append these to existing model or create if needed. These get not recorded from the pre_save or post_save method and must therefor be received from an...
def wrap_query_in_nested_if_field_is_nested(query, field, nested_fields): """Helper for wrapping a query into a nested if the fields within the query are nested Args: query : The query to be wrapped. field : The field that is being queried. nested_fields : List of fields which are neste...
Helper for wrapping a query into a nested if the fields within the query are nested Args: query : The query to be wrapped. field : The field that is being queried. nested_fields : List of fields which are nested. Returns: (dict): The nested query
Below is the the instruction that describes the task: ### Input: Helper for wrapping a query into a nested if the fields within the query are nested Args: query : The query to be wrapped. field : The field that is being queried. nested_fields : List of fields which are nested. Retur...
def loadEL(dbpath=None, recpath=None, remove_subs=None, wordpool=None, groupby=None, experiments=None, filters=None): ''' Function that loads sql files generated by autoFR Experiment ''' assert (dbpath is not None), "You must specify a db file or files." assert (recpath is not None), "You must ...
Function that loads sql files generated by autoFR Experiment
Below is the the instruction that describes the task: ### Input: Function that loads sql files generated by autoFR Experiment ### Response: def loadEL(dbpath=None, recpath=None, remove_subs=None, wordpool=None, groupby=None, experiments=None, filters=None): ''' Function that loads sql files generated b...
def stereo_parent(self, mol, skip_standardize=False): """Return the stereo parent of a given molecule. The stereo parent has all stereochemistry information removed from tetrahedral centers and double bonds. :param mol: The input molecule. :type mol: rdkit.Chem.rdchem.Mol :para...
Return the stereo parent of a given molecule. The stereo parent has all stereochemistry information removed from tetrahedral centers and double bonds. :param mol: The input molecule. :type mol: rdkit.Chem.rdchem.Mol :param bool skip_standardize: Set to True if mol has already been stan...
Below is the the instruction that describes the task: ### Input: Return the stereo parent of a given molecule. The stereo parent has all stereochemistry information removed from tetrahedral centers and double bonds. :param mol: The input molecule. :type mol: rdkit.Chem.rdchem.Mol :...
def adapt_animation_layout(animation): """ Adapt the setter in an animation's layout so that Strip animations can run on on Matrix, Cube, or Circle layout, and Matrix or Cube animations can run on a Strip layout. """ layout = animation.layout required = getattr(animation, 'LAYOUT_CLASS', Non...
Adapt the setter in an animation's layout so that Strip animations can run on on Matrix, Cube, or Circle layout, and Matrix or Cube animations can run on a Strip layout.
Below is the the instruction that describes the task: ### Input: Adapt the setter in an animation's layout so that Strip animations can run on on Matrix, Cube, or Circle layout, and Matrix or Cube animations can run on a Strip layout. ### Response: def adapt_animation_layout(animation): """ Adapt t...
def parse_name_myher(record): """Parse NAME structure assuming MYHERITAGE dialect. In MYHERITAGE dialect married name (if present) is saved as _MARNM sub-record. Maiden name is stored in SURN record. Few examples: No maiden name: 1 NAME John /Smith/ 2 GIVN John 2 SURN Smith ...
Parse NAME structure assuming MYHERITAGE dialect. In MYHERITAGE dialect married name (if present) is saved as _MARNM sub-record. Maiden name is stored in SURN record. Few examples: No maiden name: 1 NAME John /Smith/ 2 GIVN John 2 SURN Smith With maiden name: 1 NAME ...
Below is the the instruction that describes the task: ### Input: Parse NAME structure assuming MYHERITAGE dialect. In MYHERITAGE dialect married name (if present) is saved as _MARNM sub-record. Maiden name is stored in SURN record. Few examples: No maiden name: 1 NAME John /Smith/ 2 G...
def set_preserver_info(self, sample): """Updates the Preserver and the Date Preserved with the values provided in the request. If neither Preserver nor DatePreserved are present in the request, returns False """ if sample.getPreserver() and sample.getDatePreserved(): ...
Updates the Preserver and the Date Preserved with the values provided in the request. If neither Preserver nor DatePreserved are present in the request, returns False
Below is the the instruction that describes the task: ### Input: Updates the Preserver and the Date Preserved with the values provided in the request. If neither Preserver nor DatePreserved are present in the request, returns False ### Response: def set_preserver_info(self, sample): """Upda...
def _clean_data(self, data): """ Clean a dictionary of data of potentially sensitive info before sending to the database. Function based on the "_clean_credentials" function of django (https://github.com/django/django/blob/stable/1.11.x/django/contrib/auth/__init__.py#L50) ...
Clean a dictionary of data of potentially sensitive info before sending to the database. Function based on the "_clean_credentials" function of django (https://github.com/django/django/blob/stable/1.11.x/django/contrib/auth/__init__.py#L50) Fields defined by django are by default cleane...
Below is the the instruction that describes the task: ### Input: Clean a dictionary of data of potentially sensitive info before sending to the database. Function based on the "_clean_credentials" function of django (https://github.com/django/django/blob/stable/1.11.x/django/contrib/auth/__i...
def make_package_index(download_dir): """ Create a pypi server like file structure below download directory. :param download_dir: Download directory with packages. EXAMPLE BEFORE: +-- downloads/ +-- alice-1.0.zip +-- alice-1.0.tar.gz +-- bob-1.3.0.tar.gz ...
Create a pypi server like file structure below download directory. :param download_dir: Download directory with packages. EXAMPLE BEFORE: +-- downloads/ +-- alice-1.0.zip +-- alice-1.0.tar.gz +-- bob-1.3.0.tar.gz +-- bob-1.4.2.tar.gz +-- charly-1...
Below is the the instruction that describes the task: ### Input: Create a pypi server like file structure below download directory. :param download_dir: Download directory with packages. EXAMPLE BEFORE: +-- downloads/ +-- alice-1.0.zip +-- alice-1.0.tar.gz +-- bob...
def rsa_base64_decrypt(self, cipher, b64=True): """ 先base64 解码 再rsa 解密数据 """ with open(self.key_file) as fp: key_ = RSA.importKey(fp.read()) _cip = PKCS1_v1_5.new(key_) cipher = base64.b64decode(cipher) if b64 else cipher plain = _cip.d...
先base64 解码 再rsa 解密数据
Below is the the instruction that describes the task: ### Input: 先base64 解码 再rsa 解密数据 ### Response: def rsa_base64_decrypt(self, cipher, b64=True): """ 先base64 解码 再rsa 解密数据 """ with open(self.key_file) as fp: key_ = RSA.importKey(fp.read()) _cip = PKCS1_v...
def hdf5_cache(filepath=None, parent=None, group=None, names=None, typed=False, hashed_key=False, **h5dcreate_kwargs): """HDF5 cache decorator. Parameters ---------- filepath : string, optional Path to HDF5 file. If None a temporary file name will be used. parent : string, op...
HDF5 cache decorator. Parameters ---------- filepath : string, optional Path to HDF5 file. If None a temporary file name will be used. parent : string, optional Path to group within HDF5 file to use as parent. If None the root group will be used. group : string, optional ...
Below is the the instruction that describes the task: ### Input: HDF5 cache decorator. Parameters ---------- filepath : string, optional Path to HDF5 file. If None a temporary file name will be used. parent : string, optional Path to group within HDF5 file to use as parent. If None ...
def _WriteAttributes(self): """Write the dirty attributes to the data store.""" # If the object is not opened for writing we do not need to flush it to the # data_store. if "w" not in self.mode: return if self.urn is None: raise ValueError("Storing of anonymous AFF4 objects not supporte...
Write the dirty attributes to the data store.
Below is the the instruction that describes the task: ### Input: Write the dirty attributes to the data store. ### Response: def _WriteAttributes(self): """Write the dirty attributes to the data store.""" # If the object is not opened for writing we do not need to flush it to the # data_store. if "...
def inserir(self, user, pwd, name, email, user_ldap): """Inserts a new User and returns its identifier. The user will be created with active status. :param user: Username. String with a minimum 3 and maximum of 45 characters :param pwd: User password. String with a minimum 3 and maximu...
Inserts a new User and returns its identifier. The user will be created with active status. :param user: Username. String with a minimum 3 and maximum of 45 characters :param pwd: User password. String with a minimum 3 and maximum of 45 characters :param name: User name. String with a ...
Below is the the instruction that describes the task: ### Input: Inserts a new User and returns its identifier. The user will be created with active status. :param user: Username. String with a minimum 3 and maximum of 45 characters :param pwd: User password. String with a minimum 3 and ma...
def rpc(self, request, args): """RPC :param request: :args ???: """ if request.method != 'POST': return self.error(405, request) payload = request.get_data(as_text=True) or '{}' request_method = request.args.get('method') if not request_metho...
RPC :param request: :args ???:
Below is the the instruction that describes the task: ### Input: RPC :param request: :args ???: ### Response: def rpc(self, request, args): """RPC :param request: :args ???: """ if request.method != 'POST': return self.error(405, request) ...
def _find_clim_vars(self, ds, refresh=False): ''' Returns a list of variables that are likely to be climatology variables based on CF §7.4 :param netCDF4.Dataset ds: An open netCDF dataset :param bool refresh: if refresh is set to True, the cache is invalida...
Returns a list of variables that are likely to be climatology variables based on CF §7.4 :param netCDF4.Dataset ds: An open netCDF dataset :param bool refresh: if refresh is set to True, the cache is invalidated. :rtype: list :return: A list containing strin...
Below is the the instruction that describes the task: ### Input: Returns a list of variables that are likely to be climatology variables based on CF §7.4 :param netCDF4.Dataset ds: An open netCDF dataset :param bool refresh: if refresh is set to True, the cache is inval...
def QA_util_realtime(strtime, client): """ 查询数据库中的数据 :param strtime: strtime str字符串 -- 1999-12-11 这种格式 :param client: client pymongo.MongoClient类型 -- mongodb 数据库 从 QA_util_sql_mongo_setting 中 QA_util_sql_mongo_setting 获取 :return: Dictionary -- {'time_real': 时间,'id': id} """...
查询数据库中的数据 :param strtime: strtime str字符串 -- 1999-12-11 这种格式 :param client: client pymongo.MongoClient类型 -- mongodb 数据库 从 QA_util_sql_mongo_setting 中 QA_util_sql_mongo_setting 获取 :return: Dictionary -- {'time_real': 时间,'id': id}
Below is the the instruction that describes the task: ### Input: 查询数据库中的数据 :param strtime: strtime str字符串 -- 1999-12-11 这种格式 :param client: client pymongo.MongoClient类型 -- mongodb 数据库 从 QA_util_sql_mongo_setting 中 QA_util_sql_mongo_setting 获取 :return: Dictionary -- {'time_real': 时间...
def _send_data(self, data, start_offset, file_len): """Send the block to the storage service. This is a utility method that does not modify self. Args: data: data to send in str. start_offset: start offset of the data in relation to the file. file_len: an int if this is the last data to ...
Send the block to the storage service. This is a utility method that does not modify self. Args: data: data to send in str. start_offset: start offset of the data in relation to the file. file_len: an int if this is the last data to append to the file. Otherwise '*'.
Below is the the instruction that describes the task: ### Input: Send the block to the storage service. This is a utility method that does not modify self. Args: data: data to send in str. start_offset: start offset of the data in relation to the file. file_len: an int if this is the las...
def do_mfa(self, args): """ Enter a 6-digit MFA token. Nephele will execute the appropriate `aws` command line to authenticate that token. mfa -h for more details """ parser = CommandArgumentParser("mfa") parser.add_argument(dest='token',help='MFA token...
Enter a 6-digit MFA token. Nephele will execute the appropriate `aws` command line to authenticate that token. mfa -h for more details
Below is the the instruction that describes the task: ### Input: Enter a 6-digit MFA token. Nephele will execute the appropriate `aws` command line to authenticate that token. mfa -h for more details ### Response: def do_mfa(self, args): """ Enter a 6-digit MFA token. Nephele will...
def split_to_discretized_mix_logistic_params(inputs): """Splits input tensor into parameters of discretized mixture logistic. Args: inputs: A [batch, height, width, num_mixtures*10] tensor of floats comprising one unconstrained mixture probability, three means (one per channel), three standard devi...
Splits input tensor into parameters of discretized mixture logistic. Args: inputs: A [batch, height, width, num_mixtures*10] tensor of floats comprising one unconstrained mixture probability, three means (one per channel), three standard deviations (one per channel), and three coefficients whic...
Below is the the instruction that describes the task: ### Input: Splits input tensor into parameters of discretized mixture logistic. Args: inputs: A [batch, height, width, num_mixtures*10] tensor of floats comprising one unconstrained mixture probability, three means (one per channel), three sta...
def ensure_folder(path, folder=False, fatal=True, logger=LOG.debug, dryrun=None): """ :param str|None path: Path to file or folder :param bool folder: If True, 'path' refers to a folder (file otherwise) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to...
:param str|None path: Path to file or folder :param bool folder: If True, 'path' refers to a folder (file otherwise) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to use :param bool|None dryrun: If specified, override global is_dryrun() :return int: 1...
Below is the the instruction that describes the task: ### Input: :param str|None path: Path to file or folder :param bool folder: If True, 'path' refers to a folder (file otherwise) :param bool|None fatal: Abort execution on failure if True :param callable|None logger: Logger to use :param bool|None...
def list_locks(root=None): ''' List current package locks. root operate on a different root directory. Return a dict containing the locked package with attributes:: {'<package>': {'case_sensitive': '<case_sensitive>', 'match_type': '<match_type>' ...
List current package locks. root operate on a different root directory. Return a dict containing the locked package with attributes:: {'<package>': {'case_sensitive': '<case_sensitive>', 'match_type': '<match_type>' 'type': '<type>'}} CLI Exa...
Below is the the instruction that describes the task: ### Input: List current package locks. root operate on a different root directory. Return a dict containing the locked package with attributes:: {'<package>': {'case_sensitive': '<case_sensitive>', 'match_type': ...
def AddDigitalShortIdMsecRecord(site_service, tag, time_value, msec, value, status_string="OK ", warn=False, chattering=False, unreliable=False, manual=False): """ This function will add a digital value to the specified eDNA service and tag, including all default point status definition...
This function will add a digital value to the specified eDNA service and tag, including all default point status definitions. :param site_service: The site.service where data will be pushed :param tag: The eDNA tag to push data. Tag only (e.g. ADE1CA01) :param time_value: The time of the point, which M...
Below is the the instruction that describes the task: ### Input: This function will add a digital value to the specified eDNA service and tag, including all default point status definitions. :param site_service: The site.service where data will be pushed :param tag: The eDNA tag to push data. Tag only ...
def _get_fld2col_widths(self, **kws): """Return xlsx column widths based on default and user-specified field-value pairs.""" fld2col_widths = self._init_fld2col_widths() if 'fld2col_widths' not in kws: return fld2col_widths for fld, val in kws['fld2col_widths'].items(): ...
Return xlsx column widths based on default and user-specified field-value pairs.
Below is the the instruction that describes the task: ### Input: Return xlsx column widths based on default and user-specified field-value pairs. ### Response: def _get_fld2col_widths(self, **kws): """Return xlsx column widths based on default and user-specified field-value pairs.""" fld2col_widths...
def _decompose(string, n): '''Given string and multiplier n, find m**2 decomposition. :param string: input string :type string: str :param n: multiplier :type n: int :returns: generator that produces m**2 * string if m**2 is a factor of n :rtype: generator of 0 or 1 ''' binary = [i...
Given string and multiplier n, find m**2 decomposition. :param string: input string :type string: str :param n: multiplier :type n: int :returns: generator that produces m**2 * string if m**2 is a factor of n :rtype: generator of 0 or 1
Below is the the instruction that describes the task: ### Input: Given string and multiplier n, find m**2 decomposition. :param string: input string :type string: str :param n: multiplier :type n: int :returns: generator that produces m**2 * string if m**2 is a factor of n :rtype: generator...
def parse_xhtml_notes(entry): """Yield key, value pairs parsed from the XHTML notes section. Each key, value pair must be defined in its own text block, e.g. ``<p>key: value</p><p>key2: value2</p>``. The key and value must be separated by a colon. Whitespace is stripped from both key and value, and ...
Yield key, value pairs parsed from the XHTML notes section. Each key, value pair must be defined in its own text block, e.g. ``<p>key: value</p><p>key2: value2</p>``. The key and value must be separated by a colon. Whitespace is stripped from both key and value, and quotes are removed from values if pr...
Below is the the instruction that describes the task: ### Input: Yield key, value pairs parsed from the XHTML notes section. Each key, value pair must be defined in its own text block, e.g. ``<p>key: value</p><p>key2: value2</p>``. The key and value must be separated by a colon. Whitespace is stripped ...
def _get_new_finished_state(self, state, new_seq, new_log_probs): """Combine new and old finished sequences, and gather the top k sequences. Args: state: A dictionary with the current loop state. new_seq: New sequences generated by growing the current alive sequences int32 tensor with shape...
Combine new and old finished sequences, and gather the top k sequences. Args: state: A dictionary with the current loop state. new_seq: New sequences generated by growing the current alive sequences int32 tensor with shape [batch_size, beam_size, i + 1] new_log_probs: Log probabilities of...
Below is the the instruction that describes the task: ### Input: Combine new and old finished sequences, and gather the top k sequences. Args: state: A dictionary with the current loop state. new_seq: New sequences generated by growing the current alive sequences int32 tensor with shape [ba...
def a_send_password(password, ctx): """Send the password text. Before sending the password local echo is disabled. If password not provided it disconnects from the device and raises ConnectionAuthenticationError exception. """ if password: ctx.ctrl.send_command(password, password=True) ...
Send the password text. Before sending the password local echo is disabled. If password not provided it disconnects from the device and raises ConnectionAuthenticationError exception.
Below is the the instruction that describes the task: ### Input: Send the password text. Before sending the password local echo is disabled. If password not provided it disconnects from the device and raises ConnectionAuthenticationError exception. ### Response: def a_send_password(password, ctx): """...
def _hl_as_string(self, highlight): """ Given a solr string of highlighted text, returns the str representations For example: "Foo <em>Muscle</em> bar <em>atrophy</em>, generalized" Returns: "Foo Muscle bar atrophy, generalized" :return: str """ ...
Given a solr string of highlighted text, returns the str representations For example: "Foo <em>Muscle</em> bar <em>atrophy</em>, generalized" Returns: "Foo Muscle bar atrophy, generalized" :return: str
Below is the the instruction that describes the task: ### Input: Given a solr string of highlighted text, returns the str representations For example: "Foo <em>Muscle</em> bar <em>atrophy</em>, generalized" Returns: "Foo Muscle bar atrophy, generalized" :return: str #...
def _parse_data_fields(self, fields, tag_id="tag", sub_id="code"): """ Parse data fields. Args: fields (list): of HTMLElements tag_id (str): parameter name, which holds the information, about field name this is normally "tag", but in case of ...
Parse data fields. Args: fields (list): of HTMLElements tag_id (str): parameter name, which holds the information, about field name this is normally "tag", but in case of oai_marc "id" sub_id (str): id of parameter, which h...
Below is the the instruction that describes the task: ### Input: Parse data fields. Args: fields (list): of HTMLElements tag_id (str): parameter name, which holds the information, about field name this is normally "tag", but in case of ...
def login(self, email, password): """Login to Todoist. :param email: The user's email address. :type email: str :param password: The user's password. :type password: str :return: The HTTP response to the request. :rtype: :class:`requests.Response` >>> fr...
Login to Todoist. :param email: The user's email address. :type email: str :param password: The user's password. :type password: str :return: The HTTP response to the request. :rtype: :class:`requests.Response` >>> from pytodoist.api import TodoistAPI >>...
Below is the the instruction that describes the task: ### Input: Login to Todoist. :param email: The user's email address. :type email: str :param password: The user's password. :type password: str :return: The HTTP response to the request. :rtype: :class:`requests.R...
def on_state(self, *args): """If I'm pressed, unpress all other buttons in the ruleslist""" # This really ought to be done with the selection behavior if self.state == 'down': self.rulesview.rule = self.rule for button in self.ruleslist.children[0].children: ...
If I'm pressed, unpress all other buttons in the ruleslist
Below is the the instruction that describes the task: ### Input: If I'm pressed, unpress all other buttons in the ruleslist ### Response: def on_state(self, *args): """If I'm pressed, unpress all other buttons in the ruleslist""" # This really ought to be done with the selection behavior if...
def fit(self, blocks, y=None): """ Fit a k-means clustering model using an ordered sequence of blocks. """ self.kmeans.fit(make_weninger_features(blocks)) # set the cluster center closest to the origin to exactly (0.0, 0.0) self.kmeans.cluster_centers_.sort(axis=0) ...
Fit a k-means clustering model using an ordered sequence of blocks.
Below is the the instruction that describes the task: ### Input: Fit a k-means clustering model using an ordered sequence of blocks. ### Response: def fit(self, blocks, y=None): """ Fit a k-means clustering model using an ordered sequence of blocks. """ self.kmeans.fit(make_weninger...
async def disconnect(self, expected=True): """ Disconnect from server. """ if self.connected: # Unschedule ping checker. if self._ping_checker_handle: self._ping_checker_handle.cancel() # Schedule disconnect. await self._disconnect(expecte...
Disconnect from server.
Below is the the instruction that describes the task: ### Input: Disconnect from server. ### Response: async def disconnect(self, expected=True): """ Disconnect from server. """ if self.connected: # Unschedule ping checker. if self._ping_checker_handle: self....
def get(self, section, key): """get function reads the config value for the requested section and key and returns it Parameters: * **section (string):** the section to look for the config value either - oxd, client * **key (string):** the key for the config value require...
get function reads the config value for the requested section and key and returns it Parameters: * **section (string):** the section to look for the config value either - oxd, client * **key (string):** the key for the config value required Returns: **value ...
Below is the the instruction that describes the task: ### Input: get function reads the config value for the requested section and key and returns it Parameters: * **section (string):** the section to look for the config value either - oxd, client * **key (string):** the key...
def event_table(events): """Formats a table for events""" table = formatting.Table([ "Id", "Start Date", "End Date", "Subject", "Status", "Acknowledged", "Updates", "Impacted Resources" ], title="Upcoming Events") table.align['Subject'] = '...
Formats a table for events
Below is the the instruction that describes the task: ### Input: Formats a table for events ### Response: def event_table(events): """Formats a table for events""" table = formatting.Table([ "Id", "Start Date", "End Date", "Subject", "Status", "Acknowledged",...
def move_to_top(self): ''' Move an existing status update to the top of the queue and recalculate times for all updates in the queue. Returns the update with its new posting time. ''' url = PATHS['MOVE_TO_TOP'] % self.id response = self.api.post(url=url) return Update(api=self.ap...
Move an existing status update to the top of the queue and recalculate times for all updates in the queue. Returns the update with its new posting time.
Below is the the instruction that describes the task: ### Input: Move an existing status update to the top of the queue and recalculate times for all updates in the queue. Returns the update with its new posting time. ### Response: def move_to_top(self): ''' Move an existing status update to ...
def export(request, count, name='', content_type=None): """ Export banners. :Parameters: - `count`: number of objects to pass into the template - `name`: name of the template ( page/export/banner.html is default ) - `models`: list of Model classes to include """ t_list = [] ...
Export banners. :Parameters: - `count`: number of objects to pass into the template - `name`: name of the template ( page/export/banner.html is default ) - `models`: list of Model classes to include
Below is the the instruction that describes the task: ### Input: Export banners. :Parameters: - `count`: number of objects to pass into the template - `name`: name of the template ( page/export/banner.html is default ) - `models`: list of Model classes to include ### Response: def expo...
def safe_accept(target, tgt_type='glob'): ''' .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .. code-block:: b...
.. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .. code-block:: bash salt-run manage.safe_accept my_minion ...
Below is the the instruction that describes the task: ### Input: .. versionchanged:: 2017.7.0 The ``expr_form`` argument has been renamed to ``tgt_type``, earlier releases must use ``expr_form``. Accept a minion's public key after checking the fingerprint over salt-ssh CLI Example: .....
def predict(self, X): """ Predict the less costly class for a given observation Parameters ---------- X : array (n_samples, n_features) Data for which to predict minimum cost label. Returns ------- y_hat : array (n_samples,) ...
Predict the less costly class for a given observation Parameters ---------- X : array (n_samples, n_features) Data for which to predict minimum cost label. Returns ------- y_hat : array (n_samples,) Label with expected minimum cos...
Below is the the instruction that describes the task: ### Input: Predict the less costly class for a given observation Parameters ---------- X : array (n_samples, n_features) Data for which to predict minimum cost label. Returns ------- y...
def timedelta_seconds(td): ''' Return the offset stored by a :class:`datetime.timedelta` object as an integer number of seconds. Microseconds, if present, are rounded to the nearest second. Delegates to :meth:`timedelta.total_seconds() <datetime.timedelta.total_seconds()>` if available. ...
Return the offset stored by a :class:`datetime.timedelta` object as an integer number of seconds. Microseconds, if present, are rounded to the nearest second. Delegates to :meth:`timedelta.total_seconds() <datetime.timedelta.total_seconds()>` if available. >>> timedelta_seconds(timedelta(hour...
Below is the the instruction that describes the task: ### Input: Return the offset stored by a :class:`datetime.timedelta` object as an integer number of seconds. Microseconds, if present, are rounded to the nearest second. Delegates to :meth:`timedelta.total_seconds() <datetime.timedelta.total_se...
def default_content_filter(sender, instance, **kwargs): # pylint: disable=unused-argument """ Set default value for `EnterpriseCustomerCatalog.content_filter` if not already set. """ if kwargs['created'] and not instance.content_filter: instance.content_filter = get_default_catalog_content_f...
Set default value for `EnterpriseCustomerCatalog.content_filter` if not already set.
Below is the the instruction that describes the task: ### Input: Set default value for `EnterpriseCustomerCatalog.content_filter` if not already set. ### Response: def default_content_filter(sender, instance, **kwargs): # pylint: disable=unused-argument """ Set default value for `EnterpriseCustomerCata...
def deallocate(self, buf): """ Return buffers to the pool. If they are of the poolable size add them to the free list, otherwise just mark the memory as free. Arguments: buffer_ (io.BytesIO): The buffer to return """ with self._lock: # BytesIO.tru...
Return buffers to the pool. If they are of the poolable size add them to the free list, otherwise just mark the memory as free. Arguments: buffer_ (io.BytesIO): The buffer to return
Below is the the instruction that describes the task: ### Input: Return buffers to the pool. If they are of the poolable size add them to the free list, otherwise just mark the memory as free. Arguments: buffer_ (io.BytesIO): The buffer to return ### Response: def deallocate(self, buf)...
def getRandomBinaryTreeLeafNode(binaryTree): """Get random binary tree node. """ if binaryTree.internal == True: if random.random() > 0.5: return getRandomBinaryTreeLeafNode(binaryTree.left) else: return getRandomBinaryTreeLeafNode(binaryTree.right) else: ...
Get random binary tree node.
Below is the the instruction that describes the task: ### Input: Get random binary tree node. ### Response: def getRandomBinaryTreeLeafNode(binaryTree): """Get random binary tree node. """ if binaryTree.internal == True: if random.random() > 0.5: return getRandomBinaryTreeLeafNode(b...
def psf_configure_simple(psf_type="GAUSSIAN", fwhm=1, kernelsize=11, deltaPix=1, truncate=6, kernel=None): """ this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class documentation to see the full possibilities. :param psf_type: string, type of ...
this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class documentation to see the full possibilities. :param psf_type: string, type of PSF model :param fwhm: Full width at half maximum of PSF (if GAUSSIAN psf) :param kernelsize: size in pixel of ...
Below is the the instruction that describes the task: ### Input: this routine generates keyword arguments to initialize a PSF() class in lenstronomy. Have a look at the PSF class documentation to see the full possibilities. :param psf_type: string, type of PSF model :param fwhm: Full width at half maxi...
def init_log(log_file): """ Creates log file on disk and "Tees" :py:class:`sys.stdout` to console and disk Args: log_file (str): The path on disk to append or create the log file. Returns: file: The opened log file. """ #Create the log file log = None try: log = ope...
Creates log file on disk and "Tees" :py:class:`sys.stdout` to console and disk Args: log_file (str): The path on disk to append or create the log file. Returns: file: The opened log file.
Below is the the instruction that describes the task: ### Input: Creates log file on disk and "Tees" :py:class:`sys.stdout` to console and disk Args: log_file (str): The path on disk to append or create the log file. Returns: file: The opened log file. ### Response: def init_log(log_file)...
def get_default_download_dir(self, *subdirs): """ Get the download path for a file. If not defined, return default from config. Parameters ========== subdirs: a single (or list of) subfolders under the basepath """ # Look up value for key "path" i...
Get the download path for a file. If not defined, return default from config. Parameters ========== subdirs: a single (or list of) subfolders under the basepath
Below is the the instruction that describes the task: ### Input: Get the download path for a file. If not defined, return default from config. Parameters ========== subdirs: a single (or list of) subfolders under the basepath ### Response: def get_default_download_d...
def _set_bank_view(self, session): """Sets the underlying bank view to match current view""" if self._bank_view == COMPARATIVE: try: session.use_comparative_bank_view() except AttributeError: pass else: try: sess...
Sets the underlying bank view to match current view
Below is the the instruction that describes the task: ### Input: Sets the underlying bank view to match current view ### Response: def _set_bank_view(self, session): """Sets the underlying bank view to match current view""" if self._bank_view == COMPARATIVE: try: session...
def parse_author(author): """ Parses an Author object from either a String, dict, or tuple Args: author: A String formatted as "NAME <email@domain.com>", (name, email) tuple, or a dict with name and email keys. Returns: An Author object. ...
Parses an Author object from either a String, dict, or tuple Args: author: A String formatted as "NAME <email@domain.com>", (name, email) tuple, or a dict with name and email keys. Returns: An Author object.
Below is the the instruction that describes the task: ### Input: Parses an Author object from either a String, dict, or tuple Args: author: A String formatted as "NAME <email@domain.com>", (name, email) tuple, or a dict with name and email keys. Returns: An ...
def prime_factors(n): """Lists prime factors of a given natural integer, from greatest to smallest :param n: Natural integer :rtype : list of all prime factors of the given natural n """ i = 2 while i <= sqrt(n): if n % i == 0: l = prime_factors(n/i) l.append(i) ...
Lists prime factors of a given natural integer, from greatest to smallest :param n: Natural integer :rtype : list of all prime factors of the given natural n
Below is the the instruction that describes the task: ### Input: Lists prime factors of a given natural integer, from greatest to smallest :param n: Natural integer :rtype : list of all prime factors of the given natural n ### Response: def prime_factors(n): """Lists prime factors of a given natural in...
def to_instance(cls, ob, default=None, strict=False): """Encode a GeoJSON dict into an GeoJSON object. Assumes the caller knows that the dict should satisfy a GeoJSON type. :param cls: Dict containing the elements to be encoded into a GeoJSON object. :type cls: dict :par...
Encode a GeoJSON dict into an GeoJSON object. Assumes the caller knows that the dict should satisfy a GeoJSON type. :param cls: Dict containing the elements to be encoded into a GeoJSON object. :type cls: dict :param ob: GeoJSON object into which to encode the dict provided in ...
Below is the the instruction that describes the task: ### Input: Encode a GeoJSON dict into an GeoJSON object. Assumes the caller knows that the dict should satisfy a GeoJSON type. :param cls: Dict containing the elements to be encoded into a GeoJSON object. :type cls: dict ...
def possible_moves(self, position): """ Returns all possible rook moves. :type: position: Board :rtype: list """ for move in itertools.chain(*[self.moves_in_direction(fn, position) for fn in self.cross_fn]): yield move
Returns all possible rook moves. :type: position: Board :rtype: list
Below is the the instruction that describes the task: ### Input: Returns all possible rook moves. :type: position: Board :rtype: list ### Response: def possible_moves(self, position): """ Returns all possible rook moves. :type: position: Board :rtype: list ...
def shared_volume_containers(self): """All the harpoon containers in volumes.share_with for this container""" for container in self.volumes.share_with: if not isinstance(container, six.string_types): yield container.name
All the harpoon containers in volumes.share_with for this container
Below is the the instruction that describes the task: ### Input: All the harpoon containers in volumes.share_with for this container ### Response: def shared_volume_containers(self): """All the harpoon containers in volumes.share_with for this container""" for container in self.volumes.share_with: ...
def _compute_VesPoly(R=2.4, r=1., elong=0., Dshape=0., divlow=True, divup=True, nP=200): """ Utility to compute three 2D (R,Z) polygons One represents a vacuum vessel, one an outer bumper, one a baffle The vessel polygon is centered on (R,0.), with minor radius r It can have a vert...
Utility to compute three 2D (R,Z) polygons One represents a vacuum vessel, one an outer bumper, one a baffle The vessel polygon is centered on (R,0.), with minor radius r It can have a vertical (>0) or horizontal(<0) elongation in [-1;1] It can be D-shaped (Dshape in [0.,1.], typically 0.2) It can...
Below is the the instruction that describes the task: ### Input: Utility to compute three 2D (R,Z) polygons One represents a vacuum vessel, one an outer bumper, one a baffle The vessel polygon is centered on (R,0.), with minor radius r It can have a vertical (>0) or horizontal(<0) elongation in [-1;1]...
def to_bool(self, value): """ Converts a sheet string value to a boolean value. Needed because of utf-8 conversions """ try: value = value.lower() except: pass try: value = value.encode('utf-8') except: pass ...
Converts a sheet string value to a boolean value. Needed because of utf-8 conversions
Below is the the instruction that describes the task: ### Input: Converts a sheet string value to a boolean value. Needed because of utf-8 conversions ### Response: def to_bool(self, value): """ Converts a sheet string value to a boolean value. Needed because of utf-8 conversions ...
def xprint(m, *args): """Print string to stdout. Format unicode safely. """ if sys.hexversion < 0x3000000: m = m.decode('utf8') if args: m = m % args if sys.hexversion < 0x3000000: m = m.encode('utf8') sys.stdout.write(m) sys.stdout.write('\n')
Print string to stdout. Format unicode safely.
Below is the the instruction that describes the task: ### Input: Print string to stdout. Format unicode safely. ### Response: def xprint(m, *args): """Print string to stdout. Format unicode safely. """ if sys.hexversion < 0x3000000: m = m.decode('utf8') if args: m = m % ar...
def start_search(self, max_page=1): """method to start send query to google. Search start from page 1. max_page determine how many result expected hint: 10 result per page for google """ for page in range(1, (max_page + 1)): start = "start={0}".format(str((page - 1) ...
method to start send query to google. Search start from page 1. max_page determine how many result expected hint: 10 result per page for google
Below is the the instruction that describes the task: ### Input: method to start send query to google. Search start from page 1. max_page determine how many result expected hint: 10 result per page for google ### Response: def start_search(self, max_page=1): """method to start send query t...
def from_url(location): """ HTTP request for page at location returned as string malformed url returns ValueError nonexistant IP returns URLError wrong subnet IP return URLError reachable IP, no HTTP server returns URLError reachable IP, HTTP, wrong page returns HTTPError """ req = urll...
HTTP request for page at location returned as string malformed url returns ValueError nonexistant IP returns URLError wrong subnet IP return URLError reachable IP, no HTTP server returns URLError reachable IP, HTTP, wrong page returns HTTPError
Below is the the instruction that describes the task: ### Input: HTTP request for page at location returned as string malformed url returns ValueError nonexistant IP returns URLError wrong subnet IP return URLError reachable IP, no HTTP server returns URLError reachable IP, HTTP, wrong page ret...
def _mutation(candidate, rate=0.1): """Perform mutation action to candidates. For example, randomly change 10% of original sample Args: candidate: List of candidate genes (encodings). rate: Percentage of mutation bits Examples: >>> # Genes that repr...
Perform mutation action to candidates. For example, randomly change 10% of original sample Args: candidate: List of candidate genes (encodings). rate: Percentage of mutation bits Examples: >>> # Genes that represent 3 parameters >>> gene1 = np.a...
Below is the the instruction that describes the task: ### Input: Perform mutation action to candidates. For example, randomly change 10% of original sample Args: candidate: List of candidate genes (encodings). rate: Percentage of mutation bits Examples: ...
def parseDate(self, dateString, sourceTime=None): """ Parse short-form date strings:: '05/28/2006' or '04.21' @type dateString: string @param dateString: text to convert to a C{datetime} @type sourceTime: struct_time @param sourceTime: C{struct_tim...
Parse short-form date strings:: '05/28/2006' or '04.21' @type dateString: string @param dateString: text to convert to a C{datetime} @type sourceTime: struct_time @param sourceTime: C{struct_time} value to use as the base @rtype: struct_time @ret...
Below is the the instruction that describes the task: ### Input: Parse short-form date strings:: '05/28/2006' or '04.21' @type dateString: string @param dateString: text to convert to a C{datetime} @type sourceTime: struct_time @param sourceTime: C{struct_time...
def decode(cls, data, bytes_to_read=None): """Compressed messages should pass in bytes_to_read (via message size) otherwise, we decode from data as Int32 """ if isinstance(data, bytes): data = io.BytesIO(data) if bytes_to_read is None: bytes_to_read = Int3...
Compressed messages should pass in bytes_to_read (via message size) otherwise, we decode from data as Int32
Below is the the instruction that describes the task: ### Input: Compressed messages should pass in bytes_to_read (via message size) otherwise, we decode from data as Int32 ### Response: def decode(cls, data, bytes_to_read=None): """Compressed messages should pass in bytes_to_read (via message size...
def translate_to_american_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ''' translations = self.stress.mark_ipa() if (not hide_stress_mark) and self.have_vowel else "" for phoneme in self._phonem...
转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return:
Below is the the instruction that describes the task: ### Input: 转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: :return: ### Response: def translate_to_american_phonetic_alphabet(self, hide_stress_mark=False): ''' 转换成美音音。只要一个元音的时候需要隐藏重音标识 :param hide_stress_mark: ...
def updateTransactionParty(sender,instance,**kwargs): ''' If a User, StaffMember, or Location is updated, and there exists an associated TransactionParty, then the name and other attributes of that party should be updated to reflect the new information. ''' if 'loaddata' in sys.argv or (...
If a User, StaffMember, or Location is updated, and there exists an associated TransactionParty, then the name and other attributes of that party should be updated to reflect the new information.
Below is the the instruction that describes the task: ### Input: If a User, StaffMember, or Location is updated, and there exists an associated TransactionParty, then the name and other attributes of that party should be updated to reflect the new information. ### Response: def updateTransactionParty(sen...
def from_otgdict(self, message): """[summary] balance = static_balance + float_profit "currency": "", # "CNY" (币种) "pre_balance": float("nan"), # 9912934.78 (昨日账户权益) "static_balance": float("nan"), # (静态权益) "balance": float("nan"), # 9963216.55 (账户权益...
[summary] balance = static_balance + float_profit "currency": "", # "CNY" (币种) "pre_balance": float("nan"), # 9912934.78 (昨日账户权益) "static_balance": float("nan"), # (静态权益) "balance": float("nan"), # 9963216.55 (账户权益) "available": float("nan"), # ...
Below is the the instruction that describes the task: ### Input: [summary] balance = static_balance + float_profit "currency": "", # "CNY" (币种) "pre_balance": float("nan"), # 9912934.78 (昨日账户权益) "static_balance": float("nan"), # (静态权益) "balance": float("n...
def execute(self, stmt, **params): """Execute a SQL statement. The statement may be a string SQL string, an :func:`sqlalchemy.sql.expression.select` construct, or a :func:`sqlalchemy.sql.expression.text` construct. """ return self.session.execute(sql.text(stmt...
Execute a SQL statement. The statement may be a string SQL string, an :func:`sqlalchemy.sql.expression.select` construct, or a :func:`sqlalchemy.sql.expression.text` construct.
Below is the the instruction that describes the task: ### Input: Execute a SQL statement. The statement may be a string SQL string, an :func:`sqlalchemy.sql.expression.select` construct, or a :func:`sqlalchemy.sql.expression.text` construct. ### Response: def execute(self, stmt, ...
def _init_metadata(self): """Initialize OsidObjectForm metadata.""" # pylint: disable=attribute-defined-outside-init # this method is called from descendent __init__ self._mdata.update(default_mdata.get_osid_form_mdata()) update_display_text_defaults(self._mdata['journal_comment...
Initialize OsidObjectForm metadata.
Below is the the instruction that describes the task: ### Input: Initialize OsidObjectForm metadata. ### Response: def _init_metadata(self): """Initialize OsidObjectForm metadata.""" # pylint: disable=attribute-defined-outside-init # this method is called from descendent __init__ s...
def run(self): """Generate and view the documentation.""" cmds = (self.clean_docs_cmd, self.html_docs_cmd, self.view_docs_cmd) self.call_in_sequence(cmds)
Generate and view the documentation.
Below is the the instruction that describes the task: ### Input: Generate and view the documentation. ### Response: def run(self): """Generate and view the documentation.""" cmds = (self.clean_docs_cmd, self.html_docs_cmd, self.view_docs_cmd) self.call_in_sequence(cmds)
def force_sync(self): """ Forces to sync the SyncTableJob :return: :raise: CartoException """ try: self.send(self.get_resource_endpoint(), "put") except Exception as e: raise CartoException(e)
Forces to sync the SyncTableJob :return: :raise: CartoException
Below is the the instruction that describes the task: ### Input: Forces to sync the SyncTableJob :return: :raise: CartoException ### Response: def force_sync(self): """ Forces to sync the SyncTableJob :return: :raise: CartoException """ try: ...
def get_facts(self, date, end_date=None, search_terms="", ongoing_days=0): """Returns facts for the time span matching the optional filter criteria. In search terms comma (",") translates to boolean OR and space (" ") to boolean AND. Filter is applied to tags, categories, activi...
Returns facts for the time span matching the optional filter criteria. In search terms comma (",") translates to boolean OR and space (" ") to boolean AND. Filter is applied to tags, categories, activity names and description ongoing_days (int): look into the last `ongoing_da...
Below is the the instruction that describes the task: ### Input: Returns facts for the time span matching the optional filter criteria. In search terms comma (",") translates to boolean OR and space (" ") to boolean AND. Filter is applied to tags, categories, activity names and desc...
def serialize(self, serialize_cell=None): """Returns a list of all rows, with serialize_cell or self.get_cell_value called on the cells of each. """ if serialize_cell is None: serialize_cell = self.get_cell_value return [[serialize_cell(cell) for cell in row] for row in self.rows]
Returns a list of all rows, with serialize_cell or self.get_cell_value called on the cells of each.
Below is the the instruction that describes the task: ### Input: Returns a list of all rows, with serialize_cell or self.get_cell_value called on the cells of each. ### Response: def serialize(self, serialize_cell=None): """Returns a list of all rows, with serialize_cell or self.get_cell_value called on th...
def within(self, version): """ A single version can also be interpreted as an open range (i.e. no maximum version) """ if not isinstance(version, Version): version = type(self._min_ver)(self._req, version) return version >= self
A single version can also be interpreted as an open range (i.e. no maximum version)
Below is the the instruction that describes the task: ### Input: A single version can also be interpreted as an open range (i.e. no maximum version) ### Response: def within(self, version): """ A single version can also be interpreted as an open range (i.e. no maximum version) ...
def main(ctx, debug, base_config, env_file): # pragma: no cover """ \b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: ...
\b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: eval "$(_MOLECULE_COMPLETE=source molecule)"
Below is the the instruction that describes the task: ### Input: \b _____ _ _ | |___| |___ ___ _ _| |___ | | | | . | | -_| _| | | | -_| |_|_|_|___|_|___|___|___|_|___| Molecule aids in the development and testing of Ansible roles. Enable autocomplete issue: eva...
def register_mapper(self, mapper, content_type, shortname=None): """ Register new mapper. :param mapper: mapper object needs to implement ``parse()`` and ``format()`` functions. """ self._check_mapper(mapper) cont_type_names = self._get_content_type_names(content_type, ...
Register new mapper. :param mapper: mapper object needs to implement ``parse()`` and ``format()`` functions.
Below is the the instruction that describes the task: ### Input: Register new mapper. :param mapper: mapper object needs to implement ``parse()`` and ``format()`` functions. ### Response: def register_mapper(self, mapper, content_type, shortname=None): """ Register new mapper. :pa...
def identify_ibids(line): """Find IBIDs within the line, record their position and length, and replace them with underscores. @param line: (string) the working reference line @return: (tuple) containing 2 dictionaries and a string: Dictionary: matched IBID text: (Key: position of IBI...
Find IBIDs within the line, record their position and length, and replace them with underscores. @param line: (string) the working reference line @return: (tuple) containing 2 dictionaries and a string: Dictionary: matched IBID text: (Key: position of IBID in line;...
Below is the the instruction that describes the task: ### Input: Find IBIDs within the line, record their position and length, and replace them with underscores. @param line: (string) the working reference line @return: (tuple) containing 2 dictionaries and a string: Dictionary: matc...
def load_all(self, key, default=None): ''' Import settings key as a dict or list with values of importable paths If a default constructor is specified, and a path is not importable, it falls back to running the given constructor. ''' value = getattr(self, key) if ...
Import settings key as a dict or list with values of importable paths If a default constructor is specified, and a path is not importable, it falls back to running the given constructor.
Below is the the instruction that describes the task: ### Input: Import settings key as a dict or list with values of importable paths If a default constructor is specified, and a path is not importable, it falls back to running the given constructor. ### Response: def load_all(self, key, default=N...
def _allowed_to_proceed(self, verbose): """Display which files would be deleted and prompt for confirmation """ def _display(msg, paths): if not paths: return logger.info(msg) with indent_log(): for path in sorted(compact(path...
Display which files would be deleted and prompt for confirmation
Below is the the instruction that describes the task: ### Input: Display which files would be deleted and prompt for confirmation ### Response: def _allowed_to_proceed(self, verbose): """Display which files would be deleted and prompt for confirmation """ def _display(msg, paths): ...
def metadata2properties(self, field): """Return a dictionary of properties extracted from field Metadata Will include field metadata that are valid properties of `OpenAPI schema objects <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject>`_ (...
Return a dictionary of properties extracted from field Metadata Will include field metadata that are valid properties of `OpenAPI schema objects <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schemaObject>`_ (e.g. “description”, “enum”, “example”). ...
Below is the the instruction that describes the task: ### Input: Return a dictionary of properties extracted from field Metadata Will include field metadata that are valid properties of `OpenAPI schema objects <https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#schem...
def _seq(self, locus, term, rank, accession): """ creates GFE from HLA sequence and locus :param locus: string containing HLA locus. :param sequence: string containing sequence data. :return: GFEobject. """ try: feature = self.api.get_feature_by_path...
creates GFE from HLA sequence and locus :param locus: string containing HLA locus. :param sequence: string containing sequence data. :return: GFEobject.
Below is the the instruction that describes the task: ### Input: creates GFE from HLA sequence and locus :param locus: string containing HLA locus. :param sequence: string containing sequence data. :return: GFEobject. ### Response: def _seq(self, locus, term, rank, accession): """...
def view_announcement_view(request, id): """View an announcement. id: announcement id """ announcement = get_object_or_404(Announcement, id=id) return render(request, "announcements/view.html", {"announcement": announcement})
View an announcement. id: announcement id
Below is the the instruction that describes the task: ### Input: View an announcement. id: announcement id ### Response: def view_announcement_view(request, id): """View an announcement. id: announcement id """ announcement = get_object_or_404(Announcement, id=id) return render(request,...
def rmdir(path): """Safe rmdir (non-recursive) which doesn't throw if the directory is not empty.""" try: os.rmdir(path) except OSError as exc: print(str(exc))
Safe rmdir (non-recursive) which doesn't throw if the directory is not empty.
Below is the the instruction that describes the task: ### Input: Safe rmdir (non-recursive) which doesn't throw if the directory is not empty. ### Response: def rmdir(path): """Safe rmdir (non-recursive) which doesn't throw if the directory is not empty.""" try: os.rmdir(path) except OSError as...
def summary(self, prn=None, lfilter=None): """prints a summary of each SndRcv packet pair prn: function to apply to each packet pair instead of lambda s, r: "%s ==> %s" % (s.summary(),r.summary()) lfilter: truth function to apply to each packet pair to decide whether it will be displayed""" for s, r...
prints a summary of each SndRcv packet pair prn: function to apply to each packet pair instead of lambda s, r: "%s ==> %s" % (s.summary(),r.summary()) lfilter: truth function to apply to each packet pair to decide whether it will be displayed
Below is the the instruction that describes the task: ### Input: prints a summary of each SndRcv packet pair prn: function to apply to each packet pair instead of lambda s, r: "%s ==> %s" % (s.summary(),r.summary()) lfilter: truth function to apply to each packet pair to decide whether it will be displayed ### ...
def changed_files(self) -> typing.List[str]: """ :return: changed files :rtype: list of str """ changed_files: typing.List[str] = [x.a_path for x in self.repo.index.diff(None)] LOGGER.debug('changed files: %s', changed_files) return changed_files
:return: changed files :rtype: list of str
Below is the the instruction that describes the task: ### Input: :return: changed files :rtype: list of str ### Response: def changed_files(self) -> typing.List[str]: """ :return: changed files :rtype: list of str """ changed_files: typing.List[str] = [x.a_path for x...
def fillna(df, column: str, value=None, column_value=None): """ Can fill NaN values from a column with a given value or a column --- ### Parameters - `column` (*str*): name of column you want to fill - `value`: NaN will be replaced by this value - `column_value`: NaN will be replaced by ...
Can fill NaN values from a column with a given value or a column --- ### Parameters - `column` (*str*): name of column you want to fill - `value`: NaN will be replaced by this value - `column_value`: NaN will be replaced by value from this column *NOTE*: You must set either the 'value' param...
Below is the the instruction that describes the task: ### Input: Can fill NaN values from a column with a given value or a column --- ### Parameters - `column` (*str*): name of column you want to fill - `value`: NaN will be replaced by this value - `column_value`: NaN will be replaced by valu...
def ip_fqdn(): ''' Return ip address and FQDN grains ''' if salt.utils.platform.is_proxy(): return {} ret = {} ret['ipv4'] = salt.utils.network.ip_addrs(include_loopback=True) ret['ipv6'] = salt.utils.network.ip_addrs6(include_loopback=True) _fqdn = hostname()['fqdn'] for s...
Return ip address and FQDN grains
Below is the the instruction that describes the task: ### Input: Return ip address and FQDN grains ### Response: def ip_fqdn(): ''' Return ip address and FQDN grains ''' if salt.utils.platform.is_proxy(): return {} ret = {} ret['ipv4'] = salt.utils.network.ip_addrs(include_loopback...
def get_static_lib_paths(): """ Return the required static libraries path """ libs = [] is_linux = sys.platform.startswith('linux') if is_linux: libs += ['-Wl,--start-group'] libs += get_raw_static_lib_path() if is_linux: libs += ['-Wl,--end-group'] return libs
Return the required static libraries path
Below is the the instruction that describes the task: ### Input: Return the required static libraries path ### Response: def get_static_lib_paths(): """ Return the required static libraries path """ libs = [] is_linux = sys.platform.startswith('linux') if is_linux: libs += ['-Wl,--start...
def peek(self, size: int) -> memoryview: """ Get a view over at most ``size`` bytes (possibly fewer) at the current buffer position. """ assert size > 0 try: is_memview, b = self._buffers[0] except IndexError: return memoryview(b"") ...
Get a view over at most ``size`` bytes (possibly fewer) at the current buffer position.
Below is the the instruction that describes the task: ### Input: Get a view over at most ``size`` bytes (possibly fewer) at the current buffer position. ### Response: def peek(self, size: int) -> memoryview: """ Get a view over at most ``size`` bytes (possibly fewer) at the current ...
def FromStream(cls, stream, mime_type, total_size=None, auto_transfer=True, gzip_encoded=False, **kwds): """Create a new Upload object from a stream.""" if mime_type is None: raise exceptions.InvalidUserInputError( 'No mime_type specified for stream') ...
Create a new Upload object from a stream.
Below is the the instruction that describes the task: ### Input: Create a new Upload object from a stream. ### Response: def FromStream(cls, stream, mime_type, total_size=None, auto_transfer=True, gzip_encoded=False, **kwds): """Create a new Upload object from a stream.""" if mim...
def rq_job(self): """The last RQ Job this ran on""" if not self.rq_id or not self.rq_origin: return try: return RQJob.fetch(self.rq_id, connection=get_connection(self.rq_origin)) except NoSuchJobError: return
The last RQ Job this ran on
Below is the the instruction that describes the task: ### Input: The last RQ Job this ran on ### Response: def rq_job(self): """The last RQ Job this ran on""" if not self.rq_id or not self.rq_origin: return try: return RQJob.fetch(self.rq_id, connection=get_connectio...
def putstats(pfile, handle, statdicts): """ puts stats from pickles into a dictionary """ ## load in stats with open(pfile, 'r') as infile: filestats, samplestats = pickle.load(infile) ## get dicts from statdicts tuple perfile, fsamplehits, fbarhits, fmisses, fdbars = statdicts ## pul...
puts stats from pickles into a dictionary
Below is the the instruction that describes the task: ### Input: puts stats from pickles into a dictionary ### Response: def putstats(pfile, handle, statdicts): """ puts stats from pickles into a dictionary """ ## load in stats with open(pfile, 'r') as infile: filestats, samplestats = pickle.l...
def verify_token(self, token, requested_access): """ Check the token bearer is permitted to access the resource :param token: Access token :param requested_access: the access level the client has requested :returns: boolean """ client = API(options.url_auth, ...
Check the token bearer is permitted to access the resource :param token: Access token :param requested_access: the access level the client has requested :returns: boolean
Below is the the instruction that describes the task: ### Input: Check the token bearer is permitted to access the resource :param token: Access token :param requested_access: the access level the client has requested :returns: boolean ### Response: def verify_token(self, token, requested_...
def branches(self): """Return list of (name and urls) only branches.""" return [(r['name'], self.vpathto(r['name'])) for r in self.remotes if r['kind'] == 'heads']
Return list of (name and urls) only branches.
Below is the the instruction that describes the task: ### Input: Return list of (name and urls) only branches. ### Response: def branches(self): """Return list of (name and urls) only branches.""" return [(r['name'], self.vpathto(r['name'])) for r in self.remotes if r['kind'] == 'heads']
def check_config_file(msg): """ Checks the config.json file for default settings and auth values. Args: :msg: (Message class) an instance of a message class. """ with jsonconfig.Config("messages", indent=4) as cfg: verify_profile_name(msg, cfg) retrieve_data_from_config(msg...
Checks the config.json file for default settings and auth values. Args: :msg: (Message class) an instance of a message class.
Below is the the instruction that describes the task: ### Input: Checks the config.json file for default settings and auth values. Args: :msg: (Message class) an instance of a message class. ### Response: def check_config_file(msg): """ Checks the config.json file for default settings and auth...
def destroy(self, request, *args, **kwargs): """ Deletion of a project is done through sending a **DELETE** request to the project instance URI. Please note, that if a project has connected instances, deletion request will fail with 409 response code. Valid request example (token is use...
Deletion of a project is done through sending a **DELETE** request to the project instance URI. Please note, that if a project has connected instances, deletion request will fail with 409 response code. Valid request example (token is user specific): .. code-block:: http DELETE /a...
Below is the the instruction that describes the task: ### Input: Deletion of a project is done through sending a **DELETE** request to the project instance URI. Please note, that if a project has connected instances, deletion request will fail with 409 response code. Valid request example (token is...
def weighted_choice(population): """Randomly select, fitness determines probability of being selected""" random_number = random.betavariate(1, 2.5) #increased probability of selecting members early in the list #random_number = random.random() ind = int(random_number*len(population)) ind = min(max(in...
Randomly select, fitness determines probability of being selected
Below is the the instruction that describes the task: ### Input: Randomly select, fitness determines probability of being selected ### Response: def weighted_choice(population): """Randomly select, fitness determines probability of being selected""" random_number = random.betavariate(1, 2.5) #increased pro...