code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def add_link(self, name, desc, layout, node_1, node_2): """ Add a link to a network. Links are what effectively define the network topology, by associating two already existing nodes. """ existing_link = get_session().query(Link).filter(Link.name==name, Link....
Add a link to a network. Links are what effectively define the network topology, by associating two already existing nodes.
Below is the the instruction that describes the task: ### Input: Add a link to a network. Links are what effectively define the network topology, by associating two already existing nodes. ### Response: def add_link(self, name, desc, layout, node_1, node_2): """ Add a li...
def _normalize_http_methods(http_method): """ Normalizes Http Methods. Api Gateway allows a Http Methods of ANY. This is a special verb to denote all supported Http Methods on Api Gateway. :param str http_method: Http method :yield str: Either the input http_method or one of the...
Normalizes Http Methods. Api Gateway allows a Http Methods of ANY. This is a special verb to denote all supported Http Methods on Api Gateway. :param str http_method: Http method :yield str: Either the input http_method or one of the _ANY_HTTP_METHODS (normalized Http Methods)
Below is the the instruction that describes the task: ### Input: Normalizes Http Methods. Api Gateway allows a Http Methods of ANY. This is a special verb to denote all supported Http Methods on Api Gateway. :param str http_method: Http method :yield str: Either the input http_method or one...
def search_handle(self, URL=None, prefix=None, **key_value_pairs): ''' Search for handles containing the specified key with the specified value. The search terms are passed on to the reverse lookup servlet as-is. The servlet is supposed to be case-insensitive, but if it isn't, th...
Search for handles containing the specified key with the specified value. The search terms are passed on to the reverse lookup servlet as-is. The servlet is supposed to be case-insensitive, but if it isn't, the wrong case will cause a :exc:`~b2handle.handleexceptions.ReverseLookupException`. ...
Below is the the instruction that describes the task: ### Input: Search for handles containing the specified key with the specified value. The search terms are passed on to the reverse lookup servlet as-is. The servlet is supposed to be case-insensitive, but if it isn't, the wrong case will ...
def _store_token(self, token, remember=False): """Store token for future use.""" if token and remember: try: keyring.set_password('github', 'token', token) except Exception: if self._show_msgbox: QMessageBox.warning(self.parent_...
Store token for future use.
Below is the the instruction that describes the task: ### Input: Store token for future use. ### Response: def _store_token(self, token, remember=False): """Store token for future use.""" if token and remember: try: keyring.set_password('github', 'token', token) ...
def service_action(self, service, action): "Perform given action on service for the selected cluster" try: service = api.get_cluster(self.cluster).get_service(service) except ApiException: print("Service not found") return None if action == "start": ...
Perform given action on service for the selected cluster
Below is the the instruction that describes the task: ### Input: Perform given action on service for the selected cluster ### Response: def service_action(self, service, action): "Perform given action on service for the selected cluster" try: service = api.get_cluster(self.cluster).get_...
def get_cumulative_veto_group_files(workflow, option, cat_files, out_dir, execute_now=True, tags=None): """ Get the cumulative veto files that define the different backgrounds we want to analyze, defined by groups of vetos. Parameters ----------- workflow : W...
Get the cumulative veto files that define the different backgrounds we want to analyze, defined by groups of vetos. Parameters ----------- workflow : Workflow object Instance of the workflow object option : str ini file option to use to get the veto groups cat_files : FileList o...
Below is the the instruction that describes the task: ### Input: Get the cumulative veto files that define the different backgrounds we want to analyze, defined by groups of vetos. Parameters ----------- workflow : Workflow object Instance of the workflow object option : str ini...
def args(self): """The parsed URL parameters. By default an :class:`~werkzeug.datastructures.ImmutableMultiDict` is returned from this function. This can be changed by setting :attr:`parameter_storage_class` to a different type. This might be necessary if the order of the form...
The parsed URL parameters. By default an :class:`~werkzeug.datastructures.ImmutableMultiDict` is returned from this function. This can be changed by setting :attr:`parameter_storage_class` to a different type. This might be necessary if the order of the form data is important.
Below is the the instruction that describes the task: ### Input: The parsed URL parameters. By default an :class:`~werkzeug.datastructures.ImmutableMultiDict` is returned from this function. This can be changed by setting :attr:`parameter_storage_class` to a different type. This might ...
def forbid_web_access(f): """ Forbids running task using http request. :param f: Callable :return Callable """ @wraps(f) def wrapper_fn(*args, **kwargs): if isinstance(JobContext.get_current_context(), WebJobContext): raise ForbiddenError('Access forbidden from web.') ...
Forbids running task using http request. :param f: Callable :return Callable
Below is the the instruction that describes the task: ### Input: Forbids running task using http request. :param f: Callable :return Callable ### Response: def forbid_web_access(f): """ Forbids running task using http request. :param f: Callable :return Callable """ @wraps(f) ...
def get_header(cls, script_text="", executable=None): """Create a #! line, getting options (if any) from script_text""" cmd = cls.command_spec_class.best().from_param(executable) cmd.install_options(script_text) return cmd.as_header()
Create a #! line, getting options (if any) from script_text
Below is the the instruction that describes the task: ### Input: Create a #! line, getting options (if any) from script_text ### Response: def get_header(cls, script_text="", executable=None): """Create a #! line, getting options (if any) from script_text""" cmd = cls.command_spec_class.best().from...
def main(path): '''scan path directory and any subdirectories for valid captain scripts''' basepath = os.path.abspath(os.path.expanduser(str(path))) echo.h2("Available scripts in {}".format(basepath)) echo.br() for root_dir, dirs, files in os.walk(basepath, topdown=True): for f in fnmatch.f...
scan path directory and any subdirectories for valid captain scripts
Below is the the instruction that describes the task: ### Input: scan path directory and any subdirectories for valid captain scripts ### Response: def main(path): '''scan path directory and any subdirectories for valid captain scripts''' basepath = os.path.abspath(os.path.expanduser(str(path))) echo....
def get_info(self): ''' Get info regarding the current fuzzed enclosed node :return: info dictionary ''' field = self._current_field() if field: info = field.get_info() info['path'] = '%s/%s' % (self.name if self.name else '<no name>', info['path'...
Get info regarding the current fuzzed enclosed node :return: info dictionary
Below is the the instruction that describes the task: ### Input: Get info regarding the current fuzzed enclosed node :return: info dictionary ### Response: def get_info(self): ''' Get info regarding the current fuzzed enclosed node :return: info dictionary ''' fiel...
def isel(self, indexers=None, drop=False, **indexers_kwargs): """Return a new DataArray whose dataset is given by integer indexing along the specified dimension(s). See Also -------- Dataset.isel DataArray.sel """ indexers = either_dict_or_kwargs(indexers...
Return a new DataArray whose dataset is given by integer indexing along the specified dimension(s). See Also -------- Dataset.isel DataArray.sel
Below is the the instruction that describes the task: ### Input: Return a new DataArray whose dataset is given by integer indexing along the specified dimension(s). See Also -------- Dataset.isel DataArray.sel ### Response: def isel(self, indexers=None, drop=False, **indexe...
def changed_lines(self): """ A list of dicts in the format: { 'file_name': str, 'content': str, 'line_number': int, 'position': int } """ lines = [] file_name = '' line_number = 0 ...
A list of dicts in the format: { 'file_name': str, 'content': str, 'line_number': int, 'position': int }
Below is the the instruction that describes the task: ### Input: A list of dicts in the format: { 'file_name': str, 'content': str, 'line_number': int, 'position': int } ### Response: def changed_lines(self): """ ...
def description(self, value): """Update description of the zone. :type value: str :param value: (Optional) new description :raises: ValueError for invalid value types. """ if not isinstance(value, six.string_types) and value is not None: raise ValueError("Pa...
Update description of the zone. :type value: str :param value: (Optional) new description :raises: ValueError for invalid value types.
Below is the the instruction that describes the task: ### Input: Update description of the zone. :type value: str :param value: (Optional) new description :raises: ValueError for invalid value types. ### Response: def description(self, value): """Update description of the zone. ...
def pairs_multi(self, strands, cutoff=0.001, permutation=None, temp=37.0, pseudo=False, material=None, dangles='some', sodium=1.0, magnesium=0.0): '''Compute the pair probabilities for an ordered complex of strands. Runs the \'pairs\' command. :param stra...
Compute the pair probabilities for an ordered complex of strands. Runs the \'pairs\' command. :param strands: List of strands to use as inputs to pairs -multi. :type strands: list :param permutation: The circular permutation of strands to test in complex. e.g...
Below is the the instruction that describes the task: ### Input: Compute the pair probabilities for an ordered complex of strands. Runs the \'pairs\' command. :param strands: List of strands to use as inputs to pairs -multi. :type strands: list :param permutation: The circular permu...
def tablename_from_link(klass, link): """ Helper method for URL's that look like /api/now/v1/table/FOO/sys_id etc. """ arr = link.split("/") i = arr.index("table") tn = arr[i+1] return tn
Helper method for URL's that look like /api/now/v1/table/FOO/sys_id etc.
Below is the the instruction that describes the task: ### Input: Helper method for URL's that look like /api/now/v1/table/FOO/sys_id etc. ### Response: def tablename_from_link(klass, link): """ Helper method for URL's that look like /api/now/v1/table/FOO/sys_id etc. """ arr = link.s...
def local_node_swbd_number(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") local_node = ET.SubElement(config, "local-node", xmlns="urn:brocade.com:mgmt:brocade-vcs") swbd_number = ET.SubElement(local_node, "swbd-number") swbd_number.text = kwargs...
Auto Generated Code
Below is the the instruction that describes the task: ### Input: Auto Generated Code ### Response: def local_node_swbd_number(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") local_node = ET.SubElement(config, "local-node", xmlns="urn:brocade.com:mgmt:brocad...
def pred_from_structures(self, target_species, structures_list, remove_duplicates=True, remove_existing=False): """ performs a structure prediction targeting compounds containing all of the target_species, based on a list of structure (those structures can fo...
performs a structure prediction targeting compounds containing all of the target_species, based on a list of structure (those structures can for instance come from a database like the ICSD). It will return all the structures formed by ionic substitutions with a probability higher than th...
Below is the the instruction that describes the task: ### Input: performs a structure prediction targeting compounds containing all of the target_species, based on a list of structure (those structures can for instance come from a database like the ICSD). It will return all the structures fo...
def getUpdatedFields(self, cascadeObjects=False): ''' getUpdatedFields - See changed fields. @param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively). Otherwise, will just check if the pk has changed. @return - a dicti...
getUpdatedFields - See changed fields. @param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively). Otherwise, will just check if the pk has changed. @return - a dictionary of fieldName : tuple(old, new). fieldName may be ...
Below is the the instruction that describes the task: ### Input: getUpdatedFields - See changed fields. @param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively). Otherwise, will just check if the pk has changed. @return...
def public_ip_address_get(name, resource_group, **kwargs): ''' .. versionadded:: 2019.2.0 Get details about a specific public IP address. :param name: The name of the public IP address to query. :param resource_group: The resource group name assigned to the public IP address. CLI Exa...
.. versionadded:: 2019.2.0 Get details about a specific public IP address. :param name: The name of the public IP address to query. :param resource_group: The resource group name assigned to the public IP address. CLI Example: .. code-block:: bash salt-call azurearm_network.pub...
Below is the the instruction that describes the task: ### Input: .. versionadded:: 2019.2.0 Get details about a specific public IP address. :param name: The name of the public IP address to query. :param resource_group: The resource group name assigned to the public IP address. CLI Examp...
def _extract_pc(d, root, pc, whichtables): """ Extract all data from a PaleoData dictionary. :param dict d: PaleoData dictionary :param dict root: Time series root data :param str pc: paleoData or chronData :param str whichtables: all, meas, summ, or ens :return list _ts: Time series """...
Extract all data from a PaleoData dictionary. :param dict d: PaleoData dictionary :param dict root: Time series root data :param str pc: paleoData or chronData :param str whichtables: all, meas, summ, or ens :return list _ts: Time series
Below is the the instruction that describes the task: ### Input: Extract all data from a PaleoData dictionary. :param dict d: PaleoData dictionary :param dict root: Time series root data :param str pc: paleoData or chronData :param str whichtables: all, meas, summ, or ens :return list _ts: Time ...
def wrap_invalid_resp_data_error(function): """Catch exceptions when using zvm client response data.""" @functools.wraps(function) def decorated_function(*arg, **kwargs): try: return function(*arg, **kwargs) except (ValueError, TypeError, IndexError, AttributeError, ...
Catch exceptions when using zvm client response data.
Below is the the instruction that describes the task: ### Input: Catch exceptions when using zvm client response data. ### Response: def wrap_invalid_resp_data_error(function): """Catch exceptions when using zvm client response data.""" @functools.wraps(function) def decorated_function(*arg, **kwargs)...
def write_file(path, data, format=True): """ Write JSON data to file. Arguments: path (str): Destination. data (dict or list): JSON serializable data. format (bool, optional): Pretty-print JSON data. """ if format: fs.write_file(path, format_json(data)) else: ...
Write JSON data to file. Arguments: path (str): Destination. data (dict or list): JSON serializable data. format (bool, optional): Pretty-print JSON data.
Below is the the instruction that describes the task: ### Input: Write JSON data to file. Arguments: path (str): Destination. data (dict or list): JSON serializable data. format (bool, optional): Pretty-print JSON data. ### Response: def write_file(path, data, format=True): """ ...
def get_params(self, *keys): """Returns the specified parameters for the current preprocessor. Parameters: ----------- keys : variable sized list, containing the names of the requested parameters Returns: -------- values : list or dictionary, if any `keys` are s...
Returns the specified parameters for the current preprocessor. Parameters: ----------- keys : variable sized list, containing the names of the requested parameters Returns: -------- values : list or dictionary, if any `keys` are specified those named parameters'...
Below is the the instruction that describes the task: ### Input: Returns the specified parameters for the current preprocessor. Parameters: ----------- keys : variable sized list, containing the names of the requested parameters Returns: -------- values : list or di...
def _normalize_tabular_data(tabular_data, headers): """Transform a supported data type to a list of lists, and a list of headers. Supported tabular data types: * list-of-lists or another iterable of iterables * list of named tuples (usually used with headers="keys") * 2D NumPy arrays * NumP...
Transform a supported data type to a list of lists, and a list of headers. Supported tabular data types: * list-of-lists or another iterable of iterables * list of named tuples (usually used with headers="keys") * 2D NumPy arrays * NumPy record arrays (usually used with headers="keys") * d...
Below is the the instruction that describes the task: ### Input: Transform a supported data type to a list of lists, and a list of headers. Supported tabular data types: * list-of-lists or another iterable of iterables * list of named tuples (usually used with headers="keys") * 2D NumPy arrays ...
def _GetActualName(name): """ Note: Must be holding the _lazyLock """ if _allowCapitalizedNames: name = UncapitalizeVmodlName(name) for defMap in _dataDefMap, _managedDefMap, _enumDefMap: dic = defMap.get(name) if dic: return dic[0] return None
Note: Must be holding the _lazyLock
Below is the the instruction that describes the task: ### Input: Note: Must be holding the _lazyLock ### Response: def _GetActualName(name): """ Note: Must be holding the _lazyLock """ if _allowCapitalizedNames: name = UncapitalizeVmodlName(name) for defMap in _dataDefMap, _managedDefMap, _enumDefMa...
def get_element_desc(element, ar_tree, ns): # type: (_Element, _DocRoot, str) -> str """Get element description from XML.""" desc = get_child(element, "DESC", ar_tree, ns) txt = get_child(desc, 'L-2[@L="DE"]', ar_tree, ns) if txt is None: txt = get_child(desc, 'L-2[@L="EN"]', ar_tree, ns) ...
Get element description from XML.
Below is the the instruction that describes the task: ### Input: Get element description from XML. ### Response: def get_element_desc(element, ar_tree, ns): # type: (_Element, _DocRoot, str) -> str """Get element description from XML.""" desc = get_child(element, "DESC", ar_tree, ns) txt = get_chil...
def as_dict(self): """ Bson-serializable dict representation of the StructureEnvironments object. :return: Bson-serializable dict representation of the StructureEnvironments object. """ ce_list_dict = [{str(cn): [ce.as_dict() if ce is not None else None for ce in ce_dict[cn]] ...
Bson-serializable dict representation of the StructureEnvironments object. :return: Bson-serializable dict representation of the StructureEnvironments object.
Below is the the instruction that describes the task: ### Input: Bson-serializable dict representation of the StructureEnvironments object. :return: Bson-serializable dict representation of the StructureEnvironments object. ### Response: def as_dict(self): """ Bson-serializable dict represe...
def summed_probabilities(self, choosers, alternatives): """ Returns the sum of probabilities for alternatives across all chooser segments. Parameters ---------- choosers : pandas.DataFrame Table describing the agents making choices, e.g. households. ...
Returns the sum of probabilities for alternatives across all chooser segments. Parameters ---------- choosers : pandas.DataFrame Table describing the agents making choices, e.g. households. Must have a column matching the .segmentation_col attribute. alte...
Below is the the instruction that describes the task: ### Input: Returns the sum of probabilities for alternatives across all chooser segments. Parameters ---------- choosers : pandas.DataFrame Table describing the agents making choices, e.g. households. Must...
def get_used_files(): """Get files used by processes with name scanpy.""" import psutil loop_over_scanpy_processes = (proc for proc in psutil.process_iter() if proc.name() == 'scanpy') filenames = [] for proc in loop_over_scanpy_processes: try: f...
Get files used by processes with name scanpy.
Below is the the instruction that describes the task: ### Input: Get files used by processes with name scanpy. ### Response: def get_used_files(): """Get files used by processes with name scanpy.""" import psutil loop_over_scanpy_processes = (proc for proc in psutil.process_iter() ...
def spellcheck_results(self): """The list of True/False values denoting the correct spelling of words.""" if not self.is_tagged(WORDS): self.tokenize_words() return vabamorf.spellcheck(self.word_texts, suggestions=True)
The list of True/False values denoting the correct spelling of words.
Below is the the instruction that describes the task: ### Input: The list of True/False values denoting the correct spelling of words. ### Response: def spellcheck_results(self): """The list of True/False values denoting the correct spelling of words.""" if not self.is_tagged(WORDS): se...
def get_ingest_status(self, dataset_id): """ Returns the current status of dataset ingestion. If any file uploaded to a dataset is in an error/failure state this endpoint will return error/failure. If any files are still processing, will return processing. :param dataset_id: Dataset i...
Returns the current status of dataset ingestion. If any file uploaded to a dataset is in an error/failure state this endpoint will return error/failure. If any files are still processing, will return processing. :param dataset_id: Dataset identifier :return: Status of dataset ingestion as a s...
Below is the the instruction that describes the task: ### Input: Returns the current status of dataset ingestion. If any file uploaded to a dataset is in an error/failure state this endpoint will return error/failure. If any files are still processing, will return processing. :param dataset_id: D...
def find_sources(self): """ Look for Python sources available for the current configuration. """ app_configs = apps.get_app_configs() for app_config in app_configs: ignore_dirs = [] for root, dirs, files in os.walk(app_config.path): if [Tru...
Look for Python sources available for the current configuration.
Below is the the instruction that describes the task: ### Input: Look for Python sources available for the current configuration. ### Response: def find_sources(self): """ Look for Python sources available for the current configuration. """ app_configs = apps.get_app_configs() ...
def recvRtspReply(self): """Receive RTSP reply from the server.""" while True: reply = self.rtspSocket.recv(1024) if reply: self.parseRtspReply(reply) # Close the RTSP socket upon requesting Teardown if self.requestSent == self.TEARDOWN: self.rtspSocket.shutdown(socket....
Receive RTSP reply from the server.
Below is the the instruction that describes the task: ### Input: Receive RTSP reply from the server. ### Response: def recvRtspReply(self): """Receive RTSP reply from the server.""" while True: reply = self.rtspSocket.recv(1024) if reply: self.parseRtspReply(reply) # Close the R...
def new(obj, path, value, separator="/"): """ Set the element at the terminus of path to value, and create it if it does not exist (as opposed to 'set' that can only change existing keys). path will NOT be treated like a glob. If it has globbing characters in it, they will become part of the re...
Set the element at the terminus of path to value, and create it if it does not exist (as opposed to 'set' that can only change existing keys). path will NOT be treated like a glob. If it has globbing characters in it, they will become part of the resulting keys
Below is the the instruction that describes the task: ### Input: Set the element at the terminus of path to value, and create it if it does not exist (as opposed to 'set' that can only change existing keys). path will NOT be treated like a glob. If it has globbing characters in it, they will become...
def _path_pair(self, s): """Parse two paths separated by a space.""" # TODO: handle a space in the first path if s.startswith(b'"'): parts = s[1:].split(b'" ', 1) else: parts = s.split(b' ', 1) if len(parts) != 2: self.abort(errors.BadFormat, '...
Parse two paths separated by a space.
Below is the the instruction that describes the task: ### Input: Parse two paths separated by a space. ### Response: def _path_pair(self, s): """Parse two paths separated by a space.""" # TODO: handle a space in the first path if s.startswith(b'"'): parts = s[1:].split(b'" ', 1)...
def parse_srec(srec): """ Extract the data portion of a given S-Record (without checksum) Returns: the record type, the lenght of the data section, the write address, the data itself and the checksum """ record_type = srec[0:2] data_len = srec[2:4] addr_len = __ADDR_LEN.get(record_ty...
Extract the data portion of a given S-Record (without checksum) Returns: the record type, the lenght of the data section, the write address, the data itself and the checksum
Below is the the instruction that describes the task: ### Input: Extract the data portion of a given S-Record (without checksum) Returns: the record type, the lenght of the data section, the write address, the data itself and the checksum ### Response: def parse_srec(srec): """ Extract the data...
def situations(self, *, tz_offset=None): """Get a listing of situations. Parameters: tz_offset (int, Optional): A time zone offset from UTC in seconds. """ response = self._call( mc_calls.ListenNowSituations, tz_offset ) situation_list = response.body.get('situations', []) return situation_lis...
Get a listing of situations. Parameters: tz_offset (int, Optional): A time zone offset from UTC in seconds.
Below is the the instruction that describes the task: ### Input: Get a listing of situations. Parameters: tz_offset (int, Optional): A time zone offset from UTC in seconds. ### Response: def situations(self, *, tz_offset=None): """Get a listing of situations. Parameters: tz_offset (int, Optional): A ...
def argument_types(self): """Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance. """ class ArgumentsIterator(collections.Sequence): def __init__(self, parent)...
Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance.
Below is the the instruction that describes the task: ### Input: Retrieve a container for the non-variadic arguments for this type. The returned object is iterable and indexable. Each item in the container is a Type instance. ### Response: def argument_types(self): """Retrieve a container ...
def num_gpus(): """Query CUDA for the number of GPUs present. Raises ------ Will raise an exception on any CUDA error. Returns ------- count : int The number of GPUs. """ count = ctypes.c_int() check_call(_LIB.MXGetGPUCount(ctypes.byref(count))) return count.value
Query CUDA for the number of GPUs present. Raises ------ Will raise an exception on any CUDA error. Returns ------- count : int The number of GPUs.
Below is the the instruction that describes the task: ### Input: Query CUDA for the number of GPUs present. Raises ------ Will raise an exception on any CUDA error. Returns ------- count : int The number of GPUs. ### Response: def num_gpus(): """Query CUDA for the number of GP...
def gaussian_hmm(pi, P, means, sigmas): """ Initializes a 1D-Gaussian HMM Parameters ---------- pi : ndarray(nstates, ) Initial distribution. P : ndarray(nstates,nstates) Hidden transition matrix means : ndarray(nstates, ) Means of Gaussian output distributions sigma...
Initializes a 1D-Gaussian HMM Parameters ---------- pi : ndarray(nstates, ) Initial distribution. P : ndarray(nstates,nstates) Hidden transition matrix means : ndarray(nstates, ) Means of Gaussian output distributions sigmas : ndarray(nstates, ) Standard deviatio...
Below is the the instruction that describes the task: ### Input: Initializes a 1D-Gaussian HMM Parameters ---------- pi : ndarray(nstates, ) Initial distribution. P : ndarray(nstates,nstates) Hidden transition matrix means : ndarray(nstates, ) Means of Gaussian output di...
def nltides_coefs(amplitude, n, m1, m2): """Calculate the coefficents needed to compute the shift in t(f) and phi(f) due to non-linear tides. Parameters ---------- amplitude: float Amplitude of effect n: float Growth dependence of effect m1: float Mass of component 1...
Calculate the coefficents needed to compute the shift in t(f) and phi(f) due to non-linear tides. Parameters ---------- amplitude: float Amplitude of effect n: float Growth dependence of effect m1: float Mass of component 1 m2: float Mass of component 2 ...
Below is the the instruction that describes the task: ### Input: Calculate the coefficents needed to compute the shift in t(f) and phi(f) due to non-linear tides. Parameters ---------- amplitude: float Amplitude of effect n: float Growth dependence of effect m1: float ...
def _grab_concretization_results(cls, state): """ Grabs the concretized result so we can add the constraint ourselves. """ # only grab ones that match the constrained addrs if cls._should_add_constraints(state): addr = state.inspect.address_concretization_expr ...
Grabs the concretized result so we can add the constraint ourselves.
Below is the the instruction that describes the task: ### Input: Grabs the concretized result so we can add the constraint ourselves. ### Response: def _grab_concretization_results(cls, state): """ Grabs the concretized result so we can add the constraint ourselves. """ # only grab ...
def subtract(self, other, numPartitions=None): """ Return each value in C{self} that is not contained in C{other}. >>> x = sc.parallelize([("a", 1), ("b", 4), ("b", 5), ("a", 3)]) >>> y = sc.parallelize([("a", 3), ("c", None)]) >>> sorted(x.subtract(y).collect()) [('a', ...
Return each value in C{self} that is not contained in C{other}. >>> x = sc.parallelize([("a", 1), ("b", 4), ("b", 5), ("a", 3)]) >>> y = sc.parallelize([("a", 3), ("c", None)]) >>> sorted(x.subtract(y).collect()) [('a', 1), ('b', 4), ('b', 5)]
Below is the the instruction that describes the task: ### Input: Return each value in C{self} that is not contained in C{other}. >>> x = sc.parallelize([("a", 1), ("b", 4), ("b", 5), ("a", 3)]) >>> y = sc.parallelize([("a", 3), ("c", None)]) >>> sorted(x.subtract(y).collect()) [('a'...
def _vmomentsurfaceMCIntegrand(vz,vR,vT,R,z,df,sigmaR1,gamma,sigmaz1,mvT,n,m,o): """Internal function that is the integrand for the vmomentsurface mass integration""" return vR**n*vT**m*vz**o*df(R,vR*sigmaR1,vT*sigmaR1*gamma,z,vz*sigmaz1,use_physical=False)*numpy.exp(vR**2./2.+(vT-mvT)**2./2.+vz**2./2.)
Internal function that is the integrand for the vmomentsurface mass integration
Below is the the instruction that describes the task: ### Input: Internal function that is the integrand for the vmomentsurface mass integration ### Response: def _vmomentsurfaceMCIntegrand(vz,vR,vT,R,z,df,sigmaR1,gamma,sigmaz1,mvT,n,m,o): """Internal function that is the integrand for the vmomentsurface mass ...
def location_query(self): """ Return the Location-Query of the response. :rtype : String :return: the Location-Query option """ value = [] for option in self.options: if option.number == defines.OptionRegistry.LOCATION_QUERY.number: va...
Return the Location-Query of the response. :rtype : String :return: the Location-Query option
Below is the the instruction that describes the task: ### Input: Return the Location-Query of the response. :rtype : String :return: the Location-Query option ### Response: def location_query(self): """ Return the Location-Query of the response. :rtype : String :re...
def callback(self, name, before=None, after=None): """Add a callback pair to this spectator. You can specify, with keywords, whether each callback should be triggered before, and/or or after a given method is called - hereafter refered to as "beforebacks" and "afterbacks" respectively. ...
Add a callback pair to this spectator. You can specify, with keywords, whether each callback should be triggered before, and/or or after a given method is called - hereafter refered to as "beforebacks" and "afterbacks" respectively. Parameters ---------- name: str ...
Below is the the instruction that describes the task: ### Input: Add a callback pair to this spectator. You can specify, with keywords, whether each callback should be triggered before, and/or or after a given method is called - hereafter refered to as "beforebacks" and "afterbacks" respect...
def run_tasks(procs, err_q, out_q, num): """ A function that executes populated processes and processes the resultant array. Checks error queue for any exceptions. :param procs: list of Process objects :param out_q: thread-safe output queue :param err_q: thread-safe queue to populate on exception :param ...
A function that executes populated processes and processes the resultant array. Checks error queue for any exceptions. :param procs: list of Process objects :param out_q: thread-safe output queue :param err_q: thread-safe queue to populate on exception :param num : length of resultant array
Below is the the instruction that describes the task: ### Input: A function that executes populated processes and processes the resultant array. Checks error queue for any exceptions. :param procs: list of Process objects :param out_q: thread-safe output queue :param err_q: thread-safe queue to populate on...
def add_method_callback(self, classname, methodname, method_callback, namespace=None,): """ Register a callback function for a CIM method that will be called when the CIM method is invoked via `InvokeMethod`. If the namespace does not exist, :exc:`~pywbem.CIM...
Register a callback function for a CIM method that will be called when the CIM method is invoked via `InvokeMethod`. If the namespace does not exist, :exc:`~pywbem.CIMError` with status CIM_ERR_INVALID_NAMESPACE is raised. Parameters: classname (:term:`string`): ...
Below is the the instruction that describes the task: ### Input: Register a callback function for a CIM method that will be called when the CIM method is invoked via `InvokeMethod`. If the namespace does not exist, :exc:`~pywbem.CIMError` with status CIM_ERR_INVALID_NAMESPACE is raised. ...
def limits(self): """ Limits to use for the independent variable whenever creating a linespace, plot, etc. Defaults to `(-x, x)` where `x` is the largest absolute value of the data corresponding to the independent variable. If no such values are negative, defaults to `(0...
Limits to use for the independent variable whenever creating a linespace, plot, etc. Defaults to `(-x, x)` where `x` is the largest absolute value of the data corresponding to the independent variable. If no such values are negative, defaults to `(0, x)` instead.
Below is the the instruction that describes the task: ### Input: Limits to use for the independent variable whenever creating a linespace, plot, etc. Defaults to `(-x, x)` where `x` is the largest absolute value of the data corresponding to the independent variable. If no such value...
def _get_override_base(self, override_wrapper): """Retrieve the override base class from the :class:`_OverriddenMethod` wrapper. """ base = override_wrapper.modifier.base if not base: return None if is_class(base): return base # resolve th...
Retrieve the override base class from the :class:`_OverriddenMethod` wrapper.
Below is the the instruction that describes the task: ### Input: Retrieve the override base class from the :class:`_OverriddenMethod` wrapper. ### Response: def _get_override_base(self, override_wrapper): """Retrieve the override base class from the :class:`_OverriddenMethod` wrapper. ...
def sendChatAction(self, chat_id, action): """ See: https://core.telegram.org/bots/api#sendchataction """ p = _strip(locals()) return self._api_request('sendChatAction', _rectify(p))
See: https://core.telegram.org/bots/api#sendchataction
Below is the the instruction that describes the task: ### Input: See: https://core.telegram.org/bots/api#sendchataction ### Response: def sendChatAction(self, chat_id, action): """ See: https://core.telegram.org/bots/api#sendchataction """ p = _strip(locals()) return self._api_request('send...
def fault_zone(self, zone, simulate_wire_problem=False): """ Faults a zone if we are emulating a zone expander. :param zone: zone to fault :type zone: int :param simulate_wire_problem: Whether or not to simulate a wire fault :type simulate_wire_problem: bool """ ...
Faults a zone if we are emulating a zone expander. :param zone: zone to fault :type zone: int :param simulate_wire_problem: Whether or not to simulate a wire fault :type simulate_wire_problem: bool
Below is the the instruction that describes the task: ### Input: Faults a zone if we are emulating a zone expander. :param zone: zone to fault :type zone: int :param simulate_wire_problem: Whether or not to simulate a wire fault :type simulate_wire_problem: bool ### Response: def f...
def load_job_from_ref(self): """ Loads the job.json into self.job """ if not self.job_id: raise Exception('Job not loaded yet. Use load(id) first.') if not os.path.exists(self.git.work_tree + '/aetros/job.json'): raise Exception('Could not load aetros/job...
Loads the job.json into self.job
Below is the the instruction that describes the task: ### Input: Loads the job.json into self.job ### Response: def load_job_from_ref(self): """ Loads the job.json into self.job """ if not self.job_id: raise Exception('Job not loaded yet. Use load(id) first.') i...
def get_pip_requirement_set(self, arguments, use_remote_index, use_wheels=False): """ Get the unpacked requirement(s) specified by the caller by running pip. :param arguments: The command line arguments to ``pip install ...`` (a list of strings). :param use_rem...
Get the unpacked requirement(s) specified by the caller by running pip. :param arguments: The command line arguments to ``pip install ...`` (a list of strings). :param use_remote_index: A boolean indicating whether pip is allowed to connect to ...
Below is the the instruction that describes the task: ### Input: Get the unpacked requirement(s) specified by the caller by running pip. :param arguments: The command line arguments to ``pip install ...`` (a list of strings). :param use_remote_index: A boolean indicating w...
def done_tasks(self): """Return tasks in loop which its state is not pending.""" tasks = [task for task in self.all_tasks if task._state != NewTask._PENDING] return tasks
Return tasks in loop which its state is not pending.
Below is the the instruction that describes the task: ### Input: Return tasks in loop which its state is not pending. ### Response: def done_tasks(self): """Return tasks in loop which its state is not pending.""" tasks = [task for task in self.all_tasks if task._state != NewTask._PENDING] r...
def prohibit(self, data): """Checks for prohibited characters.""" for char in data: for lookup in self.prohibited: if lookup(char): raise StringprepError("Prohibited character: {0!r}" .format(...
Checks for prohibited characters.
Below is the the instruction that describes the task: ### Input: Checks for prohibited characters. ### Response: def prohibit(self, data): """Checks for prohibited characters.""" for char in data: for lookup in self.prohibited: if lookup(char): raise ...
def _CallFlowRelational(self, flow_name=None, args=None, runner_args=None, client_id=None, **kwargs): """Creates a new flow and send its responses to a state. This creates a new flo...
Creates a new flow and send its responses to a state. This creates a new flow. The flow may send back many responses which will be queued by the framework until the flow terminates. The final status message will cause the entire transaction to be committed to the specified state. Args: flow_nam...
Below is the the instruction that describes the task: ### Input: Creates a new flow and send its responses to a state. This creates a new flow. The flow may send back many responses which will be queued by the framework until the flow terminates. The final status message will cause the entire transacti...
def cctop_save_xml(jobid, outpath): """Save the CCTOP results file in XML format. Args: jobid (str): Job ID obtained when job was submitted outpath (str): Path to output filename Returns: str: Path to output filename """ status = cctop_check_status(jobid=jobid) if stat...
Save the CCTOP results file in XML format. Args: jobid (str): Job ID obtained when job was submitted outpath (str): Path to output filename Returns: str: Path to output filename
Below is the the instruction that describes the task: ### Input: Save the CCTOP results file in XML format. Args: jobid (str): Job ID obtained when job was submitted outpath (str): Path to output filename Returns: str: Path to output filename ### Response: def cctop_save_xml(jobid...
def fmt_addr_raw(addr, reverse=True): """Given a string containing a xx:xx:xx:xx:xx:xx address, return as a byte sequence. Args: addr (str): Bluetooth address in xx:xx:xx:xx:xx:xx format. reverse (bool): True if the byte ordering should be reversed in the output. Returns: A bytearr...
Given a string containing a xx:xx:xx:xx:xx:xx address, return as a byte sequence. Args: addr (str): Bluetooth address in xx:xx:xx:xx:xx:xx format. reverse (bool): True if the byte ordering should be reversed in the output. Returns: A bytearray containing the converted address.
Below is the the instruction that describes the task: ### Input: Given a string containing a xx:xx:xx:xx:xx:xx address, return as a byte sequence. Args: addr (str): Bluetooth address in xx:xx:xx:xx:xx:xx format. reverse (bool): True if the byte ordering should be reversed in the output. Re...
def prepare_outputs(self, job): """ Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail """ outputs = flatten(job.output()) for o in outputs: if isinstance(o, FileSystemTarget): ...
Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail
Below is the the instruction that describes the task: ### Input: Called before job is started. If output is a `FileSystemTarget`, create parent directories so the hive command won't fail ### Response: def prepare_outputs(self, job): """ Called before job is started. If output is a...
def availability_zone_list(request): """Utility method to retrieve a list of availability zones.""" try: return api.nova.availability_zone_list(request) except Exception: exceptions.handle(request, _('Unable to retrieve Nova availability zones.')) return []
Utility method to retrieve a list of availability zones.
Below is the the instruction that describes the task: ### Input: Utility method to retrieve a list of availability zones. ### Response: def availability_zone_list(request): """Utility method to retrieve a list of availability zones.""" try: return api.nova.availability_zone_list(request) except...
def sys_mmap_pgoff(self, address, size, prot, flags, fd, offset): """Wrapper for mmap2""" return self.sys_mmap2(address, size, prot, flags, fd, offset)
Wrapper for mmap2
Below is the the instruction that describes the task: ### Input: Wrapper for mmap2 ### Response: def sys_mmap_pgoff(self, address, size, prot, flags, fd, offset): """Wrapper for mmap2""" return self.sys_mmap2(address, size, prot, flags, fd, offset)
def patch_pyzmq(): """backport a few patches from newer pyzmq These can be removed as we bump our minimum pyzmq version """ import zmq # ioloop.install, introduced in pyzmq 2.1.7 from zmq.eventloop import ioloop def install(): import tornado.ioloop tornado...
backport a few patches from newer pyzmq These can be removed as we bump our minimum pyzmq version
Below is the the instruction that describes the task: ### Input: backport a few patches from newer pyzmq These can be removed as we bump our minimum pyzmq version ### Response: def patch_pyzmq(): """backport a few patches from newer pyzmq These can be removed as we bump our minimum pyzmq vers...
def process_app_config_section(config, app_config): """ Processes the app section from a configuration data dict. :param config: The config reference of the object that will hold the configuration data from the config_data. :param app_config: App section from a config data dict. """ if 'address...
Processes the app section from a configuration data dict. :param config: The config reference of the object that will hold the configuration data from the config_data. :param app_config: App section from a config data dict.
Below is the the instruction that describes the task: ### Input: Processes the app section from a configuration data dict. :param config: The config reference of the object that will hold the configuration data from the config_data. :param app_config: App section from a config data dict. ### Response: ...
def filter(self, mask): """ Create a SiteCollection with only a subset of sites. :param mask: Numpy array of boolean values of the same length as the site collection. ``True`` values should indicate that site with that index should be included into the filter...
Create a SiteCollection with only a subset of sites. :param mask: Numpy array of boolean values of the same length as the site collection. ``True`` values should indicate that site with that index should be included into the filtered collection. :returns: ...
Below is the the instruction that describes the task: ### Input: Create a SiteCollection with only a subset of sites. :param mask: Numpy array of boolean values of the same length as the site collection. ``True`` values should indicate that site with that index should be...
def delete(self, version_name): """Delete a version of model. Args: version_name: the name of the version in short form, such as "v1". """ name = ('%s/versions/%s' % (self._full_model_name, version_name)) response = self._api.projects().models().versions().delete(name=name).execute() if '...
Delete a version of model. Args: version_name: the name of the version in short form, such as "v1".
Below is the the instruction that describes the task: ### Input: Delete a version of model. Args: version_name: the name of the version in short form, such as "v1". ### Response: def delete(self, version_name): """Delete a version of model. Args: version_name: the name of the version in s...
def parseString(inString, silence=False): '''Parse a string, create the object tree, and export it. Arguments: - inString -- A string. This XML fragment should not start with an XML declaration containing an encoding. - silence -- A boolean. If False, export the object. Returns -- The root ...
Parse a string, create the object tree, and export it. Arguments: - inString -- A string. This XML fragment should not start with an XML declaration containing an encoding. - silence -- A boolean. If False, export the object. Returns -- The root object in the tree.
Below is the the instruction that describes the task: ### Input: Parse a string, create the object tree, and export it. Arguments: - inString -- A string. This XML fragment should not start with an XML declaration containing an encoding. - silence -- A boolean. If False, export the object. ...
def SPF(domain, record='SPF', nameserver=None): ''' Return the allowed IPv4 ranges in the SPF record for ``domain``. If record is ``SPF`` and the SPF record is empty, the TXT record will be searched automatically. If you know the domain uses TXT and not SPF, specifying that will save a lookup. ...
Return the allowed IPv4 ranges in the SPF record for ``domain``. If record is ``SPF`` and the SPF record is empty, the TXT record will be searched automatically. If you know the domain uses TXT and not SPF, specifying that will save a lookup. CLI Example: .. code-block:: bash salt ns1 di...
Below is the the instruction that describes the task: ### Input: Return the allowed IPv4 ranges in the SPF record for ``domain``. If record is ``SPF`` and the SPF record is empty, the TXT record will be searched automatically. If you know the domain uses TXT and not SPF, specifying that will save a loo...
def model_to_tree(model, title=None, lucent_id=TRANSLUCENT_BINDER_ID): """Given an model, build the tree:: {'id': <id>|'subcol', 'title': <title>, 'contents': [<tree>, ...]} """ id = model.ident_hash if id is None and isinstance(model, TranslucentBinder): id = lucent_id md = model....
Given an model, build the tree:: {'id': <id>|'subcol', 'title': <title>, 'contents': [<tree>, ...]}
Below is the the instruction that describes the task: ### Input: Given an model, build the tree:: {'id': <id>|'subcol', 'title': <title>, 'contents': [<tree>, ...]} ### Response: def model_to_tree(model, title=None, lucent_id=TRANSLUCENT_BINDER_ID): """Given an model, build the tree:: {'id': ...
def decode_network_values(ptype, plen, buf): """Decodes a list of DS values in collectd network format """ nvalues = short.unpack_from(buf, header.size)[0] off = header.size + short.size + nvalues valskip = double.size # Check whether our expected packet size is the reported one assert ((va...
Decodes a list of DS values in collectd network format
Below is the the instruction that describes the task: ### Input: Decodes a list of DS values in collectd network format ### Response: def decode_network_values(ptype, plen, buf): """Decodes a list of DS values in collectd network format """ nvalues = short.unpack_from(buf, header.size)[0] off = hea...
def new(params, event_size, num_components, dtype=None, validate_args=False, name=None): """Create the distribution instance from a `params` vector.""" with tf.compat.v1.name_scope(name, 'CategoricalMixtureOfOneHotCategorical', [params, event_size, num_components]): ...
Create the distribution instance from a `params` vector.
Below is the the instruction that describes the task: ### Input: Create the distribution instance from a `params` vector. ### Response: def new(params, event_size, num_components, dtype=None, validate_args=False, name=None): """Create the distribution instance from a `params` vector.""" with tf.c...
def fetch(self, url): ''' Fetch url and create a response object according to the mime-type. Args: url: The url to fetch data from Returns: OEmbedResponse object according to data fetched ''' opener = self._urllib.build_opener() opener.ad...
Fetch url and create a response object according to the mime-type. Args: url: The url to fetch data from Returns: OEmbedResponse object according to data fetched
Below is the the instruction that describes the task: ### Input: Fetch url and create a response object according to the mime-type. Args: url: The url to fetch data from Returns: OEmbedResponse object according to data fetched ### Response: def fetch(self, url): ''...
def _bindDomain(self, domain_name, create=False, block=True): """ Return the Boto Domain object representing the SDB domain of the given name. If the domain does not exist and `create` is True, it will be created. :param str domain_name: the name of the domain to bind to :param...
Return the Boto Domain object representing the SDB domain of the given name. If the domain does not exist and `create` is True, it will be created. :param str domain_name: the name of the domain to bind to :param bool create: True if domain should be created if it doesn't exist :param...
Below is the the instruction that describes the task: ### Input: Return the Boto Domain object representing the SDB domain of the given name. If the domain does not exist and `create` is True, it will be created. :param str domain_name: the name of the domain to bind to :param bool create:...
def validate_geotweet(self, record): """ check that stream record is actual tweet with coordinates """ if record and self._validate('user', record) \ and self._validate('coordinates', record): return True return False
check that stream record is actual tweet with coordinates
Below is the the instruction that describes the task: ### Input: check that stream record is actual tweet with coordinates ### Response: def validate_geotweet(self, record): """ check that stream record is actual tweet with coordinates """ if record and self._validate('user', record) \ ...
def function(script, x_func='x', y_func='y', z_func='z'): """Geometric function using muparser lib to generate new Coordinates You can change x, y, z for every vertex according to the function specified. See help(mlx.muparser_ref) for muparser reference documentation. It's possible to use the followin...
Geometric function using muparser lib to generate new Coordinates You can change x, y, z for every vertex according to the function specified. See help(mlx.muparser_ref) for muparser reference documentation. It's possible to use the following per-vertex variables in the expression: Variables (per ver...
Below is the the instruction that describes the task: ### Input: Geometric function using muparser lib to generate new Coordinates You can change x, y, z for every vertex according to the function specified. See help(mlx.muparser_ref) for muparser reference documentation. It's possible to use the foll...
def cublasDger(handle, m, n, alpha, x, incx, y, incy, A, lda): """ Rank-1 operation on real general matrix. """ status = _libcublas.cublasDger_v2(handle, m, n, ctypes.byref(ctypes.c_double(alpha)), ...
Rank-1 operation on real general matrix.
Below is the the instruction that describes the task: ### Input: Rank-1 operation on real general matrix. ### Response: def cublasDger(handle, m, n, alpha, x, incx, y, incy, A, lda): """ Rank-1 operation on real general matrix. """ status = _libcublas.cublasDger_v2(handle, ...
def mono(self): """ Return this instance summed to mono. If the instance is already mono, this is a no-op. """ if self.channels == 1: return self x = self.sum(axis=1) * 0.5 y = x * 0.5 return AudioSamples(y, self.samplerate)
Return this instance summed to mono. If the instance is already mono, this is a no-op.
Below is the the instruction that describes the task: ### Input: Return this instance summed to mono. If the instance is already mono, this is a no-op. ### Response: def mono(self): """ Return this instance summed to mono. If the instance is already mono, this is a no-op. ...
def __find_executables(path): """Used by find_graphviz path - single directory as a string If any of the executables are found, it will return a dictionary containing the program names as keys and their paths as values. Otherwise returns None """ success = False progs = { "do...
Used by find_graphviz path - single directory as a string If any of the executables are found, it will return a dictionary containing the program names as keys and their paths as values. Otherwise returns None
Below is the the instruction that describes the task: ### Input: Used by find_graphviz path - single directory as a string If any of the executables are found, it will return a dictionary containing the program names as keys and their paths as values. Otherwise returns None ### Response: def __f...
def _set_path_to_configs(cls, path_to_config): """ Set the paths to the configuration files. :param path_to_config: The possible path to the config to load. :type path_to_config: str :return: The path to the config to read (0), the path to the default co...
Set the paths to the configuration files. :param path_to_config: The possible path to the config to load. :type path_to_config: str :return: The path to the config to read (0), the path to the default configuration to read as fallback.(1) :rtype: tuple
Below is the the instruction that describes the task: ### Input: Set the paths to the configuration files. :param path_to_config: The possible path to the config to load. :type path_to_config: str :return: The path to the config to read (0), the path to the default ...
def auth_interactive(self, username, handler, submethods=""): """ Authenticate to the server interactively. A handler is used to answer arbitrary questions from the server. On many servers, this is just a dumb wrapper around PAM. This method will block until the authentication...
Authenticate to the server interactively. A handler is used to answer arbitrary questions from the server. On many servers, this is just a dumb wrapper around PAM. This method will block until the authentication succeeds or fails, peroidically calling the handler asynchronously to get...
Below is the the instruction that describes the task: ### Input: Authenticate to the server interactively. A handler is used to answer arbitrary questions from the server. On many servers, this is just a dumb wrapper around PAM. This method will block until the authentication succeeds or ...
def remove(self, rev, permanent=False): """Removes a revision from this changelist :param rev: Revision to remove :type rev: :class:`.Revision` :param permanent: Whether or not we need to set the changelist to default :type permanent: bool """ if not isinstance(r...
Removes a revision from this changelist :param rev: Revision to remove :type rev: :class:`.Revision` :param permanent: Whether or not we need to set the changelist to default :type permanent: bool
Below is the the instruction that describes the task: ### Input: Removes a revision from this changelist :param rev: Revision to remove :type rev: :class:`.Revision` :param permanent: Whether or not we need to set the changelist to default :type permanent: bool ### Response: def re...
def url_to_parts(url): """ Split url urlsplit style, but return path as a list and query as a dict """ if not url: return None scheme, netloc, path, query, fragment = _urlsplit(url) if not path or path == '/': path = [] else: path = path.strip('/').split('/') if not q...
Split url urlsplit style, but return path as a list and query as a dict
Below is the the instruction that describes the task: ### Input: Split url urlsplit style, but return path as a list and query as a dict ### Response: def url_to_parts(url): """ Split url urlsplit style, but return path as a list and query as a dict """ if not url: return None scheme, netloc,...
def avail(locale): ''' Check if a locale is available. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' locale.avail 'en_US.UTF-8' ''' try: normalized_locale = salt.utils.locales.normalize_locale(locale) except IndexError: log.error('Unabl...
Check if a locale is available. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' locale.avail 'en_US.UTF-8'
Below is the the instruction that describes the task: ### Input: Check if a locale is available. .. versionadded:: 2014.7.0 CLI Example: .. code-block:: bash salt '*' locale.avail 'en_US.UTF-8' ### Response: def avail(locale): ''' Check if a locale is available. .. versionadded...
def update_input(filelist, ivmlist=None, removed_files=None): """ Removes files flagged to be removed from the input filelist. Removes the corresponding ivm files if present. """ newfilelist = [] if removed_files == []: return filelist, ivmlist else: sci_ivm = list(zip(filel...
Removes files flagged to be removed from the input filelist. Removes the corresponding ivm files if present.
Below is the the instruction that describes the task: ### Input: Removes files flagged to be removed from the input filelist. Removes the corresponding ivm files if present. ### Response: def update_input(filelist, ivmlist=None, removed_files=None): """ Removes files flagged to be removed from the inpu...
def send_email_confirmation_instructions(self, user): """ Sends the confirmation instructions email for the specified user. Sends signal `confirm_instructions_sent`. :param user: The user to send the instructions to. """ token = self.security_utils_service.generate_conf...
Sends the confirmation instructions email for the specified user. Sends signal `confirm_instructions_sent`. :param user: The user to send the instructions to.
Below is the the instruction that describes the task: ### Input: Sends the confirmation instructions email for the specified user. Sends signal `confirm_instructions_sent`. :param user: The user to send the instructions to. ### Response: def send_email_confirmation_instructions(self, user): ...
def walk(value, walker, path=None, seen=None): """Walks the _evaluated_ tree of the given GCL tuple. The appropriate methods of walker will be invoked for every element in the tree. """ seen = seen or set() path = path or [] # Recursion if id(value) in seen: walker.visitRecursion(path) return ...
Walks the _evaluated_ tree of the given GCL tuple. The appropriate methods of walker will be invoked for every element in the tree.
Below is the the instruction that describes the task: ### Input: Walks the _evaluated_ tree of the given GCL tuple. The appropriate methods of walker will be invoked for every element in the tree. ### Response: def walk(value, walker, path=None, seen=None): """Walks the _evaluated_ tree of the given GCL tup...
def shift_multi( x, wrg=0.1, hrg=0.1, is_random=False, row_index=0, col_index=1, channel_index=2, fill_mode='nearest', cval=0., order=1 ): """Shift images with the same arguments, randomly or non-randomly. Usually be used for image segmentation which x=[X, Y], X and Y should be matched. Par...
Shift images with the same arguments, randomly or non-randomly. Usually be used for image segmentation which x=[X, Y], X and Y should be matched. Parameters ----------- x : list of numpy.array List of images with dimension of [n_images, row, col, channel] (default). others : args Se...
Below is the the instruction that describes the task: ### Input: Shift images with the same arguments, randomly or non-randomly. Usually be used for image segmentation which x=[X, Y], X and Y should be matched. Parameters ----------- x : list of numpy.array List of images with dimension of ...
def bash_app(function=None, data_flow_kernel=None, walltime=60, cache=False, executors='all'): """Decorator function for making bash apps. Parameters ---------- function : function Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis, for ...
Decorator function for making bash apps. Parameters ---------- function : function Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis, for example, `@bash_app` if using all defaults or `@bash_app(walltime=120)`. If the decorator is u...
Below is the the instruction that describes the task: ### Input: Decorator function for making bash apps. Parameters ---------- function : function Do not pass this keyword argument directly. This is needed in order to allow for omitted parenthesis, for example, `@bash_app` if using all...
def write_tables(fname, table_names=None, prefix=None, compress=False, local=False): """ Writes tables to a pandas.HDFStore file. Parameters ---------- fname : str File name for HDFStore. Will be opened in append mode and closed at the end of this function. table_names: list of ...
Writes tables to a pandas.HDFStore file. Parameters ---------- fname : str File name for HDFStore. Will be opened in append mode and closed at the end of this function. table_names: list of str, optional, default None List of tables to write. If None, all registered tables will ...
Below is the the instruction that describes the task: ### Input: Writes tables to a pandas.HDFStore file. Parameters ---------- fname : str File name for HDFStore. Will be opened in append mode and closed at the end of this function. table_names: list of str, optional, default None ...
async def run(websession: ClientSession): """Run.""" try: # Create a client: client = Client( '<API_KEY>', 39.7974509, -104.8887227, websession, altitude=1609.3) # Get current UV info: print('CURRENT UV DATA:') ...
Run.
Below is the the instruction that describes the task: ### Input: Run. ### Response: async def run(websession: ClientSession): """Run.""" try: # Create a client: client = Client( '<API_KEY>', 39.7974509, -104.8887227, websession, al...
def get_exitstatus(self): """Get the exit status of the program execution. Returns: int: Exit status as reported by the operating system, or None if it is not available. """ logger.debug("Exit status is {0}".format(self._spawn.exitstatus)) return sel...
Get the exit status of the program execution. Returns: int: Exit status as reported by the operating system, or None if it is not available.
Below is the the instruction that describes the task: ### Input: Get the exit status of the program execution. Returns: int: Exit status as reported by the operating system, or None if it is not available. ### Response: def get_exitstatus(self): """Get the exit status ...
def _run_paired(paired): """Run somatic variant calling pipeline. """ from bcbio.structural import titancna work_dir = _sv_workdir(paired.tumor_data) seg_files = model_segments(tz.get_in(["depth", "bins", "normalized"], paired.tumor_data), work_dir, paired) call_fi...
Run somatic variant calling pipeline.
Below is the the instruction that describes the task: ### Input: Run somatic variant calling pipeline. ### Response: def _run_paired(paired): """Run somatic variant calling pipeline. """ from bcbio.structural import titancna work_dir = _sv_workdir(paired.tumor_data) seg_files = model_segments(t...
def list_manga_series(self, filter=None, content_type='jp_manga'): """Get a list of manga series """ result = self._manga_api.list_series(filter, content_type) return result
Get a list of manga series
Below is the the instruction that describes the task: ### Input: Get a list of manga series ### Response: def list_manga_series(self, filter=None, content_type='jp_manga'): """Get a list of manga series """ result = self._manga_api.list_series(filter, content_type) return result
def make_table (dt): """ Build the HTML needed for a MultiQC table. :param data: MultiQC datatable object """ table_id = dt.pconfig.get('id', 'table_{}'.format(''.join(random.sample(letters, 4))) ) table_id = report.save_htmlid(table_id) t_headers = OrderedDict() t_modal_headers = Order...
Build the HTML needed for a MultiQC table. :param data: MultiQC datatable object
Below is the the instruction that describes the task: ### Input: Build the HTML needed for a MultiQC table. :param data: MultiQC datatable object ### Response: def make_table (dt): """ Build the HTML needed for a MultiQC table. :param data: MultiQC datatable object """ table_id = dt.pconfi...
def _common_setup(self): """ The minimal amount of setup done by both setup() and no_setup(). """ self._started = True self._reactor = self._reactorFactory() self._registry = ResultRegistry() # We want to unblock EventualResult regardless of how the reactor is ...
The minimal amount of setup done by both setup() and no_setup().
Below is the the instruction that describes the task: ### Input: The minimal amount of setup done by both setup() and no_setup(). ### Response: def _common_setup(self): """ The minimal amount of setup done by both setup() and no_setup(). """ self._started = True self._reacto...
def read_char_lengths(self, filename, electrode_filename): """Read characteristic lengths from the given file. The file is expected to have either 1 or 4 entries/lines with characteristic lengths > 0 (floats). If only one value is encountered, it is used for all four entities. If four v...
Read characteristic lengths from the given file. The file is expected to have either 1 or 4 entries/lines with characteristic lengths > 0 (floats). If only one value is encountered, it is used for all four entities. If four values are encountered, they are assigned, in order, to: ...
Below is the the instruction that describes the task: ### Input: Read characteristic lengths from the given file. The file is expected to have either 1 or 4 entries/lines with characteristic lengths > 0 (floats). If only one value is encountered, it is used for all four entities. If four va...
def get_activities(self, count=10, since=None, style='summary', limit=None): """Iterate over all activities, from newest to oldest. :param count: The number of results to retrieve per page. If set to ``None``, pagination is disabled. :param since: R...
Iterate over all activities, from newest to oldest. :param count: The number of results to retrieve per page. If set to ``None``, pagination is disabled. :param since: Return only activities since this date. Can be either a timestamp or a datetime object. ...
Below is the the instruction that describes the task: ### Input: Iterate over all activities, from newest to oldest. :param count: The number of results to retrieve per page. If set to ``None``, pagination is disabled. :param since: Return only activities since this date. Can...
def drawDisplay(self, painter, option, rect, text): """ Overloads the drawDisplay method to render HTML if the rich text \ information is set to true. :param painter | <QtGui.QPainter> option | <QtGui.QStyleOptionItem> rect ...
Overloads the drawDisplay method to render HTML if the rich text \ information is set to true. :param painter | <QtGui.QPainter> option | <QtGui.QStyleOptionItem> rect | <QtCore.QRect> text | <str>
Below is the the instruction that describes the task: ### Input: Overloads the drawDisplay method to render HTML if the rich text \ information is set to true. :param painter | <QtGui.QPainter> option | <QtGui.QStyleOptionItem> rect | <Q...
def get_subject_version_ids(self, subject): """ Return the list of schema version ids which have been registered under the given subject. """ res = requests.get(self._url('/subjects/{}/versions', subject)) raise_if_failed(res) return res.json()
Return the list of schema version ids which have been registered under the given subject.
Below is the the instruction that describes the task: ### Input: Return the list of schema version ids which have been registered under the given subject. ### Response: def get_subject_version_ids(self, subject): """ Return the list of schema version ids which have been registered u...