code
stringlengths
75
104k
docstring
stringlengths
1
46.9k
text
stringlengths
164
112k
def resolve_and_call(self, func, extra_env=None): """ Resolve function arguments and call them, possibily filling from the environment """ kwargs = self.resolve_parameters(func, extra_env=extra_env) return func(**kwargs)
Resolve function arguments and call them, possibily filling from the environment
Below is the the instruction that describes the task: ### Input: Resolve function arguments and call them, possibily filling from the environment ### Response: def resolve_and_call(self, func, extra_env=None): """ Resolve function arguments and call them, possibily filling from the environment """ ...
def gen_FS_DF(df_output): """generate DataFrame of scores. Parameters ---------- df_WS_data : type Description of parameter `df_WS_data`. Returns ------- type Description of returned object. """ df_day = pd.pivot_table( df_output, values=['T2', 'U10...
generate DataFrame of scores. Parameters ---------- df_WS_data : type Description of parameter `df_WS_data`. Returns ------- type Description of returned object.
Below is the the instruction that describes the task: ### Input: generate DataFrame of scores. Parameters ---------- df_WS_data : type Description of parameter `df_WS_data`. Returns ------- type Description of returned object. ### Response: def gen_FS_DF(df_output): ""...
def vcf2cytosure(institute_id, case_name, individual_id): """Download vcf2cytosure file for individual.""" (display_name, vcf2cytosure) = controllers.vcf2cytosure(store, institute_id, case_name, individual_id) outdir = os.path.abspath(os.path.dirname(vcf2cytosure)) filename = os.path.basename(...
Download vcf2cytosure file for individual.
Below is the the instruction that describes the task: ### Input: Download vcf2cytosure file for individual. ### Response: def vcf2cytosure(institute_id, case_name, individual_id): """Download vcf2cytosure file for individual.""" (display_name, vcf2cytosure) = controllers.vcf2cytosure(store, instit...
def get_k8s_upgrades_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument """Return Kubernetes versions available for upgrading an existing cluster.""" resource_group = getattr(namespace, 'resource_group_name', None) name = getattr(namespace, 'name', None) return get_k8s...
Return Kubernetes versions available for upgrading an existing cluster.
Below is the the instruction that describes the task: ### Input: Return Kubernetes versions available for upgrading an existing cluster. ### Response: def get_k8s_upgrades_completion_list(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument """Return Kubernetes versions available for upgrading...
def process_request(self, request): """ Sets the current request's ``urlconf`` attribute to the urlconf associated with the subdomain, if it is listed in ``settings.SUBDOMAIN_URLCONFS``. """ super(SubdomainURLRoutingMiddleware, self).process_request(request) subd...
Sets the current request's ``urlconf`` attribute to the urlconf associated with the subdomain, if it is listed in ``settings.SUBDOMAIN_URLCONFS``.
Below is the the instruction that describes the task: ### Input: Sets the current request's ``urlconf`` attribute to the urlconf associated with the subdomain, if it is listed in ``settings.SUBDOMAIN_URLCONFS``. ### Response: def process_request(self, request): """ Sets the current ...
def open(cls, grammar_filename, rel_to=None, **options): """Create an instance of Lark with the grammar given by its filename If rel_to is provided, the function will find the grammar filename in relation to it. Example: >>> Lark.open("grammar_file.lark", rel_to=__file__, parser="...
Create an instance of Lark with the grammar given by its filename If rel_to is provided, the function will find the grammar filename in relation to it. Example: >>> Lark.open("grammar_file.lark", rel_to=__file__, parser="lalr") Lark(...)
Below is the the instruction that describes the task: ### Input: Create an instance of Lark with the grammar given by its filename If rel_to is provided, the function will find the grammar filename in relation to it. Example: >>> Lark.open("grammar_file.lark", rel_to=__file__, parser=...
def as_p(self, show_leaf=True, current_linkable=False, class_current="active_link"): """ It returns breadcrumb as p """ return self.__do_menu("as_p", show_leaf, current_linkable, class_current)
It returns breadcrumb as p
Below is the the instruction that describes the task: ### Input: It returns breadcrumb as p ### Response: def as_p(self, show_leaf=True, current_linkable=False, class_current="active_link"): """ It returns breadcrumb as p """ return self.__do_menu("as_p", show_leaf, current_linkable...
def bind(self, fn: Callable[[Any], 'List']) -> 'List': """Flatten and map the List. Haskell: xs >>= f = concat (map f xs) """ return List.concat(self.map(fn))
Flatten and map the List. Haskell: xs >>= f = concat (map f xs)
Below is the the instruction that describes the task: ### Input: Flatten and map the List. Haskell: xs >>= f = concat (map f xs) ### Response: def bind(self, fn: Callable[[Any], 'List']) -> 'List': """Flatten and map the List. Haskell: xs >>= f = concat (map f xs) """ retu...
def get_vm_info(name): ''' get the information for a VM. :param name: salt_id name :return: dictionary of {'machine': x, 'cwd': y, ...}. ''' try: vm_ = __utils__['sdb.sdb_get'](_build_sdb_uri(name), __opts__) except KeyError: raise SaltInvocationError( 'Probable ...
get the information for a VM. :param name: salt_id name :return: dictionary of {'machine': x, 'cwd': y, ...}.
Below is the the instruction that describes the task: ### Input: get the information for a VM. :param name: salt_id name :return: dictionary of {'machine': x, 'cwd': y, ...}. ### Response: def get_vm_info(name): ''' get the information for a VM. :param name: salt_id name :return: dictiona...
def rtree_filter(self): """ :returns: an RtreeFilter """ return RtreeFilter(self.src_filter.sitecol, self.oqparam.maximum_distance, self.src_filter.filename)
:returns: an RtreeFilter
Below is the the instruction that describes the task: ### Input: :returns: an RtreeFilter ### Response: def rtree_filter(self): """ :returns: an RtreeFilter """ return RtreeFilter(self.src_filter.sitecol, self.oqparam.maximum_distance, ...
def get_repr(expr, multiline=False): """ Build a repr string for ``expr`` from its vars and signature. :: >>> class MyObject: ... def __init__(self, arg1, arg2, *var_args, foo=None, bar=None, **kwargs): ... self.arg1 = arg1 ... self.arg2 = arg2 ....
Build a repr string for ``expr`` from its vars and signature. :: >>> class MyObject: ... def __init__(self, arg1, arg2, *var_args, foo=None, bar=None, **kwargs): ... self.arg1 = arg1 ... self.arg2 = arg2 ... self.var_args = var_args ... ...
Below is the the instruction that describes the task: ### Input: Build a repr string for ``expr`` from its vars and signature. :: >>> class MyObject: ... def __init__(self, arg1, arg2, *var_args, foo=None, bar=None, **kwargs): ... self.arg1 = arg1 ... self.a...
def copy_file_job(job, name, file_id, output_dir): """ Job version of move_files for one file :param JobFunctionWrappingJob job: passed automatically by Toil :param str name: Name of output file (including extension) :param str file_id: FileStoreID of file :param str output_dir: Location to pla...
Job version of move_files for one file :param JobFunctionWrappingJob job: passed automatically by Toil :param str name: Name of output file (including extension) :param str file_id: FileStoreID of file :param str output_dir: Location to place output file
Below is the the instruction that describes the task: ### Input: Job version of move_files for one file :param JobFunctionWrappingJob job: passed automatically by Toil :param str name: Name of output file (including extension) :param str file_id: FileStoreID of file :param str output_dir: Location ...
def _parse_qemu_img_info(info): ''' Parse qemu-img info JSON output into disk infos dictionary ''' raw_infos = salt.utils.json.loads(info) disks = [] for disk_infos in raw_infos: disk = { 'file': disk_infos['filename'], 'file format': disk_infos['for...
Parse qemu-img info JSON output into disk infos dictionary
Below is the the instruction that describes the task: ### Input: Parse qemu-img info JSON output into disk infos dictionary ### Response: def _parse_qemu_img_info(info): ''' Parse qemu-img info JSON output into disk infos dictionary ''' raw_infos = salt.utils.json.loads(info) disks = [] for...
def state_delta(self, selector='all', power=None, duration=1.0, infrared=None, hue=None, saturation=None, brightness=None, kelvin=None): """Given a state delta, apply the modifications to lights' state over a given period of time. selector: required String The select...
Given a state delta, apply the modifications to lights' state over a given period of time. selector: required String The selector to limit which lights are controlled. power: String The power state you want to set on the selector. on or off duration: Double ...
Below is the the instruction that describes the task: ### Input: Given a state delta, apply the modifications to lights' state over a given period of time. selector: required String The selector to limit which lights are controlled. power: String The power state you...
def main(output_directory: int, data: str) -> None: """ Processes the text2sql data into the following directory structure: ``dataset/{query_split, question_split}/{train,dev,test}.json`` for datasets which have train, dev and test splits, or: ``dataset/{query_split, question_split}/{split_{split...
Processes the text2sql data into the following directory structure: ``dataset/{query_split, question_split}/{train,dev,test}.json`` for datasets which have train, dev and test splits, or: ``dataset/{query_split, question_split}/{split_{split_id}}.json`` for datasets which use cross validation. ...
Below is the the instruction that describes the task: ### Input: Processes the text2sql data into the following directory structure: ``dataset/{query_split, question_split}/{train,dev,test}.json`` for datasets which have train, dev and test splits, or: ``dataset/{query_split, question_split}/{split_{...
def result(self, line=''): """Print the result of the last asynchronous %px command. This lets you recall the results of %px computations after asynchronous submission (block=False). Examples -------- :: In [23]: %px os.getpid() Async pa...
Print the result of the last asynchronous %px command. This lets you recall the results of %px computations after asynchronous submission (block=False). Examples -------- :: In [23]: %px os.getpid() Async parallel execution on engine(s): all ...
Below is the the instruction that describes the task: ### Input: Print the result of the last asynchronous %px command. This lets you recall the results of %px computations after asynchronous submission (block=False). Examples -------- :: In [23]: %px o...
def prep_jid(nocache=False, passed_jid=None): ''' Return a job id and prepare the job id directory This is the function responsible for making sure jids don't collide (unless its passed a jid). So do what you have to do to make sure that stays the case ''' conn = _get_conn() if conn is N...
Return a job id and prepare the job id directory This is the function responsible for making sure jids don't collide (unless its passed a jid). So do what you have to do to make sure that stays the case
Below is the the instruction that describes the task: ### Input: Return a job id and prepare the job id directory This is the function responsible for making sure jids don't collide (unless its passed a jid). So do what you have to do to make sure that stays the case ### Response: def prep_jid(nocache=...
def logged_in(self): """ This is True if this instance is logged in else False. We test if this session is authenticated by calling the User.get() XMLRPC method with ids set. Logged-out users cannot pass the 'ids' parameter and will result in a 505 error. If we tried to login wi...
This is True if this instance is logged in else False. We test if this session is authenticated by calling the User.get() XMLRPC method with ids set. Logged-out users cannot pass the 'ids' parameter and will result in a 505 error. If we tried to login with a token, but the token was inc...
Below is the the instruction that describes the task: ### Input: This is True if this instance is logged in else False. We test if this session is authenticated by calling the User.get() XMLRPC method with ids set. Logged-out users cannot pass the 'ids' parameter and will result in a 505 er...
def p_catch(self, p): """catch : CATCH LPAREN identifier RPAREN block""" p[0] = ast.Catch(identifier=p[3], elements=p[5])
catch : CATCH LPAREN identifier RPAREN block
Below is the the instruction that describes the task: ### Input: catch : CATCH LPAREN identifier RPAREN block ### Response: def p_catch(self, p): """catch : CATCH LPAREN identifier RPAREN block""" p[0] = ast.Catch(identifier=p[3], elements=p[5])
def yield_event(self, act): """ Hande completion for a request and return an (op, coro) to be passed to the scheduler on the last completion loop of a proactor. """ if act in self.tokens: coro = act.coro op = self.try_run_act(act, self.tokens[act]) ...
Hande completion for a request and return an (op, coro) to be passed to the scheduler on the last completion loop of a proactor.
Below is the the instruction that describes the task: ### Input: Hande completion for a request and return an (op, coro) to be passed to the scheduler on the last completion loop of a proactor. ### Response: def yield_event(self, act): """ Hande completion for a request and return an (op...
def get_attribute_data(doc): """Helper function: parse attribute data from a wiki html doc Args: doc (document parsed with lxml.html): parsed wiki page Returns: dict: attributes values and listed links, format ``{<key>: {'value': <value>, 'link': <link>}}``; only the first hy...
Helper function: parse attribute data from a wiki html doc Args: doc (document parsed with lxml.html): parsed wiki page Returns: dict: attributes values and listed links, format ``{<key>: {'value': <value>, 'link': <link>}}``; only the first hyperlink listed in each attribute val...
Below is the the instruction that describes the task: ### Input: Helper function: parse attribute data from a wiki html doc Args: doc (document parsed with lxml.html): parsed wiki page Returns: dict: attributes values and listed links, format ``{<key>: {'value': <value>, 'link': <link>}}``...
def get_bank_name(clabe: str) -> str: """ Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control """ code = clabe[:3] try: bank_name = BANK_NAMES[BANKS[code]] except KeyError: raise ValueError(f"Ningún banco tiene ...
Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control
Below is the the instruction that describes the task: ### Input: Regresa el nombre del banco basado en los primeros 3 digitos https://es.wikipedia.org/wiki/CLABE#D.C3.ADgito_control ### Response: def get_bank_name(clabe: str) -> str: """ Regresa el nombre del banco basado en los primeros 3 digitos ...
def _set_offset_cpu(self, v, load=False): """ Setter method for offset_cpu, mapped from YANG variable /resource_monitor/cpu/offset_cpu (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_offset_cpu is considered as a private method. Backends looking to populate ...
Setter method for offset_cpu, mapped from YANG variable /resource_monitor/cpu/offset_cpu (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_offset_cpu is considered as a private method. Backends looking to populate this variable should do so via calling thisObj._se...
Below is the the instruction that describes the task: ### Input: Setter method for offset_cpu, mapped from YANG variable /resource_monitor/cpu/offset_cpu (uint32) If this variable is read-only (config: false) in the source YANG file, then _set_offset_cpu is considered as a private method. Backends looki...
def _get_exception_log_path(): """Return the normalized path for the connection log, raising an exception if it can not written to. :return: str """ app = sys.argv[0].split('/')[-1] for exception_log in ['/var/log/%s.errors' % app, '/var/tm...
Return the normalized path for the connection log, raising an exception if it can not written to. :return: str
Below is the the instruction that describes the task: ### Input: Return the normalized path for the connection log, raising an exception if it can not written to. :return: str ### Response: def _get_exception_log_path(): """Return the normalized path for the connection log, raising an ...
def drug_names_match_criteria(drug_names: List[str], names_are_generic: bool = False, include_categories: bool = False, **criteria: Dict[str, bool]) -> List[bool]: """ Establish whether multiple drugs, passed as a list of ...
Establish whether multiple drugs, passed as a list of drug names, each matches the specified criteria. See :func:`drug_matches_criteria`.
Below is the the instruction that describes the task: ### Input: Establish whether multiple drugs, passed as a list of drug names, each matches the specified criteria. See :func:`drug_matches_criteria`. ### Response: def drug_names_match_criteria(drug_names: List[str], names_are_g...
def dumpJSON(self): """ Return dictionary of data for FITS headers. """ g = get_root(self).globals return dict( RA=self.ra['text'], DEC=self.dec['text'], tel=g.cpars['telins_name'], alt=self._getVal(self.alt), az=self._g...
Return dictionary of data for FITS headers.
Below is the the instruction that describes the task: ### Input: Return dictionary of data for FITS headers. ### Response: def dumpJSON(self): """ Return dictionary of data for FITS headers. """ g = get_root(self).globals return dict( RA=self.ra['text'], ...
def workflow( graph: BELGraph, node: BaseEntity, key: Optional[str] = None, tag: Optional[str] = None, default_score: Optional[float] = None, runs: Optional[int] = None, minimum_nodes: int = 1, ) -> List['Runner']: """Generate candidate mechanisms and run the ...
Generate candidate mechanisms and run the heat diffusion workflow. :param graph: A BEL graph :param node: The BEL node that is the focus of this analysis :param key: The key in the node data dictionary representing the experimental data. Defaults to :data:`pybel_tools.constants.WEIGHT`. :param tag...
Below is the the instruction that describes the task: ### Input: Generate candidate mechanisms and run the heat diffusion workflow. :param graph: A BEL graph :param node: The BEL node that is the focus of this analysis :param key: The key in the node data dictionary representing the experimental data. ...
def AND(*args, **kwargs): """ ALL args must not raise an exception when called incrementally. If an exception is specified, raise it, otherwise raise the callable's exception. :params iterable[Certifier] args: The certifiers to call :param callable kwargs['exc']: Callable that exce...
ALL args must not raise an exception when called incrementally. If an exception is specified, raise it, otherwise raise the callable's exception. :params iterable[Certifier] args: The certifiers to call :param callable kwargs['exc']: Callable that excepts the unexpectedly raised exception ...
Below is the the instruction that describes the task: ### Input: ALL args must not raise an exception when called incrementally. If an exception is specified, raise it, otherwise raise the callable's exception. :params iterable[Certifier] args: The certifiers to call :param callable kwargs['ex...
def _assert_input_is_valid(input_value, # type: Any validators, # type: List[InputValidator] validated_func, # type: Callable input_name # type: str ): """ Called by the `validating_wrappe...
Called by the `validating_wrapper` in the first step (a) `apply_on_each_func_args` for each function input before executing the function. It simply delegates to the validator. The signature of this function is hardcoded to correspond to `apply_on_each_func_args`'s behaviour and should therefore not be changed. ...
Below is the the instruction that describes the task: ### Input: Called by the `validating_wrapper` in the first step (a) `apply_on_each_func_args` for each function input before executing the function. It simply delegates to the validator. The signature of this function is hardcoded to correspond to `apply...
def expired(self): """Called when an expired session is atime""" self._data["_killed"] = True self.save() raise SessionExpired(self._config.expired_message)
Called when an expired session is atime
Below is the the instruction that describes the task: ### Input: Called when an expired session is atime ### Response: def expired(self): """Called when an expired session is atime""" self._data["_killed"] = True self.save() raise SessionExpired(self._config.expired_message)
def dict_diff(d1, d2, no_key='<KEYNOTFOUND>'): # type: (DictUpperBound, DictUpperBound, str) -> Dict """Compares two dictionaries Args: d1 (DictUpperBound): First dictionary to compare d2 (DictUpperBound): Second dictionary to compare no_key (str): What value to use if key is not fo...
Compares two dictionaries Args: d1 (DictUpperBound): First dictionary to compare d2 (DictUpperBound): Second dictionary to compare no_key (str): What value to use if key is not found Defaults to '<KEYNOTFOUND>'. Returns: Dict: Comparison dictionary
Below is the the instruction that describes the task: ### Input: Compares two dictionaries Args: d1 (DictUpperBound): First dictionary to compare d2 (DictUpperBound): Second dictionary to compare no_key (str): What value to use if key is not found Defaults to '<KEYNOTFOUND>'. Retur...
def register(self, event, fn): """ Registers the given function as a handler to be applied in response to the the given event. """ # TODO: Can we check the method signature? self._handler_dict.setdefault(event, []) if fn not in self._handler_dict[event]: ...
Registers the given function as a handler to be applied in response to the the given event.
Below is the the instruction that describes the task: ### Input: Registers the given function as a handler to be applied in response to the the given event. ### Response: def register(self, event, fn): """ Registers the given function as a handler to be applied in response to the th...
def fit_effective_mass(distances, energies, parabolic=True): """Fit the effective masses using either a parabolic or nonparabolic fit. Args: distances (:obj:`numpy.ndarray`): The x-distances between k-points in reciprocal Angstroms, normalised to the band extrema. energies (:obj:`nu...
Fit the effective masses using either a parabolic or nonparabolic fit. Args: distances (:obj:`numpy.ndarray`): The x-distances between k-points in reciprocal Angstroms, normalised to the band extrema. energies (:obj:`numpy.ndarray`): The band eigenvalues normalised to the ei...
Below is the the instruction that describes the task: ### Input: Fit the effective masses using either a parabolic or nonparabolic fit. Args: distances (:obj:`numpy.ndarray`): The x-distances between k-points in reciprocal Angstroms, normalised to the band extrema. energies (:obj:`n...
def availability(self, dcid, params=None): ''' /v1/regions/availability GET - public Retrieve a list of the VPSPLANIDs currently available in this location. If your account has special plans available, you will need to pass your api_key in in order to see them. For all ot...
/v1/regions/availability GET - public Retrieve a list of the VPSPLANIDs currently available in this location. If your account has special plans available, you will need to pass your api_key in in order to see them. For all other accounts, the API key is not optional. Lin...
Below is the the instruction that describes the task: ### Input: /v1/regions/availability GET - public Retrieve a list of the VPSPLANIDs currently available in this location. If your account has special plans available, you will need to pass your api_key in in order to see them. ...
def set_residual(self, pores=[], overwrite=False): r""" Method to start invasion in a network w. residual saturation. Called after inlets are set. Parameters ---------- pores : array_like The pores locations that are to be filled with invader at the ...
r""" Method to start invasion in a network w. residual saturation. Called after inlets are set. Parameters ---------- pores : array_like The pores locations that are to be filled with invader at the beginning of the simulation. overwrite : boolea...
Below is the the instruction that describes the task: ### Input: r""" Method to start invasion in a network w. residual saturation. Called after inlets are set. Parameters ---------- pores : array_like The pores locations that are to be filled with invader at the...
def batch_load_docs(db, doc_iterator, on_duplicate="replace"): """Batch load documents Args: db: ArangoDB client database handle doc_iterator: function that yields (collection_name, doc_key, doc) on_duplicate: defaults to replace, but can be error, update, replace or ignore ht...
Batch load documents Args: db: ArangoDB client database handle doc_iterator: function that yields (collection_name, doc_key, doc) on_duplicate: defaults to replace, but can be error, update, replace or ignore https://python-driver-for-arangodb.readthedocs.io/en/master/specs.html?h...
Below is the the instruction that describes the task: ### Input: Batch load documents Args: db: ArangoDB client database handle doc_iterator: function that yields (collection_name, doc_key, doc) on_duplicate: defaults to replace, but can be error, update, replace or ignore htt...
def find_vc_pdir_vswhere(msvc_version): """ Find the MSVC product directory using vswhere.exe . Run it asking for specified version and get MSVS install location :param msvc_version: :return: MSVC install dir """ vswhere_path = os.path.join( 'C:\\', 'Program Files (x86)', ...
Find the MSVC product directory using vswhere.exe . Run it asking for specified version and get MSVS install location :param msvc_version: :return: MSVC install dir
Below is the the instruction that describes the task: ### Input: Find the MSVC product directory using vswhere.exe . Run it asking for specified version and get MSVS install location :param msvc_version: :return: MSVC install dir ### Response: def find_vc_pdir_vswhere(msvc_version): """ Find t...
def assign_site_properties(self, slab, height=0.9): """ Assigns site properties. """ if 'surface_properties' in slab.site_properties.keys(): return slab else: surf_sites = self.find_surface_sites_by_height(slab, height) surf_props = ['surface' if s...
Assigns site properties.
Below is the the instruction that describes the task: ### Input: Assigns site properties. ### Response: def assign_site_properties(self, slab, height=0.9): """ Assigns site properties. """ if 'surface_properties' in slab.site_properties.keys(): return slab else: ...
def df(self, src): '''Perform ``df`` on a path''' return self._getStdOutCmd([self._hadoop_cmd, 'fs', '-df', self._full_hdfs_path(src)], True)
Perform ``df`` on a path
Below is the the instruction that describes the task: ### Input: Perform ``df`` on a path ### Response: def df(self, src): '''Perform ``df`` on a path''' return self._getStdOutCmd([self._hadoop_cmd, 'fs', '-df', self._full_hdfs_path(src)], True)
def get_identifier(self): """ For methods this is the return type, the name and the (non-pretty) argument descriptor. For fields it is simply the name. The return-type of methods is attached to the identifier when it is a bridge method, which can technically allow two methods ...
For methods this is the return type, the name and the (non-pretty) argument descriptor. For fields it is simply the name. The return-type of methods is attached to the identifier when it is a bridge method, which can technically allow two methods with the same name and argument type lis...
Below is the the instruction that describes the task: ### Input: For methods this is the return type, the name and the (non-pretty) argument descriptor. For fields it is simply the name. The return-type of methods is attached to the identifier when it is a bridge method, which can technical...
def MultiWritePathHistory(self, client_path_histories): """Writes a collection of hash and stat entries observed for given paths.""" for client_path, client_path_history in iteritems(client_path_histories): if client_path.client_id not in self.metadatas: raise db.UnknownClientError(client_path.cli...
Writes a collection of hash and stat entries observed for given paths.
Below is the the instruction that describes the task: ### Input: Writes a collection of hash and stat entries observed for given paths. ### Response: def MultiWritePathHistory(self, client_path_histories): """Writes a collection of hash and stat entries observed for given paths.""" for client_path, client_...
def clear(self): """ Clear screen and go to 0,0 """ # Erase current output first. self.erase() # Send "Erase Screen" command and go to (0, 0). output = self.output output.erase_screen() output.cursor_goto(0, 0) output.flush() sel...
Clear screen and go to 0,0
Below is the the instruction that describes the task: ### Input: Clear screen and go to 0,0 ### Response: def clear(self): """ Clear screen and go to 0,0 """ # Erase current output first. self.erase() # Send "Erase Screen" command and go to (0, 0). output = ...
def add_virtualip(self, lb, vip): """Adds the VirtualIP to the specified load balancer.""" resp, body = self.api.method_post("/loadbalancers/%s/virtualips" % lb.id, body=vip.to_dict()) return resp, body
Adds the VirtualIP to the specified load balancer.
Below is the the instruction that describes the task: ### Input: Adds the VirtualIP to the specified load balancer. ### Response: def add_virtualip(self, lb, vip): """Adds the VirtualIP to the specified load balancer.""" resp, body = self.api.method_post("/loadbalancers/%s/virtualips" % lb.id, ...
def get_argument_starttime(self): """ Helper function to get starttime argument. Raises exception if argument is missing. Returns the starttime argument. """ try: starttime = self.get_argument(constants.PARAM_STARTTIME) return starttime except tornado.web.MissingArgumentError as ...
Helper function to get starttime argument. Raises exception if argument is missing. Returns the starttime argument.
Below is the the instruction that describes the task: ### Input: Helper function to get starttime argument. Raises exception if argument is missing. Returns the starttime argument. ### Response: def get_argument_starttime(self): """ Helper function to get starttime argument. Raises exception if...
def set_attributes_all(target, attributes, discard_others=True): """ Set Attributes in bulk and optionally discard others. Sets each Attribute in turn (modifying it in place if possible if it is already present) and optionally discarding all other Attributes not explicitly set. This function yields muc...
Set Attributes in bulk and optionally discard others. Sets each Attribute in turn (modifying it in place if possible if it is already present) and optionally discarding all other Attributes not explicitly set. This function yields much greater performance than the required individual calls to ``set_att...
Below is the the instruction that describes the task: ### Input: Set Attributes in bulk and optionally discard others. Sets each Attribute in turn (modifying it in place if possible if it is already present) and optionally discarding all other Attributes not explicitly set. This function yields much gr...
def on_linkType_changed(self, evt): """User changed link kind, so prepare available fields.""" if self.current_idx < 0: evt.Skip() return n = self.linkType.GetSelection() lt_str = self.linkType.GetString(n) lt = self.link_code[lt_str] self.prep_lin...
User changed link kind, so prepare available fields.
Below is the the instruction that describes the task: ### Input: User changed link kind, so prepare available fields. ### Response: def on_linkType_changed(self, evt): """User changed link kind, so prepare available fields.""" if self.current_idx < 0: evt.Skip() return ...
def _parsed_callback_wrapper(self, callback_parsed, callback_plain, foc, data): """Used to by register_catchall_*data() and Thing class (follow, create_point) to present point data as an object.""" # used by PointDataObjectHandler as reference if foc == R_FEED: point_ref = da...
Used to by register_catchall_*data() and Thing class (follow, create_point) to present point data as an object.
Below is the the instruction that describes the task: ### Input: Used to by register_catchall_*data() and Thing class (follow, create_point) to present point data as an object. ### Response: def _parsed_callback_wrapper(self, callback_parsed, callback_plain, foc, data): """Used to by register_catch...
def run_scan_command( self, server_info: ServerConnectivityInfo, scan_command: PluginScanCommand ) -> PluginScanResult: """Run a single scan command against a server; will block until the scan command has been completed. Args: server_info: The server'...
Run a single scan command against a server; will block until the scan command has been completed. Args: server_info: The server's connectivity information. The test_connectivity_to_server() method must have been called first to ensure that the server is online and accessible. ...
Below is the the instruction that describes the task: ### Input: Run a single scan command against a server; will block until the scan command has been completed. Args: server_info: The server's connectivity information. The test_connectivity_to_server() method must have been ca...
def get_gmm_pdf(self, x): """Calculate the GMM likelihood for a single point. .. math:: y = \\sum_{i=1}^{N} w_i \\times \\text{normpdf}(x, x_i, \\sigma_i)/\\sum_{i=1}^{N} w_i :label: gmm-likelihood Arguments --------- x : float Po...
Calculate the GMM likelihood for a single point. .. math:: y = \\sum_{i=1}^{N} w_i \\times \\text{normpdf}(x, x_i, \\sigma_i)/\\sum_{i=1}^{N} w_i :label: gmm-likelihood Arguments --------- x : float Point at which likelihood needs to be c...
Below is the the instruction that describes the task: ### Input: Calculate the GMM likelihood for a single point. .. math:: y = \\sum_{i=1}^{N} w_i \\times \\text{normpdf}(x, x_i, \\sigma_i)/\\sum_{i=1}^{N} w_i :label: gmm-likelihood Arguments --------- ...
def module_remove(name): ''' Removes SELinux module name The name of the module to remove .. versionadded:: 2016.11.6 ''' ret = {'name': name, 'result': True, 'comment': '', 'changes': {}} modules = __salt__['selinux.list_semod']() if name not i...
Removes SELinux module name The name of the module to remove .. versionadded:: 2016.11.6
Below is the the instruction that describes the task: ### Input: Removes SELinux module name The name of the module to remove .. versionadded:: 2016.11.6 ### Response: def module_remove(name): ''' Removes SELinux module name The name of the module to remove .. versionadd...
def open(self, fp, mode='r'): """ Open the NMEAFile. """ self._file = open(fp, mode=mode) return self._file
Open the NMEAFile.
Below is the the instruction that describes the task: ### Input: Open the NMEAFile. ### Response: def open(self, fp, mode='r'): """ Open the NMEAFile. """ self._file = open(fp, mode=mode) return self._file
def _load_data( self, resource, detail_resource=None, resource_id=None, querystring=None, traverse_pagination=False, default=DEFAULT_VALUE_SAFEGUARD, ): """ Loads a response from a call to one of the Enterprise endpo...
Loads a response from a call to one of the Enterprise endpoints. :param resource: The endpoint resource name. :param detail_resource: The sub-resource to append to the path. :param resource_id: The resource ID for the specific detail to get from the endpoint. :param querystring: Optiona...
Below is the the instruction that describes the task: ### Input: Loads a response from a call to one of the Enterprise endpoints. :param resource: The endpoint resource name. :param detail_resource: The sub-resource to append to the path. :param resource_id: The resource ID for the specific...
def format_search(q, **kwargs): '''Formats the results of a search''' m = search(q, **kwargs) count = m['count'] if not count: raise DapiCommError('Could not find any DAP packages for your query.') return for mdap in m['results']: mdap = mdap['content_object'] return ...
Formats the results of a search
Below is the the instruction that describes the task: ### Input: Formats the results of a search ### Response: def format_search(q, **kwargs): '''Formats the results of a search''' m = search(q, **kwargs) count = m['count'] if not count: raise DapiCommError('Could not find any DAP packages ...
def get_asset_lookup_session(self, proxy, *args, **kwargs): """Gets the OsidSession associated with the asset lookup service. arg proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetLookupSession) - the new AssetLookupSession raise: OperationFailed - una...
Gets the OsidSession associated with the asset lookup service. arg proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetLookupSession) - the new AssetLookupSession raise: OperationFailed - unable to complete request raise: Unimplemented - supports_asset_...
Below is the the instruction that describes the task: ### Input: Gets the OsidSession associated with the asset lookup service. arg proxy (osid.proxy.Proxy): a proxy return: (osid.repository.AssetLookupSession) - the new AssetLookupSession raise: OperationFailed - unabl...
def list_events_view(request): ''' A list view of upcoming events. ''' page_name = "Upcoming Events" profile = UserProfile.objects.get(user=request.user) event_form = EventForm( request.POST if 'post_event' in request.POST else None, profile=profile, ) if event_form.is_valid(): ...
A list view of upcoming events.
Below is the the instruction that describes the task: ### Input: A list view of upcoming events. ### Response: def list_events_view(request): ''' A list view of upcoming events. ''' page_name = "Upcoming Events" profile = UserProfile.objects.get(user=request.user) event_form = EventForm( re...
def get_cache_key(bucket, name, args, kwargs): """ Gets a unique SHA1 cache key for any call to a native tag. Use args and kwargs in hash so that the same arguments use the same key """ u = ''.join(map(str, (bucket, name, args, kwargs))) return 'native_tags.%s' % sha_constructor(u).hexdigest()
Gets a unique SHA1 cache key for any call to a native tag. Use args and kwargs in hash so that the same arguments use the same key
Below is the the instruction that describes the task: ### Input: Gets a unique SHA1 cache key for any call to a native tag. Use args and kwargs in hash so that the same arguments use the same key ### Response: def get_cache_key(bucket, name, args, kwargs): """ Gets a unique SHA1 cache key for any call ...
def mul(value, arg): """Multiply the arg with the value.""" try: return valid_numeric(value) * valid_numeric(arg) except (ValueError, TypeError): try: return value * arg except Exception: return ''
Multiply the arg with the value.
Below is the the instruction that describes the task: ### Input: Multiply the arg with the value. ### Response: def mul(value, arg): """Multiply the arg with the value.""" try: return valid_numeric(value) * valid_numeric(arg) except (ValueError, TypeError): try: return value...
def list_build_configurations_for_product(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all BuildConfigurations associated with the given Product. """ data = list_build_configurations_for_product_raw(id, name, page_size, page_index, sort, q) if data: return utils....
List all BuildConfigurations associated with the given Product.
Below is the the instruction that describes the task: ### Input: List all BuildConfigurations associated with the given Product. ### Response: def list_build_configurations_for_product(id=None, name=None, page_size=200, page_index=0, sort="", q=""): """ List all BuildConfigurations associated with the give...
def smudge(newtype, target): """ Smudge magic bytes with a known type """ db = smudge_db.get() magic_bytes = db[newtype]['magic'] magic_offset = db[newtype]['offset'] _backup_bytes(target, magic_offset, len(magic_bytes)) _smudge_bytes(target, magic_offset, magic_bytes)
Smudge magic bytes with a known type
Below is the the instruction that describes the task: ### Input: Smudge magic bytes with a known type ### Response: def smudge(newtype, target): """ Smudge magic bytes with a known type """ db = smudge_db.get() magic_bytes = db[newtype]['magic'] magic_offset = db[newtype]['offset'] ...
def tipbod(ref, body, et): """ Return a 3x3 matrix that transforms positions in inertial coordinates to positions in body-equator-and-prime-meridian coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tipbod_c.html :param ref: ID of inertial reference frame to transform from. ...
Return a 3x3 matrix that transforms positions in inertial coordinates to positions in body-equator-and-prime-meridian coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tipbod_c.html :param ref: ID of inertial reference frame to transform from. :type ref: str :param body: ID ...
Below is the the instruction that describes the task: ### Input: Return a 3x3 matrix that transforms positions in inertial coordinates to positions in body-equator-and-prime-meridian coordinates. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/tipbod_c.html :param ref: ID of inertial refer...
def extraction(event_collection, timeframe=None, timezone=None, filters=None, latest=None, email=None, property_names=None): """ Performs a data extraction Returns either a JSON object of events or a response indicating an email will be sent to you with data. :param event_collection: s...
Performs a data extraction Returns either a JSON object of events or a response indicating an email will be sent to you with data. :param event_collection: string, the name of the collection to query :param timeframe: string or dict, the timeframe in which the events happened example: "previous_7...
Below is the the instruction that describes the task: ### Input: Performs a data extraction Returns either a JSON object of events or a response indicating an email will be sent to you with data. :param event_collection: string, the name of the collection to query :param timeframe: string or dict...
def invert(self, copy=False): """ Inverts the striplog, changing its order and the order of its contents. Operates in place by default. Args: copy (bool): Whether to operate in place or make a copy. Returns: None if operating in-place, or an inverted co...
Inverts the striplog, changing its order and the order of its contents. Operates in place by default. Args: copy (bool): Whether to operate in place or make a copy. Returns: None if operating in-place, or an inverted copy of the striplog if not.
Below is the the instruction that describes the task: ### Input: Inverts the striplog, changing its order and the order of its contents. Operates in place by default. Args: copy (bool): Whether to operate in place or make a copy. Returns: None if operating in-place...
def _check_point(self, lat, lng): """ Checks if latitude and longitude correct """ if abs(lat) > 90 or abs(lng) > 180: msg = "Illegal lat and/or lng, (%s, %s) provided." % (lat, lng) raise IllegalPointException(msg)
Checks if latitude and longitude correct
Below is the the instruction that describes the task: ### Input: Checks if latitude and longitude correct ### Response: def _check_point(self, lat, lng): """ Checks if latitude and longitude correct """ if abs(lat) > 90 or abs(lng) > 180: msg = "Illegal lat and/or lng, (%s, %s) provided...
def send(self, message): """ Send a message object :type message: data.OutgoingMessage :param message: The message to send :rtype: data.OutgoingMessage :returns: The sent message with populated fields :raises AssertionError: wrong provider name encoun...
Send a message object :type message: data.OutgoingMessage :param message: The message to send :rtype: data.OutgoingMessage :returns: The sent message with populated fields :raises AssertionError: wrong provider name encountered (returned by the router, or pro...
Below is the the instruction that describes the task: ### Input: Send a message object :type message: data.OutgoingMessage :param message: The message to send :rtype: data.OutgoingMessage :returns: The sent message with populated fields :raises AssertionE...
def _update_mean_in_window(self): """ Compute mean in window the slow way. useful for first step. Considers all values in window See Also -------- _add_observation_to_means : fast update of mean for single observation addition _remove_observation_from_means : fa...
Compute mean in window the slow way. useful for first step. Considers all values in window See Also -------- _add_observation_to_means : fast update of mean for single observation addition _remove_observation_from_means : fast update of mean for single observation removal
Below is the the instruction that describes the task: ### Input: Compute mean in window the slow way. useful for first step. Considers all values in window See Also -------- _add_observation_to_means : fast update of mean for single observation addition _remove_observation_...
def add_listener(self, listener_type, callback): """ add a listener to the widget Args: listener_type: string that can either be 'objectHovered' or 'objClicked' callback: python function""" self.listener_type= listener_type if listener_type == 'object...
add a listener to the widget Args: listener_type: string that can either be 'objectHovered' or 'objClicked' callback: python function
Below is the the instruction that describes the task: ### Input: add a listener to the widget Args: listener_type: string that can either be 'objectHovered' or 'objClicked' callback: python function ### Response: def add_listener(self, listener_type, callback): ...
def get_mopheader(expnum, ccd, version='p', prefix=None): """ Retrieve the mopheader, either from cache or from vospace @param expnum: @param ccd: @param version: @param prefix: @return: Header """ prefix = prefix is None and "" or prefix mopheader_uri = dbimages_uri(expnum=expn...
Retrieve the mopheader, either from cache or from vospace @param expnum: @param ccd: @param version: @param prefix: @return: Header
Below is the the instruction that describes the task: ### Input: Retrieve the mopheader, either from cache or from vospace @param expnum: @param ccd: @param version: @param prefix: @return: Header ### Response: def get_mopheader(expnum, ccd, version='p', prefix=None): """ Retrieve the ...
def register_lazy_provider_method(self, cls, method): """ Register a class method lazily as a provider. """ if 'provides' not in getattr(method, '__di__', {}): raise DiayException('method %r is not a provider' % method) @functools.wraps(method) def wrapper(*a...
Register a class method lazily as a provider.
Below is the the instruction that describes the task: ### Input: Register a class method lazily as a provider. ### Response: def register_lazy_provider_method(self, cls, method): """ Register a class method lazily as a provider. """ if 'provides' not in getattr(method, '__di__', {})...
def roll_alpha_beta(returns, factor_returns, window=10, **kwargs): """ Computes alpha and beta over a rolling window. Parameters ---------- lhs : array-like The first array to pass to the rolling alpha-beta. rhs : array-like The second array to pass to the rolling alpha-beta. ...
Computes alpha and beta over a rolling window. Parameters ---------- lhs : array-like The first array to pass to the rolling alpha-beta. rhs : array-like The second array to pass to the rolling alpha-beta. window : int Size of the rolling window in terms of the periodicity o...
Below is the the instruction that describes the task: ### Input: Computes alpha and beta over a rolling window. Parameters ---------- lhs : array-like The first array to pass to the rolling alpha-beta. rhs : array-like The second array to pass to the rolling alpha-beta. window :...
def getApplicationKeyByProcessId(self, unProcessId, pchAppKeyBuffer, unAppKeyBufferLen): """ Returns the key of the application for the specified Process Id. The buffer should be at least k_unMaxApplicationKeyLength in order to fit the key. """ fn = self.function_table.getAppli...
Returns the key of the application for the specified Process Id. The buffer should be at least k_unMaxApplicationKeyLength in order to fit the key.
Below is the the instruction that describes the task: ### Input: Returns the key of the application for the specified Process Id. The buffer should be at least k_unMaxApplicationKeyLength in order to fit the key. ### Response: def getApplicationKeyByProcessId(self, unProcessId, pchAppKeyBuffer, unAppKeyBu...
def _Descriptor_from_json(self, obj): """Create Descriptor instance from json dict. Parameters: obj(dict): descriptor dict Returns: Descriptor: descriptor """ descs = getattr(self, "_all_descriptors", None) if descs is None: from mordred import descriptors des...
Create Descriptor instance from json dict. Parameters: obj(dict): descriptor dict Returns: Descriptor: descriptor
Below is the the instruction that describes the task: ### Input: Create Descriptor instance from json dict. Parameters: obj(dict): descriptor dict Returns: Descriptor: descriptor ### Response: def _Descriptor_from_json(self, obj): """Create Descriptor instance from json dict. Par...
def altersingle(self, alpha, i, b, g, r): """Move neuron i towards biased (b,g,r) by factor alpha""" n = self.network[i] # Alter hit neuron n[0] -= (alpha * (n[0] - b)) n[1] -= (alpha * (n[1] - g)) n[2] -= (alpha * (n[2] - r))
Move neuron i towards biased (b,g,r) by factor alpha
Below is the the instruction that describes the task: ### Input: Move neuron i towards biased (b,g,r) by factor alpha ### Response: def altersingle(self, alpha, i, b, g, r): """Move neuron i towards biased (b,g,r) by factor alpha""" n = self.network[i] # Alter hit neuron n[0] -= (alpha * (...
def _launch_editor(starting_text=''): "Launch editor, let user write text, then return that text." # TODO: What is a reasonable default for windows? Does this approach even # make sense on windows? editor = os.environ.get('EDITOR', 'vim') with tempfile.TemporaryDirectory() as dirname: filen...
Launch editor, let user write text, then return that text.
Below is the the instruction that describes the task: ### Input: Launch editor, let user write text, then return that text. ### Response: def _launch_editor(starting_text=''): "Launch editor, let user write text, then return that text." # TODO: What is a reasonable default for windows? Does this approach e...
def get_provider(self, provider_name='default'): """Fetch provider with the name specified in Configuration file""" try: if self._providers is None: self._providers = self._initialize_providers() return self._providers[provider_name] except KeyError: ...
Fetch provider with the name specified in Configuration file
Below is the the instruction that describes the task: ### Input: Fetch provider with the name specified in Configuration file ### Response: def get_provider(self, provider_name='default'): """Fetch provider with the name specified in Configuration file""" try: if self._providers is None...
def _GetWinevtRcDatabaseReader(self): """Opens the Windows Event Log resource database reader. Returns: WinevtResourcesSqlite3DatabaseReader: Windows Event Log resource database reader or None. """ if not self._winevt_database_reader and self._data_location: database_path = os.pat...
Opens the Windows Event Log resource database reader. Returns: WinevtResourcesSqlite3DatabaseReader: Windows Event Log resource database reader or None.
Below is the the instruction that describes the task: ### Input: Opens the Windows Event Log resource database reader. Returns: WinevtResourcesSqlite3DatabaseReader: Windows Event Log resource database reader or None. ### Response: def _GetWinevtRcDatabaseReader(self): """Opens the Windows...
def MDL(N, rho, k): r"""Minimum Description Length .. math:: MDL(k) = N log \rho_k + p \log N :validation: results """ from numpy import log #p = arange(1, len(rho)+1) mdl = N* log(rho) + k * log(N) return mdl
r"""Minimum Description Length .. math:: MDL(k) = N log \rho_k + p \log N :validation: results
Below is the the instruction that describes the task: ### Input: r"""Minimum Description Length .. math:: MDL(k) = N log \rho_k + p \log N :validation: results ### Response: def MDL(N, rho, k): r"""Minimum Description Length .. math:: MDL(k) = N log \rho_k + p \log N :validation: results ...
def data_format_value(self): """ :return: The data type of the data component as integer value. """ try: if self._part: value = self._part.data_format else: value = self._buffer.pixel_format except InvalidParameterException:...
:return: The data type of the data component as integer value.
Below is the the instruction that describes the task: ### Input: :return: The data type of the data component as integer value. ### Response: def data_format_value(self): """ :return: The data type of the data component as integer value. """ try: if self._part: ...
def summary(raster, geometry=None, all_touched=False, mean_only=False, bounds=None, exclude_nodata_value=True): """Return ``ST_SummaryStats`` style stats for the given raster. If ``geometry`` is provided, we mask the raster with the given geometry and return the stats for the intersection. The ...
Return ``ST_SummaryStats`` style stats for the given raster. If ``geometry`` is provided, we mask the raster with the given geometry and return the stats for the intersection. The parameter can be a GeoJSON-like object, a WKT string, or a Shapely geometry. If ``all_touched`` is set, we include every p...
Below is the the instruction that describes the task: ### Input: Return ``ST_SummaryStats`` style stats for the given raster. If ``geometry`` is provided, we mask the raster with the given geometry and return the stats for the intersection. The parameter can be a GeoJSON-like object, a WKT string, or a...
def on_equalarea_specimen_select(self, event): """ Get mouse position on double click find the nearest interpretation to the mouse position then select that interpretation Parameters ---------- event : the wx Mouseevent for that click Alters ----...
Get mouse position on double click find the nearest interpretation to the mouse position then select that interpretation Parameters ---------- event : the wx Mouseevent for that click Alters ------ current_fit
Below is the the instruction that describes the task: ### Input: Get mouse position on double click find the nearest interpretation to the mouse position then select that interpretation Parameters ---------- event : the wx Mouseevent for that click Alters --...
def ordc(item, inset): """ The function returns the ordinal position of any given item in a character set. If the item does not appear in the set, the function returns -1. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ordc_c.html :param item: An item to locate within a set. :typ...
The function returns the ordinal position of any given item in a character set. If the item does not appear in the set, the function returns -1. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ordc_c.html :param item: An item to locate within a set. :type item: str :param inset: A set...
Below is the the instruction that describes the task: ### Input: The function returns the ordinal position of any given item in a character set. If the item does not appear in the set, the function returns -1. http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/ordc_c.html :param item: An ite...
def separate_comma_imports(partitions): """Turns `import a, b` into `import a` and `import b`""" def _inner(): for partition in partitions: if partition.code_type is CodeType.IMPORT: import_obj = import_obj_from_str(partition.src) if import_obj.has_multiple_im...
Turns `import a, b` into `import a` and `import b`
Below is the the instruction that describes the task: ### Input: Turns `import a, b` into `import a` and `import b` ### Response: def separate_comma_imports(partitions): """Turns `import a, b` into `import a` and `import b`""" def _inner(): for partition in partitions: if partition.code...
def crossing(b, component, time, dynamics_method='keplerian', ltte=True, tol=1e-4, maxiter=1000): """ tol in days """ def projected_separation_sq(time, b, dynamics_method, cind1, cind2, ltte=True): """ """ #print "*** projected_separation_sq", time, dynamics_method, cind1, cind...
tol in days
Below is the the instruction that describes the task: ### Input: tol in days ### Response: def crossing(b, component, time, dynamics_method='keplerian', ltte=True, tol=1e-4, maxiter=1000): """ tol in days """ def projected_separation_sq(time, b, dynamics_method, cind1, cind2, ltte=True): ...
def _size_from_header(cls, header): """ Get the size of each columns from the header. :param header: The header template we have to get the size from. :type header: dict :return: The maximal size of the each data to print. :rtype: list """ #...
Get the size of each columns from the header. :param header: The header template we have to get the size from. :type header: dict :return: The maximal size of the each data to print. :rtype: list
Below is the the instruction that describes the task: ### Input: Get the size of each columns from the header. :param header: The header template we have to get the size from. :type header: dict :return: The maximal size of the each data to print. :rtype: list ### Respo...
def generic_path_not_found(*args): """ Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representi...
Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response object representing the GenericPathNotFound Error
Below is the the instruction that describes the task: ### Input: Creates a Lambda Service Generic PathNotFound Response Parameters ---------- args list List of arguments Flask passes to the method Returns ------- Flask.Response A response obj...
def wait_for_build(self, interval=5, path=None): """ A convenience method designed to inform you when a project build has completed. It polls the API every `interval` seconds until there is not a build running. At that point, it returns the "last_build_info" field of the projec...
A convenience method designed to inform you when a project build has completed. It polls the API every `interval` seconds until there is not a build running. At that point, it returns the "last_build_info" field of the project record if the build succeeded, and raises a LuminosoError w...
Below is the the instruction that describes the task: ### Input: A convenience method designed to inform you when a project build has completed. It polls the API every `interval` seconds until there is not a build running. At that point, it returns the "last_build_info" field of the projec...
def delete(args): """Deletes the jobs from the job manager. If the jobs are still running in the grid, they are stopped.""" jm = setup(args) # first, stop the jobs if they are running in the grid if not args.local and 'executing' in args.status: stop(args) # then, delete them from the database jm.delete...
Deletes the jobs from the job manager. If the jobs are still running in the grid, they are stopped.
Below is the the instruction that describes the task: ### Input: Deletes the jobs from the job manager. If the jobs are still running in the grid, they are stopped. ### Response: def delete(args): """Deletes the jobs from the job manager. If the jobs are still running in the grid, they are stopped.""" jm = set...
def update_state_machine_tab_label(self, state_machine_m): """ Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return: """ sm_id = state_machine_m.state_...
Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return:
Below is the the instruction that describes the task: ### Input: Updates tab label if needed because system path, root state name or marked_dirty flag changed :param StateMachineModel state_machine_m: State machine model that has changed :return: ### Response: def update_state_machine_tab_label(se...
def get_paths_for_attribute_set(self, keys): """ Given a list/set of keys (or one key), returns the parts that have all of the keys in the list. Because on_targets=True, this DOES NOT WORK WITH TOP LEVEL PROPERTIES, only those of targets. These paths are not pointers to...
Given a list/set of keys (or one key), returns the parts that have all of the keys in the list. Because on_targets=True, this DOES NOT WORK WITH TOP LEVEL PROPERTIES, only those of targets. These paths are not pointers to the objects themselves, but tuples of attribute names th...
Below is the the instruction that describes the task: ### Input: Given a list/set of keys (or one key), returns the parts that have all of the keys in the list. Because on_targets=True, this DOES NOT WORK WITH TOP LEVEL PROPERTIES, only those of targets. These paths are not pointer...
def in_transaction(self): """ :return: True if there is an open transaction. """ self._in_transaction = self._in_transaction and self.is_connected return self._in_transaction
:return: True if there is an open transaction.
Below is the the instruction that describes the task: ### Input: :return: True if there is an open transaction. ### Response: def in_transaction(self): """ :return: True if there is an open transaction. """ self._in_transaction = self._in_transaction and self.is_connected re...
def indexes_all(ol,value): ''' from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a') ''' length = ol.__len__() indexes =[] for i in range(0,length): if(value == ol[i]): indexes.append(i) else: pass return(indexes)
from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a')
Below is the the instruction that describes the task: ### Input: from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a') ### Response: def indexes_all(ol,value): ''' from elist.elist import * ol = [1,'a',3,'a',4,'a',5] indexes_all(ol,'a') ''' len...
def app(environ, start_response): """Function called by the WSGI server.""" r = HttpRequestHandler(environ, start_response, Router).dispatch() return r
Function called by the WSGI server.
Below is the the instruction that describes the task: ### Input: Function called by the WSGI server. ### Response: def app(environ, start_response): """Function called by the WSGI server.""" r = HttpRequestHandler(environ, start_response, Router).dispatch() return r
def get_db_prep_lookup(self, lookup_type, value, connection=None, prepared=None): """ Returns field's value prepared for database lookup. """ ## convert to settings.TIME_ZONE if value.tzinfo is None: value = default_tz.localize(value) else: value =...
Returns field's value prepared for database lookup.
Below is the the instruction that describes the task: ### Input: Returns field's value prepared for database lookup. ### Response: def get_db_prep_lookup(self, lookup_type, value, connection=None, prepared=None): """ Returns field's value prepared for database lookup. """ ## convert...
def guggenheim_katayama(target, K2, n, temperature='pore.temperature', critical_temperature='pore.critical_temperature', critical_pressure='pore.critical_pressure'): r""" Missing description Parameters ---------- target : OpenPNM Object The ob...
r""" Missing description Parameters ---------- target : OpenPNM Object The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to other necessary thermofluid properties. K2 : scalar Fluid sp...
Below is the the instruction that describes the task: ### Input: r""" Missing description Parameters ---------- target : OpenPNM Object The object for which these values are being calculated. This controls the length of the calculated array, and also provides access to othe...
def watch_docs(c): """ Watch both doc trees & rebuild them if files change. This includes e.g. rebuilding the API docs if the source code changes; rebuilding the WWW docs if the README changes; etc. Reuses the configuration values ``packaging.package`` or ``tests.package`` (the former winning ...
Watch both doc trees & rebuild them if files change. This includes e.g. rebuilding the API docs if the source code changes; rebuilding the WWW docs if the README changes; etc. Reuses the configuration values ``packaging.package`` or ``tests.package`` (the former winning over the latter if both defined...
Below is the the instruction that describes the task: ### Input: Watch both doc trees & rebuild them if files change. This includes e.g. rebuilding the API docs if the source code changes; rebuilding the WWW docs if the README changes; etc. Reuses the configuration values ``packaging.package`` or ``te...
def get_language_settings(language_code, site_id=None): """ Return the language settings for the current site """ if site_id is None: site_id = getattr(settings, 'SITE_ID', None) for lang_dict in FLUENT_BLOGS_LANGUAGES.get(site_id, ()): if lang_dict['code'] == language_code: ...
Return the language settings for the current site
Below is the the instruction that describes the task: ### Input: Return the language settings for the current site ### Response: def get_language_settings(language_code, site_id=None): """ Return the language settings for the current site """ if site_id is None: site_id = getattr(settings, ...
def _GetFlagValues(self, flags): """Determines which events are indicated by a set of fsevents flags. Args: flags (int): fsevents record flags. Returns: str: a comma separated string containing descriptions of the flag values stored in an fsevents record. """ event_types = []...
Determines which events are indicated by a set of fsevents flags. Args: flags (int): fsevents record flags. Returns: str: a comma separated string containing descriptions of the flag values stored in an fsevents record.
Below is the the instruction that describes the task: ### Input: Determines which events are indicated by a set of fsevents flags. Args: flags (int): fsevents record flags. Returns: str: a comma separated string containing descriptions of the flag values stored in an fsevents record....
def insertLayer(self, layer, name=None): """ Insert **layer** into the font. :: >>> layer = font.insertLayer(otherLayer, name="layer 2") This will not insert the layer directly. Rather, a new layer will be created and the data from **layer** will be copied to to the...
Insert **layer** into the font. :: >>> layer = font.insertLayer(otherLayer, name="layer 2") This will not insert the layer directly. Rather, a new layer will be created and the data from **layer** will be copied to to the new layer. **name** indicates the name that should b...
Below is the the instruction that describes the task: ### Input: Insert **layer** into the font. :: >>> layer = font.insertLayer(otherLayer, name="layer 2") This will not insert the layer directly. Rather, a new layer will be created and the data from **layer** will be copied t...
def editcomponent(self, data): """ A method to edit a component in Bugzilla. Takes a dict, with mandatory elements of product. component, and initialowner. All other elements are optional and use the same names as the addcomponent() method. """ data = data.copy() ...
A method to edit a component in Bugzilla. Takes a dict, with mandatory elements of product. component, and initialowner. All other elements are optional and use the same names as the addcomponent() method.
Below is the the instruction that describes the task: ### Input: A method to edit a component in Bugzilla. Takes a dict, with mandatory elements of product. component, and initialowner. All other elements are optional and use the same names as the addcomponent() method. ### Response: def ed...
def add_group(self, name, devices): """Add a new device group. :return: a :class:`DeviceGroup` instance. """ device = self.add_device(name, "group") device.add_to_group(devices) return device
Add a new device group. :return: a :class:`DeviceGroup` instance.
Below is the the instruction that describes the task: ### Input: Add a new device group. :return: a :class:`DeviceGroup` instance. ### Response: def add_group(self, name, devices): """Add a new device group. :return: a :class:`DeviceGroup` instance. """ device = self.add_d...
def packvalue(value, *properties): ''' Store a specified value to specified property path. Often used in nstruct "init" parameter. :param value: a fixed value :param properties: specified field name, same as sizefromlen. :returns: a function which takes a NamedStruct as parameter, and...
Store a specified value to specified property path. Often used in nstruct "init" parameter. :param value: a fixed value :param properties: specified field name, same as sizefromlen. :returns: a function which takes a NamedStruct as parameter, and store the value to property path.
Below is the the instruction that describes the task: ### Input: Store a specified value to specified property path. Often used in nstruct "init" parameter. :param value: a fixed value :param properties: specified field name, same as sizefromlen. :returns: a function which takes a NamedSt...