code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def bot_intent(self) -> "IntentAPI": """ Get the intent API for the appservice bot. Returns: The IntentAPI for the appservice bot. """ if not self._bot_intent: self._bot_intent = IntentAPI(self.bot_mxid, self, state_store=self.state_store, ...
Get the intent API for the appservice bot. Returns: The IntentAPI for the appservice bot.
Below is the the instruction that describes the task: ### Input: Get the intent API for the appservice bot. Returns: The IntentAPI for the appservice bot. ### Response: def bot_intent(self) -> "IntentAPI": """ Get the intent API for the appservice bot. Returns: ...
def get_posterior_mean_ratio_scores_vs_background(self): ''' Returns ------- pd.DataFrame of posterior mean scores vs background ''' df = self.get_term_and_background_counts() df['Log Posterior Mean Ratio'] = self._get_posterior_mean_ratio_from_counts(df['cor...
Returns ------- pd.DataFrame of posterior mean scores vs background
Below is the the instruction that describes the task: ### Input: Returns ------- pd.DataFrame of posterior mean scores vs background ### Response: def get_posterior_mean_ratio_scores_vs_background(self): ''' Returns ------- pd.DataFrame of posterior mean sc...
def get(self, request, response): """Processes a `GET` request.""" # Ensure we're allowed to read the resource. self.assert_operations('read') # Delegate to `read` to retrieve the items. items = self.read() # if self.slug is not None and not items: # # Reque...
Processes a `GET` request.
Below is the the instruction that describes the task: ### Input: Processes a `GET` request. ### Response: def get(self, request, response): """Processes a `GET` request.""" # Ensure we're allowed to read the resource. self.assert_operations('read') # Delegate to `read` to retrieve ...
def add(self, action): """Add an action to the execution queue.""" self._state_machine.transition_to_add() self._actions.append(action)
Add an action to the execution queue.
Below is the the instruction that describes the task: ### Input: Add an action to the execution queue. ### Response: def add(self, action): """Add an action to the execution queue.""" self._state_machine.transition_to_add() self._actions.append(action)
def logprint(logname, category, level='INFO', backupCount=15): """ Print logs by datetime. logname string, file name category string, category path of logs file in log directory level string, restrict whether logs to be printed or not backupCoun...
Print logs by datetime. logname string, file name category string, category path of logs file in log directory level string, restrict whether logs to be printed or not backupCount int, how many backups can be reserved
Below is the the instruction that describes the task: ### Input: Print logs by datetime. logname string, file name category string, category path of logs file in log directory level string, restrict whether logs to be printed or not backupCount ...
def create(self, attributes=values.unset, twilio_address=values.unset, date_created=values.unset, date_updated=values.unset, identity=values.unset, user_address=values.unset): """ Create a new ParticipantInstance :param unicode attributes: An optional string metada...
Create a new ParticipantInstance :param unicode attributes: An optional string metadata field you can use to store any data you wish. :param unicode twilio_address: The address of the Twilio phone number that the participant is in contact with. :param datetime date_created: The date that this r...
Below is the the instruction that describes the task: ### Input: Create a new ParticipantInstance :param unicode attributes: An optional string metadata field you can use to store any data you wish. :param unicode twilio_address: The address of the Twilio phone number that the participant is in con...
def edit(self, entity, id, payload, sync=True): """ Edit a document. """ url = urljoin(self.host, entity.value + '/') url = urljoin(url, id + '/') params = {'sync': str(sync).lower()} url = Utils.add_url_parameters(url, params) r = requests.put(url, auth=self.auth, data=j...
Edit a document.
Below is the the instruction that describes the task: ### Input: Edit a document. ### Response: def edit(self, entity, id, payload, sync=True): """ Edit a document. """ url = urljoin(self.host, entity.value + '/') url = urljoin(url, id + '/') params = {'sync': str(sync).lower()} ...
def QCapsulate(self, widget, name, blocking = False, nude = False): """Helper function that encapsulates QWidget into a QMainWindow """ class QuickWindow(QtWidgets.QMainWindow): class Signals(QtCore.QObject): close = QtCore.Signal() show = QtCore.Si...
Helper function that encapsulates QWidget into a QMainWindow
Below is the the instruction that describes the task: ### Input: Helper function that encapsulates QWidget into a QMainWindow ### Response: def QCapsulate(self, widget, name, blocking = False, nude = False): """Helper function that encapsulates QWidget into a QMainWindow """ class QuickWin...
def get_if_deleted(self, addresses): """Returns a list of addresses that have been deleted, or None if it hasn't been deleted. Args: addresses (list of str): The addresses to check if deleted. Returns: (list of str): The addresses, if deleted, or None. "...
Returns a list of addresses that have been deleted, or None if it hasn't been deleted. Args: addresses (list of str): The addresses to check if deleted. Returns: (list of str): The addresses, if deleted, or None.
Below is the the instruction that describes the task: ### Input: Returns a list of addresses that have been deleted, or None if it hasn't been deleted. Args: addresses (list of str): The addresses to check if deleted. Returns: (list of str): The addresses, if delete...
def _filter_schema(schema, schema_tables, exclude_table_columns): """Filters a schema to only include the specified tables in the schema_tables parameter. This will also filter out any colums for included tables that reference tables that are not included in the schema_tables parameter :p...
Filters a schema to only include the specified tables in the schema_tables parameter. This will also filter out any colums for included tables that reference tables that are not included in the schema_tables parameter :param schema: Schema dict to be filtered :param schema_tables: List of...
Below is the the instruction that describes the task: ### Input: Filters a schema to only include the specified tables in the schema_tables parameter. This will also filter out any colums for included tables that reference tables that are not included in the schema_tables parameter :param...
def hydrate_spawned_files(self, exported_files_mapper, filename, data_id): """Pop the given file's map from the exported files mapping. :param exported_files_mapper: The dict of file mappings this process produced. :param filename: The filename to format and remove from the ...
Pop the given file's map from the exported files mapping. :param exported_files_mapper: The dict of file mappings this process produced. :param filename: The filename to format and remove from the mapping. :param data_id: The id of the :meth:`~resolwe.flow.models.Data` ...
Below is the the instruction that describes the task: ### Input: Pop the given file's map from the exported files mapping. :param exported_files_mapper: The dict of file mappings this process produced. :param filename: The filename to format and remove from the mapping. ...
def run_nested(self, maxiter=None, maxcall=None, dlogz=None, logl_max=np.inf, add_live=True, print_progress=True, print_func=None, save_bounds=True): """ **A wrapper that executes the main nested sampling loop.** Iteratively replace the worst live point with...
**A wrapper that executes the main nested sampling loop.** Iteratively replace the worst live point with a sample drawn uniformly from the prior until the provided stopping criteria are reached. Parameters ---------- maxiter : int, optional Maximum number of ...
Below is the the instruction that describes the task: ### Input: **A wrapper that executes the main nested sampling loop.** Iteratively replace the worst live point with a sample drawn uniformly from the prior until the provided stopping criteria are reached. Parameters ----...
def can_afford(self, item_id: Union[UnitTypeId, UpgradeId, AbilityId], check_supply_cost: bool=True) -> "CanAffordWrapper": """Tests if the player has enough resources to build a unit or cast an ability.""" enough_supply = True if isinstance(item_id, UnitTypeId): unit = self._game_da...
Tests if the player has enough resources to build a unit or cast an ability.
Below is the the instruction that describes the task: ### Input: Tests if the player has enough resources to build a unit or cast an ability. ### Response: def can_afford(self, item_id: Union[UnitTypeId, UpgradeId, AbilityId], check_supply_cost: bool=True) -> "CanAffordWrapper": """Tests if the player has ...
def get_all(self, key, fallback=None): """returns all header values for given key""" if key in self.headers: value = self.headers[key] else: value = fallback or [] return value
returns all header values for given key
Below is the the instruction that describes the task: ### Input: returns all header values for given key ### Response: def get_all(self, key, fallback=None): """returns all header values for given key""" if key in self.headers: value = self.headers[key] else: value =...
def format_job_instance(job): ''' Format the job instance correctly ''' ret = {'Function': job.get('fun', 'unknown-function'), 'Arguments': list(job.get('arg', [])), # unlikely but safeguard from invalid returns 'Target': job.get('tgt', 'unknown-target'), 'Tar...
Format the job instance correctly
Below is the the instruction that describes the task: ### Input: Format the job instance correctly ### Response: def format_job_instance(job): ''' Format the job instance correctly ''' ret = {'Function': job.get('fun', 'unknown-function'), 'Arguments': list(job.get('arg', [])), ...
def read_gtfs(path: Path, dist_units: str) -> "Feed": """ Create a Feed instance from the given path and given distance units. The path should be a directory containing GTFS text files or a zip file that unzips as a collection of GTFS text files (and not as a directory containing GTFS text files). ...
Create a Feed instance from the given path and given distance units. The path should be a directory containing GTFS text files or a zip file that unzips as a collection of GTFS text files (and not as a directory containing GTFS text files). The distance units given must lie in :const:`constants.dist_uni...
Below is the the instruction that describes the task: ### Input: Create a Feed instance from the given path and given distance units. The path should be a directory containing GTFS text files or a zip file that unzips as a collection of GTFS text files (and not as a directory containing GTFS text files)...
def update(self, **kwargs): '''Update the object, removing device group if inherited If inheritedDevicegroup is the string "true" we need to remove deviceGroup from the args before we update or we get the following error: The floating traffic-group: /Common/traffic-group-1 can ...
Update the object, removing device group if inherited If inheritedDevicegroup is the string "true" we need to remove deviceGroup from the args before we update or we get the following error: The floating traffic-group: /Common/traffic-group-1 can only be set on /testfolder if i...
Below is the the instruction that describes the task: ### Input: Update the object, removing device group if inherited If inheritedDevicegroup is the string "true" we need to remove deviceGroup from the args before we update or we get the following error: The floating traffic-group...
def get_cts_metadata(self, key: str, lang: str = None) -> Literal: """ Get easily a metadata from the CTS namespace :param key: CTS property to retrieve :param lang: Language in which it should be :return: Literal value of the CTS graph property """ return self.metadata....
Get easily a metadata from the CTS namespace :param key: CTS property to retrieve :param lang: Language in which it should be :return: Literal value of the CTS graph property
Below is the the instruction that describes the task: ### Input: Get easily a metadata from the CTS namespace :param key: CTS property to retrieve :param lang: Language in which it should be :return: Literal value of the CTS graph property ### Response: def get_cts_metadata(self, key: str,...
def _from_dict(cls, _dict): """Initialize a NluEnrichmentFeatures object from a json dictionary.""" args = {} if 'keywords' in _dict: args['keywords'] = NluEnrichmentKeywords._from_dict( _dict.get('keywords')) if 'entities' in _dict: args['entities...
Initialize a NluEnrichmentFeatures object from a json dictionary.
Below is the the instruction that describes the task: ### Input: Initialize a NluEnrichmentFeatures object from a json dictionary. ### Response: def _from_dict(cls, _dict): """Initialize a NluEnrichmentFeatures object from a json dictionary.""" args = {} if 'keywords' in _dict: ...
def format_time( sec ): ''' Re-formats time duration in seconds (*sec*) into more easily readable form, where (days,) hours, minutes, and seconds are explicitly shown. Returns the new duration as a formatted string. ''' import time if sec < 864000: # Idea from: http://stackover...
Re-formats time duration in seconds (*sec*) into more easily readable form, where (days,) hours, minutes, and seconds are explicitly shown. Returns the new duration as a formatted string.
Below is the the instruction that describes the task: ### Input: Re-formats time duration in seconds (*sec*) into more easily readable form, where (days,) hours, minutes, and seconds are explicitly shown. Returns the new duration as a formatted string. ### Response: def format_time( sec ): '''...
def resample(self, edges): """Resample data to a new grid with edges *edges*. This method creates a new grid with the data from the current grid resampled to a regular grid specified by *edges*. The order of the interpolation is set by :attr:`Grid.interpolation_spline_order`: c...
Resample data to a new grid with edges *edges*. This method creates a new grid with the data from the current grid resampled to a regular grid specified by *edges*. The order of the interpolation is set by :attr:`Grid.interpolation_spline_order`: change the value *before* calli...
Below is the the instruction that describes the task: ### Input: Resample data to a new grid with edges *edges*. This method creates a new grid with the data from the current grid resampled to a regular grid specified by *edges*. The order of the interpolation is set by :attr:`Grid...
def convert_permute(builder, layer, input_names, output_names, keras_layer): """Convert a softmax layer from keras to coreml. Parameters keras_layer: layer ---------- A keras layer object. builder: NeuralNetworkBuilder A neural network builder object. """ input_name, output...
Convert a softmax layer from keras to coreml. Parameters keras_layer: layer ---------- A keras layer object. builder: NeuralNetworkBuilder A neural network builder object.
Below is the the instruction that describes the task: ### Input: Convert a softmax layer from keras to coreml. Parameters keras_layer: layer ---------- A keras layer object. builder: NeuralNetworkBuilder A neural network builder object. ### Response: def convert_permute(builder, l...
def to_xarray(self, diagnostics=False): """ Convert process variables to ``xarray.Dataset`` format. With ``diagnostics=True``, both state and diagnostic variables are included. Otherwise just the state variables are included. Returns an ``xarray.Dataset`` object with all spatial axes,...
Convert process variables to ``xarray.Dataset`` format. With ``diagnostics=True``, both state and diagnostic variables are included. Otherwise just the state variables are included. Returns an ``xarray.Dataset`` object with all spatial axes, including 'bounds' axes indicating cell bou...
Below is the the instruction that describes the task: ### Input: Convert process variables to ``xarray.Dataset`` format. With ``diagnostics=True``, both state and diagnostic variables are included. Otherwise just the state variables are included. Returns an ``xarray.Dataset`` object with ...
def parse_irreg(self, l): """ Constructeur de la classe Irreg. :param l: Ligne de chargement des irréguliers :type l: str """ ecl = l.split(':') grq = ecl[0] exclusif = False if grq.endswith("*"): grq = grq[:-1] exclusif = True ...
Constructeur de la classe Irreg. :param l: Ligne de chargement des irréguliers :type l: str
Below is the the instruction that describes the task: ### Input: Constructeur de la classe Irreg. :param l: Ligne de chargement des irréguliers :type l: str ### Response: def parse_irreg(self, l): """ Constructeur de la classe Irreg. :param l: Ligne de chargement des irréguliers ...
def cell_ends_with_code(lines): """Is the last line of the cell a line with code?""" if not lines: return False if not lines[-1].strip(): return False if lines[-1].startswith('#'): return False return True
Is the last line of the cell a line with code?
Below is the the instruction that describes the task: ### Input: Is the last line of the cell a line with code? ### Response: def cell_ends_with_code(lines): """Is the last line of the cell a line with code?""" if not lines: return False if not lines[-1].strip(): return False if lin...
def fetch_items(self, category, **kwargs): """Fetch packages and summary from Crates.io :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items """ from_date = kwargs['from_date'] if category == CATEGORY_C...
Fetch packages and summary from Crates.io :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items
Below is the the instruction that describes the task: ### Input: Fetch packages and summary from Crates.io :param category: the category of items to fetch :param kwargs: backend arguments :returns: a generator of items ### Response: def fetch_items(self, category, **kwargs): """Fe...
async def handle_frame(self, frame): """Handle incoming API frame, return True if this was the expected frame.""" if not isinstance(frame, FrameGetVersionConfirmation): return False self.version = frame.version self.success = True return True
Handle incoming API frame, return True if this was the expected frame.
Below is the the instruction that describes the task: ### Input: Handle incoming API frame, return True if this was the expected frame. ### Response: async def handle_frame(self, frame): """Handle incoming API frame, return True if this was the expected frame.""" if not isinstance(frame, FrameGetVe...
def create(self, access_tokens, days_requested, options=None): ''' Create an asset report. :param [str] access_tokens: A list of access tokens, one token for each Item to be included in the Asset ...
Create an asset report. :param [str] access_tokens: A list of access tokens, one token for each Item to be included in the Asset Report. :param int days_requested: Days of transaction history requested ...
Below is the the instruction that describes the task: ### Input: Create an asset report. :param [str] access_tokens: A list of access tokens, one token for each Item to be included in the Asset Report. :param int ...
def export(self, fn:PathOrStr, **kwargs): "Export the minimal state and save it in `fn` to load an empty version for inference." pickle.dump(self.get_state(**kwargs), open(fn, 'wb'))
Export the minimal state and save it in `fn` to load an empty version for inference.
Below is the the instruction that describes the task: ### Input: Export the minimal state and save it in `fn` to load an empty version for inference. ### Response: def export(self, fn:PathOrStr, **kwargs): "Export the minimal state and save it in `fn` to load an empty version for inference." pickle...
def hasDependency(self, name, target=None, test_dependencies=False): ''' Check if this module has any dependencies with the specified name in its dependencies list, or in target dependencies for the specified target ''' if name in self.description.get('dependencies', {})....
Check if this module has any dependencies with the specified name in its dependencies list, or in target dependencies for the specified target
Below is the the instruction that describes the task: ### Input: Check if this module has any dependencies with the specified name in its dependencies list, or in target dependencies for the specified target ### Response: def hasDependency(self, name, target=None, test_dependencies=False): ...
def google_get_token(self, config, prefix): """Make request to Google API to get token.""" params = { 'code': self.request_args_get( 'code', default=''), 'client_id': self.google_api_client_id, 'client_secret': self.google_api_client_se...
Make request to Google API to get token.
Below is the the instruction that describes the task: ### Input: Make request to Google API to get token. ### Response: def google_get_token(self, config, prefix): """Make request to Google API to get token.""" params = { 'code': self.request_args_get( 'code', ...
def getSheet(book=None,sheet=None): """returns the pyorigin object for a sheet.""" # figure out what book to use if book and not book.lower() in [x.lower() for x in bookNames()]: print("book %s doesn't exist"%book) return if book is None: book=activeBook().lower() if book is...
returns the pyorigin object for a sheet.
Below is the the instruction that describes the task: ### Input: returns the pyorigin object for a sheet. ### Response: def getSheet(book=None,sheet=None): """returns the pyorigin object for a sheet.""" # figure out what book to use if book and not book.lower() in [x.lower() for x in bookNames()]: ...
def create_data_disk(vm_=None, linode_id=None, data_size=None): r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for. ...
r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for. data_size The size of the disk, in MB.
Below is the the instruction that describes the task: ### Input: r''' Create a data disk for the linode (type is hardcoded to ext4 at the moment) .. versionadded:: 2016.3.0 vm\_ The VM profile to create the data disk for. linode_id The ID of the Linode to create the data disk for....
def _build_prior(self, unconstrained_tensor, constrained_tensor): """ Build a tensorflow representation of the prior density. The log Jacobian is included. """ if not misc.is_tensor(unconstrained_tensor): raise GPflowError("Unconstrained input must be a tensor.") ...
Build a tensorflow representation of the prior density. The log Jacobian is included.
Below is the the instruction that describes the task: ### Input: Build a tensorflow representation of the prior density. The log Jacobian is included. ### Response: def _build_prior(self, unconstrained_tensor, constrained_tensor): """ Build a tensorflow representation of the prior density. ...
def get_sent(self, expired=False, for_all=False): """Retreve information on previously sent transfers. :param expired: Whether or not to return expired transfers. :param for_all: Get transfers for all users. Requires a Filemail Business account. :type for_all: bool :typ...
Retreve information on previously sent transfers. :param expired: Whether or not to return expired transfers. :param for_all: Get transfers for all users. Requires a Filemail Business account. :type for_all: bool :type expired: bool :rtype: ``list`` of :class:`pyfilemai...
Below is the the instruction that describes the task: ### Input: Retreve information on previously sent transfers. :param expired: Whether or not to return expired transfers. :param for_all: Get transfers for all users. Requires a Filemail Business account. :type for_all: bool ...
def find(self, instance_id): """ find an instance Create a new instance and populate it with data stored if it exists. Args: instance_id (str): UUID of the instance Returns: AtlasServiceInstance.Instance: An instance """ ...
find an instance Create a new instance and populate it with data stored if it exists. Args: instance_id (str): UUID of the instance Returns: AtlasServiceInstance.Instance: An instance
Below is the the instruction that describes the task: ### Input: find an instance Create a new instance and populate it with data stored if it exists. Args: instance_id (str): UUID of the instance Returns: AtlasServiceInstance.Instance: An i...
async def answer_audio(self, audio: typing.Union[base.InputFile, base.String], caption: typing.Union[base.String, None] = None, duration: typing.Union[base.Integer, None] = None, performer: typing.Union[base.String, None] = None, ...
Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. For sending voice messages, use the sendVoice method instead. Source: https://core.telegram.org/bots/api#sendaudio :param audio: Audio file to ...
Below is the the instruction that describes the task: ### Input: Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .mp3 format. For sending voice messages, use the sendVoice method instead. Source: https://core....
def _generate_provisional_name(q, astrom_header, fits_header): """ Generates a name for an object given the information in its astrom observation header and FITS header. :param q: a queue of provisional names to return. :type q: Queue :param astrom_header: :param fits_header: """ whi...
Generates a name for an object given the information in its astrom observation header and FITS header. :param q: a queue of provisional names to return. :type q: Queue :param astrom_header: :param fits_header:
Below is the the instruction that describes the task: ### Input: Generates a name for an object given the information in its astrom observation header and FITS header. :param q: a queue of provisional names to return. :type q: Queue :param astrom_header: :param fits_header: ### Response: def _g...
def land_temp_prob(self, tlow, thigh): """Temperature-based probability of cloud over land Equation 14 (Zhu and Woodcock, 2012) Parameters ---------- tirs1: ndarray tlow: float Low (17.5 percentile) temperature of land thigh: float High (82...
Temperature-based probability of cloud over land Equation 14 (Zhu and Woodcock, 2012) Parameters ---------- tirs1: ndarray tlow: float Low (17.5 percentile) temperature of land thigh: float High (82.5 percentile) temperature of land Output ...
Below is the the instruction that describes the task: ### Input: Temperature-based probability of cloud over land Equation 14 (Zhu and Woodcock, 2012) Parameters ---------- tirs1: ndarray tlow: float Low (17.5 percentile) temperature of land thigh: float ...
def single_val(self): """return relative error of worst point that might make the data none symmetric. """ sv_t = self._sv(self._tdsphere) sv_p = self._sv(self._tdsphere) return (sv_t, sv_p)
return relative error of worst point that might make the data none symmetric.
Below is the the instruction that describes the task: ### Input: return relative error of worst point that might make the data none symmetric. ### Response: def single_val(self): """return relative error of worst point that might make the data none symmetric. """ ...
def get_names(cs): """Return list of every name.""" records = [] for c in cs: records.extend(c.get('names', [])) return records
Return list of every name.
Below is the the instruction that describes the task: ### Input: Return list of every name. ### Response: def get_names(cs): """Return list of every name.""" records = [] for c in cs: records.extend(c.get('names', [])) return records
def html_to_pdf(content, encoding="utf-8", link_callback=fetch_resources, **kwargs): """ Converts html ``content`` into PDF document. :param unicode content: html content :returns: PDF content :rtype: :class:`bytes` :raises: :exc:`~easy_pdf.exceptions.PDFRenderingError` """ ...
Converts html ``content`` into PDF document. :param unicode content: html content :returns: PDF content :rtype: :class:`bytes` :raises: :exc:`~easy_pdf.exceptions.PDFRenderingError`
Below is the the instruction that describes the task: ### Input: Converts html ``content`` into PDF document. :param unicode content: html content :returns: PDF content :rtype: :class:`bytes` :raises: :exc:`~easy_pdf.exceptions.PDFRenderingError` ### Response: def html_to_pdf(content, encoding="ut...
def load_object(target, namespace=None): """This helper function loads an object identified by a dotted-notation string. For example: # Load class Foo from example.objects load_object('example.objects:Foo') If a plugin namespace is provided simple name references are allowed. For example...
This helper function loads an object identified by a dotted-notation string. For example: # Load class Foo from example.objects load_object('example.objects:Foo') If a plugin namespace is provided simple name references are allowed. For example: # Load the plugin named 'routing' fro...
Below is the the instruction that describes the task: ### Input: This helper function loads an object identified by a dotted-notation string. For example: # Load class Foo from example.objects load_object('example.objects:Foo') If a plugin namespace is provided simple name references are ...
def Nu_cylinder_Whitaker(Re, Pr, mu=None, muw=None): r'''Calculates Nusselt number for crossflow across a single tube as shown in [1]_ at a specified `Re` and `Pr`, both evaluated at the free stream temperature. Recommends a viscosity exponent correction of 0.25, which is applied only if provided. Also ...
r'''Calculates Nusselt number for crossflow across a single tube as shown in [1]_ at a specified `Re` and `Pr`, both evaluated at the free stream temperature. Recommends a viscosity exponent correction of 0.25, which is applied only if provided. Also shown in [2]_. .. math:: Nu_D = (0.4 Re_D^{0...
Below is the the instruction that describes the task: ### Input: r'''Calculates Nusselt number for crossflow across a single tube as shown in [1]_ at a specified `Re` and `Pr`, both evaluated at the free stream temperature. Recommends a viscosity exponent correction of 0.25, which is applied only if pro...
def open_sciobj_file_by_pid_ctx(pid, write=False): """Open the file containing the Science Object bytes of ``pid`` in the default location within the tree of the local SciObj store. If ``write`` is True, the file is opened for writing and any missing directories are created. Return the file handle and ...
Open the file containing the Science Object bytes of ``pid`` in the default location within the tree of the local SciObj store. If ``write`` is True, the file is opened for writing and any missing directories are created. Return the file handle and file_url with the file location in a suitable form for...
Below is the the instruction that describes the task: ### Input: Open the file containing the Science Object bytes of ``pid`` in the default location within the tree of the local SciObj store. If ``write`` is True, the file is opened for writing and any missing directories are created. Return the file ...
def findRequirements(platform): """ Read the requirements.txt file and parse into requirements for setup's install_requirements option. """ includePycapnp = platform not in WINDOWS_PLATFORMS requirementsPath = fixPath(os.path.join(PY_BINDINGS, "requirements.txt")) return [ line.strip() for line in...
Read the requirements.txt file and parse into requirements for setup's install_requirements option.
Below is the the instruction that describes the task: ### Input: Read the requirements.txt file and parse into requirements for setup's install_requirements option. ### Response: def findRequirements(platform): """ Read the requirements.txt file and parse into requirements for setup's install_requirements ...
def read_elastic_tensor(self): """ Parse the elastic tensor data. Returns: 6x6 array corresponding to the elastic tensor from the OUTCAR. """ header_pattern = r"TOTAL ELASTIC MODULI \(kBar\)\s+" \ r"Direction\s+([X-Z][X-Z]\s+)+" \ ...
Parse the elastic tensor data. Returns: 6x6 array corresponding to the elastic tensor from the OUTCAR.
Below is the the instruction that describes the task: ### Input: Parse the elastic tensor data. Returns: 6x6 array corresponding to the elastic tensor from the OUTCAR. ### Response: def read_elastic_tensor(self): """ Parse the elastic tensor data. Returns: ...
def _build_resolver(cls, session: AppSession): '''Build resolver.''' args = session.args dns_timeout = args.dns_timeout if args.timeout: dns_timeout = args.timeout if args.inet_family == 'IPv4': family = IPFamilyPreference.ipv4_only elif args.ine...
Build resolver.
Below is the the instruction that describes the task: ### Input: Build resolver. ### Response: def _build_resolver(cls, session: AppSession): '''Build resolver.''' args = session.args dns_timeout = args.dns_timeout if args.timeout: dns_timeout = args.timeout if...
def send_file(self, path, contents, shutit_pexpect_child=None, truncate=False, note=None, user=None, echo=False, group=None, loglevel=logging.INFO, encoding=None): """S...
Sends the passed-in string as a file to the passed-in path on the target. @param path: Target location of file on target. @param contents: Contents of file as a string. @param shutit_pexpect_child: See send() @param note: See send() @param user: Set ownership to this user (def...
Below is the the instruction that describes the task: ### Input: Sends the passed-in string as a file to the passed-in path on the target. @param path: Target location of file on target. @param contents: Contents of file as a string. @param shutit_pexpect_child: See send() @param note: ...
def makePhe(segID, N, CA, C, O, geo): '''Creates a Phenylalanine residue''' ##R-Group CA_CB_length=geo.CA_CB_length C_CA_CB_angle=geo.C_CA_CB_angle N_C_CA_CB_diangle=geo.N_C_CA_CB_diangle CB_CG_length=geo.CB_CG_length CA_CB_CG_angle=geo.CA_CB_CG_angle N_CA_CB_CG_diangle=geo.N_CA_CB_...
Creates a Phenylalanine residue
Below is the the instruction that describes the task: ### Input: Creates a Phenylalanine residue ### Response: def makePhe(segID, N, CA, C, O, geo): '''Creates a Phenylalanine residue''' ##R-Group CA_CB_length=geo.CA_CB_length C_CA_CB_angle=geo.C_CA_CB_angle N_C_CA_CB_diangle=geo.N_C_CA_CB_dian...
def write(self, file_name, delim=',', sep='\t'): """Writes an undirected hypergraph from a file, where nodes are represented as strings. Each column is separated by "sep", and the individual nodes are delimited by "delim". The header line is currently ignored, but columns should ...
Writes an undirected hypergraph from a file, where nodes are represented as strings. Each column is separated by "sep", and the individual nodes are delimited by "delim". The header line is currently ignored, but columns should be of the format: node1[delim]..nodeM[sep]no...
Below is the the instruction that describes the task: ### Input: Writes an undirected hypergraph from a file, where nodes are represented as strings. Each column is separated by "sep", and the individual nodes are delimited by "delim". The header line is currently ignored, but column...
def container(self, name, length, type, *parameters): """Define a container with given length. This is a convenience method creating a `Struct` with `length` containing fields defined in `type`. """ self.new_struct('Container', name, 'length=%s' % length) BuiltIn().run_keyword(t...
Define a container with given length. This is a convenience method creating a `Struct` with `length` containing fields defined in `type`.
Below is the the instruction that describes the task: ### Input: Define a container with given length. This is a convenience method creating a `Struct` with `length` containing fields defined in `type`. ### Response: def container(self, name, length, type, *parameters): """Define a container with ...
def read_folder(directory): """read text files in directory and returns them as array Args: directory: where the text files are Returns: Array of text """ res = [] for filename in os.listdir(directory): with io.open(os.path.join(directory, filename), encoding="utf-8") a...
read text files in directory and returns them as array Args: directory: where the text files are Returns: Array of text
Below is the the instruction that describes the task: ### Input: read text files in directory and returns them as array Args: directory: where the text files are Returns: Array of text ### Response: def read_folder(directory): """read text files in directory and returns them as array ...
def not26(func): """Function decorator for methods not implemented in Python 2.6.""" @wraps(func) def errfunc(*args, **kwargs): raise NotImplementedError if hexversion < 0x02070000: return errfunc else: return func
Function decorator for methods not implemented in Python 2.6.
Below is the the instruction that describes the task: ### Input: Function decorator for methods not implemented in Python 2.6. ### Response: def not26(func): """Function decorator for methods not implemented in Python 2.6.""" @wraps(func) def errfunc(*args, **kwargs): raise NotImplementedError...
def cancel(self, job_ids): """ Cancels the jobs specified by a list of job ids Args: job_ids : [<job_id> ...] Returns : [True/False...] : If the cancel operation fails the entire list will be False. """ for job in job_ids: logger.debug("Terminating j...
Cancels the jobs specified by a list of job ids Args: job_ids : [<job_id> ...] Returns : [True/False...] : If the cancel operation fails the entire list will be False.
Below is the the instruction that describes the task: ### Input: Cancels the jobs specified by a list of job ids Args: job_ids : [<job_id> ...] Returns : [True/False...] : If the cancel operation fails the entire list will be False. ### Response: def cancel(self, job_ids): ...
def backtrace(node): """ Backtrace according to the parent records and return the path. (including both start and end nodes) """ path = [(node.x, node.y)] while node.parent: node = node.parent path.append((node.x, node.y)) path.reverse() return path
Backtrace according to the parent records and return the path. (including both start and end nodes)
Below is the the instruction that describes the task: ### Input: Backtrace according to the parent records and return the path. (including both start and end nodes) ### Response: def backtrace(node): """ Backtrace according to the parent records and return the path. (including both start and end no...
def get_volume(self, controller, zone): """ Gets the volume level which needs to be doubled to get it to the range of 0..100 - it is located on a 2 byte offset """ volume_level = self.get_zone_info(controller, zone, 2) if volume_level is not None: volume_level *= 2 re...
Gets the volume level which needs to be doubled to get it to the range of 0..100 - it is located on a 2 byte offset
Below is the the instruction that describes the task: ### Input: Gets the volume level which needs to be doubled to get it to the range of 0..100 - it is located on a 2 byte offset ### Response: def get_volume(self, controller, zone): """ Gets the volume level which needs to be doubled to get it to...
def send_file_from_directory(filename, directory, app=None): """Helper to add static rules, like in `abilian.app`.app. Example use:: app.add_url_rule( app.static_url_path + '/abilian/<path:filename>', endpoint='abilian_static', view_func=partial(send_file_from_directory, ...
Helper to add static rules, like in `abilian.app`.app. Example use:: app.add_url_rule( app.static_url_path + '/abilian/<path:filename>', endpoint='abilian_static', view_func=partial(send_file_from_directory, directory='/path/to/static/files/dir'))
Below is the the instruction that describes the task: ### Input: Helper to add static rules, like in `abilian.app`.app. Example use:: app.add_url_rule( app.static_url_path + '/abilian/<path:filename>', endpoint='abilian_static', view_func=partial(send_file_from_directory, ...
def update_internal_boundary_x_y (self, solution_array): """update the inner boundary with the same send/recv pattern as the MPIPartitioner""" nsd_ = self.nsd dtype = solution_array.dtype if nsd_!=len(self.in_lower_buffers) | nsd_!=len(self.out_lower_buffers): print("Buffers ...
update the inner boundary with the same send/recv pattern as the MPIPartitioner
Below is the the instruction that describes the task: ### Input: update the inner boundary with the same send/recv pattern as the MPIPartitioner ### Response: def update_internal_boundary_x_y (self, solution_array): """update the inner boundary with the same send/recv pattern as the MPIPartitioner""" ...
def top_parents(papers, topn=20, verbose=False): """ Returns a list of :class:`.Paper` that cite the topn most cited papers. Parameters ---------- papers : list A list of :class:`.Paper` objects. topn : int or float {0.-1.} Number (int) or percentage (float) of top-cited papers....
Returns a list of :class:`.Paper` that cite the topn most cited papers. Parameters ---------- papers : list A list of :class:`.Paper` objects. topn : int or float {0.-1.} Number (int) or percentage (float) of top-cited papers. verbose : bool If True, prints status messages. ...
Below is the the instruction that describes the task: ### Input: Returns a list of :class:`.Paper` that cite the topn most cited papers. Parameters ---------- papers : list A list of :class:`.Paper` objects. topn : int or float {0.-1.} Number (int) or percentage (float) of top-cited...
def topng(images, path, prefix="image", overwrite=False, credentials=None): """ Write out PNG files for 2d image data. See also -------- thunder.data.images.topng """ value_shape = images.value_shape if not len(value_shape) in [2, 3]: raise ValueError("Only 2D or 3D images can b...
Write out PNG files for 2d image data. See also -------- thunder.data.images.topng
Below is the the instruction that describes the task: ### Input: Write out PNG files for 2d image data. See also -------- thunder.data.images.topng ### Response: def topng(images, path, prefix="image", overwrite=False, credentials=None): """ Write out PNG files for 2d image data. See also...
def startJVM(jvm=None, *args, **kwargs): """ Starts a Java Virtual Machine. Without options it will start the JVM with the default classpath and jvm. The default classpath will be determined by jpype.getClassPath(). The default JVM is determined by jpype.getDefaultJVMPath(). Args: jvm...
Starts a Java Virtual Machine. Without options it will start the JVM with the default classpath and jvm. The default classpath will be determined by jpype.getClassPath(). The default JVM is determined by jpype.getDefaultJVMPath(). Args: jvm (str): Path to the jvm library file (libjvm.so, jvm...
Below is the the instruction that describes the task: ### Input: Starts a Java Virtual Machine. Without options it will start the JVM with the default classpath and jvm. The default classpath will be determined by jpype.getClassPath(). The default JVM is determined by jpype.getDefaultJVMPath(). ...
def showMessage(self, message, *args): """ Public method to show a message in the bottom part of the splashscreen. @param message message to be shown (string or QString) """ QSplashScreen.showMessage( self, message, Qt.AlignBottom | Qt.AlignRight | Qt.AlignAbsolute, ...
Public method to show a message in the bottom part of the splashscreen. @param message message to be shown (string or QString)
Below is the the instruction that describes the task: ### Input: Public method to show a message in the bottom part of the splashscreen. @param message message to be shown (string or QString) ### Response: def showMessage(self, message, *args): """ Public method to show a message in the bo...
def make_sshable(c): """ Set up passwordless SSH keypair & authorized_hosts access to localhost. """ user = c.travis.sudo.user home = "~{0}".format(user) # Run sudo() as the new sudo user; means less chown'ing, etc. c.config.sudo.user = user ssh_dir = "{0}/.ssh".format(home) # TODO: ...
Set up passwordless SSH keypair & authorized_hosts access to localhost.
Below is the the instruction that describes the task: ### Input: Set up passwordless SSH keypair & authorized_hosts access to localhost. ### Response: def make_sshable(c): """ Set up passwordless SSH keypair & authorized_hosts access to localhost. """ user = c.travis.sudo.user home = "~{0}".for...
def calculate_temperature_equivalent(temperatures): """ Calculates the temperature equivalent from a series of average daily temperatures according to the formula: 0.6 * tempDay0 + 0.3 * tempDay-1 + 0.1 * tempDay-2 Parameters ---------- series : Pandas Series Returns ------- Pandas...
Calculates the temperature equivalent from a series of average daily temperatures according to the formula: 0.6 * tempDay0 + 0.3 * tempDay-1 + 0.1 * tempDay-2 Parameters ---------- series : Pandas Series Returns ------- Pandas Series
Below is the the instruction that describes the task: ### Input: Calculates the temperature equivalent from a series of average daily temperatures according to the formula: 0.6 * tempDay0 + 0.3 * tempDay-1 + 0.1 * tempDay-2 Parameters ---------- series : Pandas Series Returns ------- P...
def configure(screen_name=None, config_file=None, app=None, **kwargs): """ Set up a config dictionary using a bots.yaml config file and optional keyword args. Args: screen_name (str): screen_name of user to search for in config file config_file (str): Path to read for the config file ...
Set up a config dictionary using a bots.yaml config file and optional keyword args. Args: screen_name (str): screen_name of user to search for in config file config_file (str): Path to read for the config file app (str): Name of the app to look for in the config file. Defaults to the one se...
Below is the the instruction that describes the task: ### Input: Set up a config dictionary using a bots.yaml config file and optional keyword args. Args: screen_name (str): screen_name of user to search for in config file config_file (str): Path to read for the config file app (str): N...
def Tm(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[]): r'''This function handles the retrieval of a chemical's melting point. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Prefered source...
r'''This function handles the retrieval of a chemical's melting point. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Prefered sources are 'Open Notebook Melting Points', with backup sources 'CRC Physica...
Below is the the instruction that describes the task: ### Input: r'''This function handles the retrieval of a chemical's melting point. Lookup is based on CASRNs. Will automatically select a data source to use if no Method is provided; returns None if the data is not available. Prefered sources are...
def get_turbine_data_from_oedb(turbine_type, fetch_curve, overwrite=False): r""" Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded from oedb in :py:func...
r""" Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded from oedb in :py:func:`~.load_turbine_data_from_oedb`. Use this function with `overwrite=True` to...
Below is the the instruction that describes the task: ### Input: r""" Fetches data for one wind turbine type from the OpenEnergy Database (oedb). If turbine data exists in local repository it is loaded from this file. The file is created when turbine data was loaded from oedb in :py:func:`~.load_tu...
def topic_over_time(self, k, mode='counts', slice_kwargs={}): """ Calculate the representation of topic ``k`` in the corpus over time. """ return self.corpus.feature_distribution('topics', k, mode=mode, **slice_kwargs)
Calculate the representation of topic ``k`` in the corpus over time.
Below is the the instruction that describes the task: ### Input: Calculate the representation of topic ``k`` in the corpus over time. ### Response: def topic_over_time(self, k, mode='counts', slice_kwargs={}): """ Calculate the representation of topic ``k`` in the corpus over time. """ ...
def _get_reader(self, network_reader): """ Get a reader or None if another reader is already reading. """ with (yield from self._lock): if self._reader_process is None: self._reader_process = network_reader if self._reader: if self....
Get a reader or None if another reader is already reading.
Below is the the instruction that describes the task: ### Input: Get a reader or None if another reader is already reading. ### Response: def _get_reader(self, network_reader): """ Get a reader or None if another reader is already reading. """ with (yield from self._lock): ...
def _adjust_beforenext(self, real_wave_mfcc, algo_parameters): """ BEFORENEXT """ def new_time(nsi): """ The new boundary time value is ``delay`` before the end of the nonspeech interval ``nsi``. If ``nsi`` has length less than ``delay``, ...
BEFORENEXT
Below is the the instruction that describes the task: ### Input: BEFORENEXT ### Response: def _adjust_beforenext(self, real_wave_mfcc, algo_parameters): """ BEFORENEXT """ def new_time(nsi): """ The new boundary time value is ``delay`` before the ...
def calculate_size(name, key): """ Calculates the request payload size""" data_size = 0 data_size += calculate_size_str(name) data_size += calculate_size_data(key) return data_size
Calculates the request payload size
Below is the the instruction that describes the task: ### Input: Calculates the request payload size ### Response: def calculate_size(name, key): """ Calculates the request payload size""" data_size = 0 data_size += calculate_size_str(name) data_size += calculate_size_data(key) return data_size
def from_string(species_string: str): """ Returns a Specie from a string representation. Args: species_string (str): A typical string representation of a species, e.g., "Mn2+", "Fe3+", "O2-". Returns: A Specie object. Raises: ...
Returns a Specie from a string representation. Args: species_string (str): A typical string representation of a species, e.g., "Mn2+", "Fe3+", "O2-". Returns: A Specie object. Raises: ValueError if species_string cannot be intepreted.
Below is the the instruction that describes the task: ### Input: Returns a Specie from a string representation. Args: species_string (str): A typical string representation of a species, e.g., "Mn2+", "Fe3+", "O2-". Returns: A Specie object. Raises: ...
def DEFINE_spaceseplist( # pylint: disable=invalid-name,redefined-builtin name, default, help, comma_compat=False, flag_values=_flagvalues.FLAGS, **args): """Registers a flag whose value is a whitespace-separated list of strings. Any whitespace can be used as a separator. Args: name: str, the flag ...
Registers a flag whose value is a whitespace-separated list of strings. Any whitespace can be used as a separator. Args: name: str, the flag name. default: list|str|None, the default value of the flag. help: str, the help message. comma_compat: bool - Whether to support comma as an additional sepa...
Below is the the instruction that describes the task: ### Input: Registers a flag whose value is a whitespace-separated list of strings. Any whitespace can be used as a separator. Args: name: str, the flag name. default: list|str|None, the default value of the flag. help: str, the help message. ...
def show_top_losses(self, k:int, max_len:int=70)->None: """ Create a tabulation showing the first `k` texts in top_losses along with their prediction, actual,loss, and probability of actual class. `max_len` is the maximum number of tokens displayed. """ from IPython.display impor...
Create a tabulation showing the first `k` texts in top_losses along with their prediction, actual,loss, and probability of actual class. `max_len` is the maximum number of tokens displayed.
Below is the the instruction that describes the task: ### Input: Create a tabulation showing the first `k` texts in top_losses along with their prediction, actual,loss, and probability of actual class. `max_len` is the maximum number of tokens displayed. ### Response: def show_top_losses(self, k:int, max_l...
def request_service(self, app_name, port, expected_output=None): """ Make request on service of app. If there is connection error function return False. :param app_name: str, name of the app :param expected_output: str, If not None method will check output returned from request ...
Make request on service of app. If there is connection error function return False. :param app_name: str, name of the app :param expected_output: str, If not None method will check output returned from request and try to find matching string. :param port: str or int, port of the s...
Below is the the instruction that describes the task: ### Input: Make request on service of app. If there is connection error function return False. :param app_name: str, name of the app :param expected_output: str, If not None method will check output returned from request and try to...
def dict_to_literal(dict_container: dict): """ Transforms a JSON+LD PyLD dictionary into an RDFLib object""" if isinstance(dict_container["@value"], int): return dict_container["@value"], else: return dict_container["@value"], dict_container.get("@language", None)
Transforms a JSON+LD PyLD dictionary into an RDFLib object
Below is the the instruction that describes the task: ### Input: Transforms a JSON+LD PyLD dictionary into an RDFLib object ### Response: def dict_to_literal(dict_container: dict): """ Transforms a JSON+LD PyLD dictionary into an RDFLib object""" if isinstance(dict_container["@value"], int): ...
def _traverse_command(self, name, *args, **kwargs): """ Add the key to the args and call the Redis command. """ if not name in self.available_commands: raise AttributeError("%s is not an available command for %s" % (name, self.__class__.__name...
Add the key to the args and call the Redis command.
Below is the the instruction that describes the task: ### Input: Add the key to the args and call the Redis command. ### Response: def _traverse_command(self, name, *args, **kwargs): """ Add the key to the args and call the Redis command. """ if not name in self.available_commands: ...
def page(self, email=values.unset, status=values.unset, page_token=values.unset, page_number=values.unset, page_size=values.unset): """ Retrieve a single page of AuthorizationDocumentInstance records from the API. Request is executed immediately :param unicode email: Email....
Retrieve a single page of AuthorizationDocumentInstance records from the API. Request is executed immediately :param unicode email: Email. :param AuthorizationDocumentInstance.Status status: The Status of this AuthorizationDocument. :param str page_token: PageToken provided by the API ...
Below is the the instruction that describes the task: ### Input: Retrieve a single page of AuthorizationDocumentInstance records from the API. Request is executed immediately :param unicode email: Email. :param AuthorizationDocumentInstance.Status status: The Status of this AuthorizationDoc...
def add_template_events_to_network(self, columns, vectors): """ Add a vector indexed """ # Just call through to the standard function self.template_events = self.template_event_dict['network'] self.add_template_network_events(columns, vectors) self.template_event_dict['network'] ...
Add a vector indexed
Below is the the instruction that describes the task: ### Input: Add a vector indexed ### Response: def add_template_events_to_network(self, columns, vectors): """ Add a vector indexed """ # Just call through to the standard function self.template_events = self.template_event_dict['network'...
def filter_duplicate(self, url): """ url去重 """ if self.filterDuplicate: if url in self.historys: raise Exception('duplicate excepiton: %s is duplicate' % url) else: self.historys.add(url) else: pass
url去重
Below is the the instruction that describes the task: ### Input: url去重 ### Response: def filter_duplicate(self, url): """ url去重 """ if self.filterDuplicate: if url in self.historys: raise Exception('duplicate excepiton: %s is duplicate' % url) ...
def get_forwarding_address_details(destination_address, api_key, callback_url=None, coin_symbol='btc'): """ Give a destination address and return the details of the input address that will automatically forward to the destination address Note: a blockcypher api_key is required for this method """ ...
Give a destination address and return the details of the input address that will automatically forward to the destination address Note: a blockcypher api_key is required for this method
Below is the the instruction that describes the task: ### Input: Give a destination address and return the details of the input address that will automatically forward to the destination address Note: a blockcypher api_key is required for this method ### Response: def get_forwarding_address_details(destin...
def depth_december_average_ground_temperature(self, value=None): """Corresponds to IDD Field `depth_december_average_ground_temperature` Args: value (float): value for IDD Field `depth_december_average_ground_temperature` Unit: C if `value` is None it will no...
Corresponds to IDD Field `depth_december_average_ground_temperature` Args: value (float): value for IDD Field `depth_december_average_ground_temperature` Unit: C if `value` is None it will not be checked against the specification and is assumed to be ...
Below is the the instruction that describes the task: ### Input: Corresponds to IDD Field `depth_december_average_ground_temperature` Args: value (float): value for IDD Field `depth_december_average_ground_temperature` Unit: C if `value` is None it will not be ch...
def copy(self): """Return a new :class:`Card` just like me.""" d = {} for att in ( 'deck', 'idx', 'ud', 'foreground_source', 'foreground_color', 'foreground_image', 'foreground_texture...
Return a new :class:`Card` just like me.
Below is the the instruction that describes the task: ### Input: Return a new :class:`Card` just like me. ### Response: def copy(self): """Return a new :class:`Card` just like me.""" d = {} for att in ( 'deck', 'idx', 'ud', 'fo...
def lease_storage_container(kwargs=None, storage_conn=None, call=None): ''' .. versionadded:: 2015.8.0 Lease a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f lease_storage_container my-azure name=mycontainer name: Name of contai...
.. versionadded:: 2015.8.0 Lease a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f lease_storage_container my-azure name=mycontainer name: Name of container to create. lease_action: Required. Possible values: acquire|renew|re...
Below is the the instruction that describes the task: ### Input: .. versionadded:: 2015.8.0 Lease a container associated with the storage account CLI Example: .. code-block:: bash salt-cloud -f lease_storage_container my-azure name=mycontainer name: Name of container to create. ...
def as_svg_data_uri(matrix, version, scale=1, border=None, color='#000', background=None, xmldecl=False, svgns=True, title=None, desc=None, svgid=None, svgclass='segno', lineclass='qrline', omitsize=False, unit='', encoding='utf-8', svgvers...
\ Converts the matrix to a SVG data URI. The XML declaration is omitted by default (set ``xmldecl`` to ``True`` to enable it), further the newline is omitted by default (set ``nl`` to ``True`` to enable it). Aside from the missing ``out`` parameter and the different ``xmldecl`` and ``nl`` defa...
Below is the the instruction that describes the task: ### Input: \ Converts the matrix to a SVG data URI. The XML declaration is omitted by default (set ``xmldecl`` to ``True`` to enable it), further the newline is omitted by default (set ``nl`` to ``True`` to enable it). Aside from the missin...
async def fetch_postcodes_from_coordinates(lat: float, long: float) -> Optional[List[Postcode]]: """ Gets a postcode object from the lat and long. :param lat: The latitude to look up. :param long: The longitude to look up. :return: The mapping corresponding to the lat and long or none if the postcod...
Gets a postcode object from the lat and long. :param lat: The latitude to look up. :param long: The longitude to look up. :return: The mapping corresponding to the lat and long or none if the postcode does not exist. :raises ApiError: When there was an error connecting to the API. :raises CircuitBre...
Below is the the instruction that describes the task: ### Input: Gets a postcode object from the lat and long. :param lat: The latitude to look up. :param long: The longitude to look up. :return: The mapping corresponding to the lat and long or none if the postcode does not exist. :raises ApiError: ...
def login_user(user, remember=None): """Perform the login routine. If SECURITY_TRACKABLE is used, make sure you commit changes after this request (i.e. ``app.security.datastore.commit()``). :param user: The user to login :param remember: Flag specifying if the remember cookie should be set. ...
Perform the login routine. If SECURITY_TRACKABLE is used, make sure you commit changes after this request (i.e. ``app.security.datastore.commit()``). :param user: The user to login :param remember: Flag specifying if the remember cookie should be set. Defaults to ``False``
Below is the the instruction that describes the task: ### Input: Perform the login routine. If SECURITY_TRACKABLE is used, make sure you commit changes after this request (i.e. ``app.security.datastore.commit()``). :param user: The user to login :param remember: Flag specifying if the remember coo...
def server_inspect_exception(self, req_event, rep_event, task_ctx, exc_info): """ Called when an exception has been raised in the code run by ZeroRPC """ # Hide the zerorpc internal frames for readability, for a REQ/REP or # REQ/STREAM server the frames to hide are: # - c...
Called when an exception has been raised in the code run by ZeroRPC
Below is the the instruction that describes the task: ### Input: Called when an exception has been raised in the code run by ZeroRPC ### Response: def server_inspect_exception(self, req_event, rep_event, task_ctx, exc_info): """ Called when an exception has been raised in the code run by ZeroRPC ...
def get_items(self): """ Return the item models associated with this Publish group. """ from .layers import Layer # no expansion support, just URLs results = [] for url in self.items: if '/layers/' in url: r = self._client.request('GET...
Return the item models associated with this Publish group.
Below is the the instruction that describes the task: ### Input: Return the item models associated with this Publish group. ### Response: def get_items(self): """ Return the item models associated with this Publish group. """ from .layers import Layer # no expansion support...
def _parse_boolean(value, default=False): """ Attempt to cast *value* into a bool, returning *default* if it fails. """ if value is None: return default try: return bool(value) except ValueError: return default
Attempt to cast *value* into a bool, returning *default* if it fails.
Below is the the instruction that describes the task: ### Input: Attempt to cast *value* into a bool, returning *default* if it fails. ### Response: def _parse_boolean(value, default=False): """ Attempt to cast *value* into a bool, returning *default* if it fails. """ if value is None: retu...
def load_profiles(self, overwrite=False): """Load the profiles into the dropdown list. :param overwrite: If we overwrite existing profiles from the plugin. :type overwrite: bool """ for profile in self.minimum_needs.get_profiles(overwrite): self.profile_combo.addItem...
Load the profiles into the dropdown list. :param overwrite: If we overwrite existing profiles from the plugin. :type overwrite: bool
Below is the the instruction that describes the task: ### Input: Load the profiles into the dropdown list. :param overwrite: If we overwrite existing profiles from the plugin. :type overwrite: bool ### Response: def load_profiles(self, overwrite=False): """Load the profiles into the dropdo...
def __vCmdSetCamAperture(self, args): '''ToDo: Validate CAM number and Valid Aperture Value''' if len(args) == 1: for cam in self.camera_list: cam.boSetAperture(int(args[0])) elif len(args) == 2: cam = self.camera_list[int(args[1])] cam.boSetAp...
ToDo: Validate CAM number and Valid Aperture Value
Below is the the instruction that describes the task: ### Input: ToDo: Validate CAM number and Valid Aperture Value ### Response: def __vCmdSetCamAperture(self, args): '''ToDo: Validate CAM number and Valid Aperture Value''' if len(args) == 1: for cam in self.camera_list: ...
def detachKernelDriver(self, interface): r"""Detach a kernel driver from the interface (if one is attached, we have permission and the operation is supported by the OS) Arguments: interface: interface number or an Interface object. """ if isinstance(interface, In...
r"""Detach a kernel driver from the interface (if one is attached, we have permission and the operation is supported by the OS) Arguments: interface: interface number or an Interface object.
Below is the the instruction that describes the task: ### Input: r"""Detach a kernel driver from the interface (if one is attached, we have permission and the operation is supported by the OS) Arguments: interface: interface number or an Interface object. ### Response: def detachKe...
def get_dual_rmetric( self, invert_h = False, mode_inv = 'svd' ): """ Compute the dual Riemannian Metric This is not satisfactory, because if mdimG<mdimY the shape of H will not be the same as the shape of G. TODO(maybe): return a (copied) smaller H with only the rows and columns...
Compute the dual Riemannian Metric This is not satisfactory, because if mdimG<mdimY the shape of H will not be the same as the shape of G. TODO(maybe): return a (copied) smaller H with only the rows and columns in G.
Below is the the instruction that describes the task: ### Input: Compute the dual Riemannian Metric This is not satisfactory, because if mdimG<mdimY the shape of H will not be the same as the shape of G. TODO(maybe): return a (copied) smaller H with only the rows and columns in G. ### Respon...
def QA_fetch_get_goods_list(ip=None, port=None): """[summary] Keyword Arguments: ip {[type]} -- [description] (default: {None}) port {[type]} -- [description] (default: {None}) 42 3 商品指数 TI 60 3 主力期货合约 MA 28 3 郑州商品 QZ ...
[summary] Keyword Arguments: ip {[type]} -- [description] (default: {None}) port {[type]} -- [description] (default: {None}) 42 3 商品指数 TI 60 3 主力期货合约 MA 28 3 郑州商品 QZ 29 3 大连商品 QD 30 3 ...
Below is the the instruction that describes the task: ### Input: [summary] Keyword Arguments: ip {[type]} -- [description] (default: {None}) port {[type]} -- [description] (default: {None}) 42 3 商品指数 TI 60 3 主力期货合约 MA 28 3 郑州商品 ...
def _integrate_segmentation_masks(segmasks): """ `segmasks` should be in sorted order of [coarsest, ..., finest]. Integrates the given list of segmentation masks together to form one segmentation mask by having each segment subsume ones that exist in the finer masks. """ if len(segmasks) == 1: ...
`segmasks` should be in sorted order of [coarsest, ..., finest]. Integrates the given list of segmentation masks together to form one segmentation mask by having each segment subsume ones that exist in the finer masks.
Below is the the instruction that describes the task: ### Input: `segmasks` should be in sorted order of [coarsest, ..., finest]. Integrates the given list of segmentation masks together to form one segmentation mask by having each segment subsume ones that exist in the finer masks. ### Response: def _int...
def update_models_recursively(state_m, expected=True): """ If a state model is reused the model depth maybe is to low. Therefore this method checks if all library state models are created with reliable depth :param bool expected: Define newly generated library models as expected or triggers logger war...
If a state model is reused the model depth maybe is to low. Therefore this method checks if all library state models are created with reliable depth :param bool expected: Define newly generated library models as expected or triggers logger warnings if False
Below is the the instruction that describes the task: ### Input: If a state model is reused the model depth maybe is to low. Therefore this method checks if all library state models are created with reliable depth :param bool expected: Define newly generated library models as expected or triggers logg...
def get_normal_connection(config): """ Get the connection either with a username and password or without """ if config.username and config.password: log.debug("connecting with username and password") queue_manager = pymqi.connect( config.queue_manager_name, config.channel, co...
Get the connection either with a username and password or without
Below is the the instruction that describes the task: ### Input: Get the connection either with a username and password or without ### Response: def get_normal_connection(config): """ Get the connection either with a username and password or without """ if config.username and config.password: ...
def solve(self): ''' Solves a one period consumption saving problem with risky income, with persistent income explicitly tracked as a state variable. Parameters ---------- None Returns ------- solution : ConsumerSolution The solution ...
Solves a one period consumption saving problem with risky income, with persistent income explicitly tracked as a state variable. Parameters ---------- None Returns ------- solution : ConsumerSolution The solution to the one period problem, including ...
Below is the the instruction that describes the task: ### Input: Solves a one period consumption saving problem with risky income, with persistent income explicitly tracked as a state variable. Parameters ---------- None Returns ------- solution : ConsumerSo...