code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def _add(self, ctx, table_name, record_id, column_values): """ :type column_values: list of (column, value_json) """ vsctl_table = self._get_table(table_name) ovsrec_row = ctx.must_get_row(vsctl_table, record_id) for column, value in column_values: ctx.add_col...
:type column_values: list of (column, value_json)
Below is the the instruction that describes the task: ### Input: :type column_values: list of (column, value_json) ### Response: def _add(self, ctx, table_name, record_id, column_values): """ :type column_values: list of (column, value_json) """ vsctl_table = self._get_table(table_n...
async def search_participant(self, name, force_update=False): """ search a participant by (display) name |methcoro| Args: name: display name of the participant force_update (dfault=False): True to force an update to the Challonge API Returns: Partic...
search a participant by (display) name |methcoro| Args: name: display name of the participant force_update (dfault=False): True to force an update to the Challonge API Returns: Participant: None if not found Raises: APIException
Below is the the instruction that describes the task: ### Input: search a participant by (display) name |methcoro| Args: name: display name of the participant force_update (dfault=False): True to force an update to the Challonge API Returns: Participant...
def to_bytes(obj, encoding='utf-8', errors=None, nonstring='simplerepr'): """Make sure that a string is a byte string :arg obj: An object to make sure is a byte string. In most cases this will be either a text string or a byte string. However, with ``nonstring='simplerepr'``, this can be used...
Make sure that a string is a byte string :arg obj: An object to make sure is a byte string. In most cases this will be either a text string or a byte string. However, with ``nonstring='simplerepr'``, this can be used as a traceback-free version of ``str(obj)``. :kwarg encoding: The en...
Below is the the instruction that describes the task: ### Input: Make sure that a string is a byte string :arg obj: An object to make sure is a byte string. In most cases this will be either a text string or a byte string. However, with ``nonstring='simplerepr'``, this can be used as a traceb...
def _parse_contract_headers(self, table): """ Parse the years on the contract. The years are listed as the headers on the contract. The first header contains 'Team' which specifies the player's current team and should not be included in the years. Parameters ---...
Parse the years on the contract. The years are listed as the headers on the contract. The first header contains 'Team' which specifies the player's current team and should not be included in the years. Parameters ---------- table : PyQuery object A PyQuery o...
Below is the the instruction that describes the task: ### Input: Parse the years on the contract. The years are listed as the headers on the contract. The first header contains 'Team' which specifies the player's current team and should not be included in the years. Parameters ...
def table_delete(self, table_name): """Issues a request to delete a table. Args: table_name: the name of the table as a tuple of components. Returns: A parsed result object. Raises: Exception if there is an error performing the operation. """ url = Api._ENDPOINT + (Api._TABLES...
Issues a request to delete a table. Args: table_name: the name of the table as a tuple of components. Returns: A parsed result object. Raises: Exception if there is an error performing the operation.
Below is the the instruction that describes the task: ### Input: Issues a request to delete a table. Args: table_name: the name of the table as a tuple of components. Returns: A parsed result object. Raises: Exception if there is an error performing the operation. ### Response: def t...
def enabled(self): """ Check whether we're enabled (or if parent is). """ # Cache into ._enabled if self._enabled is None: if self.parent is not None and self.parent.enabled(): self._enabled = True else: # Default to Enabled if not otherwis...
Check whether we're enabled (or if parent is).
Below is the the instruction that describes the task: ### Input: Check whether we're enabled (or if parent is). ### Response: def enabled(self): """ Check whether we're enabled (or if parent is). """ # Cache into ._enabled if self._enabled is None: if self.parent is not None and...
def add(path=None, force=False, quiet=False): """Add that path to git's staging area (default current dir) so that it will be included in next commit """ option = '-f' if force else '' return run('add %s %s' % (option, path) or '.', quiet=quiet)
Add that path to git's staging area (default current dir) so that it will be included in next commit
Below is the the instruction that describes the task: ### Input: Add that path to git's staging area (default current dir) so that it will be included in next commit ### Response: def add(path=None, force=False, quiet=False): """Add that path to git's staging area (default current dir) so that it wil...
def write_worksheets(workbook, data_list, result_info_key, identifier_keys): """Writes rest of the worksheets to workbook. Args: workbook: workbook to write into data_list: Analytics API data as a list of dicts result_info_key: the key in api_data dicts that contains the data results ...
Writes rest of the worksheets to workbook. Args: workbook: workbook to write into data_list: Analytics API data as a list of dicts result_info_key: the key in api_data dicts that contains the data results identifier_keys: the list of keys used as requested identifiers ...
Below is the the instruction that describes the task: ### Input: Writes rest of the worksheets to workbook. Args: workbook: workbook to write into data_list: Analytics API data as a list of dicts result_info_key: the key in api_data dicts that contains the data results identifie...
def do_statement(source, start): """returns none if not found other functions that begin with 'do_' raise also this do_ type function passes white space""" start = pass_white(source, start) # start is the fist position after initial start that is not a white space or \n if not start < len(source): ...
returns none if not found other functions that begin with 'do_' raise also this do_ type function passes white space
Below is the the instruction that describes the task: ### Input: returns none if not found other functions that begin with 'do_' raise also this do_ type function passes white space ### Response: def do_statement(source, start): """returns none if not found other functions that begin with 'do_' raise a...
def _connectIfNecessarySingle(self, node): """ Connect to a node if necessary. :param node: node to connect to :type node: Node """ if node in self._connections and self._connections[node].state != CONNECTION_STATE.DISCONNECTED: return True if not se...
Connect to a node if necessary. :param node: node to connect to :type node: Node
Below is the the instruction that describes the task: ### Input: Connect to a node if necessary. :param node: node to connect to :type node: Node ### Response: def _connectIfNecessarySingle(self, node): """ Connect to a node if necessary. :param node: node to connect to ...
def send(self, obj_id): """ Send email to the assigned lists :param obj_id: int :return: dict|str """ response = self._client.session.post( '{url}/{id}/send'.format( url=self.endpoint_url, id=obj_id ) ) return self....
Send email to the assigned lists :param obj_id: int :return: dict|str
Below is the the instruction that describes the task: ### Input: Send email to the assigned lists :param obj_id: int :return: dict|str ### Response: def send(self, obj_id): """ Send email to the assigned lists :param obj_id: int :return: dict|str """ ...
def seek(self, position, modifier=0): """move the cursor on the file descriptor to a different location :param position: an integer offset from the location indicated by the modifier :type position: int :param modifier: an indicator of how to find the seek locati...
move the cursor on the file descriptor to a different location :param position: an integer offset from the location indicated by the modifier :type position: int :param modifier: an indicator of how to find the seek location. - ``os.SEEK_SET`` means start fr...
Below is the the instruction that describes the task: ### Input: move the cursor on the file descriptor to a different location :param position: an integer offset from the location indicated by the modifier :type position: int :param modifier: an indicator of how to ...
def superseeded_by(self, other_service): """Return True if input service has login id and this has not.""" if not other_service or \ other_service.__class__ != self.__class__ or \ other_service.protocol != self.protocol or \ other_service.port != self.port...
Return True if input service has login id and this has not.
Below is the the instruction that describes the task: ### Input: Return True if input service has login id and this has not. ### Response: def superseeded_by(self, other_service): """Return True if input service has login id and this has not.""" if not other_service or \ other_servi...
def lines_of_content(content, width): """ 计算内容在特定输出宽度下实际显示的行数 calculate the actual rows with specific terminal width """ result = 0 if isinstance(content, list): for line in content: _line = preprocess(line) result += ceil(line_width(_line) / width) elif isins...
计算内容在特定输出宽度下实际显示的行数 calculate the actual rows with specific terminal width
Below is the the instruction that describes the task: ### Input: 计算内容在特定输出宽度下实际显示的行数 calculate the actual rows with specific terminal width ### Response: def lines_of_content(content, width): """ 计算内容在特定输出宽度下实际显示的行数 calculate the actual rows with specific terminal width """ result = 0 i...
def enable_yum_priority_obsoletes(path="/etc/yum/pluginconf.d/priorities.conf"): """Configure Yum priorities to include obsoletes""" config = configparser.ConfigParser() config.read(path) config.set('main', 'check_obsoletes', '1') with open(path, 'w') as fout: config.write(fout)
Configure Yum priorities to include obsoletes
Below is the the instruction that describes the task: ### Input: Configure Yum priorities to include obsoletes ### Response: def enable_yum_priority_obsoletes(path="/etc/yum/pluginconf.d/priorities.conf"): """Configure Yum priorities to include obsoletes""" config = configparser.ConfigParser() config.r...
def on_change(self, attr, old, new): """ Process change events adding timeout to process multiple concerted value change at once rather than firing off multiple plot updates. """ self._queue.append((attr, old, new)) if not self._active and self.plot.document: ...
Process change events adding timeout to process multiple concerted value change at once rather than firing off multiple plot updates.
Below is the the instruction that describes the task: ### Input: Process change events adding timeout to process multiple concerted value change at once rather than firing off multiple plot updates. ### Response: def on_change(self, attr, old, new): """ Process change events adding timeout ...
def create_pre_execute(task_params, parameter_map): """ Builds the code block for the GPTool Execute method before the job is submitted based on the input task_params. :param task_params: A list of task parameters from the task info structure. :return: A string representing the code block to the GP...
Builds the code block for the GPTool Execute method before the job is submitted based on the input task_params. :param task_params: A list of task parameters from the task info structure. :return: A string representing the code block to the GPTool Execute method.
Below is the the instruction that describes the task: ### Input: Builds the code block for the GPTool Execute method before the job is submitted based on the input task_params. :param task_params: A list of task parameters from the task info structure. :return: A string representing the code block to t...
def ExportModelOperationsMixin(model_name): """Returns a mixin for models to export counters for lifecycle operations. Usage: class User(ExportModelOperationsMixin('user'), Model): ... """ # Force create the labels for this model in the counters. This # is not necessary but it avoid...
Returns a mixin for models to export counters for lifecycle operations. Usage: class User(ExportModelOperationsMixin('user'), Model): ...
Below is the the instruction that describes the task: ### Input: Returns a mixin for models to export counters for lifecycle operations. Usage: class User(ExportModelOperationsMixin('user'), Model): ... ### Response: def ExportModelOperationsMixin(model_name): """Returns a mixin for models...
def lastz_to_blast(row): """ Convert the lastz tabular to the blast tabular, see headers above Obsolete after LASTZ version 1.02.40 """ atoms = row.strip().split("\t") name1, name2, coverage, identity, nmismatch, ngap, \ start1, end1, strand1, start2, end2, strand2, score = atoms ...
Convert the lastz tabular to the blast tabular, see headers above Obsolete after LASTZ version 1.02.40
Below is the the instruction that describes the task: ### Input: Convert the lastz tabular to the blast tabular, see headers above Obsolete after LASTZ version 1.02.40 ### Response: def lastz_to_blast(row): """ Convert the lastz tabular to the blast tabular, see headers above Obsolete after LASTZ v...
def shadows(self, data=None, t=None, dt=None, latitude=None, init='empty', resolution='mid'): ''' Initializes a ShadowManager object for this ``pyny.Space`` instance. The 'empty' initialization accepts ``data`` and ``t`` and ``dt`` but the Shadows...
Initializes a ShadowManager object for this ``pyny.Space`` instance. The 'empty' initialization accepts ``data`` and ``t`` and ``dt`` but the ShadowsManager will not start the calculations. It will wait the user to manually insert the rest of the parameters. Call ...
Below is the the instruction that describes the task: ### Input: Initializes a ShadowManager object for this ``pyny.Space`` instance. The 'empty' initialization accepts ``data`` and ``t`` and ``dt`` but the ShadowsManager will not start the calculations. It will wait t...
def search_requests(self, query=None, params=None, callback=None, mine_ids=None): """Mine Archive.org search results. :param query: The Archive.org search query to yield results for. Refer to https://archive.org/advancedsearch.php#raw for help formatting your...
Mine Archive.org search results. :param query: The Archive.org search query to yield results for. Refer to https://archive.org/advancedsearch.php#raw for help formatting your query. :type query: str :param params: The URL parameters to send with each...
Below is the the instruction that describes the task: ### Input: Mine Archive.org search results. :param query: The Archive.org search query to yield results for. Refer to https://archive.org/advancedsearch.php#raw for help formatting your query. :type qu...
def convert_to_gt( text, layer_name=GT_WORDS ): ''' Converts all words in a morphologically analysed Text from FS format to giellatekno (GT) format, and stores in a new layer named GT_WORDS. If the keyword argument *layer_name=='words'* , overwrites the old 'words' layer with the new laye...
Converts all words in a morphologically analysed Text from FS format to giellatekno (GT) format, and stores in a new layer named GT_WORDS. If the keyword argument *layer_name=='words'* , overwrites the old 'words' layer with the new layer containing GT format annotations. Parameters...
Below is the the instruction that describes the task: ### Input: Converts all words in a morphologically analysed Text from FS format to giellatekno (GT) format, and stores in a new layer named GT_WORDS. If the keyword argument *layer_name=='words'* , overwrites the old 'words' layer with...
def nmf_init(data, clusters, k, init='enhanced'): """ Generates initial M and W given a data set and an array of cluster labels. There are 3 options for init: enhanced - uses EIn-NMF from Gong 2013 basic - uses means for M, assigns W such that the chosen cluster for a given cell has value 0...
Generates initial M and W given a data set and an array of cluster labels. There are 3 options for init: enhanced - uses EIn-NMF from Gong 2013 basic - uses means for M, assigns W such that the chosen cluster for a given cell has value 0.75 and all others have 0.25/(k-1). nmf - uses means f...
Below is the the instruction that describes the task: ### Input: Generates initial M and W given a data set and an array of cluster labels. There are 3 options for init: enhanced - uses EIn-NMF from Gong 2013 basic - uses means for M, assigns W such that the chosen cluster for a given cell has ...
def parse_sidebar(self, manga_page): """Parses the DOM and returns manga attributes in the sidebar. :type manga_page: :class:`bs4.BeautifulSoup` :param manga_page: MAL manga page's DOM :rtype: dict :return: manga attributes :raises: :class:`.InvalidMangaError`, :class:`.MalformedMangaPageErro...
Parses the DOM and returns manga attributes in the sidebar. :type manga_page: :class:`bs4.BeautifulSoup` :param manga_page: MAL manga page's DOM :rtype: dict :return: manga attributes :raises: :class:`.InvalidMangaError`, :class:`.MalformedMangaPageError`
Below is the the instruction that describes the task: ### Input: Parses the DOM and returns manga attributes in the sidebar. :type manga_page: :class:`bs4.BeautifulSoup` :param manga_page: MAL manga page's DOM :rtype: dict :return: manga attributes :raises: :class:`.InvalidMangaError`, :class...
def extent_to_array(extent, source_crs, dest_crs=None): """Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. :type source_crs: QgsCo...
Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. :type source_crs: QgsCoordinateReferenceSystem :param dest_crs: Coordinate system...
Below is the the instruction that describes the task: ### Input: Convert the supplied extent to geographic and return as an array. :param extent: Rectangle defining a spatial extent in any CRS. :type extent: QgsRectangle :param source_crs: Coordinate system used for input extent. :type source_crs:...
def __initialize_menu_bar(self): """ Initializes Component menu_bar. """ self.__file_menu = QMenu("&File", parent=self.__menu_bar) self.__file_menu.addAction(self.__engine.actions_manager.register_action( "Actions|Umbra|Components|factory.script_editor|&File|&New", ...
Initializes Component menu_bar.
Below is the the instruction that describes the task: ### Input: Initializes Component menu_bar. ### Response: def __initialize_menu_bar(self): """ Initializes Component menu_bar. """ self.__file_menu = QMenu("&File", parent=self.__menu_bar) self.__file_menu.addAction(self....
def proc_state(self, state_data, state_id): """Processes a state into an `Assembly`. Parameters ---------- state_data : dict Contains information about the state, including all the per line structural data. state_id : str ID given to `Assembly...
Processes a state into an `Assembly`. Parameters ---------- state_data : dict Contains information about the state, including all the per line structural data. state_id : str ID given to `Assembly` that represents the state.
Below is the the instruction that describes the task: ### Input: Processes a state into an `Assembly`. Parameters ---------- state_data : dict Contains information about the state, including all the per line structural data. state_id : str ID give...
def set_element_attributes(elem_to_parse, **attrib_kwargs): """ Adds the specified key/value pairs to the element's attributes, and returns the updated set of attributes. If the element already contains any of the attributes specified in attrib_kwargs, they are updated accordingly. """ ele...
Adds the specified key/value pairs to the element's attributes, and returns the updated set of attributes. If the element already contains any of the attributes specified in attrib_kwargs, they are updated accordingly.
Below is the the instruction that describes the task: ### Input: Adds the specified key/value pairs to the element's attributes, and returns the updated set of attributes. If the element already contains any of the attributes specified in attrib_kwargs, they are updated accordingly. ### Response: def ...
def list_conversations(self, filter=None, filter_mode=None, include=None, include_all_conversation_ids=None, interleave_submissions=None, scope=None): """ List conversations. Returns the list of conversations for the current user, most recent ones first. """ path = {} ...
List conversations. Returns the list of conversations for the current user, most recent ones first.
Below is the the instruction that describes the task: ### Input: List conversations. Returns the list of conversations for the current user, most recent ones first. ### Response: def list_conversations(self, filter=None, filter_mode=None, include=None, include_all_conversation_ids=None, interleave_submi...
def is_ancestor_name( frame: astroid.node_classes.NodeNG, node: astroid.node_classes.NodeNG ) -> bool: """return True if `frame` is an astroid.Class node with `node` in the subtree of its bases attribute """ try: bases = frame.bases except AttributeError: return False for bas...
return True if `frame` is an astroid.Class node with `node` in the subtree of its bases attribute
Below is the the instruction that describes the task: ### Input: return True if `frame` is an astroid.Class node with `node` in the subtree of its bases attribute ### Response: def is_ancestor_name( frame: astroid.node_classes.NodeNG, node: astroid.node_classes.NodeNG ) -> bool: """return True if `fram...
async def prover_create_proof(wallet_handle: int, proof_req_json: str, requested_credentials_json: str, master_secret_name: str, schemas_json: str, credential_defs_json: ...
Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req). A proof request may request multiple credentials from different ...
Below is the the instruction that describes the task: ### Input: Creates a proof according to the given proof request Either a corresponding credential with optionally revealed attributes or self-attested attribute must be provided for each requested attribute (see indy_prover_get_credentials_for_pool_req)....
def messages(path, thread, fmt, nocolor, timezones, utc, noprogress, resolve, directory): """ Conversion of Facebook chat history. """ with colorize_output(nocolor): try: chat_history = _process_history( path=path, thread=thread, timezones=timezones, u...
Conversion of Facebook chat history.
Below is the the instruction that describes the task: ### Input: Conversion of Facebook chat history. ### Response: def messages(path, thread, fmt, nocolor, timezones, utc, noprogress, resolve, directory): """ Conversion of Facebook chat history. """ with colorize_output(nocolor): try: ...
def read_string(buff, byteorder='big'): """Read a string from a file-like object.""" length = read_numeric(USHORT, buff, byteorder) return buff.read(length).decode('utf-8')
Read a string from a file-like object.
Below is the the instruction that describes the task: ### Input: Read a string from a file-like object. ### Response: def read_string(buff, byteorder='big'): """Read a string from a file-like object.""" length = read_numeric(USHORT, buff, byteorder) return buff.read(length).decode('utf-8')
def all_faces_with_verts(self, v_indices, as_boolean=False): ''' returns all of the faces that contain at least one of the vertices in v_indices ''' import numpy as np included_vertices = np.zeros(self.v.shape[0], dtype=bool) included_vertices[np.array(v_indices, dtype=np...
returns all of the faces that contain at least one of the vertices in v_indices
Below is the the instruction that describes the task: ### Input: returns all of the faces that contain at least one of the vertices in v_indices ### Response: def all_faces_with_verts(self, v_indices, as_boolean=False): ''' returns all of the faces that contain at least one of the vertices in v_ind...
def interpolate2dStructuredPointSpreadIDW(grid, mask, kernel=15, power=2, maxIter=1e5, copy=True): ''' same as interpolate2dStructuredIDW but using the point spread method this is faster if there are bigger connected masked areas and the border length is sm...
same as interpolate2dStructuredIDW but using the point spread method this is faster if there are bigger connected masked areas and the border length is smaller replace all values in [grid] indicated by [mask] with the inverse distance weighted interpolation of all values within px+-kernel ...
Below is the the instruction that describes the task: ### Input: same as interpolate2dStructuredIDW but using the point spread method this is faster if there are bigger connected masked areas and the border length is smaller replace all values in [grid] indicated by [mask] with the inverse dis...
def set_renamed_input_fields(self, renamed_input_fields): """This method expects a scalar string or a list of input_fields to """ if not (isinstance(renamed_input_fields, basestring) or isinstance(renamed_input_fields, ListType)): raise ValueError("renamed_input_field...
This method expects a scalar string or a list of input_fields to
Below is the the instruction that describes the task: ### Input: This method expects a scalar string or a list of input_fields to ### Response: def set_renamed_input_fields(self, renamed_input_fields): """This method expects a scalar string or a list of input_fields to """ if not (i...
async def list(source): """Generate a single list from an asynchronous sequence.""" result = [] async with streamcontext(source) as streamer: async for item in streamer: result.append(item) yield result
Generate a single list from an asynchronous sequence.
Below is the the instruction that describes the task: ### Input: Generate a single list from an asynchronous sequence. ### Response: async def list(source): """Generate a single list from an asynchronous sequence.""" result = [] async with streamcontext(source) as streamer: async for item in st...
def modified_data_decorator(function): """ Decorator to initialise the modified_data if necessary. To be used in list functions to modify the list """ @wraps(function) def func(self, *args, **kwargs): """Decorator function""" if not self.get_read_only() or not self.is_locked(): ...
Decorator to initialise the modified_data if necessary. To be used in list functions to modify the list
Below is the the instruction that describes the task: ### Input: Decorator to initialise the modified_data if necessary. To be used in list functions to modify the list ### Response: def modified_data_decorator(function): """ Decorator to initialise the modified_data if necessary. To be used in list fu...
def custom_properties(self, props): """ Sets the custom properties file to use. :param props: the props file :type props: str """ fprops = javabridge.make_instance("java/io/File", "(Ljava/lang/String;)V", props) javabridge.call(self.jobject, "setCustomPropsFile",...
Sets the custom properties file to use. :param props: the props file :type props: str
Below is the the instruction that describes the task: ### Input: Sets the custom properties file to use. :param props: the props file :type props: str ### Response: def custom_properties(self, props): """ Sets the custom properties file to use. :param props: the props file...
def interp_value(mass, age, feh, icol, grid, mass_col, ages, fehs, grid_Ns): # return_box): """mass, age, feh are *single values* at which values are desired icol is the column index of desired value grid is nfeh x nage x max(nmass) x ncols array mass_col is the colum...
mass, age, feh are *single values* at which values are desired icol is the column index of desired value grid is nfeh x nage x max(nmass) x ncols array mass_col is the column index of mass ages is grid of ages fehs is grid of fehs grid_Ns keeps track of nmass in each slice (beyond this are nans...
Below is the the instruction that describes the task: ### Input: mass, age, feh are *single values* at which values are desired icol is the column index of desired value grid is nfeh x nage x max(nmass) x ncols array mass_col is the column index of mass ages is grid of ages fehs is grid of fehs...
def rendered(self): """The rendered wire format for all conditions that have been rendered. Rendered conditions are never cleared. A new :class:`~bloop.conditions.ConditionRenderer` should be used for each operation.""" expressions = {k: v for (k, v) in self.expressions.items() if v is not Non...
The rendered wire format for all conditions that have been rendered. Rendered conditions are never cleared. A new :class:`~bloop.conditions.ConditionRenderer` should be used for each operation.
Below is the the instruction that describes the task: ### Input: The rendered wire format for all conditions that have been rendered. Rendered conditions are never cleared. A new :class:`~bloop.conditions.ConditionRenderer` should be used for each operation. ### Response: def rendered(self): """T...
def wvcal_spectrum(sp, fxpeaks, poly_degree_wfit, wv_master, wv_ini_search=None, wv_end_search=None, wvmin_useful=None, wvmax_useful=None, geometry=None, debugplot=0): """Execute wavelength calibration of a spectrum using fixed line peaks. Parameters ...
Execute wavelength calibration of a spectrum using fixed line peaks. Parameters ---------- sp : 1d numpy array Spectrum to be wavelength calibrated. fxpeaks : 1d numpy array Refined location of peaks in array index scale, i.e, from 0 to naxis1 - 1. The wavelength calibration is ...
Below is the the instruction that describes the task: ### Input: Execute wavelength calibration of a spectrum using fixed line peaks. Parameters ---------- sp : 1d numpy array Spectrum to be wavelength calibrated. fxpeaks : 1d numpy array Refined location of peaks in array index sca...
def iter_size_changes(self, issue): """Yield an IssueSnapshot for each time the issue size changed """ # Find the first size change, if any try: size_changes = list(filter(lambda h: h.field == 'Story Points', itertools.chain.from_iterab...
Yield an IssueSnapshot for each time the issue size changed
Below is the the instruction that describes the task: ### Input: Yield an IssueSnapshot for each time the issue size changed ### Response: def iter_size_changes(self, issue): """Yield an IssueSnapshot for each time the issue size changed """ # Find the first size change, if any try...
def data_to_elem_base(self): """Custom system base unconversion function""" if not self.n or self._flags['sysbase'] is False: return self.R = mul(self.R, self.Sn) / self.system.mva super(GovernorBase, self).data_to_elem_base()
Custom system base unconversion function
Below is the the instruction that describes the task: ### Input: Custom system base unconversion function ### Response: def data_to_elem_base(self): """Custom system base unconversion function""" if not self.n or self._flags['sysbase'] is False: return self.R = mul(self.R, self....
def provider_image(self): """Image path getter. This method uses a pluggable image provider to retrieve an image's path. """ if self._image is None: if isinstance(self.configuration['disk']['image'], dict): ProviderClass = lookup_provider_class( ...
Image path getter. This method uses a pluggable image provider to retrieve an image's path.
Below is the the instruction that describes the task: ### Input: Image path getter. This method uses a pluggable image provider to retrieve an image's path. ### Response: def provider_image(self): """Image path getter. This method uses a pluggable image provider to retrieve an ...
def histograms(dat, keys=None, bins=25, logy=False, cmap=None, ncol=4): """ Plot histograms of all items in dat. Parameters ---------- dat : dict Data in {key: array} pairs. keys : arra-like The keys in dat that you want to plot. If None, all are plotted. bins : int ...
Plot histograms of all items in dat. Parameters ---------- dat : dict Data in {key: array} pairs. keys : arra-like The keys in dat that you want to plot. If None, all are plotted. bins : int The number of bins in each histogram (default = 25) logy : bool ...
Below is the the instruction that describes the task: ### Input: Plot histograms of all items in dat. Parameters ---------- dat : dict Data in {key: array} pairs. keys : arra-like The keys in dat that you want to plot. If None, all are plotted. bins : int The num...
def html_factory(tag, **defaults): '''Returns an :class:`Html` factory function for ``tag`` and a given dictionary of ``defaults`` parameters. For example:: >>> input_factory = html_factory('input', type='text') >>> html = input_factory(value='bla') ''' def html_input(*children, **params): ...
Returns an :class:`Html` factory function for ``tag`` and a given dictionary of ``defaults`` parameters. For example:: >>> input_factory = html_factory('input', type='text') >>> html = input_factory(value='bla')
Below is the the instruction that describes the task: ### Input: Returns an :class:`Html` factory function for ``tag`` and a given dictionary of ``defaults`` parameters. For example:: >>> input_factory = html_factory('input', type='text') >>> html = input_factory(value='bla') ### Response: def html_fa...
def _process_cmap(cmap): ''' Returns a kwarg dict suitable for a ColorScale ''' option = {} if isinstance(cmap, str): option['scheme'] = cmap elif isinstance(cmap, list): option['colors'] = cmap else: raise ValueError('''`cmap` must be a string (name of a color scheme...
Returns a kwarg dict suitable for a ColorScale
Below is the the instruction that describes the task: ### Input: Returns a kwarg dict suitable for a ColorScale ### Response: def _process_cmap(cmap): ''' Returns a kwarg dict suitable for a ColorScale ''' option = {} if isinstance(cmap, str): option['scheme'] = cmap elif isinstance...
def write(self, data): """ Writes data to the TLS-wrapped socket :param data: A byte string to write to the socket :raises: socket.socket - when a non-TLS socket error occurs oscrypto.errors.TLSError - when a TLS-related error occurs Valu...
Writes data to the TLS-wrapped socket :param data: A byte string to write to the socket :raises: socket.socket - when a non-TLS socket error occurs oscrypto.errors.TLSError - when a TLS-related error occurs ValueError - when any of the parameters contain...
Below is the the instruction that describes the task: ### Input: Writes data to the TLS-wrapped socket :param data: A byte string to write to the socket :raises: socket.socket - when a non-TLS socket error occurs oscrypto.errors.TLSError - when a TLS-related err...
def _adjustFileAlignment(self, value, fileAlignment): """ Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. ...
Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. @rtype: int @return: The aligned value.
Below is the the instruction that describes the task: ### Input: Align a value to C{FileAligment}. @type value: int @param value: The value to align. @type fileAlignment: int @param fileAlignment: The value to be used to align the C{value} parameter. ...
def _sign_threshold_signature_fulfillment(cls, input_, message, key_pairs): """Signs a ThresholdSha256. Args: input_ (:class:`~bigchaindb.common.transaction. Input`) The Input to be signed. message (str): The message to be signed k...
Signs a ThresholdSha256. Args: input_ (:class:`~bigchaindb.common.transaction. Input`) The Input to be signed. message (str): The message to be signed key_pairs (dict): The keys to sign the Transaction with.
Below is the the instruction that describes the task: ### Input: Signs a ThresholdSha256. Args: input_ (:class:`~bigchaindb.common.transaction. Input`) The Input to be signed. message (str): The message to be signed key_pairs (dict): T...
def find_omega_min(omega, Nl, detuningsij, i_d, I_nd): r"""This function returns a list of length Nl containing the mininmal frequency that each laser excites. """ omega_min = [] omega_min_indices = [] for l in range(Nl): omegas = sorted([(omega[i_d(p[0]+1)-1][i_d(p[1]+1)-1], p) ...
r"""This function returns a list of length Nl containing the mininmal frequency that each laser excites.
Below is the the instruction that describes the task: ### Input: r"""This function returns a list of length Nl containing the mininmal frequency that each laser excites. ### Response: def find_omega_min(omega, Nl, detuningsij, i_d, I_nd): r"""This function returns a list of length Nl containing the mininma...
def post(self, url, body=None): """Sends this `Resource` instance to the service with a ``POST`` request to the given URL. Takes an optional body""" response = self.http_request(url, 'POST', body or self, {'Content-Type': 'application/xml; charset=utf-8'}) if response.status not in (200,...
Sends this `Resource` instance to the service with a ``POST`` request to the given URL. Takes an optional body
Below is the the instruction that describes the task: ### Input: Sends this `Resource` instance to the service with a ``POST`` request to the given URL. Takes an optional body ### Response: def post(self, url, body=None): """Sends this `Resource` instance to the service with a ``POST`` requ...
def references(self): """Return EIDs of references of an article. Note: Requires the FULL view of the article. """ refs = self.items.find('bibrecord/tail/bibliography', ns) if refs is not None: eids = [r.find("ref-info/refd-itemidlist/itemid", ns).text for r ...
Return EIDs of references of an article. Note: Requires the FULL view of the article.
Below is the the instruction that describes the task: ### Input: Return EIDs of references of an article. Note: Requires the FULL view of the article. ### Response: def references(self): """Return EIDs of references of an article. Note: Requires the FULL view of the article. """ ...
def _run(self, peer): """Sends open message to peer and handles received messages. Parameters: - `peer`: the peer to which this protocol instance is connected to. """ # We know the peer we are connected to, we send open message. self._peer = peer self.connect...
Sends open message to peer and handles received messages. Parameters: - `peer`: the peer to which this protocol instance is connected to.
Below is the the instruction that describes the task: ### Input: Sends open message to peer and handles received messages. Parameters: - `peer`: the peer to which this protocol instance is connected to. ### Response: def _run(self, peer): """Sends open message to peer and handles recei...
def get(self, pk=None, **kwargs): """Return one and exactly one notification template. Note here configuration-related fields like 'notification_configuration' and 'channels' will not be used even provided. Lookups may be through a primary key, specified as a positional ...
Return one and exactly one notification template. Note here configuration-related fields like 'notification_configuration' and 'channels' will not be used even provided. Lookups may be through a primary key, specified as a positional argument, and/or through filters specified t...
Below is the the instruction that describes the task: ### Input: Return one and exactly one notification template. Note here configuration-related fields like 'notification_configuration' and 'channels' will not be used even provided. Lookups may be through a primary key, specified...
def _joinOnAsPriv(self, model, onIndex, whatAs): """ Private method for handling joins. """ if self._join: raise Exception("Already joined with a table!") self._join = model self._joinedField = whatAs table = model.table self._query = self._qu...
Private method for handling joins.
Below is the the instruction that describes the task: ### Input: Private method for handling joins. ### Response: def _joinOnAsPriv(self, model, onIndex, whatAs): """ Private method for handling joins. """ if self._join: raise Exception("Already joined with a table!") ...
def get_system_root_directory(): """ Get system root directory (application installed root directory) Returns ------- string A full path """ root = os.path.dirname(__file__) root = os.path.dirname(root) root = os.path.abspath(root) return root
Get system root directory (application installed root directory) Returns ------- string A full path
Below is the the instruction that describes the task: ### Input: Get system root directory (application installed root directory) Returns ------- string A full path ### Response: def get_system_root_directory(): """ Get system root directory (application installed root directory) ...
def reset_all(): """ Clear relevant globals to start fresh :return: """ global _username global _password global _active_config global _active_tests global _machine_names global _deployers reset_deployers() reset_collector() _username = None _password = None _active_config = None _active...
Clear relevant globals to start fresh :return:
Below is the the instruction that describes the task: ### Input: Clear relevant globals to start fresh :return: ### Response: def reset_all(): """ Clear relevant globals to start fresh :return: """ global _username global _password global _active_config global _active_tests global _machine_name...
def map_qubits(self: TSelf_PauliStringGateOperation, qubit_map: Dict[raw_types.Qid, raw_types.Qid] ) -> TSelf_PauliStringGateOperation: """Return an equivalent operation on new qubits with its Pauli string mapped to new qubits. new_pauli_string = self.pauli_...
Return an equivalent operation on new qubits with its Pauli string mapped to new qubits. new_pauli_string = self.pauli_string.map_qubits(qubit_map)
Below is the the instruction that describes the task: ### Input: Return an equivalent operation on new qubits with its Pauli string mapped to new qubits. new_pauli_string = self.pauli_string.map_qubits(qubit_map) ### Response: def map_qubits(self: TSelf_PauliStringGateOperation, ...
def _compile_params(params, im1): """ Compile the params dictionary: * Combine parameters from different sources * Perform checks to prevent non-compatible parameters * Extend parameters that need a list with one element per dimension """ # Compile parameters p = _get_fixed_params(im1) ...
Compile the params dictionary: * Combine parameters from different sources * Perform checks to prevent non-compatible parameters * Extend parameters that need a list with one element per dimension
Below is the the instruction that describes the task: ### Input: Compile the params dictionary: * Combine parameters from different sources * Perform checks to prevent non-compatible parameters * Extend parameters that need a list with one element per dimension ### Response: def _compile_params(params,...
def _prepare_persistence_engine(self): """Load the specified persistence engine, or the default if none is set. """ if self._persistence_engine: return persistence_engine = self._options.get('persistence_engine') if persistence_engine: self._persi...
Load the specified persistence engine, or the default if none is set.
Below is the the instruction that describes the task: ### Input: Load the specified persistence engine, or the default if none is set. ### Response: def _prepare_persistence_engine(self): """Load the specified persistence engine, or the default if none is set. """ if self._p...
def dist(self, x1, x2): """Return the distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `LinearSpaceElement` Elements whose distance to compute. Returns ------- dist : float Distance between ``x1`` and ``x2``. """...
Return the distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `LinearSpaceElement` Elements whose distance to compute. Returns ------- dist : float Distance between ``x1`` and ``x2``.
Below is the the instruction that describes the task: ### Input: Return the distance between ``x1`` and ``x2``. Parameters ---------- x1, x2 : `LinearSpaceElement` Elements whose distance to compute. Returns ------- dist : float Distance betw...
def rparents(self, level=-1, intermediate=True): """Create a recursive list of children. Note that the :param:`intermediate` can be used to include every parents to the returned list, not only the most nested ones. Parameters: level (int): The depth level to continue fetchi...
Create a recursive list of children. Note that the :param:`intermediate` can be used to include every parents to the returned list, not only the most nested ones. Parameters: level (int): The depth level to continue fetching parents from (default is -1, to get paren...
Below is the the instruction that describes the task: ### Input: Create a recursive list of children. Note that the :param:`intermediate` can be used to include every parents to the returned list, not only the most nested ones. Parameters: level (int): The depth level to contin...
def poll(self): """ Perform a non-blocking scan of recv and send states on the server and client connection sockets. Process new connection requests, read incomming data, and send outgoing data. Sends and receives may be partial. """ #print len(self.connections)...
Perform a non-blocking scan of recv and send states on the server and client connection sockets. Process new connection requests, read incomming data, and send outgoing data. Sends and receives may be partial.
Below is the the instruction that describes the task: ### Input: Perform a non-blocking scan of recv and send states on the server and client connection sockets. Process new connection requests, read incomming data, and send outgoing data. Sends and receives may be partial. ### Response: ...
def sanitize_http_headers(client, event): """ Sanitizes http request/response headers :param client: an ElasticAPM client :param event: a transaction or error event :return: The modified event """ # request headers try: headers = event["context"]["request"]["headers"] ev...
Sanitizes http request/response headers :param client: an ElasticAPM client :param event: a transaction or error event :return: The modified event
Below is the the instruction that describes the task: ### Input: Sanitizes http request/response headers :param client: an ElasticAPM client :param event: a transaction or error event :return: The modified event ### Response: def sanitize_http_headers(client, event): """ Sanitizes http request...
def CLASSDEF(self, node): """ Check names used in a class definition, including its decorators, base classes, and the body of its definition. Additionally, add its name to the current scope. """ for deco in node.decorator_list: self.handleNode(deco, node) ...
Check names used in a class definition, including its decorators, base classes, and the body of its definition. Additionally, add its name to the current scope.
Below is the the instruction that describes the task: ### Input: Check names used in a class definition, including its decorators, base classes, and the body of its definition. Additionally, add its name to the current scope. ### Response: def CLASSDEF(self, node): """ Check names ...
def _set_fabric_virtual_gateway(self, v, load=False): """ Setter method for fabric_virtual_gateway, mapped from YANG variable /router/fabric_virtual_gateway (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_virtual_gateway is considered as a private ...
Setter method for fabric_virtual_gateway, mapped from YANG variable /router/fabric_virtual_gateway (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_virtual_gateway is considered as a private method. Backends looking to populate this variable should do s...
Below is the the instruction that describes the task: ### Input: Setter method for fabric_virtual_gateway, mapped from YANG variable /router/fabric_virtual_gateway (container) If this variable is read-only (config: false) in the source YANG file, then _set_fabric_virtual_gateway is considered as a private ...
def analyze_traceback(tb, inspection_level=None, limit=None): """ Extract trace back information into a list of dictionaries. :param tb: traceback :return: list of dicts containing filepath, line, module, code, traceback level and source code for tracebacks """ info = [] tb_level = tb e...
Extract trace back information into a list of dictionaries. :param tb: traceback :return: list of dicts containing filepath, line, module, code, traceback level and source code for tracebacks
Below is the the instruction that describes the task: ### Input: Extract trace back information into a list of dictionaries. :param tb: traceback :return: list of dicts containing filepath, line, module, code, traceback level and source code for tracebacks ### Response: def analyze_traceback(tb, inspectio...
def set_params(self, arg_params, aux_params): """Set parameter and aux values. Parameters ---------- arg_params : list of NDArray Source parameter arrays aux_params : list of NDArray Source aux arrays. """ for texec in self.execgrp.train_...
Set parameter and aux values. Parameters ---------- arg_params : list of NDArray Source parameter arrays aux_params : list of NDArray Source aux arrays.
Below is the the instruction that describes the task: ### Input: Set parameter and aux values. Parameters ---------- arg_params : list of NDArray Source parameter arrays aux_params : list of NDArray Source aux arrays. ### Response: def set_params(self, arg_p...
def peukerdouglas(np, fel, streamSkeleton, workingdir=None, mpiexedir=None, exedir=None, log_file=None, runtime_file=None, hostfile=None): """Run peuker-douglas function""" fname = TauDEM.func_name('peukerdouglas') return TauDEM.run(FileClass.get_executable_fullpath(fname, ...
Run peuker-douglas function
Below is the the instruction that describes the task: ### Input: Run peuker-douglas function ### Response: def peukerdouglas(np, fel, streamSkeleton, workingdir=None, mpiexedir=None, exedir=None, log_file=None, runtime_file=None, hostfile=None): """Run peuker-douglas function""" ...
def _check_holiday_structure(self, times): """ To check the structure of the HolidayClass :param list times: years or months or days or number week :rtype: None or Exception :return: in the case of exception returns the exception """ if not isinstance(times, list): ...
To check the structure of the HolidayClass :param list times: years or months or days or number week :rtype: None or Exception :return: in the case of exception returns the exception
Below is the the instruction that describes the task: ### Input: To check the structure of the HolidayClass :param list times: years or months or days or number week :rtype: None or Exception :return: in the case of exception returns the exception ### Response: def _check_holiday_structure...
def uncache_zipdir(path): """Ensure that the importer caches dont have stale info for `path`""" from zipimport import _zip_directory_cache as zdc _uncache(path, zdc) _uncache(path, sys.path_importer_cache)
Ensure that the importer caches dont have stale info for `path`
Below is the the instruction that describes the task: ### Input: Ensure that the importer caches dont have stale info for `path` ### Response: def uncache_zipdir(path): """Ensure that the importer caches dont have stale info for `path`""" from zipimport import _zip_directory_cache as zdc _uncache(path,...
def flatten_container(self, container): """ Accepts a kubernetes container and pulls out the nested values into the top level """ for names in ARG_MAP.values(): if names[TransformationTypes.KUBERNETES.value]['name'] and \ '.' in names[Transformatio...
Accepts a kubernetes container and pulls out the nested values into the top level
Below is the the instruction that describes the task: ### Input: Accepts a kubernetes container and pulls out the nested values into the top level ### Response: def flatten_container(self, container): """ Accepts a kubernetes container and pulls out the nested values into the top level """ ...
def calc_time(self) -> None: """ Prints statistics about the the total duration of recordings in the corpus. """ def get_number_of_frames(feat_fns): """ fns: A list of numpy files which contain a number of feature frames. """ total = 0 ...
Prints statistics about the the total duration of recordings in the corpus.
Below is the the instruction that describes the task: ### Input: Prints statistics about the the total duration of recordings in the corpus. ### Response: def calc_time(self) -> None: """ Prints statistics about the the total duration of recordings in the corpus. """ ...
def get_suggested_saxis(magmoms): """ This method returns a suggested spin axis for a set of magmoms, taking the largest magnetic moment as the reference. For calculations with collinear spins, this would give a sensible saxis for a ncl calculation. :param magmoms: list ...
This method returns a suggested spin axis for a set of magmoms, taking the largest magnetic moment as the reference. For calculations with collinear spins, this would give a sensible saxis for a ncl calculation. :param magmoms: list of magmoms (Magmoms, scalars or vectors) :retu...
Below is the the instruction that describes the task: ### Input: This method returns a suggested spin axis for a set of magmoms, taking the largest magnetic moment as the reference. For calculations with collinear spins, this would give a sensible saxis for a ncl calculation. :param...
def _send_ping(self, dest_addr, payload): """ Send a single ICMPecho (ping) packet to the specified address. The payload must be specified as a packed byte string. Note that its length has to be divisible by 2 for this to work correctly. """ pkt_id = self._last_used_id ...
Send a single ICMPecho (ping) packet to the specified address. The payload must be specified as a packed byte string. Note that its length has to be divisible by 2 for this to work correctly.
Below is the the instruction that describes the task: ### Input: Send a single ICMPecho (ping) packet to the specified address. The payload must be specified as a packed byte string. Note that its length has to be divisible by 2 for this to work correctly. ### Response: def _send_ping(self, dest_a...
async def get_version(self, timeout: int = 15) -> Optional[str]: """Execute FFmpeg process and parse the version information. Return full FFmpeg version string. Such as 3.4.2-tessus """ command = ["-version"] # open input for capture 1 frame is_open = await self.open(cm...
Execute FFmpeg process and parse the version information. Return full FFmpeg version string. Such as 3.4.2-tessus
Below is the the instruction that describes the task: ### Input: Execute FFmpeg process and parse the version information. Return full FFmpeg version string. Such as 3.4.2-tessus ### Response: async def get_version(self, timeout: int = 15) -> Optional[str]: """Execute FFmpeg process and parse the ...
def get_path(): """ Shortcut for users whose theme is next to their conf.py. """ # Theme directory is defined as our parent directory return os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
Shortcut for users whose theme is next to their conf.py.
Below is the the instruction that describes the task: ### Input: Shortcut for users whose theme is next to their conf.py. ### Response: def get_path(): """ Shortcut for users whose theme is next to their conf.py. """ # Theme directory is defined as our parent directory return os.path.abspath(os...
def read_sis_ini(fh, byteorder, dtype, count, offsetsize): """Read OlympusSIS INI string and return as dict.""" inistr = fh.read(count) inistr = bytes2str(stripnull(inistr)) try: return olympusini_metadata(inistr) except Exception as exc: log.warning('olympusini_metadata: %s: %s', ex...
Read OlympusSIS INI string and return as dict.
Below is the the instruction that describes the task: ### Input: Read OlympusSIS INI string and return as dict. ### Response: def read_sis_ini(fh, byteorder, dtype, count, offsetsize): """Read OlympusSIS INI string and return as dict.""" inistr = fh.read(count) inistr = bytes2str(stripnull(inistr)) ...
def clear_product(self, standard, key): """ 清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 """ data = { 'keystandard': standard, ...
清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包
Below is the the instruction that describes the task: ### Input: 清除商品信息 详情请参考 http://mp.weixin.qq.com/wiki/15/7fa787701295b884410b5163e13313af.html :param standard: 商品编码标准 :param key: 商品编码内容 :return: 返回的 JSON 数据包 ### Response: def clear_product(self, standard, key): ...
def add_listener(self, callback, event_type=None): """Add a callback handler for events going to this room. Args: callback (func(room, event)): Callback called when an event arrives. event_type (str): The event_type to filter for. Returns: uuid.UUID: Unique i...
Add a callback handler for events going to this room. Args: callback (func(room, event)): Callback called when an event arrives. event_type (str): The event_type to filter for. Returns: uuid.UUID: Unique id of the listener, can be used to identify the listener.
Below is the the instruction that describes the task: ### Input: Add a callback handler for events going to this room. Args: callback (func(room, event)): Callback called when an event arrives. event_type (str): The event_type to filter for. Returns: uuid.UUID: U...
def H_acceptor_count(mol): """Hydrogen bond acceptor count """ mol.require("Valence") return sum(1 for _, a in mol.atoms_iter() if a.H_acceptor)
Hydrogen bond acceptor count
Below is the the instruction that describes the task: ### Input: Hydrogen bond acceptor count ### Response: def H_acceptor_count(mol): """Hydrogen bond acceptor count """ mol.require("Valence") return sum(1 for _, a in mol.atoms_iter() if a.H_acceptor)
def listBlocksParents(self): """ API to list block parents of multiple blocks. To be called by blockparents url with post call. :param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000. :type block_names: list """ try : ...
API to list block parents of multiple blocks. To be called by blockparents url with post call. :param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000. :type block_names: list
Below is the the instruction that describes the task: ### Input: API to list block parents of multiple blocks. To be called by blockparents url with post call. :param block_names: list of block names [block_name1, block_name2, ...] (Required). Mwx length 1000. :type block_names: list ### Response: ...
def color(self): """ The |ColorFormat| instance that provides access to the color settings for this line. Essentially a shortcut for ``line.fill.fore_color``. As a side-effect, accessing this property causes the line fill type to be set to ``MSO_FILL.SOLID``. If this sounds risky...
The |ColorFormat| instance that provides access to the color settings for this line. Essentially a shortcut for ``line.fill.fore_color``. As a side-effect, accessing this property causes the line fill type to be set to ``MSO_FILL.SOLID``. If this sounds risky for your use case, use ``lin...
Below is the the instruction that describes the task: ### Input: The |ColorFormat| instance that provides access to the color settings for this line. Essentially a shortcut for ``line.fill.fore_color``. As a side-effect, accessing this property causes the line fill type to be set to ``MSO_FI...
def score(infile, outfile, classifier, xgb_autotune, apply_weights, xeval_fraction, xeval_num_iter, ss_initial_fdr, ss_iteration_fdr, ss_num_iter, ss_main_score, group_id, parametric, pfdr, pi0_lambda, pi0_method, pi0_smooth_df, pi0_smooth_log_pi0, lfdr_truncate, lfdr_monotone, lfdr_transformation, lfdr_adj, lfdr_eps, ...
Conduct semi-supervised learning and error-rate estimation for MS1, MS2 and transition-level data.
Below is the the instruction that describes the task: ### Input: Conduct semi-supervised learning and error-rate estimation for MS1, MS2 and transition-level data. ### Response: def score(infile, outfile, classifier, xgb_autotune, apply_weights, xeval_fraction, xeval_num_iter, ss_initial_fdr, ss_iteration_fdr, ss_...
def _create_w_objective(m, X, R): """ Creates an objective function and its derivative for W, given M and X (data) Args: m (array): genes x clusters X (array): genes x cells R (array): 1 x genes """ genes, clusters = m.shape cells = X.shape[1] R1 = R.reshape((genes, ...
Creates an objective function and its derivative for W, given M and X (data) Args: m (array): genes x clusters X (array): genes x cells R (array): 1 x genes
Below is the the instruction that describes the task: ### Input: Creates an objective function and its derivative for W, given M and X (data) Args: m (array): genes x clusters X (array): genes x cells R (array): 1 x genes ### Response: def _create_w_objective(m, X, R): """ Crea...
def get_cache(self, decorated_function, *args, **kwargs): """ :meth:`WCacheStorage.get_cache` method implementation """ self.__check(decorated_function, *args, **kwargs) if decorated_function in self._storage: for i in self._storage[decorated_function]: if i['instance']() == args[0]: result = i['res...
:meth:`WCacheStorage.get_cache` method implementation
Below is the the instruction that describes the task: ### Input: :meth:`WCacheStorage.get_cache` method implementation ### Response: def get_cache(self, decorated_function, *args, **kwargs): """ :meth:`WCacheStorage.get_cache` method implementation """ self.__check(decorated_function, *args, **kwargs) if d...
def sync(self, graph_commons): """Synchronize local and remote representations.""" if self['id'] is None: return remote_graph = graph_commons.graphs(self['id']) # TODO: less forceful, more elegant self.edges = remote_graph.edges self.nodes = remote_graph.nod...
Synchronize local and remote representations.
Below is the the instruction that describes the task: ### Input: Synchronize local and remote representations. ### Response: def sync(self, graph_commons): """Synchronize local and remote representations.""" if self['id'] is None: return remote_graph = graph_commons.graphs(self...
def get_stanza(self, peer_jid): """ Return the last presence recieved for the given bare or full `peer_jid`. If the last presence was unavailable, the return value is :data:`None`, as if no presence was ever received. If no presence was ever received for the given bare JID, :dat...
Return the last presence recieved for the given bare or full `peer_jid`. If the last presence was unavailable, the return value is :data:`None`, as if no presence was ever received. If no presence was ever received for the given bare JID, :data:`None` is returned.
Below is the the instruction that describes the task: ### Input: Return the last presence recieved for the given bare or full `peer_jid`. If the last presence was unavailable, the return value is :data:`None`, as if no presence was ever received. If no presence was ever received for the giv...
def wrap_iter_with_message_events( request_or_response_iter, span, message_event_type ): """Wraps a request or response iterator to add message events to the span for each proto message sent or received """ for message_id, message in enumerate(request_or_response_iter, start=1): add_...
Wraps a request or response iterator to add message events to the span for each proto message sent or received
Below is the the instruction that describes the task: ### Input: Wraps a request or response iterator to add message events to the span for each proto message sent or received ### Response: def wrap_iter_with_message_events( request_or_response_iter, span, message_event_type ): """Wraps a reque...
def idmap_get_max_id(connection, id_class): """ Given an ilwd:char ID class, return the highest ID from the table for whose IDs that is the class. Example: >>> event_id = ilwd.ilwdchar("sngl_burst:event_id:0") >>> print event_id sngl_inspiral:event_id:0 >>> max_id = get_max_id(connection, type(event_id)) >>>...
Given an ilwd:char ID class, return the highest ID from the table for whose IDs that is the class. Example: >>> event_id = ilwd.ilwdchar("sngl_burst:event_id:0") >>> print event_id sngl_inspiral:event_id:0 >>> max_id = get_max_id(connection, type(event_id)) >>> print max_id sngl_inspiral:event_id:1054
Below is the the instruction that describes the task: ### Input: Given an ilwd:char ID class, return the highest ID from the table for whose IDs that is the class. Example: >>> event_id = ilwd.ilwdchar("sngl_burst:event_id:0") >>> print event_id sngl_inspiral:event_id:0 >>> max_id = get_max_id(connection, t...
def encode(self, name, as_map_key=False): """Returns the name the first time and the key after that""" if name in self.key_to_value: return self.key_to_value[name] return self.encache(name) if is_cacheable(name, as_map_key) else name
Returns the name the first time and the key after that
Below is the the instruction that describes the task: ### Input: Returns the name the first time and the key after that ### Response: def encode(self, name, as_map_key=False): """Returns the name the first time and the key after that""" if name in self.key_to_value: return self.key_to_v...
def import_tree_corpus(labels_path, parents_path, texts_path): """ Import dataset from the TreeLSTM data generation scrips. Arguments: ---------- labels_path : str, where are labels are stored (should be in data/sst/labels.txt). parents_path : str, where the parent relations...
Import dataset from the TreeLSTM data generation scrips. Arguments: ---------- labels_path : str, where are labels are stored (should be in data/sst/labels.txt). parents_path : str, where the parent relationships are stored (should be in data/sst/parents.txt). te...
Below is the the instruction that describes the task: ### Input: Import dataset from the TreeLSTM data generation scrips. Arguments: ---------- labels_path : str, where are labels are stored (should be in data/sst/labels.txt). parents_path : str, where the parent relationships a...
def offsets(self): """A generator producing a (path, offset) tuple for all tailed files.""" for path, tailedfile in self._tailedfiles.iteritems(): yield path, tailedfile._offset
A generator producing a (path, offset) tuple for all tailed files.
Below is the the instruction that describes the task: ### Input: A generator producing a (path, offset) tuple for all tailed files. ### Response: def offsets(self): """A generator producing a (path, offset) tuple for all tailed files.""" for path, tailedfile in self._tailedfiles.iteritems(): y...
def transform(data, target_wd, target_ht, is_train, box): """Crop and normnalize an image nd array.""" if box is not None: x, y, w, h = box data = data[y:min(y+h, data.shape[0]), x:min(x+w, data.shape[1])] # Resize to target_wd * target_ht. data = mx.image.imresize(data, target_wd, targ...
Crop and normnalize an image nd array.
Below is the the instruction that describes the task: ### Input: Crop and normnalize an image nd array. ### Response: def transform(data, target_wd, target_ht, is_train, box): """Crop and normnalize an image nd array.""" if box is not None: x, y, w, h = box data = data[y:min(y+h, data.shape...
def create_network(self): """Get an instance of vlan services facade.""" return Network( self.networkapi_url, self.user, self.password, self.user_ldap)
Get an instance of vlan services facade.
Below is the the instruction that describes the task: ### Input: Get an instance of vlan services facade. ### Response: def create_network(self): """Get an instance of vlan services facade.""" return Network( self.networkapi_url, self.user, self.password, ...
def createDenseCNNModel(self): """ Create a standard network composed of two CNN / MaxPool layers followed by a linear layer with using ReLU activation between the layers """ # Create denseCNN2 model model = nn.Sequential( nn.Conv2d(in_channels=self.in_channels, out_channels=self.out_chan...
Create a standard network composed of two CNN / MaxPool layers followed by a linear layer with using ReLU activation between the layers
Below is the the instruction that describes the task: ### Input: Create a standard network composed of two CNN / MaxPool layers followed by a linear layer with using ReLU activation between the layers ### Response: def createDenseCNNModel(self): """ Create a standard network composed of two CNN / MaxPo...
def _iparam_instancename(instancename): """ Convert an instance name specified in an operation method into a CIM object that can be passed to imethodcall(). """ if isinstance(instancename, CIMInstanceName): instancename = instancename.copy() instancename....
Convert an instance name specified in an operation method into a CIM object that can be passed to imethodcall().
Below is the the instruction that describes the task: ### Input: Convert an instance name specified in an operation method into a CIM object that can be passed to imethodcall(). ### Response: def _iparam_instancename(instancename): """ Convert an instance name specified in an operation meth...
def energy_based_strength_of_connection(A, theta=0.0, k=2): """Energy Strength Measure. Compute a strength of connection matrix using an energy-based measure. Parameters ---------- A : sparse-matrix matrix from which to generate strength of connection information theta : float ...
Energy Strength Measure. Compute a strength of connection matrix using an energy-based measure. Parameters ---------- A : sparse-matrix matrix from which to generate strength of connection information theta : float Threshold parameter in [0,1] k : int Number of relaxati...
Below is the the instruction that describes the task: ### Input: Energy Strength Measure. Compute a strength of connection matrix using an energy-based measure. Parameters ---------- A : sparse-matrix matrix from which to generate strength of connection information theta : float ...