code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def delete_model_snapshot(self, job_id, snapshot_id, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete """ for param in ...
`<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete
Below is the the instruction that describes the task: ### Input: `<http://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html>`_ :arg job_id: The ID of the job to fetch :arg snapshot_id: The ID of the snapshot to delete ### Response: def delete_model_snapshot(self, job_...
def _static(self, target, value): """PHP's "static" """ return 'static ' + self.__p(ast.Assign(targets=[target],value=value))
PHP's "static"
Below is the the instruction that describes the task: ### Input: PHP's "static" ### Response: def _static(self, target, value): """PHP's "static" """ return 'static ' + self.__p(ast.Assign(targets=[target],value=value))
def parse_args(arguments, wrapper_kwargs={}): """ MMI Runner """ # make a socket that replies to message with the grid # if we are running mpi we want to know the rank args = {} positional = [ 'engine', 'configfile', ] for key in positional: args[key] = argum...
MMI Runner
Below is the the instruction that describes the task: ### Input: MMI Runner ### Response: def parse_args(arguments, wrapper_kwargs={}): """ MMI Runner """ # make a socket that replies to message with the grid # if we are running mpi we want to know the rank args = {} positional = [ ...
def check_file_exists(self, filename, resolve='exception', force=None): """If a file exists then continue with the action specified in ``resolve``. ``resolve`` must be one of "ignore" always return ``False`` "indicate" return ``True`` if it exists "w...
If a file exists then continue with the action specified in ``resolve``. ``resolve`` must be one of "ignore" always return ``False`` "indicate" return ``True`` if it exists "warn" indicate and issue a :exc:`UserWarning` "exception" ...
Below is the the instruction that describes the task: ### Input: If a file exists then continue with the action specified in ``resolve``. ``resolve`` must be one of "ignore" always return ``False`` "indicate" return ``True`` if it exists "warn" ...
def _process_trait_mappings(self, raw, limit=None): """ This method mapps traits from/to ... Triples created: :param limit: :return: """ if self.test_mode: graph = self.testgraph else: graph = self.graph line_counter = 0 ...
This method mapps traits from/to ... Triples created: :param limit: :return:
Below is the the instruction that describes the task: ### Input: This method mapps traits from/to ... Triples created: :param limit: :return: ### Response: def _process_trait_mappings(self, raw, limit=None): """ This method mapps traits from/to ... Triples created...
async def _sasl_end(self): """ Finalize SASL authentication. """ if self._sasl_timer: self._sasl_timer.cancel() self._sasl_timer = None await self._capability_negotiated('sasl')
Finalize SASL authentication.
Below is the the instruction that describes the task: ### Input: Finalize SASL authentication. ### Response: async def _sasl_end(self): """ Finalize SASL authentication. """ if self._sasl_timer: self._sasl_timer.cancel() self._sasl_timer = None await self._capability...
def _fire_master(self, data=None, tag=None, events=None, pretag=None, timeout=60, sync=True, timeout_handler=None): ''' Fire an event on the master, or drop message if unable to send. ''' load = {'id': self.opts['id'], 'cmd': '_minion_event', 'pretag': pre...
Fire an event on the master, or drop message if unable to send.
Below is the the instruction that describes the task: ### Input: Fire an event on the master, or drop message if unable to send. ### Response: def _fire_master(self, data=None, tag=None, events=None, pretag=None, timeout=60, sync=True, timeout_handler=None): ''' Fire an event on the master, or drop...
def clipandmerge_general_stats_table(self): """ Take the parsed stats from the ClipAndMerge report and add it to the basic stats table at the top of the report """ headers = OrderedDict() headers['percentage'] = { 'title': '% Merged', 'description': 'Percentage o...
Take the parsed stats from the ClipAndMerge report and add it to the basic stats table at the top of the report
Below is the the instruction that describes the task: ### Input: Take the parsed stats from the ClipAndMerge report and add it to the basic stats table at the top of the report ### Response: def clipandmerge_general_stats_table(self): """ Take the parsed stats from the ClipAndMerge report and add i...
def procesa_tareas_paralelo(lista_tareas, dict_data, func_process, titulo=None, usar_multithread=True, max_threads=100, verbose=True): """ Procesa las tareas diarias en paralelo, limitando a un MAX de nº de threads. Especialmente útil para realizar requests simultáneos a un servi...
Procesa las tareas diarias en paralelo, limitando a un MAX de nº de threads. Especialmente útil para realizar requests simultáneos a un servidor web concreto. :param lista_tareas: Recibe una lista de tareas únicas (key_tarea) a realizar :param dict_data: Diccionario de la forma '{key_tarea : variabl...
Below is the the instruction that describes the task: ### Input: Procesa las tareas diarias en paralelo, limitando a un MAX de nº de threads. Especialmente útil para realizar requests simultáneos a un servidor web concreto. :param lista_tareas: Recibe una lista de tareas únicas (key_tarea) a realizar ...
def predict(self, X): """ Predict class of X. The predicted class for each sample in X is returned. Parameters ---------- X : array-like of shape = [n_samples, n_features] The input samples. Returns ------- y : array of shape = [n_samples] ...
Predict class of X. The predicted class for each sample in X is returned. Parameters ---------- X : array-like of shape = [n_samples, n_features] The input samples. Returns ------- y : array of shape = [n_samples] The predicted classes,
Below is the the instruction that describes the task: ### Input: Predict class of X. The predicted class for each sample in X is returned. Parameters ---------- X : array-like of shape = [n_samples, n_features] The input samples. Returns ------- ...
def current_extended(self): """ Returns a ``list`` of ``dictionaries`` of the most recent AP rankings. The list is ordered in terms of the ranking so the #1 team will be in the first element and the #25 team will be the last element. Each dictionary has the following structure:: ...
Returns a ``list`` of ``dictionaries`` of the most recent AP rankings. The list is ordered in terms of the ranking so the #1 team will be in the first element and the #25 team will be the last element. Each dictionary has the following structure:: { 'abbreviation': T...
Below is the the instruction that describes the task: ### Input: Returns a ``list`` of ``dictionaries`` of the most recent AP rankings. The list is ordered in terms of the ranking so the #1 team will be in the first element and the #25 team will be the last element. Each dictionary has the f...
def Add(self, rdf_value, mutation_pool=None): """Adds an rdf value to the queue. Adds an rdf value to the queue. Does not require that the queue be locked. Args: rdf_value: The rdf value to add to the queue. mutation_pool: A MutationPool object to write to. Raises: ValueError: rdf_...
Adds an rdf value to the queue. Adds an rdf value to the queue. Does not require that the queue be locked. Args: rdf_value: The rdf value to add to the queue. mutation_pool: A MutationPool object to write to. Raises: ValueError: rdf_value has unexpected type.
Below is the the instruction that describes the task: ### Input: Adds an rdf value to the queue. Adds an rdf value to the queue. Does not require that the queue be locked. Args: rdf_value: The rdf value to add to the queue. mutation_pool: A MutationPool object to write to. Raises: ...
def get_dists_to_ignore(installed): """ Returns a collection of package names to ignore when performing pip-sync, based on the currently installed environment. For example, when pip-tools is installed in the local environment, it should be ignored, including all of its dependencies (e.g. click). W...
Returns a collection of package names to ignore when performing pip-sync, based on the currently installed environment. For example, when pip-tools is installed in the local environment, it should be ignored, including all of its dependencies (e.g. click). When pip-tools is not installed locally, clic...
Below is the the instruction that describes the task: ### Input: Returns a collection of package names to ignore when performing pip-sync, based on the currently installed environment. For example, when pip-tools is installed in the local environment, it should be ignored, including all of its dependen...
def prune(self, symbol: SecuritySymbol): """ Delete all but the latest available price for the given symbol. Returns the number of items removed. """ from .repositories import PriceRepository assert isinstance(symbol, SecuritySymbol) self.logger.debug(f"pruning ...
Delete all but the latest available price for the given symbol. Returns the number of items removed.
Below is the the instruction that describes the task: ### Input: Delete all but the latest available price for the given symbol. Returns the number of items removed. ### Response: def prune(self, symbol: SecuritySymbol): """ Delete all but the latest available price for the given symbol. ...
def jackknife_loop(func, data, d=1, combolimit=int(1e6)): """Generic Jackknife Subsampling procedure func : function A function pointer to a python function that - accept an <Observations x Features> matrix as input variable, and - returns an array/list or scalar value as ...
Generic Jackknife Subsampling procedure func : function A function pointer to a python function that - accept an <Observations x Features> matrix as input variable, and - returns an array/list or scalar value as estimate, metric, model parameter, jackknif...
Below is the the instruction that describes the task: ### Input: Generic Jackknife Subsampling procedure func : function A function pointer to a python function that - accept an <Observations x Features> matrix as input variable, and - returns an array/list or scalar value a...
def plot_covariance( mean, cov=None, variance=1.0, std=None, interval=None, ellipse=None, title=None, axis_equal=True, show_semiaxis=False, show_center=True, facecolor=None, edgecolor=None, fc='none', ec='#004080', alpha=1.0, xlim=None, ylim=None, ls='solid'): ...
Plots the covariance ellipse for the 2D normal defined by (mean, cov) `variance` is the normal sigma^2 that we want to plot. If list-like, ellipses for all ellipses will be ploted. E.g. [1,2] will plot the sigma^2 = 1 and sigma^2 = 2 ellipses. Alternatively, use std for the standard deviation, in which...
Below is the the instruction that describes the task: ### Input: Plots the covariance ellipse for the 2D normal defined by (mean, cov) `variance` is the normal sigma^2 that we want to plot. If list-like, ellipses for all ellipses will be ploted. E.g. [1,2] will plot the sigma^2 = 1 and sigma^2 = 2 elli...
def asset_redirection(request, path, ident=None, stateless=False, **kwargs): 'Redirect static assets for a component' X, app = DashApp.locate_item(ident, stateless) # Redirect to a location based on the import path of the module containing the DjangoDash app static_path = X.get_asset_static_url(path) ...
Redirect static assets for a component
Below is the the instruction that describes the task: ### Input: Redirect static assets for a component ### Response: def asset_redirection(request, path, ident=None, stateless=False, **kwargs): 'Redirect static assets for a component' X, app = DashApp.locate_item(ident, stateless) # Redirect to a lo...
def line(separator="-·-", color=None, padding=None, num=1): """ Prints a line separator the full width of the terminal. @separator: the #str chars to create the line from @color: line color from :mod:vital.debug.colors @padding: adds extra lines to either the top, bottom or both ...
Prints a line separator the full width of the terminal. @separator: the #str chars to create the line from @color: line color from :mod:vital.debug.colors @padding: adds extra lines to either the top, bottom or both of the line via :func:padd @num: #int number of lines to pr...
Below is the the instruction that describes the task: ### Input: Prints a line separator the full width of the terminal. @separator: the #str chars to create the line from @color: line color from :mod:vital.debug.colors @padding: adds extra lines to either the top, bottom or both ...
def barplot(self, canvas, x, height, width=0.8, bottom=0, color=None, label=None, **kwargs): """ Plot vertical bar plot centered at x with height and width of bars. The y level is at bottom. the kwargs are plotting library specific kwargs! :param array-like x: the cent...
Plot vertical bar plot centered at x with height and width of bars. The y level is at bottom. the kwargs are plotting library specific kwargs! :param array-like x: the center points of the bars :param array-like height: the height of the bars :param array-like width: t...
Below is the the instruction that describes the task: ### Input: Plot vertical bar plot centered at x with height and width of bars. The y level is at bottom. the kwargs are plotting library specific kwargs! :param array-like x: the center points of the bars :param array-l...
def pull(i): """ Input: { (path) - repo UOA (where to create entry) (type) - type (url) - URL or (data_uoa) - repo UOA (clone) - if 'yes', clone repo instead of update (current_repos) - if r...
Input: { (path) - repo UOA (where to create entry) (type) - type (url) - URL or (data_uoa) - repo UOA (clone) - if 'yes', clone repo instead of update (current_repos) - if resolving dependencies on ...
Below is the the instruction that describes the task: ### Input: Input: { (path) - repo UOA (where to create entry) (type) - type (url) - URL or (data_uoa) - repo UOA (clone) - if 'yes', clone repo instead of ...
def function(self, rule, args, **kwargs): """ Implementation of :py:func:`pynspect.traversers.RuleTreeTraverser.function` interface. """ fname = rule.function try: return self.functions[fname](args) except KeyError: raise FilteringRuleException("In...
Implementation of :py:func:`pynspect.traversers.RuleTreeTraverser.function` interface.
Below is the the instruction that describes the task: ### Input: Implementation of :py:func:`pynspect.traversers.RuleTreeTraverser.function` interface. ### Response: def function(self, rule, args, **kwargs): """ Implementation of :py:func:`pynspect.traversers.RuleTreeTraverser.function` interface. ...
def channel_is_closed( self, participant1: Address, participant2: Address, block_identifier: BlockSpecification, channel_identifier: ChannelID, ) -> bool: """ Returns true if the channel is in a closed state, false otherwise. """ try: ...
Returns true if the channel is in a closed state, false otherwise.
Below is the the instruction that describes the task: ### Input: Returns true if the channel is in a closed state, false otherwise. ### Response: def channel_is_closed( self, participant1: Address, participant2: Address, block_identifier: BlockSpecification, ...
def login(self, email=None, password=None, timeout=5): """Log in to CANDY HOUSE account. Return True on success.""" if email is not None: self.email = email if password is not None: self.password = password url = self.api_url + API_LOGIN_ENDPOINT data = j...
Log in to CANDY HOUSE account. Return True on success.
Below is the the instruction that describes the task: ### Input: Log in to CANDY HOUSE account. Return True on success. ### Response: def login(self, email=None, password=None, timeout=5): """Log in to CANDY HOUSE account. Return True on success.""" if email is not None: self.email = em...
def to_text(self, name=None, origin=None, relativize=True, override_rdclass=None, **kw): """Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emit...
Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. Any additional keyword arguments are passed on to the rdata to_text() method. @param ...
Below is the the instruction that describes the task: ### Input: Convert the rdataset into DNS master file format. @see: L{dns.name.Name.choose_relativity} for more information on how I{origin} and I{relativize} determine the way names are emitted. Any additional keyword arguments ...
async def get_config(self): """Return the configuration settings dict for this application. """ app_facade = client.ApplicationFacade.from_connection(self.connection) log.debug( 'Getting config for %s', self.name) return (await app_facade.Get(self.name)).config
Return the configuration settings dict for this application.
Below is the the instruction that describes the task: ### Input: Return the configuration settings dict for this application. ### Response: async def get_config(self): """Return the configuration settings dict for this application. """ app_facade = client.ApplicationFacade.from_connection(...
def csiszar_vimco_helper(logu, name=None): """Helper to `csiszar_vimco`; computes `log_avg_u`, `log_sooavg_u`. `axis = 0` of `logu` is presumed to correspond to iid samples from `q`, i.e., ```none logu[j] = log(u[j]) u[j] = p(x, h[j]) / q(h[j] | x) h[j] iid~ q(H | x) ``` Args: logu: Floating-type...
Helper to `csiszar_vimco`; computes `log_avg_u`, `log_sooavg_u`. `axis = 0` of `logu` is presumed to correspond to iid samples from `q`, i.e., ```none logu[j] = log(u[j]) u[j] = p(x, h[j]) / q(h[j] | x) h[j] iid~ q(H | x) ``` Args: logu: Floating-type `Tensor` representing `log(p(x, h) / q(h | x))`...
Below is the the instruction that describes the task: ### Input: Helper to `csiszar_vimco`; computes `log_avg_u`, `log_sooavg_u`. `axis = 0` of `logu` is presumed to correspond to iid samples from `q`, i.e., ```none logu[j] = log(u[j]) u[j] = p(x, h[j]) / q(h[j] | x) h[j] iid~ q(H | x) ``` Args: ...
def from_dict(data, ctx): """ Instantiate a new MarketOrderTransaction from a dict (generally from loading a JSON response). The data used to instantiate the MarketOrderTransaction is a shallow copy of the dict passed in, with any complex child types instantiated appropriately. ...
Instantiate a new MarketOrderTransaction from a dict (generally from loading a JSON response). The data used to instantiate the MarketOrderTransaction is a shallow copy of the dict passed in, with any complex child types instantiated appropriately.
Below is the the instruction that describes the task: ### Input: Instantiate a new MarketOrderTransaction from a dict (generally from loading a JSON response). The data used to instantiate the MarketOrderTransaction is a shallow copy of the dict passed in, with any complex child types instan...
def iter_widgets(self, file=None, place=None): ''' Iterate registered widgets, optionally matching given criteria. :param file: optional file object will be passed to widgets' filter functions. :type file: browsepy.file.Node or None :param place: optional te...
Iterate registered widgets, optionally matching given criteria. :param file: optional file object will be passed to widgets' filter functions. :type file: browsepy.file.Node or None :param place: optional template place hint. :type place: str :yields: widget...
Below is the the instruction that describes the task: ### Input: Iterate registered widgets, optionally matching given criteria. :param file: optional file object will be passed to widgets' filter functions. :type file: browsepy.file.Node or None :param place: optional ...
def coverage(self): """ Returns NumPy array indicating number of reads covering each nucleotides of this sequence. """ variant_start_index, variant_end_index = self.variant_indices() n_nucleotides = len(self) coverage_array = np.zeros(n_nucleotides, dtype="int32")...
Returns NumPy array indicating number of reads covering each nucleotides of this sequence.
Below is the the instruction that describes the task: ### Input: Returns NumPy array indicating number of reads covering each nucleotides of this sequence. ### Response: def coverage(self): """ Returns NumPy array indicating number of reads covering each nucleotides of this sequence...
def schema_is_subset(self, dataset_id, table_id, schema): """Indicate whether the schema to be uploaded is a subset Compare the BigQuery table identified in the parameters with the schema passed in and indicate whether a subset of the fields in the former are present in the latter. Orde...
Indicate whether the schema to be uploaded is a subset Compare the BigQuery table identified in the parameters with the schema passed in and indicate whether a subset of the fields in the former are present in the latter. Order is not considered. Parameters ---------- d...
Below is the the instruction that describes the task: ### Input: Indicate whether the schema to be uploaded is a subset Compare the BigQuery table identified in the parameters with the schema passed in and indicate whether a subset of the fields in the former are present in the latter. Orde...
def from_config(cls, name, config): """ Behaves like the base Configurable class's `from_config()` except this makes sure that the `Pluggable` subclass with the given name is actually a properly installed plugin first. """ installed_classes = cls.get_installed_classes() ...
Behaves like the base Configurable class's `from_config()` except this makes sure that the `Pluggable` subclass with the given name is actually a properly installed plugin first.
Below is the the instruction that describes the task: ### Input: Behaves like the base Configurable class's `from_config()` except this makes sure that the `Pluggable` subclass with the given name is actually a properly installed plugin first. ### Response: def from_config(cls, name, config): ...
def _get_properties(self, logical_id): """ Returns the properties of resource with given logical ID. If a resource is not found, then it returns an empty data. Parameters ---------- logical_id : str Logical ID of the resource Returns ------- ...
Returns the properties of resource with given logical ID. If a resource is not found, then it returns an empty data. Parameters ---------- logical_id : str Logical ID of the resource Returns ------- samcli.commands.local.lib.sam_api_provider.ApiColle...
Below is the the instruction that describes the task: ### Input: Returns the properties of resource with given logical ID. If a resource is not found, then it returns an empty data. Parameters ---------- logical_id : str Logical ID of the resource Returns ...
def date_field_data(field, **kwargs): """ Return random value for DateField >>> result = any_form_field(forms.DateField()) >>> type(result) <type 'str'> """ from_date = kwargs.get('from_date', date(1990, 1, 1)) to_date = kwargs.get('to_date', date.today()) date_format = random....
Return random value for DateField >>> result = any_form_field(forms.DateField()) >>> type(result) <type 'str'>
Below is the the instruction that describes the task: ### Input: Return random value for DateField >>> result = any_form_field(forms.DateField()) >>> type(result) <type 'str'> ### Response: def date_field_data(field, **kwargs): """ Return random value for DateField >>> result = any_form_f...
def generate_markdown_doc(app_name, spec): """Generate Markdown Documentation for the given spec/app name. Args: app_name (str): The name of the application. spec (YapconfSpec): A yapconf specification with sources loaded. Returns (str): A valid, markdown string representation of t...
Generate Markdown Documentation for the given spec/app name. Args: app_name (str): The name of the application. spec (YapconfSpec): A yapconf specification with sources loaded. Returns (str): A valid, markdown string representation of the documentation for the given specificati...
Below is the the instruction that describes the task: ### Input: Generate Markdown Documentation for the given spec/app name. Args: app_name (str): The name of the application. spec (YapconfSpec): A yapconf specification with sources loaded. Returns (str): A valid, markdown string ...
def overlap(vec1, vec2, psd=None, low_frequency_cutoff=None, high_frequency_cutoff=None, normalized=True): """ Return the overlap between the two TimeSeries or FrequencySeries. Parameters ---------- vec1 : TimeSeries or FrequencySeries The input vector containing a waveform. vec2 ...
Return the overlap between the two TimeSeries or FrequencySeries. Parameters ---------- vec1 : TimeSeries or FrequencySeries The input vector containing a waveform. vec2 : TimeSeries or FrequencySeries The input vector containing a waveform. psd : Frequency Series A power sp...
Below is the the instruction that describes the task: ### Input: Return the overlap between the two TimeSeries or FrequencySeries. Parameters ---------- vec1 : TimeSeries or FrequencySeries The input vector containing a waveform. vec2 : TimeSeries or FrequencySeries The input vector...
def self_inventory(self): """ Inventory output will only contain the server name and the session ID when a key is provided. Provide the same format as with the full inventory instead for consistency. """ if self.api_key is None: return {} if self._sel...
Inventory output will only contain the server name and the session ID when a key is provided. Provide the same format as with the full inventory instead for consistency.
Below is the the instruction that describes the task: ### Input: Inventory output will only contain the server name and the session ID when a key is provided. Provide the same format as with the full inventory instead for consistency. ### Response: def self_inventory(self): """ Inve...
def most_likely_alpha(data, xmin, alpharange=(1.5,3.5), n_alpha=201): """ Return the most likely alpha for the data given an xmin """ alpha_vector = np.linspace(alpharange[0],alpharange[1],n_alpha) return alpha_vector[discrete_max_likelihood_arg(data, xmin, ...
Return the most likely alpha for the data given an xmin
Below is the the instruction that describes the task: ### Input: Return the most likely alpha for the data given an xmin ### Response: def most_likely_alpha(data, xmin, alpharange=(1.5,3.5), n_alpha=201): """ Return the most likely alpha for the data given an xmin """ alpha_vector = np.linspace(alp...
def GetByteSize(self): """Retrieves the byte size of the data type definition. Returns: int: data type size in bytes or None if size cannot be determined. """ if self._byte_size is None and self.members: self._byte_size = 0 for member_definition in self.members: byte_size = me...
Retrieves the byte size of the data type definition. Returns: int: data type size in bytes or None if size cannot be determined.
Below is the the instruction that describes the task: ### Input: Retrieves the byte size of the data type definition. Returns: int: data type size in bytes or None if size cannot be determined. ### Response: def GetByteSize(self): """Retrieves the byte size of the data type definition. Returns:...
def logging_auditlog_class_class(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") logging = ET.SubElement(config, "logging", xmlns="urn:brocade.com:mgmt:brocade-ras") auditlog = ET.SubElement(logging, "auditlog") class_el = ET.SubElement(auditlog,...
Auto Generated Code
Below is the the instruction that describes the task: ### Input: Auto Generated Code ### Response: def logging_auditlog_class_class(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") logging = ET.SubElement(config, "logging", xmlns="urn:brocade.com:mgmt:brocad...
def p_UnionMemberType_anyType(p): """UnionMemberType : any "[" "]" TypeSuffix""" p[0] = helper.unwrapTypeSuffix(model.Array(t=model.SimpleType( type=model.SimpleType.ANY)), p[4])
UnionMemberType : any "[" "]" TypeSuffix
Below is the the instruction that describes the task: ### Input: UnionMemberType : any "[" "]" TypeSuffix ### Response: def p_UnionMemberType_anyType(p): """UnionMemberType : any "[" "]" TypeSuffix""" p[0] = helper.unwrapTypeSuffix(model.Array(t=model.SimpleType( type=model.SimpleType.ANY)), p[4])
def as_xml(self,parent): """Create vcard-tmp XML representation of the field. :Parameters: - `parent`: parent node for the element :Types: - `parent`: `libxml2.xmlNode` :return: xml node with the field data. :returntype: `libxml2.xmlNode`""" n=pa...
Create vcard-tmp XML representation of the field. :Parameters: - `parent`: parent node for the element :Types: - `parent`: `libxml2.xmlNode` :return: xml node with the field data. :returntype: `libxml2.xmlNode`
Below is the the instruction that describes the task: ### Input: Create vcard-tmp XML representation of the field. :Parameters: - `parent`: parent node for the element :Types: - `parent`: `libxml2.xmlNode` :return: xml node with the field data. :returntype: ...
def _create_dictionary_of_ned( self): """*Create a list of dictionaries containing all the object ids (NED names) in the ned stream* **Return:** - ``dictList`` - a list of dictionaries containing all the object ids (NED names) in the ned stream **Usage:** ....
*Create a list of dictionaries containing all the object ids (NED names) in the ned stream* **Return:** - ``dictList`` - a list of dictionaries containing all the object ids (NED names) in the ned stream **Usage:** .. code-block:: python dictList = stream._cre...
Below is the the instruction that describes the task: ### Input: *Create a list of dictionaries containing all the object ids (NED names) in the ned stream* **Return:** - ``dictList`` - a list of dictionaries containing all the object ids (NED names) in the ned stream **Usage:** ...
def translate(cls, f=None, output=0, **kwargs): """translate(f=None, *, output=TranslateOutput.code, **kwargs) Decorator that turns a function into a shellcode emitting function. Arguments: f(callable): The function to decorate. If ``f`` is ``None`` a decorator will ...
translate(f=None, *, output=TranslateOutput.code, **kwargs) Decorator that turns a function into a shellcode emitting function. Arguments: f(callable): The function to decorate. If ``f`` is ``None`` a decorator will be returned instead. output(~pwnypack.shellcode...
Below is the the instruction that describes the task: ### Input: translate(f=None, *, output=TranslateOutput.code, **kwargs) Decorator that turns a function into a shellcode emitting function. Arguments: f(callable): The function to decorate. If ``f`` is ``None`` a decor...
def apply_async(self, args=None, kwargs=None, **options): """ Attempts to queues a task. Will raises an AlreadyQueued exception if already queued. :param \*args: positional arguments passed on to the task. :param \*\*kwargs: keyword arguments passed on to the task. :keyw...
Attempts to queues a task. Will raises an AlreadyQueued exception if already queued. :param \*args: positional arguments passed on to the task. :param \*\*kwargs: keyword arguments passed on to the task. :keyword \*\*once: (optional) :param: graceful: (optional) ...
Below is the the instruction that describes the task: ### Input: Attempts to queues a task. Will raises an AlreadyQueued exception if already queued. :param \*args: positional arguments passed on to the task. :param \*\*kwargs: keyword arguments passed on to the task. :keyword \*\*o...
def remove_fact(self, fact_id): """Remove fact from storage by it's ID""" self.start_transaction() fact = self.__get_fact(fact_id) if fact: self.__remove_fact(fact_id) self.facts_changed() self.end_transaction()
Remove fact from storage by it's ID
Below is the the instruction that describes the task: ### Input: Remove fact from storage by it's ID ### Response: def remove_fact(self, fact_id): """Remove fact from storage by it's ID""" self.start_transaction() fact = self.__get_fact(fact_id) if fact: self.__remove_fa...
def is_jid(jid): ''' Returns True if the passed in value is a job id ''' if not isinstance(jid, six.string_types): return False if len(jid) != 20 and (len(jid) <= 21 or jid[20] != '_'): return False try: int(jid[:20]) return True except ValueError: ret...
Returns True if the passed in value is a job id
Below is the the instruction that describes the task: ### Input: Returns True if the passed in value is a job id ### Response: def is_jid(jid): ''' Returns True if the passed in value is a job id ''' if not isinstance(jid, six.string_types): return False if len(jid) != 20 and (len(jid) ...
def _truncate_bitmap(what): """Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index. @param what: a string of octets representing a bitmap. @type what: string @rtype: string """ for i in xrange(len(what) - 1, -1, ...
Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index. @param what: a string of octets representing a bitmap. @type what: string @rtype: string
Below is the the instruction that describes the task: ### Input: Determine the index of greatest byte that isn't all zeros, and return the bitmap that contains all the bytes less than that index. @param what: a string of octets representing a bitmap. @type what: string @rtype: string ### Response: ...
def init(self): """ Initialize the computers. Should be called on the workers """ if hasattr(self, 'computers'): # init already called return with hdf5.File(self.rupgetter.filename, 'r') as parent: self.weights = parent['weights'].value self.compu...
Initialize the computers. Should be called on the workers
Below is the the instruction that describes the task: ### Input: Initialize the computers. Should be called on the workers ### Response: def init(self): """ Initialize the computers. Should be called on the workers """ if hasattr(self, 'computers'): # init already called ...
def unregisterViewType(self, cls, window=None): """ Unregisters the view at the given name. If the window option is \ supplied then the unregisterFromWindow method will be called for the \ inputed class. :param cls | <subclass of XView> ...
Unregisters the view at the given name. If the window option is \ supplied then the unregisterFromWindow method will be called for the \ inputed class. :param cls | <subclass of XView> window | <QMainWindow> || <QDialog> || None ...
Below is the the instruction that describes the task: ### Input: Unregisters the view at the given name. If the window option is \ supplied then the unregisterFromWindow method will be called for the \ inputed class. :param cls | <subclass of XView> ...
def get_graderoster(section, instructor, requestor): """ Returns a restclients.GradeRoster for the passed Section model and instructor Person. """ label = GradeRoster(section=section, instructor=instructor).graderoster_label() url = "{}/{}".format(graderoster_url, encode_...
Returns a restclients.GradeRoster for the passed Section model and instructor Person.
Below is the the instruction that describes the task: ### Input: Returns a restclients.GradeRoster for the passed Section model and instructor Person. ### Response: def get_graderoster(section, instructor, requestor): """ Returns a restclients.GradeRoster for the passed Section model and instructor...
def print_tb(tb, limit=None, file=None): """Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like object with a write() ...
Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like object with a write() method.
Below is the the instruction that describes the task: ### Input: Print up to 'limit' stack trace entries from the traceback 'tb'. If 'limit' is omitted or None, all entries are printed. If 'file' is omitted or None, the output goes to sys.stderr; otherwise 'file' should be an open file or file-like ob...
def getInfo(self): """ Returns a DevInfo instance, a named tuple with the following items: - bustype: one of BUS_USB, BUS_HIL, BUS_BLUETOOTH or BUS_VIRTUAL - vendor: device's vendor number - product: device's product number """ devinfo = _hidraw_devinfo() ...
Returns a DevInfo instance, a named tuple with the following items: - bustype: one of BUS_USB, BUS_HIL, BUS_BLUETOOTH or BUS_VIRTUAL - vendor: device's vendor number - product: device's product number
Below is the the instruction that describes the task: ### Input: Returns a DevInfo instance, a named tuple with the following items: - bustype: one of BUS_USB, BUS_HIL, BUS_BLUETOOTH or BUS_VIRTUAL - vendor: device's vendor number - product: device's product number ### Response: def getInfo...
def service_param_string(params): """Takes a param section from a metadata class and returns a param string for the service method""" p = [] k = [] for param in params: name = fix_param_name(param['name']) if 'required' in param and param['required'] is True: p.append(...
Takes a param section from a metadata class and returns a param string for the service method
Below is the the instruction that describes the task: ### Input: Takes a param section from a metadata class and returns a param string for the service method ### Response: def service_param_string(params): """Takes a param section from a metadata class and returns a param string for the service method""" ...
def open_url(url, httpuser=None, httppassword=None, method=None): """ Open a URL using an opener that will simulate a browser user-agent url: The URL httpuser, httppassword: HTTP authentication credentials (either both or neither must be provided) method: The HTTP method Caller is reponsi...
Open a URL using an opener that will simulate a browser user-agent url: The URL httpuser, httppassword: HTTP authentication credentials (either both or neither must be provided) method: The HTTP method Caller is reponsible for calling close() on the returned object
Below is the the instruction that describes the task: ### Input: Open a URL using an opener that will simulate a browser user-agent url: The URL httpuser, httppassword: HTTP authentication credentials (either both or neither must be provided) method: The HTTP method Caller is reponsible for c...
def processNickList(nicks, platforms=None, rutaDescarga="./", avoidProcessing=True, avoidDownload=True, nThreads=12, verbosity=1, logFolder="./logs"): """ Process a list of nicks to check whether they exist. This method receives as a parameter a series of nicks and verifies whether those nicks have a p...
Process a list of nicks to check whether they exist. This method receives as a parameter a series of nicks and verifies whether those nicks have a profile associated in different social networks. Args: ----- nicks: List of nicks to process. platforms: List of <Platform> objects to be p...
Below is the the instruction that describes the task: ### Input: Process a list of nicks to check whether they exist. This method receives as a parameter a series of nicks and verifies whether those nicks have a profile associated in different social networks. Args: ----- nicks: List of ni...
def min_item(self): """Get item with min key of tree, raises ValueError if tree is empty.""" if self.is_empty(): raise ValueError("Tree is empty") node = self._root while node.left is not None: node = node.left return node.key, node.value
Get item with min key of tree, raises ValueError if tree is empty.
Below is the the instruction that describes the task: ### Input: Get item with min key of tree, raises ValueError if tree is empty. ### Response: def min_item(self): """Get item with min key of tree, raises ValueError if tree is empty.""" if self.is_empty(): raise ValueError("Tree is em...
def find_vm(self, name): """ Try and find a VM by name :param name: Name of the VM :type name: str """ try: domain = self.hyper.lookupByName(name) VM = VirtualMachine(domain, self) except libvirtError: VM = None return V...
Try and find a VM by name :param name: Name of the VM :type name: str
Below is the the instruction that describes the task: ### Input: Try and find a VM by name :param name: Name of the VM :type name: str ### Response: def find_vm(self, name): """ Try and find a VM by name :param name: Name of the VM :type name: str """ ...
def parse_rule(name, rule_text, do_raise=False): """ Parses the given rule text. :param name: The name of the rule. Used when emitting log messages regarding a failure to parse the rule. :param rule_text: The text of the rule to parse. :param do_raise: If ``False`` and the rule fa...
Parses the given rule text. :param name: The name of the rule. Used when emitting log messages regarding a failure to parse the rule. :param rule_text: The text of the rule to parse. :param do_raise: If ``False`` and the rule fails to parse, a log message is emitted t...
Below is the the instruction that describes the task: ### Input: Parses the given rule text. :param name: The name of the rule. Used when emitting log messages regarding a failure to parse the rule. :param rule_text: The text of the rule to parse. :param do_raise: If ``False`` and the...
def eval_jacobian(self, ordered_parameters=[], **parameters): """ Jacobian of :math:`S` in the :class:`~symfit.core.argument.Parameter`'s (:math:`\\nabla_\\vec{p} S`). :param parameters: values of the :class:`~symfit.core.argument.Parameter`'s to evaluate :math:`\\nabla_\\ve...
Jacobian of :math:`S` in the :class:`~symfit.core.argument.Parameter`'s (:math:`\\nabla_\\vec{p} S`). :param parameters: values of the :class:`~symfit.core.argument.Parameter`'s to evaluate :math:`\\nabla_\\vec{p} S` at. :return: ``np.array`` of length equal to the number of paramet...
Below is the the instruction that describes the task: ### Input: Jacobian of :math:`S` in the :class:`~symfit.core.argument.Parameter`'s (:math:`\\nabla_\\vec{p} S`). :param parameters: values of the :class:`~symfit.core.argument.Parameter`'s to evaluate :math:`\\nabla_\\vec{p} S` at. ...
def extended_fade_in(self, segment, duration): """Add a fade-in to a segment that extends the beginning of the segment. :param segment: Segment to fade in :type segment: :py:class:`radiotool.composer.Segment` :param duration: Duration of fade-in (in seconds) :returns: Th...
Add a fade-in to a segment that extends the beginning of the segment. :param segment: Segment to fade in :type segment: :py:class:`radiotool.composer.Segment` :param duration: Duration of fade-in (in seconds) :returns: The fade that has been added to the composition :rty...
Below is the the instruction that describes the task: ### Input: Add a fade-in to a segment that extends the beginning of the segment. :param segment: Segment to fade in :type segment: :py:class:`radiotool.composer.Segment` :param duration: Duration of fade-in (in seconds) :...
def _clone_args(self): """ return args to create new Dict clone """ keys = list(self.keys) kw = {} if self.allow_any or self.extras: kw['allow_extra'] = list(self.extras) if self.allow_any: kw['allow_extra'].append('*') kw['allo...
return args to create new Dict clone
Below is the the instruction that describes the task: ### Input: return args to create new Dict clone ### Response: def _clone_args(self): """ return args to create new Dict clone """ keys = list(self.keys) kw = {} if self.allow_any or self.extras: kw['allow_extr...
def sharepoint(self, *, resource=''): """ Get an instance to read information from Sharepoint sites for the specified account resource :param str resource: Custom resource to be used in this sharepoint object (Defaults to parent main_resource) :return: a representation of Share...
Get an instance to read information from Sharepoint sites for the specified account resource :param str resource: Custom resource to be used in this sharepoint object (Defaults to parent main_resource) :return: a representation of Sharepoint Sites :rtype: Sharepoint :ra...
Below is the the instruction that describes the task: ### Input: Get an instance to read information from Sharepoint sites for the specified account resource :param str resource: Custom resource to be used in this sharepoint object (Defaults to parent main_resource) :return: a repr...
def observe(self, callback, err_callback, duration=60): """Observe resource and call callback when updated.""" def observe_callback(value): """ Called when end point is updated. Returns a Command. """ self.raw = value callback(self...
Observe resource and call callback when updated.
Below is the the instruction that describes the task: ### Input: Observe resource and call callback when updated. ### Response: def observe(self, callback, err_callback, duration=60): """Observe resource and call callback when updated.""" def observe_callback(value): """ Cal...
def get_classname(obj): """ Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str """ if isinstance(obj, javabridge.JB_Object): cls = javabr...
Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str
Below is the the instruction that describes the task: ### Input: Returns the classname of the JB_Object, Python class or object. :param obj: the java object or Python class/object to get the classname for :type obj: object :return: the classname :rtype: str ### Response: def get_classname(obj): ...
def to_csv_path(graph: BELGraph, path: str, sep: Optional[str] = None) -> None: """Write the graph as a tab-separated edge list to a file at the given path.""" with open(path, 'w') as file: to_csv(graph, file, sep=sep)
Write the graph as a tab-separated edge list to a file at the given path.
Below is the the instruction that describes the task: ### Input: Write the graph as a tab-separated edge list to a file at the given path. ### Response: def to_csv_path(graph: BELGraph, path: str, sep: Optional[str] = None) -> None: """Write the graph as a tab-separated edge list to a file at the given path.""...
def collect_fragment(event, agora_host): """ Execute a search plan for the declared graph pattern and sends all obtained triples to the corresponding collector functions (config """ agora = Agora(agora_host) graph_pattern = "" for tp in __triple_patterns: graph_pattern += '{} . '.for...
Execute a search plan for the declared graph pattern and sends all obtained triples to the corresponding collector functions (config
Below is the the instruction that describes the task: ### Input: Execute a search plan for the declared graph pattern and sends all obtained triples to the corresponding collector functions (config ### Response: def collect_fragment(event, agora_host): """ Execute a search plan for the declared graph p...
def get_bbox(self): """Returns ((top, left), (bottom, right)) of bounding box A bounding box is the smallest rectangle that contains all selections. Non-specified boundaries are None. """ bb_top, bb_left, bb_bottom, bb_right = [None] * 4 # Block selections fo...
Returns ((top, left), (bottom, right)) of bounding box A bounding box is the smallest rectangle that contains all selections. Non-specified boundaries are None.
Below is the the instruction that describes the task: ### Input: Returns ((top, left), (bottom, right)) of bounding box A bounding box is the smallest rectangle that contains all selections. Non-specified boundaries are None. ### Response: def get_bbox(self): """Returns ((top, left), (bott...
def get_email(self): """Gets email :return: Email of user """ api_url = self.api_url + "/events/public" api_content = GithubRawApi( api_url, get_api_content_now=True ).api_content for event in api_content: if event["type"] == "...
Gets email :return: Email of user
Below is the the instruction that describes the task: ### Input: Gets email :return: Email of user ### Response: def get_email(self): """Gets email :return: Email of user """ api_url = self.api_url + "/events/public" api_content = GithubRawApi( api_url, ...
def _update_limits_from_api(self): """ Query Route53's GetHostedZoneLimit API action, and update limits with the quotas returned. Updates ``self.limits``. """ logger.info("Querying Route53 GetHostedZoneLimits for limits") self.connect() self._find_limit_hosted_zon...
Query Route53's GetHostedZoneLimit API action, and update limits with the quotas returned. Updates ``self.limits``.
Below is the the instruction that describes the task: ### Input: Query Route53's GetHostedZoneLimit API action, and update limits with the quotas returned. Updates ``self.limits``. ### Response: def _update_limits_from_api(self): """ Query Route53's GetHostedZoneLimit API action, and update...
def to_df(self, recommended_only=False, include_io=True): """ Return a pandas DataFrame for each model and dataset. Parameters ---------- recommended_only : bool, optional If True, only recommended models for each session are included. If no model is reco...
Return a pandas DataFrame for each model and dataset. Parameters ---------- recommended_only : bool, optional If True, only recommended models for each session are included. If no model is recommended, then a row with it's ID will be included, but all fields ...
Below is the the instruction that describes the task: ### Input: Return a pandas DataFrame for each model and dataset. Parameters ---------- recommended_only : bool, optional If True, only recommended models for each session are included. If no model is recommended, ...
def prepare(c): """ Edit changelog & version, git commit, and git tag, to set up for release. """ # Print dry-run/status/actions-to-take data & grab programmatic result # TODO: maybe expand the enum-based stuff to have values that split up # textual description, command string, etc. See the TODO...
Edit changelog & version, git commit, and git tag, to set up for release.
Below is the the instruction that describes the task: ### Input: Edit changelog & version, git commit, and git tag, to set up for release. ### Response: def prepare(c): """ Edit changelog & version, git commit, and git tag, to set up for release. """ # Print dry-run/status/actions-to-take data & gr...
def add_virtual_columns_cartesian_velocities_to_spherical(self, x="x", y="y", z="z", vx="vx", vy="vy", vz="vz", vr="vr", vlong="vlong", vlat="vlat", distance=None): """Concert velocities from a cartesian to a spherical coordinate system TODO: errors :param x: name of x column (input) :...
Concert velocities from a cartesian to a spherical coordinate system TODO: errors :param x: name of x column (input) :param y: y :param z: z :param vx: vx :param vy: vy :param vz: vz :param vr: name of the column for the...
Below is the the instruction that describes the task: ### Input: Concert velocities from a cartesian to a spherical coordinate system TODO: errors :param x: name of x column (input) :param y: y :param z: z :param vx: vx :param vy: vy ...
def dump(u, from_date, with_json=True, latest_only=False, **kwargs): """Dump the UserEXt objects as a list of dictionaries. :param u: UserEXT to be dumped. :type u: `invenio_accounts.models.UserEXT [Invenio2.x]` :returns: User serialized to dictionary. :rtype: dict """ return dict(id=u.id, ...
Dump the UserEXt objects as a list of dictionaries. :param u: UserEXT to be dumped. :type u: `invenio_accounts.models.UserEXT [Invenio2.x]` :returns: User serialized to dictionary. :rtype: dict
Below is the the instruction that describes the task: ### Input: Dump the UserEXt objects as a list of dictionaries. :param u: UserEXT to be dumped. :type u: `invenio_accounts.models.UserEXT [Invenio2.x]` :returns: User serialized to dictionary. :rtype: dict ### Response: def dump(u, from_date, wi...
def plot_responsibility(data, responsibility, cmap='nipy_spectral'): '''Classify the 2D ``data`` according to the ``responsibility`` and make a scatter plot of each data point with the color of the component it is most likely from. The ``responsibility`` is normalized internally ...
Classify the 2D ``data`` according to the ``responsibility`` and make a scatter plot of each data point with the color of the component it is most likely from. The ``responsibility`` is normalized internally such that each row sums to unity. :param data: matrix-like; one row = one 2D sample ...
Below is the the instruction that describes the task: ### Input: Classify the 2D ``data`` according to the ``responsibility`` and make a scatter plot of each data point with the color of the component it is most likely from. The ``responsibility`` is normalized internally such that each row sums to unit...
def get_children(self): """Return the children of this folder""" try: children = os.listdir(self.real_path) except OSError: return [] result = [] for name in children: try: child = self.get_child(name) except excepti...
Return the children of this folder
Below is the the instruction that describes the task: ### Input: Return the children of this folder ### Response: def get_children(self): """Return the children of this folder""" try: children = os.listdir(self.real_path) except OSError: return [] result = []...
def update(self): """ Redraw the figure to show changed data. This is automatically called after `start()` was run. """ assert threading.current_thread() == threading.main_thread() for axis, line, interface in self.interfaces: line.set_xdata(interface.xdata) ...
Redraw the figure to show changed data. This is automatically called after `start()` was run.
Below is the the instruction that describes the task: ### Input: Redraw the figure to show changed data. This is automatically called after `start()` was run. ### Response: def update(self): """ Redraw the figure to show changed data. This is automatically called after `start()` was...
def video_time_to_gyro_sample(self, t): """Convert video time to gyroscope sample index and interpolation factor Parameters ------------------- t : float Video timestamp Returns -------------------- n : int Sample index that precedes t ...
Convert video time to gyroscope sample index and interpolation factor Parameters ------------------- t : float Video timestamp Returns -------------------- n : int Sample index that precedes t tau : float Interpolation factor ...
Below is the the instruction that describes the task: ### Input: Convert video time to gyroscope sample index and interpolation factor Parameters ------------------- t : float Video timestamp Returns -------------------- n : int Sample index ...
def _speak_header_always_inherit(self, element): """ The cells headers will be spoken for every data cell for element and descendants. :param element: The element. :type element: hatemile.util.html.htmldomelement.HTMLDOMElement """ self._speak_header_once_inheri...
The cells headers will be spoken for every data cell for element and descendants. :param element: The element. :type element: hatemile.util.html.htmldomelement.HTMLDOMElement
Below is the the instruction that describes the task: ### Input: The cells headers will be spoken for every data cell for element and descendants. :param element: The element. :type element: hatemile.util.html.htmldomelement.HTMLDOMElement ### Response: def _speak_header_always_inherit(sel...
def close(self): """Close the socket""" if self.is_open(): fd = self._fd self._fd = -1 if self.uses_nanoconfig: wrapper.nc_close(fd) else: _nn_check_positive_rtn(wrapper.nn_close(fd))
Close the socket
Below is the the instruction that describes the task: ### Input: Close the socket ### Response: def close(self): """Close the socket""" if self.is_open(): fd = self._fd self._fd = -1 if self.uses_nanoconfig: wrapper.nc_close(fd) else: ...
def _check_section_option(self, section, option): """ Private method to check section and option types """ if section is None: section = self.DEFAULT_SECTION_NAME elif not is_text_string(section): raise RuntimeError("Argument 'section' must be a str...
Private method to check section and option types
Below is the the instruction that describes the task: ### Input: Private method to check section and option types ### Response: def _check_section_option(self, section, option): """ Private method to check section and option types """ if section is None: section = s...
def load_pointings(self): """Load some pointings""" import os,re,ephem import tkFileDialog,tkMessageBox filename=tkFileDialog.askopenfilename() if filename is None: return f=open(filename) lines=f.readlines() f.close() points=[] if lines[0][0:5]=="<?xml": #...
Load some pointings
Below is the the instruction that describes the task: ### Input: Load some pointings ### Response: def load_pointings(self): """Load some pointings""" import os,re,ephem import tkFileDialog,tkMessageBox filename=tkFileDialog.askopenfilename() if filename is None: return ...
def strip(self, text): '''Return string with markup tags removed.''' tags, results = [], [] return self.re_tag.sub(lambda m: self.clear_tag(m, tags, results), text)
Return string with markup tags removed.
Below is the the instruction that describes the task: ### Input: Return string with markup tags removed. ### Response: def strip(self, text): '''Return string with markup tags removed.''' tags, results = [], [] return self.re_tag.sub(lambda m: self.clear_tag(m, tags, results), text)
def restore_original_dimensions(obs, obs_space, tensorlib=tf): """Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into Dicts or Tuples of tensors...
Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into Dicts or Tuples of tensors. Arguments: obs: The flattened observation tensor. ...
Below is the the instruction that describes the task: ### Input: Unpacks Dict and Tuple space observations into their original form. This is needed since we flatten Dict and Tuple observations in transit. Before sending them to the model though, we should unflatten them into Dicts or Tuples of tensors....
def resource_present(name, resource_type, resource_selector_property, resource_selector_value, **kwargs): ''' Ensure resource exists with provided properties name : string name of the zone resource_type : string type of resource resource_selector_property : string unique res...
Ensure resource exists with provided properties name : string name of the zone resource_type : string type of resource resource_selector_property : string unique resource identifier resource_selector_value : string value for resource selection kwargs : string|int|......
Below is the the instruction that describes the task: ### Input: Ensure resource exists with provided properties name : string name of the zone resource_type : string type of resource resource_selector_property : string unique resource identifier resource_selector_value : st...
def get_cassandra_connections(): """ :return: List of tuples (db_alias, connection) for all cassandra connections in DATABASES dict. """ from django.db import connections for alias in connections: engine = connections[alias].settings_dict.get('ENGINE', '') if engine == 'django_c...
:return: List of tuples (db_alias, connection) for all cassandra connections in DATABASES dict.
Below is the the instruction that describes the task: ### Input: :return: List of tuples (db_alias, connection) for all cassandra connections in DATABASES dict. ### Response: def get_cassandra_connections(): """ :return: List of tuples (db_alias, connection) for all cassandra connections in DATABAS...
def list_rooms(self, message): """what are the rooms?: List all the rooms I know about.""" context = {"rooms": self.available_rooms.values(), } self.say(rendered_template("rooms.html", context), message=message, html=True)
what are the rooms?: List all the rooms I know about.
Below is the the instruction that describes the task: ### Input: what are the rooms?: List all the rooms I know about. ### Response: def list_rooms(self, message): """what are the rooms?: List all the rooms I know about.""" context = {"rooms": self.available_rooms.values(), } self.say(rende...
def _get_session(server): ''' Get session and key ''' if server in _sessions: return _sessions[server] config = _get_spacewalk_configuration(server) if not config: raise Exception('No config for \'{0}\' found on master'.format(server)) session = _get_client_and_key(config['...
Get session and key
Below is the the instruction that describes the task: ### Input: Get session and key ### Response: def _get_session(server): ''' Get session and key ''' if server in _sessions: return _sessions[server] config = _get_spacewalk_configuration(server) if not config: raise Excep...
def load_snippet(self, name, package): """Starts the snippet apk with the given package name and connects. Examples: .. code-block:: python ad.load_snippet( name='maps', package='com.google.maps.snippets') ad.maps.activateZoom('3') Args: ...
Starts the snippet apk with the given package name and connects. Examples: .. code-block:: python ad.load_snippet( name='maps', package='com.google.maps.snippets') ad.maps.activateZoom('3') Args: name: string, the attribute name to whic...
Below is the the instruction that describes the task: ### Input: Starts the snippet apk with the given package name and connects. Examples: .. code-block:: python ad.load_snippet( name='maps', package='com.google.maps.snippets') ad.maps.activateZoom('3'...
def sorted_groupby(df, groupby): """ Perform a groupby on a DataFrame using a specific column and assuming that that column is sorted. Parameters ---------- df : pandas.DataFrame groupby : object Column name on which to groupby. This column must be sorted. Returns ------- ...
Perform a groupby on a DataFrame using a specific column and assuming that that column is sorted. Parameters ---------- df : pandas.DataFrame groupby : object Column name on which to groupby. This column must be sorted. Returns ------- generator Yields pairs of group_na...
Below is the the instruction that describes the task: ### Input: Perform a groupby on a DataFrame using a specific column and assuming that that column is sorted. Parameters ---------- df : pandas.DataFrame groupby : object Column name on which to groupby. This column must be sorted. ...
def close(self): """ Close and release the current usb device. :return: None """ # This may not be absolutely necessary, but it is safe. # It's the closest thing to a close() method. if self._dev is not None: usb.util.dispose_resources(self._dev) ...
Close and release the current usb device. :return: None
Below is the the instruction that describes the task: ### Input: Close and release the current usb device. :return: None ### Response: def close(self): """ Close and release the current usb device. :return: None """ # This may not be absolutely necessary, but it is s...
def _set_prior(self, prior): """Set prior for this parameter. The prior must be a function accepting the current value of the parameter as input and giving the probability density as output.""" if prior is None: # Removing prior self._prior = None else: ...
Set prior for this parameter. The prior must be a function accepting the current value of the parameter as input and giving the probability density as output.
Below is the the instruction that describes the task: ### Input: Set prior for this parameter. The prior must be a function accepting the current value of the parameter as input and giving the probability density as output. ### Response: def _set_prior(self, prior): """Set prior for this parameter....
def generate_hash(self): """ Create a unique SHA token/hash using the project SECRET_KEY, URL, email address and current datetime. """ from django.utils.hashcompat import sha_constructor hash = sha_constructor(settings.SECRET_KEY + self.url + self.email + unicode(datetime...
Create a unique SHA token/hash using the project SECRET_KEY, URL, email address and current datetime.
Below is the the instruction that describes the task: ### Input: Create a unique SHA token/hash using the project SECRET_KEY, URL, email address and current datetime. ### Response: def generate_hash(self): """ Create a unique SHA token/hash using the project SECRET_KEY, URL, email a...
def _compute_head_process_tail(self, audio_file_mfcc): """ Set the audio file head or tail, by either reading the explicit values from the Task configuration, or using SD to determine them. This function returns the lengths, in seconds, of the (head, process, tai...
Set the audio file head or tail, by either reading the explicit values from the Task configuration, or using SD to determine them. This function returns the lengths, in seconds, of the (head, process, tail). :rtype: tuple (float, float, float)
Below is the the instruction that describes the task: ### Input: Set the audio file head or tail, by either reading the explicit values from the Task configuration, or using SD to determine them. This function returns the lengths, in seconds, of the (head, process, tail). ...
def _format_label( hazard_class, value, exposure_unit, hazard_unit=None, minimum=None, maximum=None): """Helper function to format the label in the legend. :param hazard_class: The main name of the label. :type hazard_class: basestring :param value: The ...
Helper function to format the label in the legend. :param hazard_class: The main name of the label. :type hazard_class: basestring :param value: The number of features affected by this hazard class. :type value: float :param exposure_unit: The exposure unit. :type exposure_unit: basestring ...
Below is the the instruction that describes the task: ### Input: Helper function to format the label in the legend. :param hazard_class: The main name of the label. :type hazard_class: basestring :param value: The number of features affected by this hazard class. :type value: float :param exp...
async def _recv_loop(self): """ This loop is responsible for reading all incoming responses from the network, decrypting and handling or dispatching them. Besides `connect`, only this method ever receives data. """ while self._user_connected and not self._reconnecting: ...
This loop is responsible for reading all incoming responses from the network, decrypting and handling or dispatching them. Besides `connect`, only this method ever receives data.
Below is the the instruction that describes the task: ### Input: This loop is responsible for reading all incoming responses from the network, decrypting and handling or dispatching them. Besides `connect`, only this method ever receives data. ### Response: async def _recv_loop(self): """ ...
def trim_node(self, node): """Removes a node from the hypergraph. Modifies hypredges with the trimmed node in their head or tail so that they no longer include the trimmed node. If a hyperedge has solely the trimmed node in its head or tail, that hyperedge is removed. ...
Removes a node from the hypergraph. Modifies hypredges with the trimmed node in their head or tail so that they no longer include the trimmed node. If a hyperedge has solely the trimmed node in its head or tail, that hyperedge is removed. Note: hyperedges modified this way wil...
Below is the the instruction that describes the task: ### Input: Removes a node from the hypergraph. Modifies hypredges with the trimmed node in their head or tail so that they no longer include the trimmed node. If a hyperedge has solely the trimmed node in its head or tail, that hyperedg...
def modify_prefix(arg, opts, shell_opts): """ Modify the prefix 'arg' with the options 'opts' """ modify_confirmed = shell_opts.force spec = { 'prefix': arg } v = get_vrf(opts.get('vrf_rt'), abort=True) spec['vrf_rt'] = v.rt res = Prefix.list(spec) if len(res) == 0: print("Pre...
Modify the prefix 'arg' with the options 'opts'
Below is the the instruction that describes the task: ### Input: Modify the prefix 'arg' with the options 'opts' ### Response: def modify_prefix(arg, opts, shell_opts): """ Modify the prefix 'arg' with the options 'opts' """ modify_confirmed = shell_opts.force spec = { 'prefix': arg } v = get...
def all_stats(klass, account, ids, metric_groups, **kwargs): """ Pulls a list of metrics for a specified set of object IDs. """ params = klass._standard_params(ids, metric_groups, **kwargs) resource = klass.RESOURCE_SYNC.format(account_id=account.id) response = Request(a...
Pulls a list of metrics for a specified set of object IDs.
Below is the the instruction that describes the task: ### Input: Pulls a list of metrics for a specified set of object IDs. ### Response: def all_stats(klass, account, ids, metric_groups, **kwargs): """ Pulls a list of metrics for a specified set of object IDs. """ params = klass._s...
def auth_list(**kwargs): """ Shows available authorization groups. """ ctx = Context(**kwargs) ctx.execute_action('auth:group:list', **{ 'storage': ctx.repo.create_secure_service('storage'), })
Shows available authorization groups.
Below is the the instruction that describes the task: ### Input: Shows available authorization groups. ### Response: def auth_list(**kwargs): """ Shows available authorization groups. """ ctx = Context(**kwargs) ctx.execute_action('auth:group:list', **{ 'storage': ctx.repo.create_secure...
def start_timer(self): """ This is a low-level method that is called by pywbem at the begin of an operation. It starts the measurement for that operation, if statistics is enabled for the connection. A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer` ...
This is a low-level method that is called by pywbem at the begin of an operation. It starts the measurement for that operation, if statistics is enabled for the connection. A subsequent invocation of :meth:`~pywbem.OperationStatistic.stop_timer` will complete the measurement for that op...
Below is the the instruction that describes the task: ### Input: This is a low-level method that is called by pywbem at the begin of an operation. It starts the measurement for that operation, if statistics is enabled for the connection. A subsequent invocation of :meth:`~pywbem.OperationSt...