code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def updateUserTone(conversationPayload, toneAnalyzerPayload, maintainHistory): """ updateUserTone processes the Tone Analyzer payload to pull out the emotion, writing and social tones, and identify the meaningful tones (i.e., those tones that meet the specified thresholds). The conversationPayload j...
updateUserTone processes the Tone Analyzer payload to pull out the emotion, writing and social tones, and identify the meaningful tones (i.e., those tones that meet the specified thresholds). The conversationPayload json object is updated to include these tones. @param conversationPayload json object re...
Below is the the instruction that describes the task: ### Input: updateUserTone processes the Tone Analyzer payload to pull out the emotion, writing and social tones, and identify the meaningful tones (i.e., those tones that meet the specified thresholds). The conversationPayload json object is updated ...
def contained_bins(start, stop=None): """ Given an interval `start:stop`, return bins for intervals completely *contained by* `start:stop`. The order is according to the bin level (starting with the smallest bins), and within a level according to the bin number (ascending). :arg int start, stop...
Given an interval `start:stop`, return bins for intervals completely *contained by* `start:stop`. The order is according to the bin level (starting with the smallest bins), and within a level according to the bin number (ascending). :arg int start, stop: Interval positions (zero-based, open-ended). If ...
Below is the the instruction that describes the task: ### Input: Given an interval `start:stop`, return bins for intervals completely *contained by* `start:stop`. The order is according to the bin level (starting with the smallest bins), and within a level according to the bin number (ascending). :...
def _merge_headers(self, call_specific_headers): """ Merge headers from different sources together. Headers passed to the post/get methods have highest priority, then headers associated with the connection object itself have next priority. :param call_specific_headers: A header...
Merge headers from different sources together. Headers passed to the post/get methods have highest priority, then headers associated with the connection object itself have next priority. :param call_specific_headers: A header dict from the get/post call, or None (the default for th...
Below is the the instruction that describes the task: ### Input: Merge headers from different sources together. Headers passed to the post/get methods have highest priority, then headers associated with the connection object itself have next priority. :param call_specific_headers: A header...
def get_source(self, doc): """ Grab contents of 'doc' and return it :param doc: The active document :return: """ start_iter = doc.get_start_iter() end_iter = doc.get_end_iter() source = doc.get_text(start_iter, end_iter, False) return source
Grab contents of 'doc' and return it :param doc: The active document :return:
Below is the the instruction that describes the task: ### Input: Grab contents of 'doc' and return it :param doc: The active document :return: ### Response: def get_source(self, doc): """ Grab contents of 'doc' and return it :param doc: The active document :return:...
def delete_checkpoint(self, checkpoint_dir): """Removes subdirectory within checkpoint_folder Parameters ---------- checkpoint_dir : path to checkpoint """ if os.path.isfile(checkpoint_dir): shutil.rmtree(os.path.dirname(checkpoint_dir)) else: ...
Removes subdirectory within checkpoint_folder Parameters ---------- checkpoint_dir : path to checkpoint
Below is the the instruction that describes the task: ### Input: Removes subdirectory within checkpoint_folder Parameters ---------- checkpoint_dir : path to checkpoint ### Response: def delete_checkpoint(self, checkpoint_dir): """Removes subdirectory within checkpoint_folder ...
def check_type(self, value): """Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None """ if self.__dict__['dtype'] is None: ...
Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None
Below is the the instruction that describes the task: ### Input: Hook for type-checking, invoked during assignment. raises TypeError if neither value nor self.dtype are None and they do not match. will not raise an exception if either value or self.dtype is None ### Response: def check_ty...
def confirmation_pdf(self, confirmation_id): """ Opens a pdf of a confirmation :param confirmation_id: the confirmation id :return: dict """ return self._create_get_request(resource=CONFIRMATIONS, billomat_id=confirmation_id, command=PDF)
Opens a pdf of a confirmation :param confirmation_id: the confirmation id :return: dict
Below is the the instruction that describes the task: ### Input: Opens a pdf of a confirmation :param confirmation_id: the confirmation id :return: dict ### Response: def confirmation_pdf(self, confirmation_id): """ Opens a pdf of a confirmation :param confirmation_id: the...
def trans_his(self, symbol='', start=0, offset=10, date=''): ''' 查询历史分笔成交 :param market: 市场代码 :param symbol: 股票代码 :param start: 起始位置 :param offset: 数量 :param date: 日期 :return: pd.dataFrame or None ''' market = get_stock_market(symbol) ...
查询历史分笔成交 :param market: 市场代码 :param symbol: 股票代码 :param start: 起始位置 :param offset: 数量 :param date: 日期 :return: pd.dataFrame or None
Below is the the instruction that describes the task: ### Input: 查询历史分笔成交 :param market: 市场代码 :param symbol: 股票代码 :param start: 起始位置 :param offset: 数量 :param date: 日期 :return: pd.dataFrame or None ### Response: def trans_his(self, symbol='', start=0, offset=10, date...
def failures(): """Show any unexpected failures""" if not HAVE_BIN_LIBS: click.echo("missing required binary libs (lz4, msgpack)") return q = Queue('failed', connection=worker.connection) for i in q.get_job_ids(): j = q.job_class.fetch(i, connection=q.connection) click.e...
Show any unexpected failures
Below is the the instruction that describes the task: ### Input: Show any unexpected failures ### Response: def failures(): """Show any unexpected failures""" if not HAVE_BIN_LIBS: click.echo("missing required binary libs (lz4, msgpack)") return q = Queue('failed', connection=worker.co...
def available_languages(wordlist='best'): """ Given a wordlist name, return a dictionary of language codes to filenames, representing all the languages in which that wordlist is available. """ if wordlist == 'best': available = available_languages('small') available.update(available_...
Given a wordlist name, return a dictionary of language codes to filenames, representing all the languages in which that wordlist is available.
Below is the the instruction that describes the task: ### Input: Given a wordlist name, return a dictionary of language codes to filenames, representing all the languages in which that wordlist is available. ### Response: def available_languages(wordlist='best'): """ Given a wordlist name, return a dic...
def register(self, name, callback, filter): """ register: string, function: string, data -> None, function: data -> boolean -> None Register will save the given name, callback, and filter function for use when a packet arrives. When one arrives, the filter function will ...
register: string, function: string, data -> None, function: data -> boolean -> None Register will save the given name, callback, and filter function for use when a packet arrives. When one arrives, the filter function will be called to determine whether to call its associated ca...
Below is the the instruction that describes the task: ### Input: register: string, function: string, data -> None, function: data -> boolean -> None Register will save the given name, callback, and filter function for use when a packet arrives. When one arrives, the filter function ...
def _get_scenarios(network_id, include_data, user_id, scenario_ids=None): """ Get all the scenarios in a network """ scen_qry = db.DBSession.query(Scenario).filter( Scenario.network_id == network_id).options( noload('network')).filter( ...
Get all the scenarios in a network
Below is the the instruction that describes the task: ### Input: Get all the scenarios in a network ### Response: def _get_scenarios(network_id, include_data, user_id, scenario_ids=None): """ Get all the scenarios in a network """ scen_qry = db.DBSession.query(Scenario).filter( ...
def small_parts(script, ratio=0.2, non_closed_only=False): """ Select & delete the small disconnected parts (components) of a mesh. Args: script: the FilterScript object or script filename to write the filter to. ratio (float): This ratio (between 0 and 1) defines the meaning of ...
Select & delete the small disconnected parts (components) of a mesh. Args: script: the FilterScript object or script filename to write the filter to. ratio (float): This ratio (between 0 and 1) defines the meaning of 'small' as the threshold ratio between the number of faces...
Below is the the instruction that describes the task: ### Input: Select & delete the small disconnected parts (components) of a mesh. Args: script: the FilterScript object or script filename to write the filter to. ratio (float): This ratio (between 0 and 1) defines the meaning of ...
def dx_orbit_sys(t, X): '''X = [ m1x, m1y, m2x, m2y, m3x, m3y, m4x, m4y, m1vx, m1vy, m2vx, m2vy, m3vx, m3vy, m4vx, m4vy ] ''' (m1x, m1y, m2x, m2y, m3x, m3y, m4x, m4y, m1vx, m1vy, m2vx, m2vy, m3vx, m3vy, m4vx, m4vy) = X m_moon1 = 7.34...
X = [ m1x, m1y, m2x, m2y, m3x, m3y, m4x, m4y, m1vx, m1vy, m2vx, m2vy, m3vx, m3vy, m4vx, m4vy ]
Below is the the instruction that describes the task: ### Input: X = [ m1x, m1y, m2x, m2y, m3x, m3y, m4x, m4y, m1vx, m1vy, m2vx, m2vy, m3vx, m3vy, m4vx, m4vy ] ### Response: def dx_orbit_sys(t, X): '''X = [ m1x, m1y, m2x, m2y, m3x, m3y, m4x, m4y, m1vx, m1...
def set_label(self, label, lang): """ Add the label of the collection in given lang :param label: Label Value :param lang: Language code """ try: self.metadata.add(SKOS.prefLabel, Literal(label, lang=lang)) self.graph.addN([ (self.asNode(...
Add the label of the collection in given lang :param label: Label Value :param lang: Language code
Below is the the instruction that describes the task: ### Input: Add the label of the collection in given lang :param label: Label Value :param lang: Language code ### Response: def set_label(self, label, lang): """ Add the label of the collection in given lang :param label: Labe...
def ckan_extension_template(name, target): """ Create ckanext-(name) in target directory. """ setupdir = '{0}/ckanext-{1}theme'.format(target, name) extdir = setupdir + '/ckanext/{0}theme'.format(name) templatedir = extdir + '/templates/' staticdir = extdir + '/static/datacats' makedirs...
Create ckanext-(name) in target directory.
Below is the the instruction that describes the task: ### Input: Create ckanext-(name) in target directory. ### Response: def ckan_extension_template(name, target): """ Create ckanext-(name) in target directory. """ setupdir = '{0}/ckanext-{1}theme'.format(target, name) extdir = setupdir + '/ck...
def shutdown(self): """ Request broker gracefully disconnect streams and stop. Safe to call from any thread. """ _v and LOG.debug('%r.shutdown()', self) def _shutdown(): self._alive = False if self._alive and not self._exitted: self.defer(_...
Request broker gracefully disconnect streams and stop. Safe to call from any thread.
Below is the the instruction that describes the task: ### Input: Request broker gracefully disconnect streams and stop. Safe to call from any thread. ### Response: def shutdown(self): """ Request broker gracefully disconnect streams and stop. Safe to call from any thread. ""...
def remove_client(self, client): # type: (object) -> None """Remove the client from the users of the socket. If there are no more clients for the socket, it will close automatically. """ try: self._clients.remove(id(client)) except ValueError: ...
Remove the client from the users of the socket. If there are no more clients for the socket, it will close automatically.
Below is the the instruction that describes the task: ### Input: Remove the client from the users of the socket. If there are no more clients for the socket, it will close automatically. ### Response: def remove_client(self, client): # type: (object) -> None """Remove the client fr...
def __require_kytos_config(self): """Set path locations from kytosd API. It should not be called directly, but from properties that require a running kytosd instance. """ if self.__enabled is None: uri = self._kytos_api + 'api/kytos/core/config/' try: ...
Set path locations from kytosd API. It should not be called directly, but from properties that require a running kytosd instance.
Below is the the instruction that describes the task: ### Input: Set path locations from kytosd API. It should not be called directly, but from properties that require a running kytosd instance. ### Response: def __require_kytos_config(self): """Set path locations from kytosd API. ...
def set_selected_submission(self, course, task, submissionid): """ Set submission whose id is `submissionid` to selected grading submission for the given course/task. Returns a boolean indicating whether the operation was successful or not. """ submission = self.submission_manager.g...
Set submission whose id is `submissionid` to selected grading submission for the given course/task. Returns a boolean indicating whether the operation was successful or not.
Below is the the instruction that describes the task: ### Input: Set submission whose id is `submissionid` to selected grading submission for the given course/task. Returns a boolean indicating whether the operation was successful or not. ### Response: def set_selected_submission(self, course, task, su...
def get_dsn(d): """ Get the dataset name from a record :param dict d: Metadata :return str: Dataset name """ try: return d["dataSetName"] except Exception as e: logger_misc.warn("get_dsn: Exception: No datasetname found, unable to continue: {}".format(e)) exit(1)
Get the dataset name from a record :param dict d: Metadata :return str: Dataset name
Below is the the instruction that describes the task: ### Input: Get the dataset name from a record :param dict d: Metadata :return str: Dataset name ### Response: def get_dsn(d): """ Get the dataset name from a record :param dict d: Metadata :return str: Dataset name """ try: ...
def signals_blocker(instance, attribute, *args, **kwargs): """ Blocks given instance signals before calling the given attribute with \ given arguments and then unblocks the signals. :param instance: Instance object. :type instance: QObject :param attribute: Attribute to call. :type attribut...
Blocks given instance signals before calling the given attribute with \ given arguments and then unblocks the signals. :param instance: Instance object. :type instance: QObject :param attribute: Attribute to call. :type attribute: QObject :param \*args: Arguments. :type \*args: \* :para...
Below is the the instruction that describes the task: ### Input: Blocks given instance signals before calling the given attribute with \ given arguments and then unblocks the signals. :param instance: Instance object. :type instance: QObject :param attribute: Attribute to call. :type attribute:...
def get_labels(obj): """ Retrieve the labels of a clustering.rst object :param obj: the clustering.rst object :return: the resulting labels """ if Clustering.is_pyclustering_instance(obj.model): return obj._labels_from_pyclusters else: ret...
Retrieve the labels of a clustering.rst object :param obj: the clustering.rst object :return: the resulting labels
Below is the the instruction that describes the task: ### Input: Retrieve the labels of a clustering.rst object :param obj: the clustering.rst object :return: the resulting labels ### Response: def get_labels(obj): """ Retrieve the labels of a clustering.rst object :param ...
def list_orgs(self): """ list the orgs configured in the keychain """ orgs = list(self.orgs.keys()) orgs.sort() return orgs
list the orgs configured in the keychain
Below is the the instruction that describes the task: ### Input: list the orgs configured in the keychain ### Response: def list_orgs(self): """ list the orgs configured in the keychain """ orgs = list(self.orgs.keys()) orgs.sort() return orgs
def merge(obj_a, obj_b, strategy='smart', renderer='yaml', merge_lists=False): ''' Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge ...
Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge '{foo: Foo}' '{bar: Bar}'
Below is the the instruction that describes the task: ### Input: Merge a data structure into another by choosing a merge strategy Strategies: * aggregate * list * overwrite * recurse * smart CLI Example: .. code-block:: shell salt '*' slsutil.merge '{foo: Foo}' '{bar: Ba...
def load_page_buffer(self, buffer_number, address, bytes): """! @brief Load data to a numbered page buffer. This method is used in conjunction with start_program_page_with_buffer() to implement double buffered programming. """ assert buffer_number < len(self.page...
! @brief Load data to a numbered page buffer. This method is used in conjunction with start_program_page_with_buffer() to implement double buffered programming.
Below is the the instruction that describes the task: ### Input: ! @brief Load data to a numbered page buffer. This method is used in conjunction with start_program_page_with_buffer() to implement double buffered programming. ### Response: def load_page_buffer(self, buffer_number, ...
def _get_classifier(self, prefix): """ Construct a decoder for the next sentence prediction task """ with self.name_scope(): classifier = nn.Dense(2, prefix=prefix) return classifier
Construct a decoder for the next sentence prediction task
Below is the the instruction that describes the task: ### Input: Construct a decoder for the next sentence prediction task ### Response: def _get_classifier(self, prefix): """ Construct a decoder for the next sentence prediction task """ with self.name_scope(): classifier = nn.Dense(2, ...
def rename_state_fluent(name: str) -> str: '''Returns current state fluent canonical name. Args: name (str): The next state fluent name. Returns: str: The current state fluent name. ''' i = name.index('/') functor = name[:i] arity = name[i+1:] return "{}'/{}".format(fun...
Returns current state fluent canonical name. Args: name (str): The next state fluent name. Returns: str: The current state fluent name.
Below is the the instruction that describes the task: ### Input: Returns current state fluent canonical name. Args: name (str): The next state fluent name. Returns: str: The current state fluent name. ### Response: def rename_state_fluent(name: str) -> str: '''Returns current state fl...
def delete_keys(self, keys, quiet=False, mfa_token=None, headers=None): """ Deletes a set of keys using S3's Multi-object delete API. If a VersionID is specified for that key then that version is removed. Returns a MultiDeleteResult Object, which contains Deleted and Error elemen...
Deletes a set of keys using S3's Multi-object delete API. If a VersionID is specified for that key then that version is removed. Returns a MultiDeleteResult Object, which contains Deleted and Error elements for each key you ask to delete. :type keys: list :param keys: A ...
Below is the the instruction that describes the task: ### Input: Deletes a set of keys using S3's Multi-object delete API. If a VersionID is specified for that key then that version is removed. Returns a MultiDeleteResult Object, which contains Deleted and Error elements for each key you ask...
def login(self, pin, user_type=CKU_USER): """ C_Login :param pin: the user's PIN or None for CKF_PROTECTED_AUTHENTICATION_PATH :type pin: string :param user_type: the user type. The default value is CKU_USER. You may also use CKU_SO :type user_type: integer ...
C_Login :param pin: the user's PIN or None for CKF_PROTECTED_AUTHENTICATION_PATH :type pin: string :param user_type: the user type. The default value is CKU_USER. You may also use CKU_SO :type user_type: integer
Below is the the instruction that describes the task: ### Input: C_Login :param pin: the user's PIN or None for CKF_PROTECTED_AUTHENTICATION_PATH :type pin: string :param user_type: the user type. The default value is CKU_USER. You may also use CKU_SO :type user_type: inte...
def predict_proba(self, X): """ Apply transforms, and predict_proba of the final estimator Parameters ---------- X : iterable Data to predict on. Must fulfill input requirements of first step of the pipeline. Returns ------- y_pro...
Apply transforms, and predict_proba of the final estimator Parameters ---------- X : iterable Data to predict on. Must fulfill input requirements of first step of the pipeline. Returns ------- y_proba : array-like, shape = [n_samples, n_classes] ...
Below is the the instruction that describes the task: ### Input: Apply transforms, and predict_proba of the final estimator Parameters ---------- X : iterable Data to predict on. Must fulfill input requirements of first step of the pipeline. Returns ...
def readAlignments(self, reads): """ Read lines of JSON from self._filename, convert them to read alignments and yield them. @param reads: An iterable of L{Read} instances, corresponding to the reads that were given to BLAST. @raise ValueError: If any of the lines in...
Read lines of JSON from self._filename, convert them to read alignments and yield them. @param reads: An iterable of L{Read} instances, corresponding to the reads that were given to BLAST. @raise ValueError: If any of the lines in the file cannot be converted to JSON. ...
Below is the the instruction that describes the task: ### Input: Read lines of JSON from self._filename, convert them to read alignments and yield them. @param reads: An iterable of L{Read} instances, corresponding to the reads that were given to BLAST. @raise ValueError: If any...
def dump_xml(props, fp, comment=None, encoding='UTF-8', sort_keys=False): """ Write a series ``props`` of key-value pairs to a binary filehandle ``fp`` in the format of an XML properties file. The file will include both an XML declaration and a doctype declaration. :param props: A mapping or itera...
Write a series ``props`` of key-value pairs to a binary filehandle ``fp`` in the format of an XML properties file. The file will include both an XML declaration and a doctype declaration. :param props: A mapping or iterable of ``(key, value)`` pairs to write to ``fp``. All keys and values in ``pr...
Below is the the instruction that describes the task: ### Input: Write a series ``props`` of key-value pairs to a binary filehandle ``fp`` in the format of an XML properties file. The file will include both an XML declaration and a doctype declaration. :param props: A mapping or iterable of ``(key, va...
def add_highlight(self, hl_group, line, col_start=0, col_end=-1, src_id=-1, async_=None, **kwargs): """Add a highlight to the buffer.""" async_ = check_async(async_, kwargs, src_id != 0) return self.request('nvim_buf_add_highlight', src_id, hl_group, ...
Add a highlight to the buffer.
Below is the the instruction that describes the task: ### Input: Add a highlight to the buffer. ### Response: def add_highlight(self, hl_group, line, col_start=0, col_end=-1, src_id=-1, async_=None, **kwargs): """Add a highlight to the buffer.""" async_ =...
def evaluate(self, dataset, metric='auto', missing_value_action='auto'): """ Evaluate the model on the given dataset. Parameters ---------- dataset : SFrame Dataset in the same format used for training. The columns names and types of the dataset must be ...
Evaluate the model on the given dataset. Parameters ---------- dataset : SFrame Dataset in the same format used for training. The columns names and types of the dataset must be the same as that used in training. metric : str, optional Name of the ev...
Below is the the instruction that describes the task: ### Input: Evaluate the model on the given dataset. Parameters ---------- dataset : SFrame Dataset in the same format used for training. The columns names and types of the dataset must be the same as that used in...
def execute(self): """ Execute the actions necessary to perform a `molecule converge` and returns None. :return: None """ self.print_info() self._config.provisioner.converge() self._config.state.change_state('converged', True)
Execute the actions necessary to perform a `molecule converge` and returns None. :return: None
Below is the the instruction that describes the task: ### Input: Execute the actions necessary to perform a `molecule converge` and returns None. :return: None ### Response: def execute(self): """ Execute the actions necessary to perform a `molecule converge` and returns No...
def _make_routing_list(api_provider): """ Returns a list of routes to configure the Local API Service based on the APIs configured in the template. Parameters ---------- api_provider : samcli.commands.local.lib.sam_api_provider.SamApiProvider Returns ------- ...
Returns a list of routes to configure the Local API Service based on the APIs configured in the template. Parameters ---------- api_provider : samcli.commands.local.lib.sam_api_provider.SamApiProvider Returns ------- list(samcli.local.apigw.service.Route) Li...
Below is the the instruction that describes the task: ### Input: Returns a list of routes to configure the Local API Service based on the APIs configured in the template. Parameters ---------- api_provider : samcli.commands.local.lib.sam_api_provider.SamApiProvider Returns ...
def mmPrettyPrintDataOverlap(self): """ Returns pretty-printed string representation of overlap metric data. (See `mmGetDataOverlap`.) @return (string) Pretty-printed data """ matrix = self.mmGetDataOverlap() resetsTrace = self.mmGetTraceResets() text = "" for i, row in enumerate(...
Returns pretty-printed string representation of overlap metric data. (See `mmGetDataOverlap`.) @return (string) Pretty-printed data
Below is the the instruction that describes the task: ### Input: Returns pretty-printed string representation of overlap metric data. (See `mmGetDataOverlap`.) @return (string) Pretty-printed data ### Response: def mmPrettyPrintDataOverlap(self): """ Returns pretty-printed string representation of...
def meraculous_runner(self): """ Check to make sure that the allAssembliesDir has been created, if not, make it. This will only execute for the first time an assembly has been run in this directory. Run the directory from allAssembliesDir. The self.callString instance at...
Check to make sure that the allAssembliesDir has been created, if not, make it. This will only execute for the first time an assembly has been run in this directory. Run the directory from allAssembliesDir. The self.callString instance attribute tells Meraculous to name the assembly dir...
Below is the the instruction that describes the task: ### Input: Check to make sure that the allAssembliesDir has been created, if not, make it. This will only execute for the first time an assembly has been run in this directory. Run the directory from allAssembliesDir. The self.callString...
def chooseReliableActiveFiringRate(cellsPerAxis, bumpSigma, minimumActiveDiameter=None): """ When a cell is activated by sensory input, this implies that the phase is within a particular small patch of the rhombus. This patch is roughly equivalent to a circle of diam...
When a cell is activated by sensory input, this implies that the phase is within a particular small patch of the rhombus. This patch is roughly equivalent to a circle of diameter (1/cellsPerAxis)(2/sqrt(3)), centered on the cell. This 2/sqrt(3) accounts for the fact that when circles are packed into hex...
Below is the the instruction that describes the task: ### Input: When a cell is activated by sensory input, this implies that the phase is within a particular small patch of the rhombus. This patch is roughly equivalent to a circle of diameter (1/cellsPerAxis)(2/sqrt(3)), centered on the cell. This 2/sq...
def sensoryCompute(self, activeMinicolumns, learn): """ @param activeMinicolumns (numpy array) List of indices of minicolumns to activate. @param learn (bool) If True, the two layers should learn this association. @return (tuple of dicts) Data for logging/tracing. """ inputParams =...
@param activeMinicolumns (numpy array) List of indices of minicolumns to activate. @param learn (bool) If True, the two layers should learn this association. @return (tuple of dicts) Data for logging/tracing.
Below is the the instruction that describes the task: ### Input: @param activeMinicolumns (numpy array) List of indices of minicolumns to activate. @param learn (bool) If True, the two layers should learn this association. @return (tuple of dicts) Data for logging/tracing. ### Response: def s...
def get_stp_mst_detail_output_cist_port_interface_name(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_stp_mst_detail = ET.Element("get_stp_mst_detail") config = get_stp_mst_detail output = ET.SubElement(get_stp_mst_detail, "output") ...
Auto Generated Code
Below is the the instruction that describes the task: ### Input: Auto Generated Code ### Response: def get_stp_mst_detail_output_cist_port_interface_name(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") get_stp_mst_detail = ET.Element("get_stp_mst_detail") ...
def check_validity_of_long_form_args(model_obj, wide_weights, rows_to_obs): """ Ensures the args to `create_long_form_weights` have expected properties. """ # Ensure model_obj has the necessary method for create_long_form_weights ensure_model_obj_has_mapping_constructor(model_obj) # Ensure wide_...
Ensures the args to `create_long_form_weights` have expected properties.
Below is the the instruction that describes the task: ### Input: Ensures the args to `create_long_form_weights` have expected properties. ### Response: def check_validity_of_long_form_args(model_obj, wide_weights, rows_to_obs): """ Ensures the args to `create_long_form_weights` have expected properties. ...
def quote_header_value(value, extra_chars='', allow_token=True): """Quote a header value if necessary. :param value: the value to quote. :param extra_chars: a list of extra characters to skip quoting. :param allow_token: if this is enabled token values are returned unchanged. """ value ...
Quote a header value if necessary. :param value: the value to quote. :param extra_chars: a list of extra characters to skip quoting. :param allow_token: if this is enabled token values are returned unchanged.
Below is the the instruction that describes the task: ### Input: Quote a header value if necessary. :param value: the value to quote. :param extra_chars: a list of extra characters to skip quoting. :param allow_token: if this is enabled token values are returned unchanged. ### Response: def qu...
def workload_state_compare(current_workload_state, workload_state): """ Return highest priority of two states""" hierarchy = {'unknown': -1, 'active': 0, 'maintenance': 1, 'waiting': 2, 'blocked': 3, } if hierarchy.get(wor...
Return highest priority of two states
Below is the the instruction that describes the task: ### Input: Return highest priority of two states ### Response: def workload_state_compare(current_workload_state, workload_state): """ Return highest priority of two states""" hierarchy = {'unknown': -1, 'active': 0, 'm...
def decode_response(client_message, to_object=None): """ Decode response from client message""" parameters = dict(base=None, increment=None, batch_size=None) parameters['base'] = client_message.read_long() parameters['increment'] = client_message.read_long() parameters['batch_size'] = client_message...
Decode response from client message
Below is the the instruction that describes the task: ### Input: Decode response from client message ### Response: def decode_response(client_message, to_object=None): """ Decode response from client message""" parameters = dict(base=None, increment=None, batch_size=None) parameters['base'] = client_me...
def unlisten_to_node(self, id_): """Stop listening to a job Parameters ---------- id_ : str An ID to remove Returns -------- str or None The ID removed or None if the ID was not removed """ id_pubsub = _pubsub_key(id_) ...
Stop listening to a job Parameters ---------- id_ : str An ID to remove Returns -------- str or None The ID removed or None if the ID was not removed
Below is the the instruction that describes the task: ### Input: Stop listening to a job Parameters ---------- id_ : str An ID to remove Returns -------- str or None The ID removed or None if the ID was not removed ### Response: def unlisten...
def should_display_warnings_for(to_type): """ Central method where we control whether warnings should be displayed """ if not hasattr(to_type, '__module__'): return True elif to_type.__module__ in {'builtins'} or to_type.__module__.startswith('parsyfiles') \ or to_type.__name__ in {'Data...
Central method where we control whether warnings should be displayed
Below is the the instruction that describes the task: ### Input: Central method where we control whether warnings should be displayed ### Response: def should_display_warnings_for(to_type): """ Central method where we control whether warnings should be displayed """ if not hasattr(to_type, '__module__'): ...
def _margtimephase_loglr(self, mf_snr, opt_snr): """Returns the log likelihood ratio marginalized over time and phase. """ return special.logsumexp(numpy.log(special.i0(mf_snr)), b=self._deltat) - 0.5*opt_snr
Returns the log likelihood ratio marginalized over time and phase.
Below is the the instruction that describes the task: ### Input: Returns the log likelihood ratio marginalized over time and phase. ### Response: def _margtimephase_loglr(self, mf_snr, opt_snr): """Returns the log likelihood ratio marginalized over time and phase. """ return special.logsume...
def from_maildir(self, codes: str) -> FrozenSet[Flag]: """Return the set of IMAP flags that correspond to the letter codes. Args: codes: The letter codes to map. """ flags = set() for code in codes: if code == ',': break to_sy...
Return the set of IMAP flags that correspond to the letter codes. Args: codes: The letter codes to map.
Below is the the instruction that describes the task: ### Input: Return the set of IMAP flags that correspond to the letter codes. Args: codes: The letter codes to map. ### Response: def from_maildir(self, codes: str) -> FrozenSet[Flag]: """Return the set of IMAP flags that correspond ...
def safe_makedirs(path): """A safe function for creating a directory tree.""" try: os.makedirs(path) except OSError as err: if err.errno == errno.EEXIST: if not os.path.isdir(path): raise else: raise
A safe function for creating a directory tree.
Below is the the instruction that describes the task: ### Input: A safe function for creating a directory tree. ### Response: def safe_makedirs(path): """A safe function for creating a directory tree.""" try: os.makedirs(path) except OSError as err: if err.errno == errno.EEXIST: ...
def dolnp3_0(Data): """ DEPRECATED!! USE dolnp() Desciption: takes a list of dicts with the controlled vocabulary of 3_0 and calls dolnp on them after reformating for compatibility. Parameters __________ Data : nested list of dictionarys with keys dir_dec dir_inc dir_til...
DEPRECATED!! USE dolnp() Desciption: takes a list of dicts with the controlled vocabulary of 3_0 and calls dolnp on them after reformating for compatibility. Parameters __________ Data : nested list of dictionarys with keys dir_dec dir_inc dir_tilt_correction method_code...
Below is the the instruction that describes the task: ### Input: DEPRECATED!! USE dolnp() Desciption: takes a list of dicts with the controlled vocabulary of 3_0 and calls dolnp on them after reformating for compatibility. Parameters __________ Data : nested list of dictionarys with keys di...
def unsurt(surt): """ # Simple surt >>> unsurt('com,example)/') 'example.com/' # Broken surt >>> unsurt('com,example)') 'com,example)' # Long surt >>> unsurt('suffix,domain,sub,subsub,another,subdomain)/path/file/\ index.html?a=b?c=)/') 'subdomain.another.subsub.sub.domain.suff...
# Simple surt >>> unsurt('com,example)/') 'example.com/' # Broken surt >>> unsurt('com,example)') 'com,example)' # Long surt >>> unsurt('suffix,domain,sub,subsub,another,subdomain)/path/file/\ index.html?a=b?c=)/') 'subdomain.another.subsub.sub.domain.suffix/path/file/index.html?a=b?c=...
Below is the the instruction that describes the task: ### Input: # Simple surt >>> unsurt('com,example)/') 'example.com/' # Broken surt >>> unsurt('com,example)') 'com,example)' # Long surt >>> unsurt('suffix,domain,sub,subsub,another,subdomain)/path/file/\ index.html?a=b?c=)/') 's...
def save(self, *args): """ Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function. """ with open(self.file_root + '.pkl', "wb") as f: ...
Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function.
Below is the the instruction that describes the task: ### Input: Save cache to file using pickle. Parameters ---------- *args: All but the last argument are inputs to the cached function. The last is the actual value of the function. ### Response: def save(self, *ar...
def update_handler(feeds): '''Update all cross-referencing filters results for feeds and others, related to them. Intended to be called from non-Feed update hooks (like new Post saving).''' # Check if this call is a result of actions initiated from # one of the hooks in a higher frame (resulting in recursion)...
Update all cross-referencing filters results for feeds and others, related to them. Intended to be called from non-Feed update hooks (like new Post saving).
Below is the the instruction that describes the task: ### Input: Update all cross-referencing filters results for feeds and others, related to them. Intended to be called from non-Feed update hooks (like new Post saving). ### Response: def update_handler(feeds): '''Update all cross-referencing filters results...
def load_edbfile(file=None): """Load the targets from a file""" import ephem,string,math if file is None: import tkFileDialog try: file=tkFileDialog.askopenfilename() except: return if file is None or file == '': return f=open(file) lines=f.readl...
Load the targets from a file
Below is the the instruction that describes the task: ### Input: Load the targets from a file ### Response: def load_edbfile(file=None): """Load the targets from a file""" import ephem,string,math if file is None: import tkFileDialog try: file=tkFileDialog.askopenfilename() ...
def _api_post(self, url, **kwargs): """ A convenience wrapper for _post. Adds headers, auth and base url by default """ kwargs['url'] = self.url + url kwargs['auth'] = self.auth headers = deepcopy(self.headers) headers.update(kwargs.get('headers', {})) ...
A convenience wrapper for _post. Adds headers, auth and base url by default
Below is the the instruction that describes the task: ### Input: A convenience wrapper for _post. Adds headers, auth and base url by default ### Response: def _api_post(self, url, **kwargs): """ A convenience wrapper for _post. Adds headers, auth and base url by default """ ...
def update_batch_count(instance, **kwargs): """Sample post-save handler to update the sample's batch count. Batches are unpublished by default (to prevent publishing empty batches). If the `AUTO_PUBLISH_BATCH` setting is true, the batch will be published automatically when at least one published sample...
Sample post-save handler to update the sample's batch count. Batches are unpublished by default (to prevent publishing empty batches). If the `AUTO_PUBLISH_BATCH` setting is true, the batch will be published automatically when at least one published sample is in the batch.
Below is the the instruction that describes the task: ### Input: Sample post-save handler to update the sample's batch count. Batches are unpublished by default (to prevent publishing empty batches). If the `AUTO_PUBLISH_BATCH` setting is true, the batch will be published automatically when at least on...
def read_settings(self): """Set the dock state from QSettings. Do this on init and after changing options in the options dialog. """ extent = setting('user_extent', None, str) if extent: extent = QgsGeometry.fromWkt(extent) if not extent.isGeosValid(): ...
Set the dock state from QSettings. Do this on init and after changing options in the options dialog.
Below is the the instruction that describes the task: ### Input: Set the dock state from QSettings. Do this on init and after changing options in the options dialog. ### Response: def read_settings(self): """Set the dock state from QSettings. Do this on init and after changing options in ...
def assign(self, bugids, user): """ Assign a bug to a user. param bugid: ``int``, bug ID number. param user: ``str``, the login name of the user to whom the bug is assigned returns: deferred that when fired returns True if the change succeeded, ...
Assign a bug to a user. param bugid: ``int``, bug ID number. param user: ``str``, the login name of the user to whom the bug is assigned returns: deferred that when fired returns True if the change succeeded, False if the change was unnecessary (because the ...
Below is the the instruction that describes the task: ### Input: Assign a bug to a user. param bugid: ``int``, bug ID number. param user: ``str``, the login name of the user to whom the bug is assigned returns: deferred that when fired returns True if the change succeede...
def start(name=None, user=None, group=None, chroot=None, caps=None, no_caps=False, pidfile=None, enable_core=False, fd_limit=None, verbose=False, debug=False, trace=False, yydebug=False, per...
Ensures, that syslog-ng is started via the given parameters. This function is intended to be used from the state module. Users shouldn't use this function, if the service module is available on their system. If :mod:`syslog_ng.set_config_file <salt.modules.syslog_ng.set_binary_path>`, is called before,...
Below is the the instruction that describes the task: ### Input: Ensures, that syslog-ng is started via the given parameters. This function is intended to be used from the state module. Users shouldn't use this function, if the service module is available on their system. If :mod:`syslog_ng.set_config_...
def annotation(self, type, set=None): """Will return a **single** annotation (even if there are multiple). Raises a ``NoSuchAnnotation`` exception if none was found""" l = self.count(type,set,True,default_ignore_annotations) if len(l) >= 1: return l[0] else: raise...
Will return a **single** annotation (even if there are multiple). Raises a ``NoSuchAnnotation`` exception if none was found
Below is the the instruction that describes the task: ### Input: Will return a **single** annotation (even if there are multiple). Raises a ``NoSuchAnnotation`` exception if none was found ### Response: def annotation(self, type, set=None): """Will return a **single** annotation (even if there are multiple...
def createCollection(self, className = 'Collection', **colProperties) : """Creates a collection and returns it. ClassName the name of a class inheriting from Collection or Egdes, it can also be set to 'Collection' or 'Edges' in order to create untyped collections of documents or edges. Use colPr...
Creates a collection and returns it. ClassName the name of a class inheriting from Collection or Egdes, it can also be set to 'Collection' or 'Edges' in order to create untyped collections of documents or edges. Use colProperties to put things such as 'waitForSync = True' (see ArangoDB's doc for...
Below is the the instruction that describes the task: ### Input: Creates a collection and returns it. ClassName the name of a class inheriting from Collection or Egdes, it can also be set to 'Collection' or 'Edges' in order to create untyped collections of documents or edges. Use colProperties to pu...
def visualRectRC(self, row, column): """The rectangle for the bounds of the item at *row*, *column* :param row: row of the item :type row: int :param column: column of the item :type column: int :returns: :qtdoc:`QRect` -- rectangle of the borders of the item """...
The rectangle for the bounds of the item at *row*, *column* :param row: row of the item :type row: int :param column: column of the item :type column: int :returns: :qtdoc:`QRect` -- rectangle of the borders of the item
Below is the the instruction that describes the task: ### Input: The rectangle for the bounds of the item at *row*, *column* :param row: row of the item :type row: int :param column: column of the item :type column: int :returns: :qtdoc:`QRect` -- rectangle of the borders of...
def triangle(self, verts=True, lines=True): """ Converts actor polygons and strips to triangles. """ tf = vtk.vtkTriangleFilter() tf.SetPassLines(lines) tf.SetPassVerts(verts) tf.SetInputData(self.poly) tf.Update() return self.updateMesh(tf.GetOutp...
Converts actor polygons and strips to triangles.
Below is the the instruction that describes the task: ### Input: Converts actor polygons and strips to triangles. ### Response: def triangle(self, verts=True, lines=True): """ Converts actor polygons and strips to triangles. """ tf = vtk.vtkTriangleFilter() tf.SetPassLines(l...
def makeOuputDir(outputDir, force): """ Create or check for an output directory. @param outputDir: A C{str} output directory name, or C{None}. @param force: If C{True}, allow overwriting of pre-existing files. @return: The C{str} output directory name. """ if outputDir: if exists(ou...
Create or check for an output directory. @param outputDir: A C{str} output directory name, or C{None}. @param force: If C{True}, allow overwriting of pre-existing files. @return: The C{str} output directory name.
Below is the the instruction that describes the task: ### Input: Create or check for an output directory. @param outputDir: A C{str} output directory name, or C{None}. @param force: If C{True}, allow overwriting of pre-existing files. @return: The C{str} output directory name. ### Response: def makeOu...
def imshow( self, data=None, save=False, ax=None, interpolation="none", extra_title=None, show_resonances="some", set_extent=True, equalized=False, rmin=None, rmax=None, savepath=".", **kwargs, ): """Powe...
Powerful default display. show_resonances can be True, a list, 'all', or 'some'
Below is the the instruction that describes the task: ### Input: Powerful default display. show_resonances can be True, a list, 'all', or 'some' ### Response: def imshow( self, data=None, save=False, ax=None, interpolation="none", extra_title=None, s...
def refresh(name): ''' Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification. The timestamp of the last reconfiguration event (in seconds since epoch) is published in the proxy.node.config.reconfigure_time...
Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification. The timestamp of the last reconfiguration event (in seconds since epoch) is published in the proxy.node.config.reconfigure_time metric. .. code-block:: y...
Below is the the instruction that describes the task: ### Input: Initiate a Traffic Server configuration file reread. Use this command to update the running configuration after any configuration file modification. The timestamp of the last reconfiguration event (in seconds since epoch) is published in ...
def min_pulse_sp(self): """ Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the miniumum (counter-clockwise) position_sp. Default value is 600. Valid values are 300 to 700. You must write to the position_sp attribute for changes to this ...
Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the miniumum (counter-clockwise) position_sp. Default value is 600. Valid values are 300 to 700. You must write to the position_sp attribute for changes to this attribute to take effect.
Below is the the instruction that describes the task: ### Input: Used to set the pulse size in milliseconds for the signal that tells the servo to drive to the miniumum (counter-clockwise) position_sp. Default value is 600. Valid values are 300 to 700. You must write to the position_sp attri...
def _get_bufsize_linux(iface): ''' Return network interface buffer information using ethtool ''' ret = {'result': False} cmd = '/sbin/ethtool -g {0}'.format(iface) out = __salt__['cmd.run'](cmd) pat = re.compile(r'^(.+):\s+(\d+)$') suffix = 'max-' for line in out.splitlines(): ...
Return network interface buffer information using ethtool
Below is the the instruction that describes the task: ### Input: Return network interface buffer information using ethtool ### Response: def _get_bufsize_linux(iface): ''' Return network interface buffer information using ethtool ''' ret = {'result': False} cmd = '/sbin/ethtool -g {0}'.format(...
def format_text_as_docstr(text): r""" CommandLine: python ~/local/vim/rc/pyvim_funcs.py --test-format_text_as_docstr Example: >>> # DISABLE_DOCTEST >>> from pyvim_funcs import * # NOQA >>> text = testdata_text() >>> formated_text = format_text_as_docstr(text) ...
r""" CommandLine: python ~/local/vim/rc/pyvim_funcs.py --test-format_text_as_docstr Example: >>> # DISABLE_DOCTEST >>> from pyvim_funcs import * # NOQA >>> text = testdata_text() >>> formated_text = format_text_as_docstr(text) >>> result = ('formated_text = \...
Below is the the instruction that describes the task: ### Input: r""" CommandLine: python ~/local/vim/rc/pyvim_funcs.py --test-format_text_as_docstr Example: >>> # DISABLE_DOCTEST >>> from pyvim_funcs import * # NOQA >>> text = testdata_text() >>> formated_text =...
def calc_abort(request, calc_id): """ Abort the given calculation, it is it running """ job = logs.dbcmd('get_job', calc_id) if job is None: message = {'error': 'Unknown job %s' % calc_id} return HttpResponse(content=json.dumps(message), content_type=JSON) if job.status not in (...
Abort the given calculation, it is it running
Below is the the instruction that describes the task: ### Input: Abort the given calculation, it is it running ### Response: def calc_abort(request, calc_id): """ Abort the given calculation, it is it running """ job = logs.dbcmd('get_job', calc_id) if job is None: message = {'error': '...
def select_action(self, nb_actions, probs): """Return the selected action # Arguments probs (np.ndarray) : Probabilty for each action # Returns action """ action = np.random.choice(range(nb_actions), p=probs) return action
Return the selected action # Arguments probs (np.ndarray) : Probabilty for each action # Returns action
Below is the the instruction that describes the task: ### Input: Return the selected action # Arguments probs (np.ndarray) : Probabilty for each action # Returns action ### Response: def select_action(self, nb_actions, probs): """Return the selected action ...
def run(self): """Render and display Python package documentation. """ os.environ['JARN_RUN'] = '1' self.python.check_valid_python() args = self.parse_options(self.args) if args: arg = args[0] else: arg = os.curdir if arg: ...
Render and display Python package documentation.
Below is the the instruction that describes the task: ### Input: Render and display Python package documentation. ### Response: def run(self): """Render and display Python package documentation. """ os.environ['JARN_RUN'] = '1' self.python.check_valid_python() args = self.p...
def send_article_message(self, user_id, articles=None, media_id=None): """ 发送图文消息 详情请参考 http://mp.weixin.qq.com/wiki/7/12a5a320ae96fecdf0e15cb06123de9f.html :param user_id: 用户 ID, 就是你收到的 WechatMessage 的 source :param articles: list 对象, 每个元素为一个 dict 对象, key 包含 `title`, `descriptio...
发送图文消息 详情请参考 http://mp.weixin.qq.com/wiki/7/12a5a320ae96fecdf0e15cb06123de9f.html :param user_id: 用户 ID, 就是你收到的 WechatMessage 的 source :param articles: list 对象, 每个元素为一个 dict 对象, key 包含 `title`, `description`, `picurl`, `url` :param media_id: 待发送的图文 Media ID :return: 返回的 JSON 数据包
Below is the the instruction that describes the task: ### Input: 发送图文消息 详情请参考 http://mp.weixin.qq.com/wiki/7/12a5a320ae96fecdf0e15cb06123de9f.html :param user_id: 用户 ID, 就是你收到的 WechatMessage 的 source :param articles: list 对象, 每个元素为一个 dict 对象, key 包含 `title`, `description`, `picurl`, `url` ...
def use_plenary_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view""" self._object_views['sequence_rule'] = PLENARY # self._get_provider_session('sequence_rule_lookup_session') # To make sure the session is tracked for session i...
Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view
Below is the the instruction that describes the task: ### Input: Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view ### Response: def use_plenary_sequence_rule_view(self): """Pass through to provider SequenceRuleLookupSession.use_plenary_sequence_rule_view""" self._ob...
def sync(self, json_obj=None): """ synchronize this transport with the Ariane server transport :return: """ LOGGER.debug("Transport.sync") if json_obj is None: params = None if self.id is not None: params = SessionService.complete_t...
synchronize this transport with the Ariane server transport :return:
Below is the the instruction that describes the task: ### Input: synchronize this transport with the Ariane server transport :return: ### Response: def sync(self, json_obj=None): """ synchronize this transport with the Ariane server transport :return: """ LOGGER.debu...
def delete_guest(userid): """ Destroy a virtual machine. Input parameters: :userid: USERID of the guest, last 8 if length > 8 """ # Check if the guest exists. guest_list_info = client.send_request('guest_list') # the string 'userid' need to be coded as 'u'userid' in case of py2 i...
Destroy a virtual machine. Input parameters: :userid: USERID of the guest, last 8 if length > 8
Below is the the instruction that describes the task: ### Input: Destroy a virtual machine. Input parameters: :userid: USERID of the guest, last 8 if length > 8 ### Response: def delete_guest(userid): """ Destroy a virtual machine. Input parameters: :userid: USERID of th...
def shutdown(self, restart=False): """Request an immediate kernel shutdown. Upon receipt of the (empty) reply, client code can safely assume that the kernel has shut down and it's safe to forcefully terminate it if it's still alive. The kernel will send the reply via a function...
Request an immediate kernel shutdown. Upon receipt of the (empty) reply, client code can safely assume that the kernel has shut down and it's safe to forcefully terminate it if it's still alive. The kernel will send the reply via a function registered with Python's atexit modul...
Below is the the instruction that describes the task: ### Input: Request an immediate kernel shutdown. Upon receipt of the (empty) reply, client code can safely assume that the kernel has shut down and it's safe to forcefully terminate it if it's still alive. The kernel will send t...
def fetch_protein_list(self, taxon_id): """ Fetch a list of proteins for a species in biomart :param taxid: :return: list """ protein_list = list() # col = self.columns['ensembl_biomart'] col = ['ensembl_peptide_id', ] params = urllib.parse.urlenc...
Fetch a list of proteins for a species in biomart :param taxid: :return: list
Below is the the instruction that describes the task: ### Input: Fetch a list of proteins for a species in biomart :param taxid: :return: list ### Response: def fetch_protein_list(self, taxon_id): """ Fetch a list of proteins for a species in biomart :param taxid: :r...
def unfold_lines(string): '''Join lines that are wrapped. Any line that starts with a space or tab is joined to the previous line. ''' assert isinstance(string, str), 'Expect str. Got {}'.format(type(string)) lines = string.splitlines() line_buffer = io.StringIO() for line_number in ra...
Join lines that are wrapped. Any line that starts with a space or tab is joined to the previous line.
Below is the the instruction that describes the task: ### Input: Join lines that are wrapped. Any line that starts with a space or tab is joined to the previous line. ### Response: def unfold_lines(string): '''Join lines that are wrapped. Any line that starts with a space or tab is joined to the ...
def collect_loaded_packages() -> List[Tuple[str, str]]: """ Return the currently loaded package names and their versions. """ dists = get_installed_distributions() get_dist_files = DistFilesFinder() file_table = {} for dist in dists: for file in get_dist_files(dist): file...
Return the currently loaded package names and their versions.
Below is the the instruction that describes the task: ### Input: Return the currently loaded package names and their versions. ### Response: def collect_loaded_packages() -> List[Tuple[str, str]]: """ Return the currently loaded package names and their versions. """ dists = get_installed_distributi...
def load_code_info(phases_or_groups): """Recursively load code info for a PhaseGroup or list of phases or groups.""" if isinstance(phases_or_groups, PhaseGroup): return phases_or_groups.load_code_info() ret = [] for phase in phases_or_groups: if isinstance(phase, PhaseGroup): ret.append(phase.load...
Recursively load code info for a PhaseGroup or list of phases or groups.
Below is the the instruction that describes the task: ### Input: Recursively load code info for a PhaseGroup or list of phases or groups. ### Response: def load_code_info(phases_or_groups): """Recursively load code info for a PhaseGroup or list of phases or groups.""" if isinstance(phases_or_groups, PhaseGroup...
def compute_trip_stats( feed: "Feed", route_ids: Optional[List[str]] = None, *, compute_dist_from_shapes: bool = False, ) -> DataFrame: """ Return a DataFrame with the following columns: - ``'trip_id'`` - ``'route_id'`` - ``'route_short_name'`` - ``'route_type'`` - ``'direct...
Return a DataFrame with the following columns: - ``'trip_id'`` - ``'route_id'`` - ``'route_short_name'`` - ``'route_type'`` - ``'direction_id'``: NaN if missing from feed - ``'shape_id'``: NaN if missing from feed - ``'num_stops'``: number of stops on trip - ``'start_time'``: first depa...
Below is the the instruction that describes the task: ### Input: Return a DataFrame with the following columns: - ``'trip_id'`` - ``'route_id'`` - ``'route_short_name'`` - ``'route_type'`` - ``'direction_id'``: NaN if missing from feed - ``'shape_id'``: NaN if missing from feed - ``'num...
def date_time_between_dates( self, datetime_start=None, datetime_end=None, tzinfo=None): """ Takes two DateTime objects and returns a random datetime between the two given datetimes. Accepts DateTime objects. :param datetime_start:...
Takes two DateTime objects and returns a random datetime between the two given datetimes. Accepts DateTime objects. :param datetime_start: DateTime :param datetime_end: DateTime :param tzinfo: timezone, instance of datetime.tzinfo subclass :example DateTime('1999-02-02 1...
Below is the the instruction that describes the task: ### Input: Takes two DateTime objects and returns a random datetime between the two given datetimes. Accepts DateTime objects. :param datetime_start: DateTime :param datetime_end: DateTime :param tzinfo: timezone, instanc...
def setVisibleColumns(self, visible): """ Sets the list of visible columns for this widget. This method will take any column in this tree's list NOT found within the inputed column list and hide them. :param columns | [<str>, ..] """ colname...
Sets the list of visible columns for this widget. This method will take any column in this tree's list NOT found within the inputed column list and hide them. :param columns | [<str>, ..]
Below is the the instruction that describes the task: ### Input: Sets the list of visible columns for this widget. This method will take any column in this tree's list NOT found within the inputed column list and hide them. :param columns | [<str>, ..] ### Response: def s...
def _integration(data, sample_rate): """ Moving window integration. N is the number of samples in the width of the integration window ---------- Parameters ---------- data : ndarray Samples of the signal where a moving window integration will be applied. sample_rate : int ...
Moving window integration. N is the number of samples in the width of the integration window ---------- Parameters ---------- data : ndarray Samples of the signal where a moving window integration will be applied. sample_rate : int Sampling rate at which the acquisition took pla...
Below is the the instruction that describes the task: ### Input: Moving window integration. N is the number of samples in the width of the integration window ---------- Parameters ---------- data : ndarray Samples of the signal where a moving window integration will be applied. samp...
def list_storage_class(self, **kwargs): """ list or watch objects of kind StorageClass This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_storage_class(async_req=True) >>> result ...
list or watch objects of kind StorageClass This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_storage_class(async_req=True) >>> result = thread.get() :param async_req bool :param...
Below is the the instruction that describes the task: ### Input: list or watch objects of kind StorageClass This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_storage_class(async_req=True) >>...
def register( cls, plugin ): """ Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin> """ if ( not plugin ): return if ( cls._plugins is None ): cls._plugins = {} ...
Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin>
Below is the the instruction that describes the task: ### Input: Registers a particular plugin to the global system at the given name. :param plugin | <XWizardPlugin> ### Response: def register( cls, plugin ): """ Registers a particular plugin to the global system at the give...
def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Load Logical Partition (requires classic mode).""" assert wait_for_completion is True # async not supported yet lpar_oid = uri_parms[0] lpar_uri = '/api/logical-partitions/' + lp...
Operation: Load Logical Partition (requires classic mode).
Below is the the instruction that describes the task: ### Input: Operation: Load Logical Partition (requires classic mode). ### Response: def post(method, hmc, uri, uri_parms, body, logon_required, wait_for_completion): """Operation: Load Logical Partition (requires classic mode).""" a...
def load_clients_file(filename, configuration_class=ClientConfiguration): """ Loads client configurations from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param configuration_class: Class of the configuration object to create. :type configuration_class: class ...
Loads client configurations from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param configuration_class: Class of the configuration object to create. :type configuration_class: class :return: A dictionary of client configuration objects. :rtype: dict[unicode | st...
Below is the the instruction that describes the task: ### Input: Loads client configurations from a YAML file. :param filename: YAML file name. :type filename: unicode | str :param configuration_class: Class of the configuration object to create. :type configuration_class: class :return: A dict...
def search(self, **kwargs): """Searches for files/folders Args: \*\*kwargs (dict): A dictionary containing necessary parameters (check https://developers.box.com/docs/#search for list of parameters) Returns: dict. ...
Searches for files/folders Args: \*\*kwargs (dict): A dictionary containing necessary parameters (check https://developers.box.com/docs/#search for list of parameters) Returns: dict. Response from Box. Raises: ...
Below is the the instruction that describes the task: ### Input: Searches for files/folders Args: \*\*kwargs (dict): A dictionary containing necessary parameters (check https://developers.box.com/docs/#search for list of parameters) ...
def TerminalSize(): """Returns terminal length and width as a tuple.""" try: with open(os.ctermid(), 'r') as tty_instance: length_width = struct.unpack( 'hh', fcntl.ioctl(tty_instance.fileno(), termios.TIOCGWINSZ, '1234')) except (IOError, OSError): try: length_width = (int(os.enviro...
Returns terminal length and width as a tuple.
Below is the the instruction that describes the task: ### Input: Returns terminal length and width as a tuple. ### Response: def TerminalSize(): """Returns terminal length and width as a tuple.""" try: with open(os.ctermid(), 'r') as tty_instance: length_width = struct.unpack( 'hh', fcntl.i...
def plot(self, stachans='all', size=(10, 7), show=True): """ Plot the output basis vectors for the detector at the given dimension. Corresponds to the first n horizontal vectors of the V matrix. :type stachans: list :param stachans: list of tuples of station, channel pairs to p...
Plot the output basis vectors for the detector at the given dimension. Corresponds to the first n horizontal vectors of the V matrix. :type stachans: list :param stachans: list of tuples of station, channel pairs to plot. :type stachans: list :param stachans: List of tuples of ...
Below is the the instruction that describes the task: ### Input: Plot the output basis vectors for the detector at the given dimension. Corresponds to the first n horizontal vectors of the V matrix. :type stachans: list :param stachans: list of tuples of station, channel pairs to plot. ...
def _do_shell(self, line): """Send a command to the Unix shell.\n==> Usage: shell ls ~""" if not line: return sp = Popen(line, shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE, close_fds=no...
Send a command to the Unix shell.\n==> Usage: shell ls ~
Below is the the instruction that describes the task: ### Input: Send a command to the Unix shell.\n==> Usage: shell ls ~ ### Response: def _do_shell(self, line): """Send a command to the Unix shell.\n==> Usage: shell ls ~""" if not line: return sp = Popen(line, ...
def clean_form_template(self): """ Check if template exists """ form_template = self.cleaned_data.get('form_template', '') if form_template: try: get_template(form_template) except TemplateDoesNotExist: msg = _('Selected Form Template does ...
Check if template exists
Below is the the instruction that describes the task: ### Input: Check if template exists ### Response: def clean_form_template(self): """ Check if template exists """ form_template = self.cleaned_data.get('form_template', '') if form_template: try: get_template(...
def perform_create(self, serializer): """Create a resource.""" with transaction.atomic(): instance = serializer.save() # Assign all permissions to the object contributor. assign_contributor_permissions(instance)
Create a resource.
Below is the the instruction that describes the task: ### Input: Create a resource. ### Response: def perform_create(self, serializer): """Create a resource.""" with transaction.atomic(): instance = serializer.save() # Assign all permissions to the object contributor. ...
def iscsi_settings(self): """Property to provide reference to iSCSI settings instance It is calculated once when the first time it is queried. On refresh, this property gets reset. """ return ISCSISettings( self._conn, utils.get_subresource_path_by( s...
Property to provide reference to iSCSI settings instance It is calculated once when the first time it is queried. On refresh, this property gets reset.
Below is the the instruction that describes the task: ### Input: Property to provide reference to iSCSI settings instance It is calculated once when the first time it is queried. On refresh, this property gets reset. ### Response: def iscsi_settings(self): """Property to provide reference ...
def getEmailTemplate(request): ''' This function handles the Ajax call made when a user wants a specific email template ''' if request.method != 'POST': return HttpResponse(_('Error, no POST data.')) if not hasattr(request,'user'): return HttpResponse(_('Error, not authentic...
This function handles the Ajax call made when a user wants a specific email template
Below is the the instruction that describes the task: ### Input: This function handles the Ajax call made when a user wants a specific email template ### Response: def getEmailTemplate(request): ''' This function handles the Ajax call made when a user wants a specific email template ''' if requ...
def get_creator(self, lang=None): """ Get the DC Creator literal value :param lang: Language to retrieve :return: Creator string representation :rtype: Literal """ return self.metadata.get_single(key=DC.creator, lang=lang)
Get the DC Creator literal value :param lang: Language to retrieve :return: Creator string representation :rtype: Literal
Below is the the instruction that describes the task: ### Input: Get the DC Creator literal value :param lang: Language to retrieve :return: Creator string representation :rtype: Literal ### Response: def get_creator(self, lang=None): """ Get the DC Creator literal value :...