code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def __validate_arguments(self): """! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown. """ if len(self.__data) == 0: raise ValueError("Empty input data. Data should contain at lea...
! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown.
Below is the the instruction that describes the task: ### Input: ! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown. ### Response: def __validate_arguments(self): """! @brief Check input arguments of ...
def addGraphic(self, typ='basic'): """ Adds a new graphic to the scene. :param typ | <str> :return <XWalkthroughGraphic> || None """ cls = XWalkthroughGraphic.find(typ) if not cls: return None graphic = c...
Adds a new graphic to the scene. :param typ | <str> :return <XWalkthroughGraphic> || None
Below is the the instruction that describes the task: ### Input: Adds a new graphic to the scene. :param typ | <str> :return <XWalkthroughGraphic> || None ### Response: def addGraphic(self, typ='basic'): """ Adds a new graphic to the scene. ...
def add_minutes(self, datetimestr, n): """Returns a time that n minutes after a time. :param datetimestr: a datetime object or a datetime str :param n: number of minutes, value can be negative **中文文档** 返回给定日期N分钟之后的时间。 """ a_datetime = self.parse_datetime(dateti...
Returns a time that n minutes after a time. :param datetimestr: a datetime object or a datetime str :param n: number of minutes, value can be negative **中文文档** 返回给定日期N分钟之后的时间。
Below is the the instruction that describes the task: ### Input: Returns a time that n minutes after a time. :param datetimestr: a datetime object or a datetime str :param n: number of minutes, value can be negative **中文文档** 返回给定日期N分钟之后的时间。 ### Response: def add_minutes(self, dat...
def batch_predictions( self, images, greedy=False, strict=True, return_details=False): """Interface to model.batch_predictions for attacks. Parameters ---------- images : `numpy.ndarray` Batch of inputs with shape as expected by the model. greedy : bool ...
Interface to model.batch_predictions for attacks. Parameters ---------- images : `numpy.ndarray` Batch of inputs with shape as expected by the model. greedy : bool Whether the first adversarial should be returned. strict : bool Controls if the...
Below is the the instruction that describes the task: ### Input: Interface to model.batch_predictions for attacks. Parameters ---------- images : `numpy.ndarray` Batch of inputs with shape as expected by the model. greedy : bool Whether the first adversarial ...
def ang2pix(nside, theta, phi): r"""Convert angle :math:`\theta` :math:`\phi` to pixel. This is translated from chealpix.c; but refer to Section 4.1 of http://adsabs.harvard.edu/abs/2005ApJ...622..759G """ nside, theta, phi = numpy.lib.stride_tricks.broadcast_arrays(nside, theta, phi) ...
r"""Convert angle :math:`\theta` :math:`\phi` to pixel. This is translated from chealpix.c; but refer to Section 4.1 of http://adsabs.harvard.edu/abs/2005ApJ...622..759G
Below is the the instruction that describes the task: ### Input: r"""Convert angle :math:`\theta` :math:`\phi` to pixel. This is translated from chealpix.c; but refer to Section 4.1 of http://adsabs.harvard.edu/abs/2005ApJ...622..759G ### Response: def ang2pix(nside, theta, phi): r"""Convert a...
def package_repositories(self): """ Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos. :rtype: yagocd.resources.package_repository.PackageRepositoryManager """ if self._package_repository_manager is None: self._p...
Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos. :rtype: yagocd.resources.package_repository.PackageRepositoryManager
Below is the the instruction that describes the task: ### Input: Property for accessing :class:`PackageRepositoryManager` instance, which is used to manage package repos. :rtype: yagocd.resources.package_repository.PackageRepositoryManager ### Response: def package_repositories(self): """ ...
def failed(self, fail_on_warnings=True): """Returns a boolean value describing whether the validation succeeded or not.""" return bool(self.errors) or (fail_on_warnings and bool(self.warnings))
Returns a boolean value describing whether the validation succeeded or not.
Below is the the instruction that describes the task: ### Input: Returns a boolean value describing whether the validation succeeded or not. ### Response: def failed(self, fail_on_warnings=True): """Returns a boolean value describing whether the validation succeeded or not.""" retu...
async def get_lease_async(self, partition_id): """ Return the lease info for the specified partition. Can return null if no lease has been created in the store for the specified partition. :param partition_id: The partition ID. :type partition_id: str :return: lease info...
Return the lease info for the specified partition. Can return null if no lease has been created in the store for the specified partition. :param partition_id: The partition ID. :type partition_id: str :return: lease info for the partition, or `None`. :rtype: ~azure.eventprocesso...
Below is the the instruction that describes the task: ### Input: Return the lease info for the specified partition. Can return null if no lease has been created in the store for the specified partition. :param partition_id: The partition ID. :type partition_id: str :return: lease in...
def _load_from_environ(metadata, value_func=None): """ Load configuration from environment variables. Any environment variable prefixed with the metadata's name will be used to recursively set dictionary keys, splitting on '__'. :param value_func: a mutator for the envvar's value (if any) """...
Load configuration from environment variables. Any environment variable prefixed with the metadata's name will be used to recursively set dictionary keys, splitting on '__'. :param value_func: a mutator for the envvar's value (if any)
Below is the the instruction that describes the task: ### Input: Load configuration from environment variables. Any environment variable prefixed with the metadata's name will be used to recursively set dictionary keys, splitting on '__'. :param value_func: a mutator for the envvar's value (if any) ##...
def validateDocument(self, doc): """Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. """ if doc is None: doc__o = None e...
Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree.
Below is the the instruction that describes the task: ### Input: Try to validate the document instance basically it does the all the checks described by the XML Rec i.e. validates the internal and external subset (if present) and validate the document tree. ### Response: def validat...
def reserve_ids( self, resource, num_ids, url_prefix, auth, session, send_opts): """Reserve a block of unique, sequential ids for annotations. Args: resource (intern.resource.Resource): Resource should be an annotation channel. num_ids (int): Number of id...
Reserve a block of unique, sequential ids for annotations. Args: resource (intern.resource.Resource): Resource should be an annotation channel. num_ids (int): Number of ids to reserve. url_prefix (string): Protocol + host such as https://api.theboss.io auth (stri...
Below is the the instruction that describes the task: ### Input: Reserve a block of unique, sequential ids for annotations. Args: resource (intern.resource.Resource): Resource should be an annotation channel. num_ids (int): Number of ids to reserve. url_prefix (string): ...
def check(module): global passed, failed ''' apply pylint to the file specified if it is a *.py file ''' module_name = module.rsplit('/', 1)[1] if module[-3:] == ".py" and module_name not in IGNORED_FILES: print ("CHECKING ", module) pout = os.popen('pylint %s'% module, 'r') for line in pout: ...
apply pylint to the file specified if it is a *.py file
Below is the the instruction that describes the task: ### Input: apply pylint to the file specified if it is a *.py file ### Response: def check(module): global passed, failed ''' apply pylint to the file specified if it is a *.py file ''' module_name = module.rsplit('/', 1)[1] if module[-3:] == ".py" ...
def get_file_to_stream(self, stream, share_name, directory_name, file_name, **kwargs): """ Download a file from Azure File Share. :param stream: A filehandle to store the file to. :type stream: file-like object :param share_name: Name of the share. :type share_name: str ...
Download a file from Azure File Share. :param stream: A filehandle to store the file to. :type stream: file-like object :param share_name: Name of the share. :type share_name: str :param directory_name: Name of the directory. :type directory_name: str :param file...
Below is the the instruction that describes the task: ### Input: Download a file from Azure File Share. :param stream: A filehandle to store the file to. :type stream: file-like object :param share_name: Name of the share. :type share_name: str :param directory_name: Name of...
def queryGitHubFromFile(self, filePath, gitvars={}, verbosity=0, **kwargs): """Submit a GitHub GraphQL query from a file. Can only be used with GraphQL queries. For REST queries, see the 'queryGitHub' method. Args: filePath (str): A relative or absolute path to a file conta...
Submit a GitHub GraphQL query from a file. Can only be used with GraphQL queries. For REST queries, see the 'queryGitHub' method. Args: filePath (str): A relative or absolute path to a file containing a GraphQL query. File may use comments and multi-...
Below is the the instruction that describes the task: ### Input: Submit a GitHub GraphQL query from a file. Can only be used with GraphQL queries. For REST queries, see the 'queryGitHub' method. Args: filePath (str): A relative or absolute path to a file containing ...
def plot(self, columns=None, loc=None, iloc=None, **kwargs): """" A wrapper around plotting. Matplotlib plot arguments can be passed in, plus: Parameters ----------- columns: string or list-like, optional If not empty, plot a subset of columns from the ``cumulative_haz...
A wrapper around plotting. Matplotlib plot arguments can be passed in, plus: Parameters ----------- columns: string or list-like, optional If not empty, plot a subset of columns from the ``cumulative_hazards_``. Default all. loc: iloc: slice, optional specif...
Below is the the instruction that describes the task: ### Input: A wrapper around plotting. Matplotlib plot arguments can be passed in, plus: Parameters ----------- columns: string or list-like, optional If not empty, plot a subset of columns from the ``cumulative_hazards_``. Defa...
def runs_once(meth): """ A wrapper around Fabric's runs_once() to support our dryrun feature. """ from burlap.common import get_dryrun, runs_once_methods if get_dryrun(): pass else: runs_once_methods.append(meth) _runs_once(meth) return meth
A wrapper around Fabric's runs_once() to support our dryrun feature.
Below is the the instruction that describes the task: ### Input: A wrapper around Fabric's runs_once() to support our dryrun feature. ### Response: def runs_once(meth): """ A wrapper around Fabric's runs_once() to support our dryrun feature. """ from burlap.common import get_dryrun, runs_once_metho...
def associate_failure_node(self, parent, child=None, **kwargs): """Add a node to run on failure. =====API DOCS===== Add a node to run on failure. :param parent: Primary key of parent node to associate failure node to. :type parent: int :param child: Primary key of child...
Add a node to run on failure. =====API DOCS===== Add a node to run on failure. :param parent: Primary key of parent node to associate failure node to. :type parent: int :param child: Primary key of child node to be associated. :type child: int :param `**kwargs`:...
Below is the the instruction that describes the task: ### Input: Add a node to run on failure. =====API DOCS===== Add a node to run on failure. :param parent: Primary key of parent node to associate failure node to. :type parent: int :param child: Primary key of child node ...
def recipe_weinreb17(adata, log=True, mean_threshold=0.01, cv_threshold=2, n_pcs=50, svd_solver='randomized', random_state=0, copy=False): """Normalization and filtering as of [Weinreb17]_. Expects non-logarithmized data. If using logarithmized data, pass `log=False`. ...
Normalization and filtering as of [Weinreb17]_. Expects non-logarithmized data. If using logarithmized data, pass `log=False`. Parameters ---------- adata : :class:`~anndata.AnnData` Annotated data matrix. copy : bool (default: False) Return a copy if true.
Below is the the instruction that describes the task: ### Input: Normalization and filtering as of [Weinreb17]_. Expects non-logarithmized data. If using logarithmized data, pass `log=False`. Parameters ---------- adata : :class:`~anndata.AnnData` Annotated data matrix. copy : bool (de...
def extend(self, data, size): """ Append user-supplied data to chunk, return resulting chunk size. If the data would exceeded the available space, the chunk grows in size. """ return lib.zchunk_extend(self._as_parameter_, data, size)
Append user-supplied data to chunk, return resulting chunk size. If the data would exceeded the available space, the chunk grows in size.
Below is the the instruction that describes the task: ### Input: Append user-supplied data to chunk, return resulting chunk size. If the data would exceeded the available space, the chunk grows in size. ### Response: def extend(self, data, size): """ Append user-supplied data to chunk, return resul...
def _set_traffic_class(self, v, load=False): """ Setter method for traffic_class, mapped from YANG variable /interface/port_channel/qos/random_detect/traffic_class (list) If this variable is read-only (config: false) in the source YANG file, then _set_traffic_class is considered as a private method....
Setter method for traffic_class, mapped from YANG variable /interface/port_channel/qos/random_detect/traffic_class (list) If this variable is read-only (config: false) in the source YANG file, then _set_traffic_class is considered as a private method. Backends looking to populate this variable should do...
Below is the the instruction that describes the task: ### Input: Setter method for traffic_class, mapped from YANG variable /interface/port_channel/qos/random_detect/traffic_class (list) If this variable is read-only (config: false) in the source YANG file, then _set_traffic_class is considered as a private...
def all_host_infos(): ''' Summarize all host information. ''' output = [] output.append(["Operating system", os()]) output.append(["CPUID information", cpu()]) output.append(["CC information", compiler()]) output.append(["JDK information", from_cmd("java -version")]) output.appen...
Summarize all host information.
Below is the the instruction that describes the task: ### Input: Summarize all host information. ### Response: def all_host_infos(): ''' Summarize all host information. ''' output = [] output.append(["Operating system", os()]) output.append(["CPUID information", cpu()]) output.appen...
def component_title(component): """ Label, title and caption Title is the label text plus the title text Title may contain italic tag, etc. """ title = u'' label_text = u'' title_text = u'' if component.get('label'): label_text = component.get('label') if component.get...
Label, title and caption Title is the label text plus the title text Title may contain italic tag, etc.
Below is the the instruction that describes the task: ### Input: Label, title and caption Title is the label text plus the title text Title may contain italic tag, etc. ### Response: def component_title(component): """ Label, title and caption Title is the label text plus the title text Tit...
def lowpass(var, key, factor): '''a simple lowpass filter''' global lowpass_data if not key in lowpass_data: lowpass_data[key] = var else: lowpass_data[key] = factor*lowpass_data[key] + (1.0 - factor)*var return lowpass_data[key]
a simple lowpass filter
Below is the the instruction that describes the task: ### Input: a simple lowpass filter ### Response: def lowpass(var, key, factor): '''a simple lowpass filter''' global lowpass_data if not key in lowpass_data: lowpass_data[key] = var else: lowpass_data[key] = factor*lowpass_data[k...
def is_compatible_with(self, spec_or_tensor): """Returns True if spec_or_tensor is compatible with this TensorSpec. Two tensors are considered compatible if they have the same dtype and their shapes are compatible (see `tf.TensorShape.is_compatible_with`). Args: spec_or_tensor: A tf.TensorSpec o...
Returns True if spec_or_tensor is compatible with this TensorSpec. Two tensors are considered compatible if they have the same dtype and their shapes are compatible (see `tf.TensorShape.is_compatible_with`). Args: spec_or_tensor: A tf.TensorSpec or a tf.Tensor Returns: True if spec_or_ten...
Below is the the instruction that describes the task: ### Input: Returns True if spec_or_tensor is compatible with this TensorSpec. Two tensors are considered compatible if they have the same dtype and their shapes are compatible (see `tf.TensorShape.is_compatible_with`). Args: spec_or_tensor: A...
def get_urlclass_from (scheme, assume_local_file=False): """Return checker class for given URL scheme. If the scheme cannot be matched and assume_local_file is True, assume a local file. """ if scheme in ("http", "https"): klass = httpurl.HttpUrl elif scheme == "ftp": klass = ftpurl....
Return checker class for given URL scheme. If the scheme cannot be matched and assume_local_file is True, assume a local file.
Below is the the instruction that describes the task: ### Input: Return checker class for given URL scheme. If the scheme cannot be matched and assume_local_file is True, assume a local file. ### Response: def get_urlclass_from (scheme, assume_local_file=False): """Return checker class for given URL scheme...
def list_tags(cwd, user=None, password=None, ignore_retcode=False, output_encoding=None): ''' .. versionadded:: 2015.8.0 Return a list of tags cwd The path to the git checkout user User under which to run the git command. By ...
.. versionadded:: 2015.8.0 Return a list of tags cwd The path to the git checkout user User under which to run the git command. By default, the command is run by the user under which the minion is running. password Windows only. Required when specifying ``user``. This...
Below is the the instruction that describes the task: ### Input: .. versionadded:: 2015.8.0 Return a list of tags cwd The path to the git checkout user User under which to run the git command. By default, the command is run by the user under which the minion is running. p...
def angle(self, vertices): """ If Text is 2D, get the rotation angle in radians. Parameters ----------- vertices : (n, 2) float Vertices in space referenced by self.points Returns --------- angle : float Rotation angle in radians ...
If Text is 2D, get the rotation angle in radians. Parameters ----------- vertices : (n, 2) float Vertices in space referenced by self.points Returns --------- angle : float Rotation angle in radians
Below is the the instruction that describes the task: ### Input: If Text is 2D, get the rotation angle in radians. Parameters ----------- vertices : (n, 2) float Vertices in space referenced by self.points Returns --------- angle : float Rotation...
def write_hdf5_series(series, output, path=None, attrs=None, **kwargs): """Write a Series to HDF5. See :func:`write_hdf5_array` for details of arguments and keywords. """ if attrs is None: attrs = format_index_array_attrs(series) return write_hdf5_array(series, output, path=path, attrs=attr...
Write a Series to HDF5. See :func:`write_hdf5_array` for details of arguments and keywords.
Below is the the instruction that describes the task: ### Input: Write a Series to HDF5. See :func:`write_hdf5_array` for details of arguments and keywords. ### Response: def write_hdf5_series(series, output, path=None, attrs=None, **kwargs): """Write a Series to HDF5. See :func:`write_hdf5_array` fo...
def interrupt (aggregate): """Interrupt execution and shutdown, ignoring any subsequent interrupts.""" while True: try: log.warn(LOG_CHECK, _("interrupt; waiting for active threads to finish")) log.warn(LOG_CHECK, _("another interrupt will exit i...
Interrupt execution and shutdown, ignoring any subsequent interrupts.
Below is the the instruction that describes the task: ### Input: Interrupt execution and shutdown, ignoring any subsequent interrupts. ### Response: def interrupt (aggregate): """Interrupt execution and shutdown, ignoring any subsequent interrupts.""" while True: try: log.warn(L...
async def list_all_active_projects(self, page_size=1000): """Get all active projects. You can find the endpoint documentation `here <https://cloud. google.com/resource-manager/reference/rest/v1/projects/list>`__. Args: page_size (int): hint for the client to only retrieve u...
Get all active projects. You can find the endpoint documentation `here <https://cloud. google.com/resource-manager/reference/rest/v1/projects/list>`__. Args: page_size (int): hint for the client to only retrieve up to this number of results per API call. Ret...
Below is the the instruction that describes the task: ### Input: Get all active projects. You can find the endpoint documentation `here <https://cloud. google.com/resource-manager/reference/rest/v1/projects/list>`__. Args: page_size (int): hint for the client to only retrieve u...
def to_fmt(self) -> fmt.indentable: """ Return an Fmt representation for pretty-printing """ lsb = [] if len(self._lsig) > 0: for s in self._lsig: lsb.append(s.to_fmt()) block = fmt.block("(", ")", fmt.sep(', ', lsb)) qual = "tuple" ...
Return an Fmt representation for pretty-printing
Below is the the instruction that describes the task: ### Input: Return an Fmt representation for pretty-printing ### Response: def to_fmt(self) -> fmt.indentable: """ Return an Fmt representation for pretty-printing """ lsb = [] if len(self._lsig) > 0: for s in ...
def xml_entity_escape(data): """ replace special characters with their XML entity versions """ data = data.replace("&", "&amp;") data = data.replace(">", "&gt;") data = data.replace("<", "&lt;") return data
replace special characters with their XML entity versions
Below is the the instruction that describes the task: ### Input: replace special characters with their XML entity versions ### Response: def xml_entity_escape(data): """ replace special characters with their XML entity versions """ data = data.replace("&", "&amp;") data = data.replace(">", "&g...
def has_child(cls, child_type, query): ''' http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html The has_child query accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. > child_query = ElasticQ...
http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html The has_child query accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. > child_query = ElasticQuery().term(tag='something') > query = ElasticQuery...
Below is the the instruction that describes the task: ### Input: http://www.elasticsearch.org/guide/reference/query-dsl/has-child-query.html The has_child query accepts a query and the child type to run against, and results in parent documents that have child docs matching the query. > child_query ...
def log_subtract(loga, logb): r"""Numerically stable method for avoiding overflow errors when calculating :math:`\log (a-b)`, given :math:`\log (a)`, :math:`\log (a)` and that :math:`a > b`. See https://hips.seas.harvard.edu/blog/2013/01/09/computing-log-sum-exp/ for more details. Parameters ...
r"""Numerically stable method for avoiding overflow errors when calculating :math:`\log (a-b)`, given :math:`\log (a)`, :math:`\log (a)` and that :math:`a > b`. See https://hips.seas.harvard.edu/blog/2013/01/09/computing-log-sum-exp/ for more details. Parameters ---------- loga: float ...
Below is the the instruction that describes the task: ### Input: r"""Numerically stable method for avoiding overflow errors when calculating :math:`\log (a-b)`, given :math:`\log (a)`, :math:`\log (a)` and that :math:`a > b`. See https://hips.seas.harvard.edu/blog/2013/01/09/computing-log-sum-exp/ ...
def update_x(self, x, indices=None): """ Update partial or entire x. Args: x (numpy.ndarray or list): to-be-updated x indices (numpy.ndarray or list or optional): to-be-updated qubit indices Returns: Pauli: self Raises: QiskitErr...
Update partial or entire x. Args: x (numpy.ndarray or list): to-be-updated x indices (numpy.ndarray or list or optional): to-be-updated qubit indices Returns: Pauli: self Raises: QiskitError: when updating whole x, the number of qubits must be t...
Below is the the instruction that describes the task: ### Input: Update partial or entire x. Args: x (numpy.ndarray or list): to-be-updated x indices (numpy.ndarray or list or optional): to-be-updated qubit indices Returns: Pauli: self Raises: ...
def get_context_data(self, **kwargs): """ Returns the context data to provide to the template. """ context = super().get_context_data(**kwargs) context['poster'] = self.poster return context
Returns the context data to provide to the template.
Below is the the instruction that describes the task: ### Input: Returns the context data to provide to the template. ### Response: def get_context_data(self, **kwargs): """ Returns the context data to provide to the template. """ context = super().get_context_data(**kwargs) context['poster...
def packets(self): """ :return: dictionary {id: object} of all packets. :rtype: dict of (int, xenamanager.xena_port.XenaCapturePacket) """ if not self.get_object_by_type('cappacket'): for index in range(0, self.read_stats()['packets']): XenaCapturePac...
:return: dictionary {id: object} of all packets. :rtype: dict of (int, xenamanager.xena_port.XenaCapturePacket)
Below is the the instruction that describes the task: ### Input: :return: dictionary {id: object} of all packets. :rtype: dict of (int, xenamanager.xena_port.XenaCapturePacket) ### Response: def packets(self): """ :return: dictionary {id: object} of all packets. :rtype: dict of (int...
def join_multicast(self, universe: int) -> None: """ Joins the multicast address that is used for the given universe. Note: If you are on Windows you must have given a bind IP-Address for this feature to function properly. On the other hand you are not allowed to set a bind address if yo...
Joins the multicast address that is used for the given universe. Note: If you are on Windows you must have given a bind IP-Address for this feature to function properly. On the other hand you are not allowed to set a bind address if you are on any other OS. :param universe: the universe to join ...
Below is the the instruction that describes the task: ### Input: Joins the multicast address that is used for the given universe. Note: If you are on Windows you must have given a bind IP-Address for this feature to function properly. On the other hand you are not allowed to set a bind address if yo...
def _get_utc_sun_time_deg(self, deg): """ Return the times in minutes from 00:00 (utc) for a given sun altitude. This is done for a given sun altitude in sunrise `deg` degrees This function only works for altitudes sun really is. If the sun never gets to this altitude, the retur...
Return the times in minutes from 00:00 (utc) for a given sun altitude. This is done for a given sun altitude in sunrise `deg` degrees This function only works for altitudes sun really is. If the sun never gets to this altitude, the returned sunset and sunrise values will be negative. Th...
Below is the the instruction that describes the task: ### Input: Return the times in minutes from 00:00 (utc) for a given sun altitude. This is done for a given sun altitude in sunrise `deg` degrees This function only works for altitudes sun really is. If the sun never gets to this altitude...
def _elem_set_attrs(obj, parent, to_str): """ :param obj: Container instance gives attributes of XML Element :param parent: XML ElementTree parent node object :param to_str: Callable to convert value to string or None :param options: Keyword options, see :func:`container_to_etree` :return: None...
:param obj: Container instance gives attributes of XML Element :param parent: XML ElementTree parent node object :param to_str: Callable to convert value to string or None :param options: Keyword options, see :func:`container_to_etree` :return: None but parent will be modified
Below is the the instruction that describes the task: ### Input: :param obj: Container instance gives attributes of XML Element :param parent: XML ElementTree parent node object :param to_str: Callable to convert value to string or None :param options: Keyword options, see :func:`container_to_etree` ...
def _generate_dockerfile(base_image, layers): """ Generate the Dockerfile contents A generated Dockerfile will look like the following: ``` FROM lambci/lambda:python3.6 ADD --chown=sbx_user1051:495 layer1 /opt ADD --chown=sbx_user1051:495 layer2 /opt ```...
Generate the Dockerfile contents A generated Dockerfile will look like the following: ``` FROM lambci/lambda:python3.6 ADD --chown=sbx_user1051:495 layer1 /opt ADD --chown=sbx_user1051:495 layer2 /opt ``` Parameters ---------- base_image str ...
Below is the the instruction that describes the task: ### Input: Generate the Dockerfile contents A generated Dockerfile will look like the following: ``` FROM lambci/lambda:python3.6 ADD --chown=sbx_user1051:495 layer1 /opt ADD --chown=sbx_user1051:495 layer2 /opt ...
def GetArchiveTypeIndicators(cls, path_spec, resolver_context=None): """Determines if a file contains a supported archive types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in context which is not ...
Determines if a file contains a supported archive types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in context which is not multi process safe. Returns: list[str]: supported format type ind...
Below is the the instruction that describes the task: ### Input: Determines if a file contains a supported archive types. Args: path_spec (PathSpec): path specification. resolver_context (Optional[Context]): resolver context, where None represents the built-in context which is not multi p...
def rindex(values, value): """ :return: the highest index in values where value is found, else raise ValueError """ if isinstance(values, STRING_TYPES): try: return values.rindex(value) except TypeError: # Python 3 compliance: search for str values in bytearray ...
:return: the highest index in values where value is found, else raise ValueError
Below is the the instruction that describes the task: ### Input: :return: the highest index in values where value is found, else raise ValueError ### Response: def rindex(values, value): """ :return: the highest index in values where value is found, else raise ValueError """ if isinstance(values, STRING_T...
def compress_mean(x, dim, compression_factor): """Compress by taking group means. Args: x: a Tensor dim: a dimension in x.shape compression_factor: an integer Returns: a Tensor """ dims = x.shape.dims pos = dims.index(dim) compressed_dim = mtf.Dimension(dim.name, dim.size // compression_...
Compress by taking group means. Args: x: a Tensor dim: a dimension in x.shape compression_factor: an integer Returns: a Tensor
Below is the the instruction that describes the task: ### Input: Compress by taking group means. Args: x: a Tensor dim: a dimension in x.shape compression_factor: an integer Returns: a Tensor ### Response: def compress_mean(x, dim, compression_factor): """Compress by taking group means. ...
def agent_checks(consul_url=None, token=None): ''' Returns the checks the local agent is managing :param consul_url: The Consul server URL. :return: Returns the checks the local agent is managing CLI Example: .. code-block:: bash salt '*' consul.agent_checks ''' ret = {} ...
Returns the checks the local agent is managing :param consul_url: The Consul server URL. :return: Returns the checks the local agent is managing CLI Example: .. code-block:: bash salt '*' consul.agent_checks
Below is the the instruction that describes the task: ### Input: Returns the checks the local agent is managing :param consul_url: The Consul server URL. :return: Returns the checks the local agent is managing CLI Example: .. code-block:: bash salt '*' consul.agent_checks ### Response: ...
def _handle_select(self, parts, result_metadata=None): """Handle reply messages from SELECT statements""" self.rowcount = -1 if result_metadata is not None: # Select was prepared and we can use the already received metadata self.description, self._column_types = self._han...
Handle reply messages from SELECT statements
Below is the the instruction that describes the task: ### Input: Handle reply messages from SELECT statements ### Response: def _handle_select(self, parts, result_metadata=None): """Handle reply messages from SELECT statements""" self.rowcount = -1 if result_metadata is not None: ...
def remove_this_clink(self,clink_id): """ Removes the clink for the given clink identifier @type clink_id: string @param clink_id: the clink identifier to be removed """ for clink in self.get_clinks(): if clink.get_id() == clink_id: self.node.r...
Removes the clink for the given clink identifier @type clink_id: string @param clink_id: the clink identifier to be removed
Below is the the instruction that describes the task: ### Input: Removes the clink for the given clink identifier @type clink_id: string @param clink_id: the clink identifier to be removed ### Response: def remove_this_clink(self,clink_id): """ Removes the clink for the given clink ...
def pre_save(self, instance, add: bool): """Ran just before the model is saved, allows us to built the slug. Arguments: instance: The model that is being saved. add: Indicates whether this is a new entry to the database or...
Ran just before the model is saved, allows us to built the slug. Arguments: instance: The model that is being saved. add: Indicates whether this is a new entry to the database or an update.
Below is the the instruction that describes the task: ### Input: Ran just before the model is saved, allows us to built the slug. Arguments: instance: The model that is being saved. add: Indicates whether this is a new entry t...
def move(self, group, cluster_ids=None): """Assign a group to some clusters. Example: `good` """ if isinstance(cluster_ids, string_types): logger.warn("The list of clusters should be a list of integers, " "not a string.") return s...
Assign a group to some clusters. Example: `good`
Below is the the instruction that describes the task: ### Input: Assign a group to some clusters. Example: `good` ### Response: def move(self, group, cluster_ids=None): """Assign a group to some clusters. Example: `good` """ if isinstance(cluster_ids, string_types): ...
def sanitize(self): ''' Check and optionally fix properties ''' # Let the parent do its stuff super(Protocol, self).sanitize() # Check if the next header is of the right type, and fix this header # if we know better (i.e. the payload is a ProtocolElement so we kn...
Check and optionally fix properties
Below is the the instruction that describes the task: ### Input: Check and optionally fix properties ### Response: def sanitize(self): ''' Check and optionally fix properties ''' # Let the parent do its stuff super(Protocol, self).sanitize() # Check if the next head...
def initialize(*args, **kwargs): """ Functional approach to initializing Sanic JWT. This was the original method, but was replaced by the Initialize class. It is recommended to use the class because it is more flexible. There is no current plan to remove this method, but it may be depracated in the ...
Functional approach to initializing Sanic JWT. This was the original method, but was replaced by the Initialize class. It is recommended to use the class because it is more flexible. There is no current plan to remove this method, but it may be depracated in the future.
Below is the the instruction that describes the task: ### Input: Functional approach to initializing Sanic JWT. This was the original method, but was replaced by the Initialize class. It is recommended to use the class because it is more flexible. There is no current plan to remove this method, but it m...
def complete_offset_upload(self, chunk_num): # type: (Descriptor, int) -> None """Complete the upload for the offset :param Descriptor self: this :param int chunk_num: chunk num completed """ with self._meta_lock: self._outstanding_ops -= 1 # save ...
Complete the upload for the offset :param Descriptor self: this :param int chunk_num: chunk num completed
Below is the the instruction that describes the task: ### Input: Complete the upload for the offset :param Descriptor self: this :param int chunk_num: chunk num completed ### Response: def complete_offset_upload(self, chunk_num): # type: (Descriptor, int) -> None """Complete the upl...
def partitions(l, partition_size): """ >>> list(partitions([], 10)) [] >>> list(partitions([1,2,3,4,5], 1)) [[1], [2], [3], [4], [5]] >>> list(partitions([1,2,3,4,5], 2)) [[1, 2], [3, 4], [5]] >>> list(partitions([1,2,3,4,5], 5)) [[1, 2, 3, 4, 5]] :param list l: List to be parti...
>>> list(partitions([], 10)) [] >>> list(partitions([1,2,3,4,5], 1)) [[1], [2], [3], [4], [5]] >>> list(partitions([1,2,3,4,5], 2)) [[1, 2], [3, 4], [5]] >>> list(partitions([1,2,3,4,5], 5)) [[1, 2, 3, 4, 5]] :param list l: List to be partitioned :param int partition_size: Size of p...
Below is the the instruction that describes the task: ### Input: >>> list(partitions([], 10)) [] >>> list(partitions([1,2,3,4,5], 1)) [[1], [2], [3], [4], [5]] >>> list(partitions([1,2,3,4,5], 2)) [[1, 2], [3, 4], [5]] >>> list(partitions([1,2,3,4,5], 5)) [[1, 2, 3, 4, 5]] :param li...
def to_dict_list(df, use_ordered_dict=True): """Transform each row to dict, and put them into a list. **中文文档** 将 ``pandas.DataFrame`` 转换成一个字典的列表。列表的长度与行数相同, 其中 每一个字典相当于表中的一行, 相当于一个 ``pandas.Series`` 对象。 """ if use_ordered_dict: dict = OrderedDict columns = df.columns data = li...
Transform each row to dict, and put them into a list. **中文文档** 将 ``pandas.DataFrame`` 转换成一个字典的列表。列表的长度与行数相同, 其中 每一个字典相当于表中的一行, 相当于一个 ``pandas.Series`` 对象。
Below is the the instruction that describes the task: ### Input: Transform each row to dict, and put them into a list. **中文文档** 将 ``pandas.DataFrame`` 转换成一个字典的列表。列表的长度与行数相同, 其中 每一个字典相当于表中的一行, 相当于一个 ``pandas.Series`` 对象。 ### Response: def to_dict_list(df, use_ordered_dict=True): """Transform each ...
def post_message(message, channel=None, username=None, api_url=None, hook=None): ''' Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :pa...
Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param message: The message to send to the Mattermost channel. :param api_url: The Mattermost api url, if not specified in the configuration. :param...
Below is the the instruction that describes the task: ### Input: Send a message to a Mattermost channel. :param channel: The channel name, either will work. :param username: The username of the poster. :param message: The message to send to the Mattermost channel. :param api_url: The ...
def get_timestamp_expression(self, time_grain): """Getting the time component of the query""" label = utils.DTTM_ALIAS db = self.table.database pdf = self.python_date_format is_epoch = pdf in ('epoch_s', 'epoch_ms') if not self.expression and not time_grain and not is_ep...
Getting the time component of the query
Below is the the instruction that describes the task: ### Input: Getting the time component of the query ### Response: def get_timestamp_expression(self, time_grain): """Getting the time component of the query""" label = utils.DTTM_ALIAS db = self.table.database pdf = self.python_d...
def collapse_pane(self, side): """ Toggle collapsing the left or right panes. """ # TODO: this is too tied to one configuration, need to figure # out how to generalize this hsplit = self.w['hpnl'] sizes = hsplit.get_sizes() lsize, msize, rsize = sizes ...
Toggle collapsing the left or right panes.
Below is the the instruction that describes the task: ### Input: Toggle collapsing the left or right panes. ### Response: def collapse_pane(self, side): """ Toggle collapsing the left or right panes. """ # TODO: this is too tied to one configuration, need to figure # out how...
def conditional(mean, covar, dims_in, dims_out, covariance_type='full'): """ Return a function f such that f(x) = p(dims_out | dims_in = x) (f actually returns the mean and covariance of the conditional distribution """ in_in = covar[ix_(dims_in, dims_in)] in_out = covar[ix_(dims_in, dims_out)] out_...
Return a function f such that f(x) = p(dims_out | dims_in = x) (f actually returns the mean and covariance of the conditional distribution
Below is the the instruction that describes the task: ### Input: Return a function f such that f(x) = p(dims_out | dims_in = x) (f actually returns the mean and covariance of the conditional distribution ### Response: def conditional(mean, covar, dims_in, dims_out, covariance_type='full'): """ Return a functio...
def run_script(self, requires, script_name): """Locate distribution for `requires` and run `script_name` script""" ns = sys._getframe(1).f_globals name = ns['__name__'] ns.clear() ns['__name__'] = name self.require(requires)[0].run_script(script_name, ns)
Locate distribution for `requires` and run `script_name` script
Below is the the instruction that describes the task: ### Input: Locate distribution for `requires` and run `script_name` script ### Response: def run_script(self, requires, script_name): """Locate distribution for `requires` and run `script_name` script""" ns = sys._getframe(1).f_globals n...
def splitext(self): """ p.splitext() -> Return ``(p.stripext(), p.ext)``. Split the filename extension from this path and return the two parts. Either part may be empty. The extension is everything from ``'.'`` to the end of the last path segment. This has the property that i...
p.splitext() -> Return ``(p.stripext(), p.ext)``. Split the filename extension from this path and return the two parts. Either part may be empty. The extension is everything from ``'.'`` to the end of the last path segment. This has the property that if ``(a, b) == p.splitext...
Below is the the instruction that describes the task: ### Input: p.splitext() -> Return ``(p.stripext(), p.ext)``. Split the filename extension from this path and return the two parts. Either part may be empty. The extension is everything from ``'.'`` to the end of the last path s...
def convert_raw_tuple(value_tuple, format_string): """ Convert a tuple of raw values, according to the given line format. :param tuple value_tuple: the tuple of raw values :param str format_string: the format of the tuple :rtype: list of tuples """ values = [] for v, c in zip(value_tup...
Convert a tuple of raw values, according to the given line format. :param tuple value_tuple: the tuple of raw values :param str format_string: the format of the tuple :rtype: list of tuples
Below is the the instruction that describes the task: ### Input: Convert a tuple of raw values, according to the given line format. :param tuple value_tuple: the tuple of raw values :param str format_string: the format of the tuple :rtype: list of tuples ### Response: def convert_raw_tuple(value_tuple...
def node_created_handler(sender, **kwargs): """ send notification when a new node is created according to users's settings """ if kwargs['created']: obj = kwargs['instance'] queryset = exclude_owner_of_node(obj) create_notifications.delay(**{ "users": queryset, "n...
send notification when a new node is created according to users's settings
Below is the the instruction that describes the task: ### Input: send notification when a new node is created according to users's settings ### Response: def node_created_handler(sender, **kwargs): """ send notification when a new node is created according to users's settings """ if kwargs['created']: ...
def tab_name_editor(self): """Trigger the tab name editor.""" index = self.tabwidget.currentIndex() self.tabwidget.tabBar().tab_name_editor.edit_tab(index)
Trigger the tab name editor.
Below is the the instruction that describes the task: ### Input: Trigger the tab name editor. ### Response: def tab_name_editor(self): """Trigger the tab name editor.""" index = self.tabwidget.currentIndex() self.tabwidget.tabBar().tab_name_editor.edit_tab(index)
def get_internal_modules(key='exa'): """ Get a list of modules belonging to the given package. Args: key (str): Package or library name (e.g. "exa") """ key += '.' return [v for k, v in sys.modules.items() if k.startswith(key)]
Get a list of modules belonging to the given package. Args: key (str): Package or library name (e.g. "exa")
Below is the the instruction that describes the task: ### Input: Get a list of modules belonging to the given package. Args: key (str): Package or library name (e.g. "exa") ### Response: def get_internal_modules(key='exa'): """ Get a list of modules belonging to the given package. Args: ...
def on_drag_data_get(self, widget, context, data, info, time): """dragged state is inserted and its state_id sent to the receiver :param widget: :param context: :param data: SelectionData: contains state_id :param info: :param time: """ library_state = se...
dragged state is inserted and its state_id sent to the receiver :param widget: :param context: :param data: SelectionData: contains state_id :param info: :param time:
Below is the the instruction that describes the task: ### Input: dragged state is inserted and its state_id sent to the receiver :param widget: :param context: :param data: SelectionData: contains state_id :param info: :param time: ### Response: def on_drag_data_get(self, w...
def ec2_elasticip_elasticip_ipaddress(self, lookup, default=None): """ Args: lookup: the CloudFormation resource name of the Elastic IP address to look up default: the optional value to return if lookup failed; returns None if not set Returns: The IP address of the first Elastic IP found w...
Args: lookup: the CloudFormation resource name of the Elastic IP address to look up default: the optional value to return if lookup failed; returns None if not set Returns: The IP address of the first Elastic IP found with a description matching 'lookup' or default/None if no match
Below is the the instruction that describes the task: ### Input: Args: lookup: the CloudFormation resource name of the Elastic IP address to look up default: the optional value to return if lookup failed; returns None if not set Returns: The IP address of the first Elastic IP found with a desc...
def authenticate(url, account, key, by='name', expires=0, timestamp=None, timeout=None, request_type="xml", admin_auth=False, use_password=False, raise_on_error=False): """ Authenticate to the Zimbra server :param url: URL of Zimbra SOAP service :param account: The accoun...
Authenticate to the Zimbra server :param url: URL of Zimbra SOAP service :param account: The account to be authenticated against :param key: The preauth key of the domain of the account or a password (if admin_auth or use_password is True) :param by: If the account is specified as a name, an ID o...
Below is the the instruction that describes the task: ### Input: Authenticate to the Zimbra server :param url: URL of Zimbra SOAP service :param account: The account to be authenticated against :param key: The preauth key of the domain of the account or a password (if admin_auth or use_password i...
def get(self): '''taobao.time.get 获取前台展示的店铺类目 获取淘宝系统当前时间''' request = TOPRequest('taobao.time.get') self.create(self.execute(request)) return self.time
taobao.time.get 获取前台展示的店铺类目 获取淘宝系统当前时间
Below is the the instruction that describes the task: ### Input: taobao.time.get 获取前台展示的店铺类目 获取淘宝系统当前时间 ### Response: def get(self): '''taobao.time.get 获取前台展示的店铺类目 获取淘宝系统当前时间''' request = TOPRequest('taobao.time.get') self.create(self.execute(request)) ...
def day(t, now=None, format='%B %d'): ''' Date delta compared to ``t``. You can override ``now`` to specify what date to compare to. You can override the date format by supplying a ``format`` parameter. :param t: timestamp, :class:`datetime.date` or :class:`datetime.datetime` object ...
Date delta compared to ``t``. You can override ``now`` to specify what date to compare to. You can override the date format by supplying a ``format`` parameter. :param t: timestamp, :class:`datetime.date` or :class:`datetime.datetime` object :param now: default ``None``, optionally a :cl...
Below is the the instruction that describes the task: ### Input: Date delta compared to ``t``. You can override ``now`` to specify what date to compare to. You can override the date format by supplying a ``format`` parameter. :param t: timestamp, :class:`datetime.date` or :class:`datetime.datetime` ...
def name(self): """The descriptive device name as advertised by the kernel and/or the hardware itself. To get the sysname for this device, use :attr:`sysname`. Returns: str: The device name. """ pchar = self._libinput.libinput_device_get_name(self._handle) return string_at(pchar).decode()
The descriptive device name as advertised by the kernel and/or the hardware itself. To get the sysname for this device, use :attr:`sysname`. Returns: str: The device name.
Below is the the instruction that describes the task: ### Input: The descriptive device name as advertised by the kernel and/or the hardware itself. To get the sysname for this device, use :attr:`sysname`. Returns: str: The device name. ### Response: def name(self): """The descriptive device name as a...
def CreateTasksFilter(pc, tasks): """ Create property collector filter for tasks """ if not tasks: return None # First create the object specification as the task object. objspecs = [vmodl.query.PropertyCollector.ObjectSpec(obj=task) for task in tasks] # Next, create the pr...
Create property collector filter for tasks
Below is the the instruction that describes the task: ### Input: Create property collector filter for tasks ### Response: def CreateTasksFilter(pc, tasks): """ Create property collector filter for tasks """ if not tasks: return None # First create the object specification as the task object. ...
def to_match(self): """Return a unicode object with the MATCH representation of this expression.""" self.validate() mark_name, field_name = self.location.get_location_name() validate_safe_string(mark_name) if field_name is not None: raise AssertionError(u'Vertex loc...
Return a unicode object with the MATCH representation of this expression.
Below is the the instruction that describes the task: ### Input: Return a unicode object with the MATCH representation of this expression. ### Response: def to_match(self): """Return a unicode object with the MATCH representation of this expression.""" self.validate() mark_name, field_name...
def geocode(address): '''Query function to obtain a latitude and longitude from a location string such as `Houston, TX` or`Colombia`. This uses an online lookup, currently wrapping the `geopy` library, and providing an on-disk cache of queries. Parameters ---------- address : str ...
Query function to obtain a latitude and longitude from a location string such as `Houston, TX` or`Colombia`. This uses an online lookup, currently wrapping the `geopy` library, and providing an on-disk cache of queries. Parameters ---------- address : str Search string to retrieve t...
Below is the the instruction that describes the task: ### Input: Query function to obtain a latitude and longitude from a location string such as `Houston, TX` or`Colombia`. This uses an online lookup, currently wrapping the `geopy` library, and providing an on-disk cache of queries. Parameters...
def old_lambdef(self, lambda_loc, args_opt, colon_loc, body): """(2.6, 2.7) old_lambdef: 'lambda' [varargslist] ':' old_test""" if args_opt is None: args_opt = self._arguments() args_opt.loc = colon_loc.begin() return ast.Lambda(args=args_opt, body=body, ...
(2.6, 2.7) old_lambdef: 'lambda' [varargslist] ':' old_test
Below is the the instruction that describes the task: ### Input: (2.6, 2.7) old_lambdef: 'lambda' [varargslist] ':' old_test ### Response: def old_lambdef(self, lambda_loc, args_opt, colon_loc, body): """(2.6, 2.7) old_lambdef: 'lambda' [varargslist] ':' old_test""" if args_opt is None: ...
def simplex_optimal(self, t): ''' API: simplex_optimal(self, t) Description: Checks if the current solution is optimal, if yes returns True, False otherwise. Pre: 'flow' attributes represents a solution. Input: t: Graph ...
API: simplex_optimal(self, t) Description: Checks if the current solution is optimal, if yes returns True, False otherwise. Pre: 'flow' attributes represents a solution. Input: t: Graph instance tat reperesents spanning tree solution. ...
Below is the the instruction that describes the task: ### Input: API: simplex_optimal(self, t) Description: Checks if the current solution is optimal, if yes returns True, False otherwise. Pre: 'flow' attributes represents a solution. Input: ...
def get_serializer_class(self, view, method_func): """ Try to get the serializer class from view method. If view method don't have request serializer, fallback to serializer_class on view class """ if hasattr(method_func, 'request_serializer'): return getattr(method_f...
Try to get the serializer class from view method. If view method don't have request serializer, fallback to serializer_class on view class
Below is the the instruction that describes the task: ### Input: Try to get the serializer class from view method. If view method don't have request serializer, fallback to serializer_class on view class ### Response: def get_serializer_class(self, view, method_func): """ Try to get the ser...
def bdh( tickers, flds=None, start_date=None, end_date='today', adjust=None, **kwargs ) -> pd.DataFrame: """ Bloomberg historical data Args: tickers: ticker(s) flds: field(s) start_date: start date end_date: end date - default today adjust: `all`, `dvd`, `nor...
Bloomberg historical data Args: tickers: ticker(s) flds: field(s) start_date: start date end_date: end date - default today adjust: `all`, `dvd`, `normal`, `abn` (=abnormal), `split`, `-` or None exact match of above words will adjust for corresponding events...
Below is the the instruction that describes the task: ### Input: Bloomberg historical data Args: tickers: ticker(s) flds: field(s) start_date: start date end_date: end date - default today adjust: `all`, `dvd`, `normal`, `abn` (=abnormal), `split`, `-` or None ...
def whole_line_styled(p): """ Checks to see if the whole p tag will end up being bold or italics. Returns a tuple (boolean, boolean). The first boolean will be True if the whole line is bold, False otherwise. The second boolean will be True if the whole line is italics, False otherwise. """ ...
Checks to see if the whole p tag will end up being bold or italics. Returns a tuple (boolean, boolean). The first boolean will be True if the whole line is bold, False otherwise. The second boolean will be True if the whole line is italics, False otherwise.
Below is the the instruction that describes the task: ### Input: Checks to see if the whole p tag will end up being bold or italics. Returns a tuple (boolean, boolean). The first boolean will be True if the whole line is bold, False otherwise. The second boolean will be True if the whole line is italics...
def RepairNodeStorageUnits(r, node, storage_type, name): """ Repairs a storage unit on the node. @type node: str @param node: node whose storage units to repair @type storage_type: str @param storage_type: storage type to repair @type name: str @param name: name of the storage unit to r...
Repairs a storage unit on the node. @type node: str @param node: node whose storage units to repair @type storage_type: str @param storage_type: storage type to repair @type name: str @param name: name of the storage unit to repair @rtype: int @return: job id
Below is the the instruction that describes the task: ### Input: Repairs a storage unit on the node. @type node: str @param node: node whose storage units to repair @type storage_type: str @param storage_type: storage type to repair @type name: str @param name: name of the storage unit to r...
def _config_session(): """ Configure session for particular device Returns: tensorflow.Session """ config = tf.ConfigProto() config.gpu_options.allow_growth = True config.gpu_options.visible_device_list = '0' return tf.Session(config=config)
Configure session for particular device Returns: tensorflow.Session
Below is the the instruction that describes the task: ### Input: Configure session for particular device Returns: tensorflow.Session ### Response: def _config_session(): """ Configure session for particular device Returns: tensorflow.Session """ ...
def complete_english(string): """ >>> complete_english('dont do this') "don't do this" >>> complete_english('doesnt is matched as well') "doesn't is matched as well" """ for x, y in [("dont", "don't"), ("doesnt", "doesn't"), ("wont", "won't"), ...
>>> complete_english('dont do this') "don't do this" >>> complete_english('doesnt is matched as well') "doesn't is matched as well"
Below is the the instruction that describes the task: ### Input: >>> complete_english('dont do this') "don't do this" >>> complete_english('doesnt is matched as well') "doesn't is matched as well" ### Response: def complete_english(string): """ >>> complete_english('dont do this') "don't do...
def plotRaster (include = ['allCells'], timeRange = None, maxSpikes = 1e8, orderBy = 'gid', orderInverse = False, labels = 'legend', popRates = False, spikeHist=None, spikeHistBin=5, syncLines=False, lw=2, marker='|', markerSize=5, popColors=None, figSize=(10, 8), fontSize=12, dpi = 100, saveData = None...
Raster plot of network cells - include (['all',|'allCells',|'allNetStims',|,120,|,'E1'|,('L2', 56)|,('L5',[4,5,6])]): Cells to include (default: 'allCells') - timeRange ([start:stop]): Time range of spikes shown; if None shows all (default: None) - maxSpikes (int): maximum number of spikes that ...
Below is the the instruction that describes the task: ### Input: Raster plot of network cells - include (['all',|'allCells',|'allNetStims',|,120,|,'E1'|,('L2', 56)|,('L5',[4,5,6])]): Cells to include (default: 'allCells') - timeRange ([start:stop]): Time range of spikes shown; if None shows all (def...
def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT): ''' Increment the value of a key CLI Example: .. code-block:: bash salt '*' memcached.increment <key> salt '*' memcached.increment <key> 2 ''' conn = _connect(host, port) _check_stats(conn) cur = get(ke...
Increment the value of a key CLI Example: .. code-block:: bash salt '*' memcached.increment <key> salt '*' memcached.increment <key> 2
Below is the the instruction that describes the task: ### Input: Increment the value of a key CLI Example: .. code-block:: bash salt '*' memcached.increment <key> salt '*' memcached.increment <key> 2 ### Response: def increment(key, delta=1, host=DEFAULT_HOST, port=DEFAULT_PORT): '''...
def get_object_references(tb, source, max_string_length=1000): """ Find the values of referenced attributes of objects within the traceback scope. :param tb: traceback :return: list of tuples containing (variable name, value) """ global obj_ref_regex referenced_attr = set() for line in ...
Find the values of referenced attributes of objects within the traceback scope. :param tb: traceback :return: list of tuples containing (variable name, value)
Below is the the instruction that describes the task: ### Input: Find the values of referenced attributes of objects within the traceback scope. :param tb: traceback :return: list of tuples containing (variable name, value) ### Response: def get_object_references(tb, source, max_string_length=1000): "...
def transform(self, Z): """TODO: rewrite docstring Transform X separately by each transformer, concatenate results. Parameters ---------- X : array-like or sparse matrix, shape (n_samples, n_features) Input data to be transformed. Returns ------- ...
TODO: rewrite docstring Transform X separately by each transformer, concatenate results. Parameters ---------- X : array-like or sparse matrix, shape (n_samples, n_features) Input data to be transformed. Returns ------- X_t : array-like or sparse matri...
Below is the the instruction that describes the task: ### Input: TODO: rewrite docstring Transform X separately by each transformer, concatenate results. Parameters ---------- X : array-like or sparse matrix, shape (n_samples, n_features) Input data to be transformed. ...
def get_orgs(self): """ :calls: `GET /user/orgs <http://developer.github.com/v3/orgs>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization` """ return github.PaginatedList.PaginatedList( github.Organization.Organization, ...
:calls: `GET /user/orgs <http://developer.github.com/v3/orgs>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization`
Below is the the instruction that describes the task: ### Input: :calls: `GET /user/orgs <http://developer.github.com/v3/orgs>`_ :rtype: :class:`github.PaginatedList.PaginatedList` of :class:`github.Organization.Organization` ### Response: def get_orgs(self): """ :calls: `GET /user/orgs <ht...
def deactivate_(self): """Init shmem variables to None """ self.preDeactivate_() self.active = False self.image_dimensions = None self.client = None
Init shmem variables to None
Below is the the instruction that describes the task: ### Input: Init shmem variables to None ### Response: def deactivate_(self): """Init shmem variables to None """ self.preDeactivate_() self.active = False self.image_dimensions = None self.client = None
def _claskey(obj, style): '''Wrap an old- or new-style class object. ''' i = id(obj) k = _claskeys.get(i, None) if not k: _claskeys[i] = k = _Claskey(obj, style) return k
Wrap an old- or new-style class object.
Below is the the instruction that describes the task: ### Input: Wrap an old- or new-style class object. ### Response: def _claskey(obj, style): '''Wrap an old- or new-style class object. ''' i = id(obj) k = _claskeys.get(i, None) if not k: _claskeys[i] = k = _Claskey(obj, style) r...
def lookup(self, short_url): ''' Lookup an URL shortened with `is.gd - v.gd url service <http://is.gd/developers.php>`_ and return the real url :param short_url: the url shortened with .gd service :type short_url: str. :returns: str. -- T...
Lookup an URL shortened with `is.gd - v.gd url service <http://is.gd/developers.php>`_ and return the real url :param short_url: the url shortened with .gd service :type short_url: str. :returns: str. -- The original url that was shortened with .gd service ...
Below is the the instruction that describes the task: ### Input: Lookup an URL shortened with `is.gd - v.gd url service <http://is.gd/developers.php>`_ and return the real url :param short_url: the url shortened with .gd service :type short_url: str. :re...
def plot_diagnostics(self, variable=0, lags=10, fig=None, figsize=None): """Plot an ARIMA's diagnostics. Diagnostic plots for standardized residuals of one endogenous variable Parameters ---------- variable : integer, optional Index of the endogenous variable for wh...
Plot an ARIMA's diagnostics. Diagnostic plots for standardized residuals of one endogenous variable Parameters ---------- variable : integer, optional Index of the endogenous variable for which the diagnostic plots should be created. Default is 0. lags ...
Below is the the instruction that describes the task: ### Input: Plot an ARIMA's diagnostics. Diagnostic plots for standardized residuals of one endogenous variable Parameters ---------- variable : integer, optional Index of the endogenous variable for which the diagnos...
def search( self, search_space, valid_data, init_args=[], train_args=[], init_kwargs={}, train_kwargs={}, module_args={}, module_kwargs={}, max_search=None, shuffle=True, verbose=True, **score_kwargs, ): ...
Args: search_space: see config_generator() documentation valid_data: a tuple of Tensors (X,Y), a Dataset, or a DataLoader of X (data) and Y (labels) for the dev split init_args: (list) positional args for initializing the model train_args: (list) positiona...
Below is the the instruction that describes the task: ### Input: Args: search_space: see config_generator() documentation valid_data: a tuple of Tensors (X,Y), a Dataset, or a DataLoader of X (data) and Y (labels) for the dev split init_args: (list) positional arg...
def quickvolshow( data, lighting=False, data_min=None, data_max=None, max_shape=256, level=[0.1, 0.5, 0.9], opacity=[0.01, 0.05, 0.1], level_width=0.1, extent=None, memorder='C', **kwargs ): """Visualize a 3d array using volume rendering. :param data: 3d numpy array ...
Visualize a 3d array using volume rendering. :param data: 3d numpy array :param lighting: boolean, to use lighting or not, if set to false, lighting parameters will be overriden :param data_min: minimum value to consider for data, if None, computed using np.nanmin :param data_max: maximum value to cons...
Below is the the instruction that describes the task: ### Input: Visualize a 3d array using volume rendering. :param data: 3d numpy array :param lighting: boolean, to use lighting or not, if set to false, lighting parameters will be overriden :param data_min: minimum value to consider for data, if None...
def hide_routemap_holder_route_map_content_set_ipv6_next_vrf_next_vrf_list_vrf(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") hide_routemap_holder = ET.SubElement(config, "hide-routemap-holder", xmlns="urn:brocade.com:mgmt:brocade-ip-policy") route_map ...
Auto Generated Code
Below is the the instruction that describes the task: ### Input: Auto Generated Code ### Response: def hide_routemap_holder_route_map_content_set_ipv6_next_vrf_next_vrf_list_vrf(self, **kwargs): """Auto Generated Code """ config = ET.Element("config") hide_routemap_holder = ET.SubEl...
def set_kind(query_proto, kind): """Set the kind constraint for the given datastore.Query proto message.""" del query_proto.kind[:] query_proto.kind.add().name = kind
Set the kind constraint for the given datastore.Query proto message.
Below is the the instruction that describes the task: ### Input: Set the kind constraint for the given datastore.Query proto message. ### Response: def set_kind(query_proto, kind): """Set the kind constraint for the given datastore.Query proto message.""" del query_proto.kind[:] query_proto.kind.add().name =...
def setWindowSize(self, winsz): """Sets the size of scroll window""" self.tracePlot.setWindowSize(winsz) self.stimPlot.setWindowSize(winsz)
Sets the size of scroll window
Below is the the instruction that describes the task: ### Input: Sets the size of scroll window ### Response: def setWindowSize(self, winsz): """Sets the size of scroll window""" self.tracePlot.setWindowSize(winsz) self.stimPlot.setWindowSize(winsz)
def sort_top_targets(self, top, orders): ''' Returns the sorted high data from the merged top files ''' sorted_top = collections.defaultdict(OrderedDict) # pylint: disable=cell-var-from-loop for saltenv, targets in six.iteritems(top): sorted_targets = sorted(t...
Returns the sorted high data from the merged top files
Below is the the instruction that describes the task: ### Input: Returns the sorted high data from the merged top files ### Response: def sort_top_targets(self, top, orders): ''' Returns the sorted high data from the merged top files ''' sorted_top = collections.defaultdict(OrderedD...
def V(a,b,C): """ Simple interface to the nuclear attraction function. >>> from pyquante2 import pgbf,cgbf >>> s = pgbf(1) >>> isclose(V(s,s,(0,0,0)),-1.595769) True >>> sc = cgbf(exps=[1],coefs=[1]) >>> isclose(V(sc,sc,(0,0,0)),-1.595769) True >>> sc = cgbf(exps=[1],coefs=[1])...
Simple interface to the nuclear attraction function. >>> from pyquante2 import pgbf,cgbf >>> s = pgbf(1) >>> isclose(V(s,s,(0,0,0)),-1.595769) True >>> sc = cgbf(exps=[1],coefs=[1]) >>> isclose(V(sc,sc,(0,0,0)),-1.595769) True >>> sc = cgbf(exps=[1],coefs=[1]) >>> isclose(V(sc,s,(0...
Below is the the instruction that describes the task: ### Input: Simple interface to the nuclear attraction function. >>> from pyquante2 import pgbf,cgbf >>> s = pgbf(1) >>> isclose(V(s,s,(0,0,0)),-1.595769) True >>> sc = cgbf(exps=[1],coefs=[1]) >>> isclose(V(sc,sc,(0,0,0)),-1.595769) ...
def gallery_section(images, title): """Create detail section with gallery. Args: title (str): Title to be displayed for detail section. images: stream of marv image files Returns One detail section. """ # pull all images imgs = [] while True: img = yield mar...
Create detail section with gallery. Args: title (str): Title to be displayed for detail section. images: stream of marv image files Returns One detail section.
Below is the the instruction that describes the task: ### Input: Create detail section with gallery. Args: title (str): Title to be displayed for detail section. images: stream of marv image files Returns One detail section. ### Response: def gallery_section(images, title): ""...
def match_pagination(ref_line): """Remove footer pagination from references lines""" pattern = ur'\(?\[?(\d{1,4})\]?\)?\.?\s*$' re_footer = re.compile(pattern, re.UNICODE) match = re_footer.match(ref_line) if match: return int(match.group(1)) return None
Remove footer pagination from references lines
Below is the the instruction that describes the task: ### Input: Remove footer pagination from references lines ### Response: def match_pagination(ref_line): """Remove footer pagination from references lines""" pattern = ur'\(?\[?(\d{1,4})\]?\)?\.?\s*$' re_footer = re.compile(pattern, re.UNICODE) m...
def from_sample(sample): """Upload results of processing from an analysis pipeline sample. """ upload_config = sample.get("upload") if upload_config: approach = _approaches[upload_config.get("method", "filesystem")] for finfo in _get_files(sample): approach.update_file(finfo,...
Upload results of processing from an analysis pipeline sample.
Below is the the instruction that describes the task: ### Input: Upload results of processing from an analysis pipeline sample. ### Response: def from_sample(sample): """Upload results of processing from an analysis pipeline sample. """ upload_config = sample.get("upload") if upload_config: ...