code
stringlengths
75
104k
code_sememe
stringlengths
47
309k
token_type
stringlengths
215
214k
code_dependency
stringlengths
75
155k
def _strip_stray_atoms(self): """Remove stray atoms and surface pieces. """ components = self.bond_graph.connected_components() major_component = max(components, key=len) for atom in list(self.particles()): if atom not in major_component: self.remove(atom)
def function[_strip_stray_atoms, parameter[self]]: constant[Remove stray atoms and surface pieces. ] variable[components] assign[=] call[name[self].bond_graph.connected_components, parameter[]] variable[major_component] assign[=] call[name[max], parameter[name[components]]] for taget[nam...
keyword[def] identifier[_strip_stray_atoms] ( identifier[self] ): literal[string] identifier[components] = identifier[self] . identifier[bond_graph] . identifier[connected_components] () identifier[major_component] = identifier[max] ( identifier[components] , identifier[key] = identifier[l...
def _strip_stray_atoms(self): """Remove stray atoms and surface pieces. """ components = self.bond_graph.connected_components() major_component = max(components, key=len) for atom in list(self.particles()): if atom not in major_component: self.remove(atom) # depends on [control=['if...
def _expander(namepath): """ expand ./ ~ and ../ designators in location names """ if "~" in namepath: namepath = os.path.expanduser(namepath) else: namepath = os.path.abspath(namepath) return namepath
def function[_expander, parameter[namepath]]: constant[ expand ./ ~ and ../ designators in location names ] if compare[constant[~] in name[namepath]] begin[:] variable[namepath] assign[=] call[name[os].path.expanduser, parameter[name[namepath]]] return[name[namepath]]
keyword[def] identifier[_expander] ( identifier[namepath] ): literal[string] keyword[if] literal[string] keyword[in] identifier[namepath] : identifier[namepath] = identifier[os] . identifier[path] . identifier[expanduser] ( identifier[namepath] ) keyword[else] : identifier[namepat...
def _expander(namepath): """ expand ./ ~ and ../ designators in location names """ if '~' in namepath: namepath = os.path.expanduser(namepath) # depends on [control=['if'], data=['namepath']] else: namepath = os.path.abspath(namepath) return namepath
def _insert_paragraph_before(self): """ Return a newly created paragraph, inserted directly before this paragraph. """ p = self._p.add_p_before() return Paragraph(p, self._parent)
def function[_insert_paragraph_before, parameter[self]]: constant[ Return a newly created paragraph, inserted directly before this paragraph. ] variable[p] assign[=] call[name[self]._p.add_p_before, parameter[]] return[call[name[Paragraph], parameter[name[p], name[self]._pare...
keyword[def] identifier[_insert_paragraph_before] ( identifier[self] ): literal[string] identifier[p] = identifier[self] . identifier[_p] . identifier[add_p_before] () keyword[return] identifier[Paragraph] ( identifier[p] , identifier[self] . identifier[_parent] )
def _insert_paragraph_before(self): """ Return a newly created paragraph, inserted directly before this paragraph. """ p = self._p.add_p_before() return Paragraph(p, self._parent)
def start_polling(dispatcher, *, loop=None, skip_updates=False, reset_webhook=True, on_startup=None, on_shutdown=None, timeout=20, fast=True): """ Start bot in long-polling mode :param dispatcher: :param loop: :param skip_updates: :param reset_webhook: :param on_startup: ...
def function[start_polling, parameter[dispatcher]]: constant[ Start bot in long-polling mode :param dispatcher: :param loop: :param skip_updates: :param reset_webhook: :param on_startup: :param on_shutdown: :param timeout: ] variable[executor] assign[=] call[name[Exe...
keyword[def] identifier[start_polling] ( identifier[dispatcher] ,*, identifier[loop] = keyword[None] , identifier[skip_updates] = keyword[False] , identifier[reset_webhook] = keyword[True] , identifier[on_startup] = keyword[None] , identifier[on_shutdown] = keyword[None] , identifier[timeout] = literal[int] , identi...
def start_polling(dispatcher, *, loop=None, skip_updates=False, reset_webhook=True, on_startup=None, on_shutdown=None, timeout=20, fast=True): """ Start bot in long-polling mode :param dispatcher: :param loop: :param skip_updates: :param reset_webhook: :param on_startup: :param on_shutd...
def FrameworkDir32(self): """ Microsoft .NET Framework 32bit directory. """ # Default path guess_fw = os.path.join(self.WinDir, r'Microsoft.NET\Framework') # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vc, 'frameworkdir32...
def function[FrameworkDir32, parameter[self]]: constant[ Microsoft .NET Framework 32bit directory. ] variable[guess_fw] assign[=] call[name[os].path.join, parameter[name[self].WinDir, constant[Microsoft.NET\Framework]]] return[<ast.BoolOp object at 0x7da1b1b86620>]
keyword[def] identifier[FrameworkDir32] ( identifier[self] ): literal[string] identifier[guess_fw] = identifier[os] . identifier[path] . identifier[join] ( identifier[self] . identifier[WinDir] , literal[string] ) keyword[return] identifier[self] . identifier[ri] . iden...
def FrameworkDir32(self): """ Microsoft .NET Framework 32bit directory. """ # Default path guess_fw = os.path.join(self.WinDir, 'Microsoft.NET\\Framework') # Try to get path from registry, if fail use default path return self.ri.lookup(self.ri.vc, 'frameworkdir32') or guess_fw
def find_formatter(name, path): """ Returns the formatter class whose name attribute is *name* when *name* is not *AUTO_FORMATTER*. Otherwise, the first formatter that accepts *path* is returned. Internally, this method simply uses :py:func:`get_formatter` or :py:func:`find_formatters` depending on the ...
def function[find_formatter, parameter[name, path]]: constant[ Returns the formatter class whose name attribute is *name* when *name* is not *AUTO_FORMATTER*. Otherwise, the first formatter that accepts *path* is returned. Internally, this method simply uses :py:func:`get_formatter` or :py:func:`fin...
keyword[def] identifier[find_formatter] ( identifier[name] , identifier[path] ): literal[string] keyword[if] identifier[name] == identifier[AUTO_FORMATTER] : keyword[return] identifier[find_formatters] ( identifier[path] , identifier[silent] = keyword[False] )[ literal[int] ] keyword[else] ...
def find_formatter(name, path): """ Returns the formatter class whose name attribute is *name* when *name* is not *AUTO_FORMATTER*. Otherwise, the first formatter that accepts *path* is returned. Internally, this method simply uses :py:func:`get_formatter` or :py:func:`find_formatters` depending on the ...
def from_file(filename, check_for_POTCAR=True, read_velocities=True): """ Reads a Poscar from a file. The code will try its best to determine the elements in the POSCAR in the following order: 1. If check_for_POTCAR is True, the code will try to check if a POTCAR is in t...
def function[from_file, parameter[filename, check_for_POTCAR, read_velocities]]: constant[ Reads a Poscar from a file. The code will try its best to determine the elements in the POSCAR in the following order: 1. If check_for_POTCAR is True, the code will try to check if a POTCA...
keyword[def] identifier[from_file] ( identifier[filename] , identifier[check_for_POTCAR] = keyword[True] , identifier[read_velocities] = keyword[True] ): literal[string] identifier[dirname] = identifier[os] . identifier[path] . identifier[dirname] ( identifier[os] . identifier[path] . identifier[ab...
def from_file(filename, check_for_POTCAR=True, read_velocities=True): """ Reads a Poscar from a file. The code will try its best to determine the elements in the POSCAR in the following order: 1. If check_for_POTCAR is True, the code will try to check if a POTCAR is in the s...
def annotation(args): """ %prog annotation blastfile > annotations Create simple two column files from the first two coluns in blastfile. Use --queryids and --subjectids to switch IDs or descriptions. """ from jcvi.formats.base import DictFile p = OptionParser(annotation.__doc__) p.add...
def function[annotation, parameter[args]]: constant[ %prog annotation blastfile > annotations Create simple two column files from the first two coluns in blastfile. Use --queryids and --subjectids to switch IDs or descriptions. ] from relative_module[jcvi.formats.base] import module[DictFil...
keyword[def] identifier[annotation] ( identifier[args] ): literal[string] keyword[from] identifier[jcvi] . identifier[formats] . identifier[base] keyword[import] identifier[DictFile] identifier[p] = identifier[OptionParser] ( identifier[annotation] . identifier[__doc__] ) identifier[p] . ide...
def annotation(args): """ %prog annotation blastfile > annotations Create simple two column files from the first two coluns in blastfile. Use --queryids and --subjectids to switch IDs or descriptions. """ from jcvi.formats.base import DictFile p = OptionParser(annotation.__doc__) p.add_...
def new(cls, *args, **kwargs): """Create a new instance of this model based on its spec and either a map or the provided kwargs.""" new = cls(make_default(getattr(cls, 'spec', {}))) new.update(args[0] if args and not kwargs else kwargs) return new
def function[new, parameter[cls]]: constant[Create a new instance of this model based on its spec and either a map or the provided kwargs.] variable[new] assign[=] call[name[cls], parameter[call[name[make_default], parameter[call[name[getattr], parameter[name[cls], constant[spec], dictionary[[],...
keyword[def] identifier[new] ( identifier[cls] ,* identifier[args] ,** identifier[kwargs] ): literal[string] identifier[new] = identifier[cls] ( identifier[make_default] ( identifier[getattr] ( identifier[cls] , literal[string] ,{}))) identifier[new] . identifier[update] ( identifier[args]...
def new(cls, *args, **kwargs): """Create a new instance of this model based on its spec and either a map or the provided kwargs.""" new = cls(make_default(getattr(cls, 'spec', {}))) new.update(args[0] if args and (not kwargs) else kwargs) return new
def find_count_label(d): """Find the member of a set that means "count" or "frequency" or "probability" or "number of occurrences". """ for name in COUNT_NAMES: if name in d: return name for name in COUNT_NAMES: if str(name).lower() in d: return name
def function[find_count_label, parameter[d]]: constant[Find the member of a set that means "count" or "frequency" or "probability" or "number of occurrences". ] for taget[name[name]] in starred[name[COUNT_NAMES]] begin[:] if compare[name[name] in name[d]] begin[:] return...
keyword[def] identifier[find_count_label] ( identifier[d] ): literal[string] keyword[for] identifier[name] keyword[in] identifier[COUNT_NAMES] : keyword[if] identifier[name] keyword[in] identifier[d] : keyword[return] identifier[name] keyword[for] identifier[name] keywo...
def find_count_label(d): """Find the member of a set that means "count" or "frequency" or "probability" or "number of occurrences". """ for name in COUNT_NAMES: if name in d: return name # depends on [control=['if'], data=['name']] # depends on [control=['for'], data=['name']] for...
def _build_preconditions_table(self): '''Builds the local action precondition expressions.''' self.local_action_preconditions = dict() self.global_action_preconditions = [] action_fluents = self.action_fluents for precond in self.preconds: scope = precond.scope ...
def function[_build_preconditions_table, parameter[self]]: constant[Builds the local action precondition expressions.] name[self].local_action_preconditions assign[=] call[name[dict], parameter[]] name[self].global_action_preconditions assign[=] list[[]] variable[action_fluents] assign[=...
keyword[def] identifier[_build_preconditions_table] ( identifier[self] ): literal[string] identifier[self] . identifier[local_action_preconditions] = identifier[dict] () identifier[self] . identifier[global_action_preconditions] =[] identifier[action_fluents] = identifier[self] . ...
def _build_preconditions_table(self): """Builds the local action precondition expressions.""" self.local_action_preconditions = dict() self.global_action_preconditions = [] action_fluents = self.action_fluents for precond in self.preconds: scope = precond.scope action_scope = [action...
def equals(self, other): """ Determine if two Index objects contain the same elements. """ if self.is_(other): return True if not isinstance(other, Index): return False if is_object_dtype(self) and not is_object_dtype(other): # if oth...
def function[equals, parameter[self, other]]: constant[ Determine if two Index objects contain the same elements. ] if call[name[self].is_, parameter[name[other]]] begin[:] return[constant[True]] if <ast.UnaryOp object at 0x7da18fe91de0> begin[:] return[constant[F...
keyword[def] identifier[equals] ( identifier[self] , identifier[other] ): literal[string] keyword[if] identifier[self] . identifier[is_] ( identifier[other] ): keyword[return] keyword[True] keyword[if] keyword[not] identifier[isinstance] ( identifier[other] , identifier[...
def equals(self, other): """ Determine if two Index objects contain the same elements. """ if self.is_(other): return True # depends on [control=['if'], data=[]] if not isinstance(other, Index): return False # depends on [control=['if'], data=[]] if is_object_dtype(self...
def read(self, uri): """ Retrieve the contents of the resource :param uri: the URI of the resource to be retrieved :type uri: str :return: the contents of the resource :rtype: str """ uri = self.__absolute__(uri) mime, _ = guess_type(uri) if "imag...
def function[read, parameter[self, uri]]: constant[ Retrieve the contents of the resource :param uri: the URI of the resource to be retrieved :type uri: str :return: the contents of the resource :rtype: str ] variable[uri] assign[=] call[name[self].__absolute__, ...
keyword[def] identifier[read] ( identifier[self] , identifier[uri] ): literal[string] identifier[uri] = identifier[self] . identifier[__absolute__] ( identifier[uri] ) identifier[mime] , identifier[_] = identifier[guess_type] ( identifier[uri] ) keyword[if] literal[string] keywo...
def read(self, uri): """ Retrieve the contents of the resource :param uri: the URI of the resource to be retrieved :type uri: str :return: the contents of the resource :rtype: str """ uri = self.__absolute__(uri) (mime, _) = guess_type(uri) if 'image' in mime: ...
def Harrison_Brunner_Hecker(dp, voidage, vs, rho, mu, L=1, Dt=None): r'''Calculates pressure drop across a packed bed of spheres using a correlation developed in [1]_, also shown in [2]_. Fourth most accurate correlation overall in the review of [2]_. Applies a wall correction if diameter of tube is pro...
def function[Harrison_Brunner_Hecker, parameter[dp, voidage, vs, rho, mu, L, Dt]]: constant[Calculates pressure drop across a packed bed of spheres using a correlation developed in [1]_, also shown in [2]_. Fourth most accurate correlation overall in the review of [2]_. Applies a wall correction if ...
keyword[def] identifier[Harrison_Brunner_Hecker] ( identifier[dp] , identifier[voidage] , identifier[vs] , identifier[rho] , identifier[mu] , identifier[L] = literal[int] , identifier[Dt] = keyword[None] ): literal[string] identifier[Re] = identifier[dp] * identifier[rho] * identifier[vs] / identifier[mu] ...
def Harrison_Brunner_Hecker(dp, voidage, vs, rho, mu, L=1, Dt=None): """Calculates pressure drop across a packed bed of spheres using a correlation developed in [1]_, also shown in [2]_. Fourth most accurate correlation overall in the review of [2]_. Applies a wall correction if diameter of tube is prov...
def command(results_dir, result_id): """ Print the command that needs to be used to reproduce a result. """ campaign = sem.CampaignManager.load(results_dir) result = campaign.db.get_results(result_id=result_id)[0] click.echo("Simulation command:") click.echo(sem.utils.get_command_from_resu...
def function[command, parameter[results_dir, result_id]]: constant[ Print the command that needs to be used to reproduce a result. ] variable[campaign] assign[=] call[name[sem].CampaignManager.load, parameter[name[results_dir]]] variable[result] assign[=] call[call[name[campaign].db.get_...
keyword[def] identifier[command] ( identifier[results_dir] , identifier[result_id] ): literal[string] identifier[campaign] = identifier[sem] . identifier[CampaignManager] . identifier[load] ( identifier[results_dir] ) identifier[result] = identifier[campaign] . identifier[db] . identifier[get_results...
def command(results_dir, result_id): """ Print the command that needs to be used to reproduce a result. """ campaign = sem.CampaignManager.load(results_dir) result = campaign.db.get_results(result_id=result_id)[0] click.echo('Simulation command:') click.echo(sem.utils.get_command_from_result...
def as_fs(self): """ Returns the value of component encoded as formatted string. Inspect each character in value of component. Certain nonalpha characters pass thru without escaping into the result, but most retain escaping. :returns: Formatted string associated with co...
def function[as_fs, parameter[self]]: constant[ Returns the value of component encoded as formatted string. Inspect each character in value of component. Certain nonalpha characters pass thru without escaping into the result, but most retain escaping. :returns: Formatte...
keyword[def] identifier[as_fs] ( identifier[self] ): literal[string] identifier[s] = identifier[self] . identifier[_standard_value] identifier[result] =[] identifier[idx] = literal[int] keyword[while] ( identifier[idx] < identifier[len] ( identifier[s] )): ...
def as_fs(self): """ Returns the value of component encoded as formatted string. Inspect each character in value of component. Certain nonalpha characters pass thru without escaping into the result, but most retain escaping. :returns: Formatted string associated with compon...
def _le_from_ge(self, other): """Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented return not op_result or self == other
def function[_le_from_ge, parameter[self, other]]: constant[Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).] variable[op_result] assign[=] call[name[self].__ge__, parameter[name[other]]] if compare[name[op_result] is name[NotImplemented]] begin[:] return[name[N...
keyword[def] identifier[_le_from_ge] ( identifier[self] , identifier[other] ): literal[string] identifier[op_result] = identifier[self] . identifier[__ge__] ( identifier[other] ) keyword[if] identifier[op_result] keyword[is] identifier[NotImplemented] : keyword[return] identifier[NotImple...
def _le_from_ge(self, other): """Return a <= b. Computed by @total_ordering from (not a >= b) or (a == b).""" op_result = self.__ge__(other) if op_result is NotImplemented: return NotImplemented # depends on [control=['if'], data=['NotImplemented']] return not op_result or self == other
def get_absolute_url(self, domain=False): " Get object's URL. " category = self.category kwargs = { 'slug': self.slug, } if self.static: kwargs['id'] = self.pk if category.tree_parent_id: kwargs['category'] = category.tree_pat...
def function[get_absolute_url, parameter[self, domain]]: constant[ Get object's URL. ] variable[category] assign[=] name[self].category variable[kwargs] assign[=] dictionary[[<ast.Constant object at 0x7da2054a4d00>], [<ast.Attribute object at 0x7da2054a7d30>]] if name[self].static begin[...
keyword[def] identifier[get_absolute_url] ( identifier[self] , identifier[domain] = keyword[False] ): literal[string] identifier[category] = identifier[self] . identifier[category] identifier[kwargs] ={ literal[string] : identifier[self] . identifier[slug] , } ...
def get_absolute_url(self, domain=False): """ Get object's URL. """ category = self.category kwargs = {'slug': self.slug} if self.static: kwargs['id'] = self.pk if category.tree_parent_id: kwargs['category'] = category.tree_path url = reverse('static_detail', kwar...
def create_param_info(task_params, parameter_map): """ Builds the code block for the GPTool GetParameterInfo method based on the input task_params. :param task_params: A list of task parameters to map to GPTool parameters. :return: A string representing the code block to the GPTool GetParameterInfo met...
def function[create_param_info, parameter[task_params, parameter_map]]: constant[ Builds the code block for the GPTool GetParameterInfo method based on the input task_params. :param task_params: A list of task parameters to map to GPTool parameters. :return: A string representing the code block to ...
keyword[def] identifier[create_param_info] ( identifier[task_params] , identifier[parameter_map] ): literal[string] identifier[gp_params] =[] identifier[gp_param_list] =[] identifier[gp_param_idx_list] =[] identifier[gp_param_idx] = literal[int] keyword[for] identifier[task_param] ke...
def create_param_info(task_params, parameter_map): """ Builds the code block for the GPTool GetParameterInfo method based on the input task_params. :param task_params: A list of task parameters to map to GPTool parameters. :return: A string representing the code block to the GPTool GetParameterInfo met...
def _clone(self): """Make a (shallow) copy of the set. There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes def...
def function[_clone, parameter[self]]: constant[Make a (shallow) copy of the set. There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow c...
keyword[def] identifier[_clone] ( identifier[self] ): literal[string] identifier[cls] = identifier[self] . identifier[__class__] identifier[obj] = identifier[cls] . identifier[__new__] ( identifier[cls] ) identifier[obj] . identifier[items] = identifier[list] ( identifier[self] ...
def _clone(self): """Make a (shallow) copy of the set. There is a 'clone protocol' that subclasses of this class should use. To make a copy, first call your super's _clone() method, and use the object returned as the new instance. Then make shallow copies of the attributes defined...
def default_instance(cls): """ For use like a singleton, return the existing instance of the object or a new instance """ if cls._instance is None: with cls._instance_lock: if cls._instance is None: cls._instance = MessageDispatcher...
def function[default_instance, parameter[cls]]: constant[ For use like a singleton, return the existing instance of the object or a new instance ] if compare[name[cls]._instance is constant[None]] begin[:] with name[cls]._instance_lock begin[:] ...
keyword[def] identifier[default_instance] ( identifier[cls] ): literal[string] keyword[if] identifier[cls] . identifier[_instance] keyword[is] keyword[None] : keyword[with] identifier[cls] . identifier[_instance_lock] : keyword[if] identifier[cls] . identifier[_in...
def default_instance(cls): """ For use like a singleton, return the existing instance of the object or a new instance """ if cls._instance is None: with cls._instance_lock: if cls._instance is None: cls._instance = MessageDispatcher() # depends on [co...
def clipped_zoom(img, zoom_factor): """Zoom image with clipping. Zoom the central part of the image and clip extra pixels. Args: img: numpy array, uncorrupted image. zoom_factor: numpy array, a sequence of float numbers for zoom factor. Returns: numpy array, zoomed image after clipping. """ h...
def function[clipped_zoom, parameter[img, zoom_factor]]: constant[Zoom image with clipping. Zoom the central part of the image and clip extra pixels. Args: img: numpy array, uncorrupted image. zoom_factor: numpy array, a sequence of float numbers for zoom factor. Returns: numpy array, zoome...
keyword[def] identifier[clipped_zoom] ( identifier[img] , identifier[zoom_factor] ): literal[string] identifier[h] = identifier[img] . identifier[shape] [ literal[int] ] identifier[ch] = identifier[int] ( identifier[np] . identifier[ceil] ( identifier[h] / identifier[float] ( identifier[zoom_factor] ))) ...
def clipped_zoom(img, zoom_factor): """Zoom image with clipping. Zoom the central part of the image and clip extra pixels. Args: img: numpy array, uncorrupted image. zoom_factor: numpy array, a sequence of float numbers for zoom factor. Returns: numpy array, zoomed image after clipping. """ ...
def get_valid_indentations(self, idx): """Returns the valid offsets for the token at the given position.""" # The closing brace on a dict or the 'for' in a dict comprehension may # reset two indent levels because the dict value is ended implicitly stack_top = -1 if ( ...
def function[get_valid_indentations, parameter[self, idx]]: constant[Returns the valid offsets for the token at the given position.] variable[stack_top] assign[=] <ast.UnaryOp object at 0x7da1b024ecb0> if <ast.BoolOp object at 0x7da1b024e170> begin[:] variable[stack_top] assign[=...
keyword[def] identifier[get_valid_indentations] ( identifier[self] , identifier[idx] ): literal[string] identifier[stack_top] =- literal[int] keyword[if] ( identifier[self] . identifier[_tokens] . identifier[token] ( identifier[idx] ) keyword[in] ( literal[strin...
def get_valid_indentations(self, idx): """Returns the valid offsets for the token at the given position.""" # The closing brace on a dict or the 'for' in a dict comprehension may # reset two indent levels because the dict value is ended implicitly stack_top = -1 if self._tokens.token(idx) in ('}', '...
def add(self, pk, quantity=1, **kwargs): """Add an item to the cart. If the item is already in the cart, then its quantity will be increased by `quantity` units. Parameters ---------- pk : str or int The primary key of the item. quantity : int-conver...
def function[add, parameter[self, pk, quantity]]: constant[Add an item to the cart. If the item is already in the cart, then its quantity will be increased by `quantity` units. Parameters ---------- pk : str or int The primary key of the item. quanti...
keyword[def] identifier[add] ( identifier[self] , identifier[pk] , identifier[quantity] = literal[int] ,** identifier[kwargs] ): literal[string] identifier[pk] = identifier[str] ( identifier[pk] ) keyword[if] identifier[pk] keyword[in] identifier[self] . identifier[items] : ...
def add(self, pk, quantity=1, **kwargs): """Add an item to the cart. If the item is already in the cart, then its quantity will be increased by `quantity` units. Parameters ---------- pk : str or int The primary key of the item. quantity : int-convertibl...
def statistical_distances(samples1, samples2, earth_mover_dist=True, energy_dist=True): """Compute measures of the statistical distance between samples. Parameters ---------- samples1: 1d array samples2: 1d array earth_mover_dist: bool, optional Whether or not ...
def function[statistical_distances, parameter[samples1, samples2, earth_mover_dist, energy_dist]]: constant[Compute measures of the statistical distance between samples. Parameters ---------- samples1: 1d array samples2: 1d array earth_mover_dist: bool, optional Whether or not to co...
keyword[def] identifier[statistical_distances] ( identifier[samples1] , identifier[samples2] , identifier[earth_mover_dist] = keyword[True] , identifier[energy_dist] = keyword[True] ): literal[string] identifier[out] =[] identifier[temp] = identifier[scipy] . identifier[stats] . identifier[ks_2samp] ...
def statistical_distances(samples1, samples2, earth_mover_dist=True, energy_dist=True): """Compute measures of the statistical distance between samples. Parameters ---------- samples1: 1d array samples2: 1d array earth_mover_dist: bool, optional Whether or not to compute the Earth mover...
def to_python(self, value): """ Validates that the value is in self.choices and can be coerced to the right type. """ value = '' if value in validators.EMPTY_VALUES else smart_text(value) if value == self.empty_value or value in validators.EMPTY_VALUES: return...
def function[to_python, parameter[self, value]]: constant[ Validates that the value is in self.choices and can be coerced to the right type. ] variable[value] assign[=] <ast.IfExp object at 0x7da1b0b72290> if <ast.BoolOp object at 0x7da1b0b72bc0> begin[:] return[n...
keyword[def] identifier[to_python] ( identifier[self] , identifier[value] ): literal[string] identifier[value] = literal[string] keyword[if] identifier[value] keyword[in] identifier[validators] . identifier[EMPTY_VALUES] keyword[else] identifier[smart_text] ( identifier[value] ) keyw...
def to_python(self, value): """ Validates that the value is in self.choices and can be coerced to the right type. """ value = '' if value in validators.EMPTY_VALUES else smart_text(value) if value == self.empty_value or value in validators.EMPTY_VALUES: return self.empty_valu...
def artist_commentary_create_update(self, post_id, original_title, original_description, translated_title, translated_description): """Create or update artist commentary (Requires login) (UNTESTED). Parameters: ...
def function[artist_commentary_create_update, parameter[self, post_id, original_title, original_description, translated_title, translated_description]]: constant[Create or update artist commentary (Requires login) (UNTESTED). Parameters: post_id (int): Post id. original_title (s...
keyword[def] identifier[artist_commentary_create_update] ( identifier[self] , identifier[post_id] , identifier[original_title] , identifier[original_description] , identifier[translated_title] , identifier[translated_description] ): literal[string] identifier[params] ={ literal[string] :...
def artist_commentary_create_update(self, post_id, original_title, original_description, translated_title, translated_description): """Create or update artist commentary (Requires login) (UNTESTED). Parameters: post_id (int): Post id. original_title (str): Original title. ...
def plot1D_mat(a, b, M, title=''): """ Plot matrix M with the source and target 1D distribution Creates a subplot with the source distribution a on the left and target distribution b on the tot. The matrix M is shown in between. Parameters ---------- a : np.array, shape (na,) Source ...
def function[plot1D_mat, parameter[a, b, M, title]]: constant[ Plot matrix M with the source and target 1D distribution Creates a subplot with the source distribution a on the left and target distribution b on the tot. The matrix M is shown in between. Parameters ---------- a : np.array,...
keyword[def] identifier[plot1D_mat] ( identifier[a] , identifier[b] , identifier[M] , identifier[title] = literal[string] ): literal[string] identifier[na] , identifier[nb] = identifier[M] . identifier[shape] identifier[gs] = identifier[gridspec] . identifier[GridSpec] ( literal[int] , literal[int] ...
def plot1D_mat(a, b, M, title=''): """ Plot matrix M with the source and target 1D distribution Creates a subplot with the source distribution a on the left and target distribution b on the tot. The matrix M is shown in between. Parameters ---------- a : np.array, shape (na,) Source ...
def read_padding(fp, size, divisor=2): """ Read padding bytes for the given byte size. :param fp: file-like object :param divisor: divisor of the byte alignment :return: read byte size """ remainder = size % divisor if remainder: return fp.read(divisor - remainder) return b'...
def function[read_padding, parameter[fp, size, divisor]]: constant[ Read padding bytes for the given byte size. :param fp: file-like object :param divisor: divisor of the byte alignment :return: read byte size ] variable[remainder] assign[=] binary_operation[name[size] <ast.Mod obje...
keyword[def] identifier[read_padding] ( identifier[fp] , identifier[size] , identifier[divisor] = literal[int] ): literal[string] identifier[remainder] = identifier[size] % identifier[divisor] keyword[if] identifier[remainder] : keyword[return] identifier[fp] . identifier[read] ( identifie...
def read_padding(fp, size, divisor=2): """ Read padding bytes for the given byte size. :param fp: file-like object :param divisor: divisor of the byte alignment :return: read byte size """ remainder = size % divisor if remainder: return fp.read(divisor - remainder) # depends on...
def get_server(self, datacenter_id, server_id, depth=1): """ Retrieves a server by its ID. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``str`` ...
def function[get_server, parameter[self, datacenter_id, server_id, depth]]: constant[ Retrieves a server by its ID. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type ...
keyword[def] identifier[get_server] ( identifier[self] , identifier[datacenter_id] , identifier[server_id] , identifier[depth] = literal[int] ): literal[string] identifier[response] = identifier[self] . identifier[_perform_request] ( literal[string] %( identifier[datacenter_id] , ...
def get_server(self, datacenter_id, server_id, depth=1): """ Retrieves a server by its ID. :param datacenter_id: The unique ID of the data center. :type datacenter_id: ``str`` :param server_id: The unique ID of the server. :type server_id: ``str`` ...
def get_assessment_part_mdata(): """Return default mdata map for AssessmentPart""" return { 'assessment_part': { 'element_label': { 'text': 'assessment part', 'languageTypeId': str(DEFAULT_LANGUAGE_TYPE), 'scriptTypeId': str(DEFAULT_SCRIPT_TYPE...
def function[get_assessment_part_mdata, parameter[]]: constant[Return default mdata map for AssessmentPart] return[dictionary[[<ast.Constant object at 0x7da204347bb0>, <ast.Constant object at 0x7da204347d00>, <ast.Constant object at 0x7da204347010>, <ast.Constant object at 0x7da2043478b0>], [<ast.Dict objec...
keyword[def] identifier[get_assessment_part_mdata] (): literal[string] keyword[return] { literal[string] :{ literal[string] :{ literal[string] : literal[string] , literal[string] : identifier[str] ( identifier[DEFAULT_LANGUAGE_TYPE] ), literal[string] : identifier[str] ( identifier...
def get_assessment_part_mdata(): """Return default mdata map for AssessmentPart""" return {'assessment_part': {'element_label': {'text': 'assessment part', 'languageTypeId': str(DEFAULT_LANGUAGE_TYPE), 'scriptTypeId': str(DEFAULT_SCRIPT_TYPE), 'formatTypeId': str(DEFAULT_FORMAT_TYPE)}, 'instructions': {'text': ...
async def download_file( self, input_location, file=None, *, part_size_kb=None, file_size=None, progress_callback=None, dc_id=None): """ Downloads the given input location to a file. Args: input_location (:tl:`InputFileLocation`): The file loc...
<ast.AsyncFunctionDef object at 0x7da1b21e1ba0>
keyword[async] keyword[def] identifier[download_file] ( identifier[self] , identifier[input_location] , identifier[file] = keyword[None] ,*, identifier[part_size_kb] = keyword[None] , identifier[file_size] = keyword[None] , identifier[progress_callback] = keyword[None] , identifier[dc_id] = keyword[None] ): ...
async def download_file(self, input_location, file=None, *, part_size_kb=None, file_size=None, progress_callback=None, dc_id=None): """ Downloads the given input location to a file. Args: input_location (:tl:`InputFileLocation`): The file location from which the file wil...
def merge_plugin_from_baseline(baseline_plugins, args): """ :type baseline_plugins: tuple of BasePlugin :param baseline_plugins: BasePlugin instances from baseline file :type args: dict :param args: diction of arguments parsed from usage param priority: input param > baseline param > default ...
def function[merge_plugin_from_baseline, parameter[baseline_plugins, args]]: constant[ :type baseline_plugins: tuple of BasePlugin :param baseline_plugins: BasePlugin instances from baseline file :type args: dict :param args: diction of arguments parsed from usage param priority: input par...
keyword[def] identifier[merge_plugin_from_baseline] ( identifier[baseline_plugins] , identifier[args] ): literal[string] keyword[def] identifier[_remove_key] ( identifier[d] , identifier[key] ): identifier[r] = identifier[dict] ( identifier[d] ) identifier[r] . identifier[pop] ( identifi...
def merge_plugin_from_baseline(baseline_plugins, args): """ :type baseline_plugins: tuple of BasePlugin :param baseline_plugins: BasePlugin instances from baseline file :type args: dict :param args: diction of arguments parsed from usage param priority: input param > baseline param > default ...
def getSDSSImage(ra,dec,radius=1.0,xsize=800,opt='GML',**kwargs): """ Download Sloan Digital Sky Survey images http://skyserver.sdss3.org/dr9/en/tools/chart/chart.asp radius (degrees) opts: (G) Grid, (L) Label, P (PhotoObj), S (SpecObj), O (Outline), (B) Bounding Box, (F) Fields, (M) Mas...
def function[getSDSSImage, parameter[ra, dec, radius, xsize, opt]]: constant[ Download Sloan Digital Sky Survey images http://skyserver.sdss3.org/dr9/en/tools/chart/chart.asp radius (degrees) opts: (G) Grid, (L) Label, P (PhotoObj), S (SpecObj), O (Outline), (B) Bounding Box, (F) Fie...
keyword[def] identifier[getSDSSImage] ( identifier[ra] , identifier[dec] , identifier[radius] = literal[int] , identifier[xsize] = literal[int] , identifier[opt] = literal[string] ,** identifier[kwargs] ): literal[string] keyword[import] identifier[subprocess] keyword[import] identifier[tempfile] ...
def getSDSSImage(ra, dec, radius=1.0, xsize=800, opt='GML', **kwargs): """ Download Sloan Digital Sky Survey images http://skyserver.sdss3.org/dr9/en/tools/chart/chart.asp radius (degrees) opts: (G) Grid, (L) Label, P (PhotoObj), S (SpecObj), O (Outline), (B) Bounding Box, (F) Fields, (M...
def runner(self): """ Run the necessary methods in the correct order """ logging.info('Starting {} analysis pipeline'.format(self.analysistype)) # Initialise the GenObject for sample in self.runmetadata.samples: setattr(sample, self.analysistype, GenObject()) ...
def function[runner, parameter[self]]: constant[ Run the necessary methods in the correct order ] call[name[logging].info, parameter[call[constant[Starting {} analysis pipeline].format, parameter[name[self].analysistype]]]] for taget[name[sample]] in starred[name[self].runmetadat...
keyword[def] identifier[runner] ( identifier[self] ): literal[string] identifier[logging] . identifier[info] ( literal[string] . identifier[format] ( identifier[self] . identifier[analysistype] )) keyword[for] identifier[sample] keyword[in] identifier[self] . identifier[runmeta...
def runner(self): """ Run the necessary methods in the correct order """ logging.info('Starting {} analysis pipeline'.format(self.analysistype)) # Initialise the GenObject for sample in self.runmetadata.samples: setattr(sample, self.analysistype, GenObject()) try: ...
def range(self): """A tuple containing the numeric range for this Slot. The Python equivalent of the CLIPS deftemplate-slot-range function. """ data = clips.data.DataObject(self._env) lib.EnvDeftemplateSlotRange( self._env, self._tpl, self._name, data.byref) ...
def function[range, parameter[self]]: constant[A tuple containing the numeric range for this Slot. The Python equivalent of the CLIPS deftemplate-slot-range function. ] variable[data] assign[=] call[name[clips].data.DataObject, parameter[name[self]._env]] call[name[lib].EnvDeft...
keyword[def] identifier[range] ( identifier[self] ): literal[string] identifier[data] = identifier[clips] . identifier[data] . identifier[DataObject] ( identifier[self] . identifier[_env] ) identifier[lib] . identifier[EnvDeftemplateSlotRange] ( identifier[self] . identifier[_env...
def range(self): """A tuple containing the numeric range for this Slot. The Python equivalent of the CLIPS deftemplate-slot-range function. """ data = clips.data.DataObject(self._env) lib.EnvDeftemplateSlotRange(self._env, self._tpl, self._name, data.byref) return tuple(data.value) if ...
def from_variant_sequence_and_reference_context( cls, variant_sequence, reference_context): """ Combines a VariantSequence with the reading frame implied by a ReferenceContext, reverse complementing if necessary and finding the offset to the first complete codon in the cDNA s...
def function[from_variant_sequence_and_reference_context, parameter[cls, variant_sequence, reference_context]]: constant[ Combines a VariantSequence with the reading frame implied by a ReferenceContext, reverse complementing if necessary and finding the offset to the first complete codon...
keyword[def] identifier[from_variant_sequence_and_reference_context] ( identifier[cls] , identifier[variant_sequence] , identifier[reference_context] ): literal[string] ( identifier[cdna_prefix] , identifier[cdna_alt] , identifier[cdna_suffix] , identifier[reference_prefix] , identifier[re...
def from_variant_sequence_and_reference_context(cls, variant_sequence, reference_context): """ Combines a VariantSequence with the reading frame implied by a ReferenceContext, reverse complementing if necessary and finding the offset to the first complete codon in the cDNA sequence. ...
def api(endpoint, data=None, json=None, filename=None, save_to=None): """ Perform a REST API request to a previously connected server. This function is mostly for internal purposes, but may occasionally be useful for direct access to the backend H2O server. It has same parameters as :meth:`H2OConnectio...
def function[api, parameter[endpoint, data, json, filename, save_to]]: constant[ Perform a REST API request to a previously connected server. This function is mostly for internal purposes, but may occasionally be useful for direct access to the backend H2O server. It has same parameters as :meth:`H...
keyword[def] identifier[api] ( identifier[endpoint] , identifier[data] = keyword[None] , identifier[json] = keyword[None] , identifier[filename] = keyword[None] , identifier[save_to] = keyword[None] ): literal[string] identifier[_check_connection] () keyword[return] identifier[h2oconn] . identif...
def api(endpoint, data=None, json=None, filename=None, save_to=None): """ Perform a REST API request to a previously connected server. This function is mostly for internal purposes, but may occasionally be useful for direct access to the backend H2O server. It has same parameters as :meth:`H2OConnectio...
async def get_albums(self, *, limit=20, offset=0) -> List[Album]: """Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library. Parameters ---------- limit : Optional[int] The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. ...
<ast.AsyncFunctionDef object at 0x7da20c6e6da0>
keyword[async] keyword[def] identifier[get_albums] ( identifier[self] ,*, identifier[limit] = literal[int] , identifier[offset] = literal[int] )-> identifier[List] [ identifier[Album] ]: literal[string] identifier[data] = keyword[await] identifier[self] . identifier[user] . identifier[http] . ide...
async def get_albums(self, *, limit=20, offset=0) -> List[Album]: """Get a list of the albums saved in the current Spotify user’s ‘Your Music’ library. Parameters ---------- limit : Optional[int] The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50. ...
def _ExtractJQuery(self, jquery_raw): """Extracts values from a JQuery string. Args: jquery_raw (str): JQuery string. Returns: dict[str, str]: extracted values. """ data_part = '' if not jquery_raw: return {} if '[' in jquery_raw: _, _, first_part = jquery_raw.part...
def function[_ExtractJQuery, parameter[self, jquery_raw]]: constant[Extracts values from a JQuery string. Args: jquery_raw (str): JQuery string. Returns: dict[str, str]: extracted values. ] variable[data_part] assign[=] constant[] if <ast.UnaryOp object at 0x7da20cabe8f...
keyword[def] identifier[_ExtractJQuery] ( identifier[self] , identifier[jquery_raw] ): literal[string] identifier[data_part] = literal[string] keyword[if] keyword[not] identifier[jquery_raw] : keyword[return] {} keyword[if] literal[string] keyword[in] identifier[jquery_raw] : ...
def _ExtractJQuery(self, jquery_raw): """Extracts values from a JQuery string. Args: jquery_raw (str): JQuery string. Returns: dict[str, str]: extracted values. """ data_part = '' if not jquery_raw: return {} # depends on [control=['if'], data=[]] if '[' in jquery_raw:...
def rst_preprocess(file): """ Preprocess reST file to support Sphinx like include directive. Includes are relative to the current working directory. """ with open(file) as fp: return re.sub( "^\.\.\s+include:: (.*?)$", lambda x: (rst_preprocess(x.group(1)) or "").rst...
def function[rst_preprocess, parameter[file]]: constant[ Preprocess reST file to support Sphinx like include directive. Includes are relative to the current working directory. ] with call[name[open], parameter[name[file]]] begin[:] return[call[name[re].sub, parameter[constant[^\.\.\s...
keyword[def] identifier[rst_preprocess] ( identifier[file] ): literal[string] keyword[with] identifier[open] ( identifier[file] ) keyword[as] identifier[fp] : keyword[return] identifier[re] . identifier[sub] ( literal[string] , keyword[lambda] identifier[x] :( identifier[rst...
def rst_preprocess(file): """ Preprocess reST file to support Sphinx like include directive. Includes are relative to the current working directory. """ with open(file) as fp: return re.sub('^\\.\\.\\s+include:: (.*?)$', lambda x: (rst_preprocess(x.group(1)) or '').rstrip(), fp.read(), flags...
def walk(self, head=None): """Do a breadth-first walk of the graph, yielding on each node, starting at `head`.""" head = head or self._root_node queue = [] queue.insert(0, head) while queue: node = queue.pop() yield node.num, node.previous, node...
def function[walk, parameter[self, head]]: constant[Do a breadth-first walk of the graph, yielding on each node, starting at `head`.] variable[head] assign[=] <ast.BoolOp object at 0x7da20c6e7550> variable[queue] assign[=] list[[]] call[name[queue].insert, parameter[constant[0], ...
keyword[def] identifier[walk] ( identifier[self] , identifier[head] = keyword[None] ): literal[string] identifier[head] = identifier[head] keyword[or] identifier[self] . identifier[_root_node] identifier[queue] =[] identifier[queue] . identifier[insert] ( literal[int] , identi...
def walk(self, head=None): """Do a breadth-first walk of the graph, yielding on each node, starting at `head`.""" head = head or self._root_node queue = [] queue.insert(0, head) while queue: node = queue.pop() yield (node.num, node.previous, node.siblings) for child i...
def uniquenessRatio(self, value): """Set private ``_uniqueness`` and reset ``_block_matcher``.""" if value >= 5 and value <= 15: self._uniqueness = value else: raise InvalidUniquenessRatioError("Uniqueness ratio must be " "bet...
def function[uniquenessRatio, parameter[self, value]]: constant[Set private ``_uniqueness`` and reset ``_block_matcher``.] if <ast.BoolOp object at 0x7da20c990430> begin[:] name[self]._uniqueness assign[=] name[value] call[name[self]._replace_bm, parameter[]]
keyword[def] identifier[uniquenessRatio] ( identifier[self] , identifier[value] ): literal[string] keyword[if] identifier[value] >= literal[int] keyword[and] identifier[value] <= literal[int] : identifier[self] . identifier[_uniqueness] = identifier[value] keyword[else] : ...
def uniquenessRatio(self, value): """Set private ``_uniqueness`` and reset ``_block_matcher``.""" if value >= 5 and value <= 15: self._uniqueness = value # depends on [control=['if'], data=[]] else: raise InvalidUniquenessRatioError('Uniqueness ratio must be between 5 and 15.') self._re...
def dump_objects(self): """Dump scheduler objects into a dump (temp) file :return: None """ path = os.path.join(tempfile.gettempdir(), 'dump-obj-scheduler-%s-%d.json' % (self.name, int(time.time()))) logger.info('Dumping scheduler objects to: %s', pa...
def function[dump_objects, parameter[self]]: constant[Dump scheduler objects into a dump (temp) file :return: None ] variable[path] assign[=] call[name[os].path.join, parameter[call[name[tempfile].gettempdir, parameter[]], binary_operation[constant[dump-obj-scheduler-%s-%d.json] <ast.Mo...
keyword[def] identifier[dump_objects] ( identifier[self] ): literal[string] identifier[path] = identifier[os] . identifier[path] . identifier[join] ( identifier[tempfile] . identifier[gettempdir] (), literal[string] %( identifier[self] . identifier[name] , identifier[int] ( identifier[time...
def dump_objects(self): """Dump scheduler objects into a dump (temp) file :return: None """ path = os.path.join(tempfile.gettempdir(), 'dump-obj-scheduler-%s-%d.json' % (self.name, int(time.time()))) logger.info('Dumping scheduler objects to: %s', path) try: fd = open(path, 'wb'...
def field_get_subfields(field): """ Given a field, will place all subfields into a dictionary Parameters: * field - tuple: The field to get subfields for Returns: a dictionary, codes as keys and a list of values as the value """ pairs = {} for key, value in field[0]: if key in pairs and...
def function[field_get_subfields, parameter[field]]: constant[ Given a field, will place all subfields into a dictionary Parameters: * field - tuple: The field to get subfields for Returns: a dictionary, codes as keys and a list of values as the value ] variable[pairs] assign[=] dictionary[...
keyword[def] identifier[field_get_subfields] ( identifier[field] ): literal[string] identifier[pairs] ={} keyword[for] identifier[key] , identifier[value] keyword[in] identifier[field] [ literal[int] ]: keyword[if] identifier[key] keyword[in] identifier[pairs] keyword[and] identifier[...
def field_get_subfields(field): """ Given a field, will place all subfields into a dictionary Parameters: * field - tuple: The field to get subfields for Returns: a dictionary, codes as keys and a list of values as the value """ pairs = {} for (key, value) in field[0]: if key in pairs a...
def _parse_game_date_and_location(self, boxscore): """ Retrieve the game's date and location. The date and location of the game follow a more complicated parsing scheme and should be handled differently from other tags. Both fields are separated by a newline character ('\n') wit...
def function[_parse_game_date_and_location, parameter[self, boxscore]]: constant[ Retrieve the game's date and location. The date and location of the game follow a more complicated parsing scheme and should be handled differently from other tags. Both fields are separated by a n...
keyword[def] identifier[_parse_game_date_and_location] ( identifier[self] , identifier[boxscore] ): literal[string] identifier[scheme] = identifier[BOXSCORE_SCHEME] [ literal[string] ] identifier[items] =[ identifier[i] . identifier[text] () keyword[for] identifier[i] keyword[in] identi...
def _parse_game_date_and_location(self, boxscore): """ Retrieve the game's date and location. The date and location of the game follow a more complicated parsing scheme and should be handled differently from other tags. Both fields are separated by a newline character (' ') with the...
def send_audio_packet(self, data, *, encode=True): """Sends an audio packet composed of the data. You must be connected to play audio. Parameters ---------- data: bytes The :term:`py:bytes-like object` denoting PCM or Opus voice data. encode: bool ...
def function[send_audio_packet, parameter[self, data]]: constant[Sends an audio packet composed of the data. You must be connected to play audio. Parameters ---------- data: bytes The :term:`py:bytes-like object` denoting PCM or Opus voice data. encode: bool...
keyword[def] identifier[send_audio_packet] ( identifier[self] , identifier[data] ,*, identifier[encode] = keyword[True] ): literal[string] identifier[self] . identifier[checked_add] ( literal[string] , literal[int] , literal[int] ) keyword[if] identifier[encode] : identifier...
def send_audio_packet(self, data, *, encode=True): """Sends an audio packet composed of the data. You must be connected to play audio. Parameters ---------- data: bytes The :term:`py:bytes-like object` denoting PCM or Opus voice data. encode: bool In...
def set_resolution(self, resolution=None): """ Add physical pixel dimensions `resolution` supposed two be tuple of two parameterts: pixels per unit and unit type; unit type may be omitted pixels per unit could be simple integer or tuple of (ppu_x, ppu_y) Also possible to...
def function[set_resolution, parameter[self, resolution]]: constant[ Add physical pixel dimensions `resolution` supposed two be tuple of two parameterts: pixels per unit and unit type; unit type may be omitted pixels per unit could be simple integer or tuple of (ppu_x, ppu_y) ...
keyword[def] identifier[set_resolution] ( identifier[self] , identifier[resolution] = keyword[None] ): literal[string] keyword[if] identifier[resolution] keyword[is] keyword[None] : identifier[self] . identifier[resolution] = keyword[None] keyword[return] ...
def set_resolution(self, resolution=None): """ Add physical pixel dimensions `resolution` supposed two be tuple of two parameterts: pixels per unit and unit type; unit type may be omitted pixels per unit could be simple integer or tuple of (ppu_x, ppu_y) Also possible to use...
def search_meta(self, attr, value=None, stronly=False): """ Get a list of Symbols by searching a specific meta attribute, and optionally the value. Parameters ---------- attr : str The meta attribute to query. value : None, str or list ...
def function[search_meta, parameter[self, attr, value, stronly]]: constant[ Get a list of Symbols by searching a specific meta attribute, and optionally the value. Parameters ---------- attr : str The meta attribute to query. value : None, str or list ...
keyword[def] identifier[search_meta] ( identifier[self] , identifier[attr] , identifier[value] = keyword[None] , identifier[stronly] = keyword[False] ): literal[string] keyword[if] identifier[stronly] : identifier[qry] = identifier[self] . identifier[ses] . identifier[query] ( iden...
def search_meta(self, attr, value=None, stronly=False): """ Get a list of Symbols by searching a specific meta attribute, and optionally the value. Parameters ---------- attr : str The meta attribute to query. value : None, str or list The meta attr...
def legacy_approximant_name(apx): """Convert the old style xml approximant name to a name and phase_order. Alex: I hate this function. Please delete this when we use Collin's new tables. """ apx = str(apx) try: order = sim.GetOrderFromString(apx) except: print("Warning: Could...
def function[legacy_approximant_name, parameter[apx]]: constant[Convert the old style xml approximant name to a name and phase_order. Alex: I hate this function. Please delete this when we use Collin's new tables. ] variable[apx] assign[=] call[name[str], parameter[name[apx]]] <ast.Try o...
keyword[def] identifier[legacy_approximant_name] ( identifier[apx] ): literal[string] identifier[apx] = identifier[str] ( identifier[apx] ) keyword[try] : identifier[order] = identifier[sim] . identifier[GetOrderFromString] ( identifier[apx] ) keyword[except] : identifier[print]...
def legacy_approximant_name(apx): """Convert the old style xml approximant name to a name and phase_order. Alex: I hate this function. Please delete this when we use Collin's new tables. """ apx = str(apx) try: order = sim.GetOrderFromString(apx) # depends on [control=['try'], data=[]] ...
def get_pypi_auth(configfile='~/.pypirc'): """Read auth from pip config.""" pypi_cfg = ConfigParser() if pypi_cfg.read(os.path.expanduser(configfile)): try: user = pypi_cfg.get('pypi', 'username') pwd = pypi_cfg.get('pypi', 'password') return user, pwd exc...
def function[get_pypi_auth, parameter[configfile]]: constant[Read auth from pip config.] variable[pypi_cfg] assign[=] call[name[ConfigParser], parameter[]] if call[name[pypi_cfg].read, parameter[call[name[os].path.expanduser, parameter[name[configfile]]]]] begin[:] <ast.Try object at 0x7...
keyword[def] identifier[get_pypi_auth] ( identifier[configfile] = literal[string] ): literal[string] identifier[pypi_cfg] = identifier[ConfigParser] () keyword[if] identifier[pypi_cfg] . identifier[read] ( identifier[os] . identifier[path] . identifier[expanduser] ( identifier[configfile] )): ...
def get_pypi_auth(configfile='~/.pypirc'): """Read auth from pip config.""" pypi_cfg = ConfigParser() if pypi_cfg.read(os.path.expanduser(configfile)): try: user = pypi_cfg.get('pypi', 'username') pwd = pypi_cfg.get('pypi', 'password') return (user, pwd) # depend...
def is_empty(self): """Determines if the priority queue has any elements. Performs removal of any elements that were "marked-as-invalid". :returns: true iff the priority queue has no elements. """ while self.pq: if self.pq[0][1] != self.INVALID: retu...
def function[is_empty, parameter[self]]: constant[Determines if the priority queue has any elements. Performs removal of any elements that were "marked-as-invalid". :returns: true iff the priority queue has no elements. ] while name[self].pq begin[:] if compare[...
keyword[def] identifier[is_empty] ( identifier[self] ): literal[string] keyword[while] identifier[self] . identifier[pq] : keyword[if] identifier[self] . identifier[pq] [ literal[int] ][ literal[int] ]!= identifier[self] . identifier[INVALID] : keyword[return] keywo...
def is_empty(self): """Determines if the priority queue has any elements. Performs removal of any elements that were "marked-as-invalid". :returns: true iff the priority queue has no elements. """ while self.pq: if self.pq[0][1] != self.INVALID: return False # depe...
def saveSettings(self, settings): """ Saves the data for this tree to the inputed xml entry. :param xml | <xml.etree.ElementTree.Element> :return <bool> success """ # save order data settings.setValue('headerState', wrapVariant(...
def function[saveSettings, parameter[self, settings]]: constant[ Saves the data for this tree to the inputed xml entry. :param xml | <xml.etree.ElementTree.Element> :return <bool> success ] call[name[settings].setValue, parameter[constant[header...
keyword[def] identifier[saveSettings] ( identifier[self] , identifier[settings] ): literal[string] identifier[settings] . identifier[setValue] ( literal[string] , identifier[wrapVariant] ( identifier[str] ( identifier[self] . identifier[header] (). identifier[saveState] (). identifier[t...
def saveSettings(self, settings): """ Saves the data for this tree to the inputed xml entry. :param xml | <xml.etree.ElementTree.Element> :return <bool> success """ # save order data settings.setValue('headerState', wrapVariant(str(self.header().saveSt...
def bracket(value_and_gradients_function, search_interval, f_lim, max_iterations, expansion_param=5.0): """Brackets the minimum given an initial starting point. Applies the Hager Zhang bracketing algorithm to find an interval containing a region with points satisfy...
def function[bracket, parameter[value_and_gradients_function, search_interval, f_lim, max_iterations, expansion_param]]: constant[Brackets the minimum given an initial starting point. Applies the Hager Zhang bracketing algorithm to find an interval containing a region with points satisfying Wolfe condition...
keyword[def] identifier[bracket] ( identifier[value_and_gradients_function] , identifier[search_interval] , identifier[f_lim] , identifier[max_iterations] , identifier[expansion_param] = literal[int] ): literal[string] identifier[already_stopped] = identifier[search_interval] . identifier[failed] | identif...
def bracket(value_and_gradients_function, search_interval, f_lim, max_iterations, expansion_param=5.0): """Brackets the minimum given an initial starting point. Applies the Hager Zhang bracketing algorithm to find an interval containing a region with points satisfying Wolfe conditions. Uses the supplied initia...
def authors(self, *usernames): """ Return the entries written by the given usernames When multiple tags are provided, they operate as "OR" query. """ if len(usernames) == 1: return self.filter(**{"author__{}".format(User.USERNAME_FIELD): usernames[0]}) else: ...
def function[authors, parameter[self]]: constant[ Return the entries written by the given usernames When multiple tags are provided, they operate as "OR" query. ] if compare[call[name[len], parameter[name[usernames]]] equal[==] constant[1]] begin[:] return[call[name[self]...
keyword[def] identifier[authors] ( identifier[self] ,* identifier[usernames] ): literal[string] keyword[if] identifier[len] ( identifier[usernames] )== literal[int] : keyword[return] identifier[self] . identifier[filter] (**{ literal[string] . identifier[format] ( identifier[User] . ...
def authors(self, *usernames): """ Return the entries written by the given usernames When multiple tags are provided, they operate as "OR" query. """ if len(usernames) == 1: return self.filter(**{'author__{}'.format(User.USERNAME_FIELD): usernames[0]}) # depends on [control=['if...
def parse_hpo_phenotypes(hpo_lines): """Parse hpo phenotypes Group the genes that a phenotype is associated to in 'genes' Args: hpo_lines(iterable(str)): A file handle to the hpo phenotypes file Returns: hpo_terms(dict): A dictionary with hpo_ids as keys and terms as v...
def function[parse_hpo_phenotypes, parameter[hpo_lines]]: constant[Parse hpo phenotypes Group the genes that a phenotype is associated to in 'genes' Args: hpo_lines(iterable(str)): A file handle to the hpo phenotypes file Returns: hpo_terms(dict): A dictionary with...
keyword[def] identifier[parse_hpo_phenotypes] ( identifier[hpo_lines] ): literal[string] identifier[hpo_terms] ={} identifier[LOG] . identifier[info] ( literal[string] ) keyword[for] identifier[index] , identifier[line] keyword[in] identifier[enumerate] ( identifier[hpo_lines] ): keyw...
def parse_hpo_phenotypes(hpo_lines): """Parse hpo phenotypes Group the genes that a phenotype is associated to in 'genes' Args: hpo_lines(iterable(str)): A file handle to the hpo phenotypes file Returns: hpo_terms(dict): A dictionary with hpo_ids as keys and terms as v...
def from_handle(fh, stream_default='fasta'): """ Look up the BioPython file type corresponding to a file-like object. For stdin, stdout, and stderr, ``stream_default`` is used. """ if fh in (sys.stdin, sys.stdout, sys.stderr): return stream_default return from_filename(fh.name)
def function[from_handle, parameter[fh, stream_default]]: constant[ Look up the BioPython file type corresponding to a file-like object. For stdin, stdout, and stderr, ``stream_default`` is used. ] if compare[name[fh] in tuple[[<ast.Attribute object at 0x7da1b1a2b460>, <ast.Attribute object...
keyword[def] identifier[from_handle] ( identifier[fh] , identifier[stream_default] = literal[string] ): literal[string] keyword[if] identifier[fh] keyword[in] ( identifier[sys] . identifier[stdin] , identifier[sys] . identifier[stdout] , identifier[sys] . identifier[stderr] ): keyword[return] i...
def from_handle(fh, stream_default='fasta'): """ Look up the BioPython file type corresponding to a file-like object. For stdin, stdout, and stderr, ``stream_default`` is used. """ if fh in (sys.stdin, sys.stdout, sys.stderr): return stream_default # depends on [control=['if'], data=[]] ...
def check(self, key, value): """ Check whether `key` matchs the :attr:`keyword`. If so, set the :attr:`value` to `value`. Args: key (str): Key which will be matched with :attr:`keyword`. value (str): Value which will be assigned to :attr:`value` if keys ...
def function[check, parameter[self, key, value]]: constant[ Check whether `key` matchs the :attr:`keyword`. If so, set the :attr:`value` to `value`. Args: key (str): Key which will be matched with :attr:`keyword`. value (str): Value which will be assigned to :att...
keyword[def] identifier[check] ( identifier[self] , identifier[key] , identifier[value] ): literal[string] identifier[key] = identifier[key] . identifier[lower] (). identifier[strip] () keyword[try] : identifier[key] = identifier[key] . identifier[decode] ( literal[s...
def check(self, key, value): """ Check whether `key` matchs the :attr:`keyword`. If so, set the :attr:`value` to `value`. Args: key (str): Key which will be matched with :attr:`keyword`. value (str): Value which will be assigned to :attr:`value` if keys ...
def _get_site_amplification(self, sites, C): """ Compute the fourth term of the equation 1 described on paragraph : The functional form Fs in Eq. (1) represents the site amplification and it is given by FS = sj Cj , for j = 1,...,5, where sj are the coefficients to be determined ...
def function[_get_site_amplification, parameter[self, sites, C]]: constant[ Compute the fourth term of the equation 1 described on paragraph : The functional form Fs in Eq. (1) represents the site amplification and it is given by FS = sj Cj , for j = 1,...,5, where sj are the coe...
keyword[def] identifier[_get_site_amplification] ( identifier[self] , identifier[sites] , identifier[C] ): literal[string] identifier[ssa] , identifier[ssb] , identifier[ssc] , identifier[ssd] , identifier[sse] = identifier[self] . identifier[_get_site_type_dummy_variables] ( identifier[sites] ) ...
def _get_site_amplification(self, sites, C): """ Compute the fourth term of the equation 1 described on paragraph : The functional form Fs in Eq. (1) represents the site amplification and it is given by FS = sj Cj , for j = 1,...,5, where sj are the coefficients to be determined thro...
def from_phase(self, phase_name): """ Returns the result of a previous phase by its name Parameters ---------- phase_name: str The name of a previous phase Returns ------- result: Result The result of that phase Raises ...
def function[from_phase, parameter[self, phase_name]]: constant[ Returns the result of a previous phase by its name Parameters ---------- phase_name: str The name of a previous phase Returns ------- result: Result The result of th...
keyword[def] identifier[from_phase] ( identifier[self] , identifier[phase_name] ): literal[string] keyword[try] : keyword[return] identifier[self] . identifier[__result_dict] [ identifier[phase_name] ] keyword[except] identifier[KeyError] : keyword[raise] ident...
def from_phase(self, phase_name): """ Returns the result of a previous phase by its name Parameters ---------- phase_name: str The name of a previous phase Returns ------- result: Result The result of that phase Raises ...
def setTimer(self, timeout, description=None): """ Sets a timer. :param description: :param timeout: timeout in seconds :return: the timerId """ self.timerId += 1 timer = Timer(timeout, self.__timeoutHandler, (self.timerId, description)) timer.sta...
def function[setTimer, parameter[self, timeout, description]]: constant[ Sets a timer. :param description: :param timeout: timeout in seconds :return: the timerId ] <ast.AugAssign object at 0x7da1b1ecdcf0> variable[timer] assign[=] call[name[Timer], parameter...
keyword[def] identifier[setTimer] ( identifier[self] , identifier[timeout] , identifier[description] = keyword[None] ): literal[string] identifier[self] . identifier[timerId] += literal[int] identifier[timer] = identifier[Timer] ( identifier[timeout] , identifier[self] . identifier[__time...
def setTimer(self, timeout, description=None): """ Sets a timer. :param description: :param timeout: timeout in seconds :return: the timerId """ self.timerId += 1 timer = Timer(timeout, self.__timeoutHandler, (self.timerId, description)) timer.start() self.ti...
def from_iter(cls, data, name=None): """Convenience method for loading data from an iterable. Defaults to numerical indexing for x-axis. Parameters ---------- data: iterable An iterable of data (list, tuple, dict of key/val pairs) name: string, default None ...
def function[from_iter, parameter[cls, data, name]]: constant[Convenience method for loading data from an iterable. Defaults to numerical indexing for x-axis. Parameters ---------- data: iterable An iterable of data (list, tuple, dict of key/val pairs) name:...
keyword[def] identifier[from_iter] ( identifier[cls] , identifier[data] , identifier[name] = keyword[None] ): literal[string] keyword[if] keyword[not] identifier[name] : identifier[name] = literal[string] keyword[if] identifier[isinstance] ( identifier[data] ,( identifier...
def from_iter(cls, data, name=None): """Convenience method for loading data from an iterable. Defaults to numerical indexing for x-axis. Parameters ---------- data: iterable An iterable of data (list, tuple, dict of key/val pairs) name: string, default None ...
def list_zones(): ''' Displays a list of available time zones. Use this list when setting a time zone using ``timezone.set_zone`` :return: a list of time zones :rtype: list CLI Example: .. code-block:: bash salt '*' timezone.list_zones ''' ret = salt.utils.mac_utils.execu...
def function[list_zones, parameter[]]: constant[ Displays a list of available time zones. Use this list when setting a time zone using ``timezone.set_zone`` :return: a list of time zones :rtype: list CLI Example: .. code-block:: bash salt '*' timezone.list_zones ] ...
keyword[def] identifier[list_zones] (): literal[string] identifier[ret] = identifier[salt] . identifier[utils] . identifier[mac_utils] . identifier[execute_return_result] ( literal[string] ) identifier[zones] = identifier[salt] . identifier[utils] . identifier[mac_utils] . identifier[parse_return...
def list_zones(): """ Displays a list of available time zones. Use this list when setting a time zone using ``timezone.set_zone`` :return: a list of time zones :rtype: list CLI Example: .. code-block:: bash salt '*' timezone.list_zones """ ret = salt.utils.mac_utils.execu...
def _is_peer(self, keys, node_self, node_other): '''_is_peer Low-level api: Return True if node_self and node_other are considered as peer with regards to a set of keys. Parameters ---------- keys : `list` A list of keys in `{url}tagname` notation. ...
def function[_is_peer, parameter[self, keys, node_self, node_other]]: constant[_is_peer Low-level api: Return True if node_self and node_other are considered as peer with regards to a set of keys. Parameters ---------- keys : `list` A list of keys in `{url}...
keyword[def] identifier[_is_peer] ( identifier[self] , identifier[keys] , identifier[node_self] , identifier[node_other] ): literal[string] keyword[for] identifier[key] keyword[in] identifier[keys] : identifier[s] = identifier[list] ( identifier[node_self] . identifier[iterchildren...
def _is_peer(self, keys, node_self, node_other): """_is_peer Low-level api: Return True if node_self and node_other are considered as peer with regards to a set of keys. Parameters ---------- keys : `list` A list of keys in `{url}tagname` notation. nod...
def _run_blocking(self, args, input=None): """Internal API: run a blocking command with subprocess. This closes any open non-blocking dialog before running the command. Parameters ---------- args: Popen constructor arguments Command to run. input: string ...
def function[_run_blocking, parameter[self, args, input]]: constant[Internal API: run a blocking command with subprocess. This closes any open non-blocking dialog before running the command. Parameters ---------- args: Popen constructor arguments Command to run. ...
keyword[def] identifier[_run_blocking] ( identifier[self] , identifier[args] , identifier[input] = keyword[None] ): literal[string] keyword[if] identifier[self] . identifier[_process] : identifier[self] . identifier[close] () identifier[kwargs] ={} ...
def _run_blocking(self, args, input=None): """Internal API: run a blocking command with subprocess. This closes any open non-blocking dialog before running the command. Parameters ---------- args: Popen constructor arguments Command to run. input: string ...
async def scroll(self, value, mode='relative'): """Scroll the cursor in the result set to a new position according to mode . Same as :meth:`Cursor.scroll`, but move cursor on server side one by one row. If you want to move 20 rows forward scroll will make 20 queries to move cursor. Curre...
<ast.AsyncFunctionDef object at 0x7da1b1d8e920>
keyword[async] keyword[def] identifier[scroll] ( identifier[self] , identifier[value] , identifier[mode] = literal[string] ): literal[string] identifier[self] . identifier[_check_executed] () keyword[if] identifier[mode] == literal[string] : keyword[if] identifier[value] ...
async def scroll(self, value, mode='relative'): """Scroll the cursor in the result set to a new position according to mode . Same as :meth:`Cursor.scroll`, but move cursor on server side one by one row. If you want to move 20 rows forward scroll will make 20 queries to move cursor. Currently...
def get_assessments_taken_for_assessment_offered(self, assessment_offered_id): """Gets an ``AssessmentTakenList`` by the given assessment offered. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain only t...
def function[get_assessments_taken_for_assessment_offered, parameter[self, assessment_offered_id]]: constant[Gets an ``AssessmentTakenList`` by the given assessment offered. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned ...
keyword[def] identifier[get_assessments_taken_for_assessment_offered] ( identifier[self] , identifier[assessment_offered_id] ): literal[string] identifier[collection] = identifier[JSONClientValidated] ( literal[string] , identifier[collection] = literal[string] ,...
def get_assessments_taken_for_assessment_offered(self, assessment_offered_id): """Gets an ``AssessmentTakenList`` by the given assessment offered. In plenary mode, the returned list contains all known assessments taken or an error results. Otherwise, the returned list may contain only those...
def authenticate(self, login=None, password=None): ''' Authenticated this client instance. ``login`` and ``password`` default to the environment variables ``MS_LOGIN`` and ``MS_PASSWD`` respectively. :param login: Email address associated with a microsoft account :para...
def function[authenticate, parameter[self, login, password]]: constant[ Authenticated this client instance. ``login`` and ``password`` default to the environment variables ``MS_LOGIN`` and ``MS_PASSWD`` respectively. :param login: Email address associated with a microsoft acco...
keyword[def] identifier[authenticate] ( identifier[self] , identifier[login] = keyword[None] , identifier[password] = keyword[None] ): literal[string] keyword[if] identifier[login] keyword[is] keyword[None] : identifier[login] = identifier[os] . identifier[environ] . identifier[get]...
def authenticate(self, login=None, password=None): """ Authenticated this client instance. ``login`` and ``password`` default to the environment variables ``MS_LOGIN`` and ``MS_PASSWD`` respectively. :param login: Email address associated with a microsoft account :param pa...
def refill_main_wallet(self, from_address, to_address, nfees, ntokens, password, min_confirmations=6, sync=False): """ Refill the Federation wallet with tokens and fees. This keeps the federation wallet clean. Dealing with exact values simplifies the transactions. No need to calculate change. Ea...
def function[refill_main_wallet, parameter[self, from_address, to_address, nfees, ntokens, password, min_confirmations, sync]]: constant[ Refill the Federation wallet with tokens and fees. This keeps the federation wallet clean. Dealing with exact values simplifies the transactions. No need to c...
keyword[def] identifier[refill_main_wallet] ( identifier[self] , identifier[from_address] , identifier[to_address] , identifier[nfees] , identifier[ntokens] , identifier[password] , identifier[min_confirmations] = literal[int] , identifier[sync] = keyword[False] ): literal[string] identifier[path] ...
def refill_main_wallet(self, from_address, to_address, nfees, ntokens, password, min_confirmations=6, sync=False): """ Refill the Federation wallet with tokens and fees. This keeps the federation wallet clean. Dealing with exact values simplifies the transactions. No need to calculate change. Easier...
def pre_release(version): """Generates new docs, release announcements and creates a local tag.""" create_branch(version) changelog(version, write_out=True) check_call(["git", "commit", "-a", "-m", f"Preparing release {version}"]) print() print(f"{Fore.GREEN}Please push your branch to your for...
def function[pre_release, parameter[version]]: constant[Generates new docs, release announcements and creates a local tag.] call[name[create_branch], parameter[name[version]]] call[name[changelog], parameter[name[version]]] call[name[check_call], parameter[list[[<ast.Constant object at 0...
keyword[def] identifier[pre_release] ( identifier[version] ): literal[string] identifier[create_branch] ( identifier[version] ) identifier[changelog] ( identifier[version] , identifier[write_out] = keyword[True] ) identifier[check_call] ([ literal[string] , literal[string] , literal[string] , li...
def pre_release(version): """Generates new docs, release announcements and creates a local tag.""" create_branch(version) changelog(version, write_out=True) check_call(['git', 'commit', '-a', '-m', f'Preparing release {version}']) print() print(f'{Fore.GREEN}Please push your branch to your fork ...
def validateDocumentFinal(self, ctxt): """Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for v...
def function[validateDocumentFinal, parameter[self, ctxt]]: constant[Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes ...
keyword[def] identifier[validateDocumentFinal] ( identifier[self] , identifier[ctxt] ): literal[string] keyword[if] identifier[ctxt] keyword[is] keyword[None] : identifier[ctxt__o] = keyword[None] keyword[else] : identifier[ctxt__o] = identifier[ctxt] . identifier[_o] identif...
def validateDocumentFinal(self, ctxt): """Does the final step for the document validation once all the incremental validation steps have been completed basically it does the following checks described by the XML Rec Check all the IDREF/IDREFS attributes definition for valid...
def is_by_step(raw): """If the password is alphabet step by step.""" # make sure it is unicode delta = ord(raw[1]) - ord(raw[0]) for i in range(2, len(raw)): if ord(raw[i]) - ord(raw[i-1]) != delta: return False return True
def function[is_by_step, parameter[raw]]: constant[If the password is alphabet step by step.] variable[delta] assign[=] binary_operation[call[name[ord], parameter[call[name[raw]][constant[1]]]] - call[name[ord], parameter[call[name[raw]][constant[0]]]]] for taget[name[i]] in starred[call[name[ra...
keyword[def] identifier[is_by_step] ( identifier[raw] ): literal[string] identifier[delta] = identifier[ord] ( identifier[raw] [ literal[int] ])- identifier[ord] ( identifier[raw] [ literal[int] ]) keyword[for] identifier[i] keyword[in] identifier[range] ( literal[int] , identifier[len] ( ide...
def is_by_step(raw): """If the password is alphabet step by step.""" # make sure it is unicode delta = ord(raw[1]) - ord(raw[0]) for i in range(2, len(raw)): if ord(raw[i]) - ord(raw[i - 1]) != delta: return False # depends on [control=['if'], data=[]] # depends on [control=['for']...
def filter_and_normalize(data, min_counts=None, min_counts_u=None, min_cells=None, min_cells_u=None, min_shared_counts=None, min_shared_cells=None, n_top_genes=None, flavor='seurat', log=True, copy=False): """Filtering, normalization and log transform Expects n...
def function[filter_and_normalize, parameter[data, min_counts, min_counts_u, min_cells, min_cells_u, min_shared_counts, min_shared_cells, n_top_genes, flavor, log, copy]]: constant[Filtering, normalization and log transform Expects non-logarithmized data. If using logarithmized data, pass `log=False`. ...
keyword[def] identifier[filter_and_normalize] ( identifier[data] , identifier[min_counts] = keyword[None] , identifier[min_counts_u] = keyword[None] , identifier[min_cells] = keyword[None] , identifier[min_cells_u] = keyword[None] , identifier[min_shared_counts] = keyword[None] , identifier[min_shared_cells] = keywo...
def filter_and_normalize(data, min_counts=None, min_counts_u=None, min_cells=None, min_cells_u=None, min_shared_counts=None, min_shared_cells=None, n_top_genes=None, flavor='seurat', log=True, copy=False): """Filtering, normalization and log transform Expects non-logarithmized data. If using logarithmized data...
def dict(self): """The dict representation of this sentence.""" return { 'raw': self.raw, 'start_index': self.start_index, 'end_index': self.end_index, 'stripped': self.stripped, 'noun_phrases': self.noun_phrases, 'polarity': self.p...
def function[dict, parameter[self]]: constant[The dict representation of this sentence.] return[dictionary[[<ast.Constant object at 0x7da20c6e49d0>, <ast.Constant object at 0x7da20c6e6650>, <ast.Constant object at 0x7da20c6e6c20>, <ast.Constant object at 0x7da20c6e47c0>, <ast.Constant object at 0x7da20c6e67...
keyword[def] identifier[dict] ( identifier[self] ): literal[string] keyword[return] { literal[string] : identifier[self] . identifier[raw] , literal[string] : identifier[self] . identifier[start_index] , literal[string] : identifier[self] . identifier[end_index] , ...
def dict(self): """The dict representation of this sentence.""" return {'raw': self.raw, 'start_index': self.start_index, 'end_index': self.end_index, 'stripped': self.stripped, 'noun_phrases': self.noun_phrases, 'polarity': self.polarity, 'subjectivity': self.subjectivity}
def eq(a, b): """ The great missing equivalence function: Guaranteed evaluation to a single bool value. """ if a is b: return True if a is None or b is None: return True if a is None and b is None else False try: e = a == b except ValueError: return False ...
def function[eq, parameter[a, b]]: constant[ The great missing equivalence function: Guaranteed evaluation to a single bool value. ] if compare[name[a] is name[b]] begin[:] return[constant[True]] if <ast.BoolOp object at 0x7da1b0e49120> begin[:] return[<ast.IfExp object a...
keyword[def] identifier[eq] ( identifier[a] , identifier[b] ): literal[string] keyword[if] identifier[a] keyword[is] identifier[b] : keyword[return] keyword[True] keyword[if] identifier[a] keyword[is] keyword[None] keyword[or] identifier[b] keyword[is] keyword[None] : key...
def eq(a, b): """ The great missing equivalence function: Guaranteed evaluation to a single bool value. """ if a is b: return True # depends on [control=['if'], data=[]] if a is None or b is None: return True if a is None and b is None else False # depends on [control=['if'], data=...
def add_permissions(self, group_name, resource, permissions, url_prefix, auth, session, send_opts): """ Args: group_name (string): Name of group. resource (intern.resource.boss.BossResource): Identifies which data model object to operate on. permissions (list): List o...
def function[add_permissions, parameter[self, group_name, resource, permissions, url_prefix, auth, session, send_opts]]: constant[ Args: group_name (string): Name of group. resource (intern.resource.boss.BossResource): Identifies which data model object to operate on. ...
keyword[def] identifier[add_permissions] ( identifier[self] , identifier[group_name] , identifier[resource] , identifier[permissions] , identifier[url_prefix] , identifier[auth] , identifier[session] , identifier[send_opts] ): literal[string] identifier[post_data] ={ literal[string] : identifier[gr...
def add_permissions(self, group_name, resource, permissions, url_prefix, auth, session, send_opts): """ Args: group_name (string): Name of group. resource (intern.resource.boss.BossResource): Identifies which data model object to operate on. permissions (list): List of pe...
def set_keepalive(sock, after_idle_sec=1, interval_sec=3, max_fails=5): """Set TCP keepalive on an open socket. It activates after 1 second (after_idle_sec) of idleness, then sends a keepalive ping once every 3 seconds (interval_sec), and closes the connection after 5 failed ping (max_fails), or 15 sec...
def function[set_keepalive, parameter[sock, after_idle_sec, interval_sec, max_fails]]: constant[Set TCP keepalive on an open socket. It activates after 1 second (after_idle_sec) of idleness, then sends a keepalive ping once every 3 seconds (interval_sec), and closes the connection after 5 failed pi...
keyword[def] identifier[set_keepalive] ( identifier[sock] , identifier[after_idle_sec] = literal[int] , identifier[interval_sec] = literal[int] , identifier[max_fails] = literal[int] ): literal[string] keyword[if] identifier[hasattr] ( identifier[socket] , literal[string] ): identifier[sock] . id...
def set_keepalive(sock, after_idle_sec=1, interval_sec=3, max_fails=5): """Set TCP keepalive on an open socket. It activates after 1 second (after_idle_sec) of idleness, then sends a keepalive ping once every 3 seconds (interval_sec), and closes the connection after 5 failed ping (max_fails), or 15 sec...
def regex_search(self, regex: str) -> List[HistoryItem]: """Find history items which match a given regular expression :param regex: the regular expression to search for. :return: a list of history items, or an empty list if the string was not found """ regex = regex.strip() ...
def function[regex_search, parameter[self, regex]]: constant[Find history items which match a given regular expression :param regex: the regular expression to search for. :return: a list of history items, or an empty list if the string was not found ] variable[regex] assign[=] c...
keyword[def] identifier[regex_search] ( identifier[self] , identifier[regex] : identifier[str] )-> identifier[List] [ identifier[HistoryItem] ]: literal[string] identifier[regex] = identifier[regex] . identifier[strip] () keyword[if] identifier[regex] . identifier[startswith] ( literal[st...
def regex_search(self, regex: str) -> List[HistoryItem]: """Find history items which match a given regular expression :param regex: the regular expression to search for. :return: a list of history items, or an empty list if the string was not found """ regex = regex.strip() if regex...
def tensors_equal(tensor1: torch.Tensor, tensor2: torch.Tensor, tolerance: float = 1e-12) -> bool: """ A check for tensor equality (by value). We make sure that the tensors have the same shape, then check all of the entries in the tensor for equality. We additionally allow the input tensors to be list...
def function[tensors_equal, parameter[tensor1, tensor2, tolerance]]: constant[ A check for tensor equality (by value). We make sure that the tensors have the same shape, then check all of the entries in the tensor for equality. We additionally allow the input tensors to be lists or dictionaries, w...
keyword[def] identifier[tensors_equal] ( identifier[tensor1] : identifier[torch] . identifier[Tensor] , identifier[tensor2] : identifier[torch] . identifier[Tensor] , identifier[tolerance] : identifier[float] = literal[int] )-> identifier[bool] : literal[string] keyword[if] identifier[isinstance] ( i...
def tensors_equal(tensor1: torch.Tensor, tensor2: torch.Tensor, tolerance: float=1e-12) -> bool: """ A check for tensor equality (by value). We make sure that the tensors have the same shape, then check all of the entries in the tensor for equality. We additionally allow the input tensors to be lists ...
def include(module_name, *module_names): """Used by functions in package.py to have access to named modules. See the 'package_definition_python_path' config setting for more info. """ def decorated(fn): _add_decorator(fn, "include", nargs=[module_name] + list(module_names)) return fn ...
def function[include, parameter[module_name]]: constant[Used by functions in package.py to have access to named modules. See the 'package_definition_python_path' config setting for more info. ] def function[decorated, parameter[fn]]: call[name[_add_decorator], parameter[name[fn]...
keyword[def] identifier[include] ( identifier[module_name] ,* identifier[module_names] ): literal[string] keyword[def] identifier[decorated] ( identifier[fn] ): identifier[_add_decorator] ( identifier[fn] , literal[string] , identifier[nargs] =[ identifier[module_name] ]+ identifier[list] ( ident...
def include(module_name, *module_names): """Used by functions in package.py to have access to named modules. See the 'package_definition_python_path' config setting for more info. """ def decorated(fn): _add_decorator(fn, 'include', nargs=[module_name] + list(module_names)) return fn ...
def save_draft(self, target_folder=OutlookWellKnowFolderNames.DRAFTS): """ Save this message as a draft on the cloud :param target_folder: name of the drafts folder :return: Success / Failure :rtype: bool """ if self.object_id: # update message. Attachments ...
def function[save_draft, parameter[self, target_folder]]: constant[ Save this message as a draft on the cloud :param target_folder: name of the drafts folder :return: Success / Failure :rtype: bool ] if name[self].object_id begin[:] if <ast.UnaryOp object...
keyword[def] identifier[save_draft] ( identifier[self] , identifier[target_folder] = identifier[OutlookWellKnowFolderNames] . identifier[DRAFTS] ): literal[string] keyword[if] identifier[self] . identifier[object_id] : keyword[if] keyword[not] identifier[self] . identifier...
def save_draft(self, target_folder=OutlookWellKnowFolderNames.DRAFTS): """ Save this message as a draft on the cloud :param target_folder: name of the drafts folder :return: Success / Failure :rtype: bool """ if self.object_id: # update message. Attachments are NOT inclu...
def reset_logformat_timestamped(logger: logging.Logger, extraname: str = "", level: int = logging.INFO) -> None: """ Apply a simple time-stamped log format to an existing logger, and set its loglevel to either ``logging.DEBUG`` or ``logging.INF...
def function[reset_logformat_timestamped, parameter[logger, extraname, level]]: constant[ Apply a simple time-stamped log format to an existing logger, and set its loglevel to either ``logging.DEBUG`` or ``logging.INFO``. Args: logger: logger to modify extraname: additional name to ...
keyword[def] identifier[reset_logformat_timestamped] ( identifier[logger] : identifier[logging] . identifier[Logger] , identifier[extraname] : identifier[str] = literal[string] , identifier[level] : identifier[int] = identifier[logging] . identifier[INFO] )-> keyword[None] : literal[string] identifier[na...
def reset_logformat_timestamped(logger: logging.Logger, extraname: str='', level: int=logging.INFO) -> None: """ Apply a simple time-stamped log format to an existing logger, and set its loglevel to either ``logging.DEBUG`` or ``logging.INFO``. Args: logger: logger to modify extraname: ...
def to_lines(s): """ Like `str.splitlines()`, except that an empty string results in a one-element list and a trailing newline results in a trailing empty string (and all without re-implementing Python's changing line-splitting algorithm). >>> to_lines('') [''] >>> to_lines('\\n') [...
def function[to_lines, parameter[s]]: constant[ Like `str.splitlines()`, except that an empty string results in a one-element list and a trailing newline results in a trailing empty string (and all without re-implementing Python's changing line-splitting algorithm). >>> to_lines('') [''...
keyword[def] identifier[to_lines] ( identifier[s] ): literal[string] identifier[lines] = identifier[s] . identifier[splitlines] ( keyword[True] ) keyword[if] keyword[not] identifier[lines] : keyword[return] [ literal[string] ] keyword[if] identifier[lines] [- literal[int] ]. identifie...
def to_lines(s): """ Like `str.splitlines()`, except that an empty string results in a one-element list and a trailing newline results in a trailing empty string (and all without re-implementing Python's changing line-splitting algorithm). >>> to_lines('') [''] >>> to_lines('\\n') [...
def build_remap_symbols(self, name_generator, children_only=True): """ This builds the replacement table for all the defined symbols for all the children, and this scope, if the children_only argument is False. """ if not children_only: replacement = name_gen...
def function[build_remap_symbols, parameter[self, name_generator, children_only]]: constant[ This builds the replacement table for all the defined symbols for all the children, and this scope, if the children_only argument is False. ] if <ast.UnaryOp object at 0x7da20e9b0...
keyword[def] identifier[build_remap_symbols] ( identifier[self] , identifier[name_generator] , identifier[children_only] = keyword[True] ): literal[string] keyword[if] keyword[not] identifier[children_only] : identifier[replacement] = identifier[name_generator] ( identifier[skip] =(...
def build_remap_symbols(self, name_generator, children_only=True): """ This builds the replacement table for all the defined symbols for all the children, and this scope, if the children_only argument is False. """ if not children_only: replacement = name_generator(skip=s...
def refresh_token(self, client_id, client_secret, refresh_token, grant_type='refresh_token'): """Calls oauth/token endpoint with refresh token grant type Use this endpoint to refresh an access token, using the refresh token you got during authorization. Args: grant_type (str): Deno...
def function[refresh_token, parameter[self, client_id, client_secret, refresh_token, grant_type]]: constant[Calls oauth/token endpoint with refresh token grant type Use this endpoint to refresh an access token, using the refresh token you got during authorization. Args: grant_type ...
keyword[def] identifier[refresh_token] ( identifier[self] , identifier[client_id] , identifier[client_secret] , identifier[refresh_token] , identifier[grant_type] = literal[string] ): literal[string] keyword[return] identifier[self] . identifier[post] ( literal[string] . identifier[forma...
def refresh_token(self, client_id, client_secret, refresh_token, grant_type='refresh_token'): """Calls oauth/token endpoint with refresh token grant type Use this endpoint to refresh an access token, using the refresh token you got during authorization. Args: grant_type (str): Denotes ...
def _gen_3spec(op, path, xattr=False): """ Returns a Spec tuple suitable for passing to the underlying C extension. This variant is called for operations that lack an input value. :param str path: The path to fetch :param bool xattr: Whether this is an extended attribute :return: a spec suitabl...
def function[_gen_3spec, parameter[op, path, xattr]]: constant[ Returns a Spec tuple suitable for passing to the underlying C extension. This variant is called for operations that lack an input value. :param str path: The path to fetch :param bool xattr: Whether this is an extended attribute ...
keyword[def] identifier[_gen_3spec] ( identifier[op] , identifier[path] , identifier[xattr] = keyword[False] ): literal[string] identifier[flags] = literal[int] keyword[if] identifier[xattr] : identifier[flags] |= identifier[_P] . identifier[SDSPEC_F_XATTR] keyword[return] identifier...
def _gen_3spec(op, path, xattr=False): """ Returns a Spec tuple suitable for passing to the underlying C extension. This variant is called for operations that lack an input value. :param str path: The path to fetch :param bool xattr: Whether this is an extended attribute :return: a spec suitabl...
def node_from_xml(xmlfile, nodefactory=Node): """ Convert a .xml file into a Node object. :param xmlfile: a file name or file object open for reading """ root = parse(xmlfile).getroot() return node_from_elem(root, nodefactory)
def function[node_from_xml, parameter[xmlfile, nodefactory]]: constant[ Convert a .xml file into a Node object. :param xmlfile: a file name or file object open for reading ] variable[root] assign[=] call[call[name[parse], parameter[name[xmlfile]]].getroot, parameter[]] return[call[name[...
keyword[def] identifier[node_from_xml] ( identifier[xmlfile] , identifier[nodefactory] = identifier[Node] ): literal[string] identifier[root] = identifier[parse] ( identifier[xmlfile] ). identifier[getroot] () keyword[return] identifier[node_from_elem] ( identifier[root] , identifier[nodefactory] )
def node_from_xml(xmlfile, nodefactory=Node): """ Convert a .xml file into a Node object. :param xmlfile: a file name or file object open for reading """ root = parse(xmlfile).getroot() return node_from_elem(root, nodefactory)
def enable_reporting(self): """Set an input pin to report values.""" if self.mode is not INPUT: raise IOError("{0} is not an input and can therefore not report".format(self)) if self.type == ANALOG: self.reporting = True msg = bytearray([REPORT_ANALOG + self.p...
def function[enable_reporting, parameter[self]]: constant[Set an input pin to report values.] if compare[name[self].mode is_not name[INPUT]] begin[:] <ast.Raise object at 0x7da1b1e65e70> if compare[name[self].type equal[==] name[ANALOG]] begin[:] name[self].reporting assi...
keyword[def] identifier[enable_reporting] ( identifier[self] ): literal[string] keyword[if] identifier[self] . identifier[mode] keyword[is] keyword[not] identifier[INPUT] : keyword[raise] identifier[IOError] ( literal[string] . identifier[format] ( identifier[self] )) key...
def enable_reporting(self): """Set an input pin to report values.""" if self.mode is not INPUT: raise IOError('{0} is not an input and can therefore not report'.format(self)) # depends on [control=['if'], data=[]] if self.type == ANALOG: self.reporting = True msg = bytearray([REPORT...
def brier_score(observations, forecasts): """ Calculate the Brier score (BS) The Brier score (BS) scores binary forecasts $k \in \{0, 1\}$, ..math: BS(p, k) = (p_1 - k)^2, where $p_1$ is the forecast probability of $k=1$. Parameters ---------- observations, forecasts : array_...
def function[brier_score, parameter[observations, forecasts]]: constant[ Calculate the Brier score (BS) The Brier score (BS) scores binary forecasts $k \in \{0, 1\}$, ..math: BS(p, k) = (p_1 - k)^2, where $p_1$ is the forecast probability of $k=1$. Parameters ---------- o...
keyword[def] identifier[brier_score] ( identifier[observations] , identifier[forecasts] ): literal[string] identifier[machine_eps] = identifier[np] . identifier[finfo] ( identifier[float] ). identifier[eps] identifier[forecasts] = identifier[np] . identifier[asarray] ( identifier[forecasts] ) ke...
def brier_score(observations, forecasts): """ Calculate the Brier score (BS) The Brier score (BS) scores binary forecasts $k \\in \\{0, 1\\}$, ..math: BS(p, k) = (p_1 - k)^2, where $p_1$ is the forecast probability of $k=1$. Parameters ---------- observations, forecasts : arr...
def _get_secedit_value(option): ''' Helper function that looks for the passed option in the secedit data ''' secedit_data = _get_secedit_data() for _line in secedit_data: if _line.startswith(option): return _line.split('=')[1].strip() return 'Not Defined'
def function[_get_secedit_value, parameter[option]]: constant[ Helper function that looks for the passed option in the secedit data ] variable[secedit_data] assign[=] call[name[_get_secedit_data], parameter[]] for taget[name[_line]] in starred[name[secedit_data]] begin[:] ...
keyword[def] identifier[_get_secedit_value] ( identifier[option] ): literal[string] identifier[secedit_data] = identifier[_get_secedit_data] () keyword[for] identifier[_line] keyword[in] identifier[secedit_data] : keyword[if] identifier[_line] . identifier[startswith] ( identifier[option]...
def _get_secedit_value(option): """ Helper function that looks for the passed option in the secedit data """ secedit_data = _get_secedit_data() for _line in secedit_data: if _line.startswith(option): return _line.split('=')[1].strip() # depends on [control=['if'], data=[]] # de...
def metric_path(cls, project, metric): """Return a fully-qualified metric string.""" return google.api_core.path_template.expand( "projects/{project}/metrics/{metric}", project=project, metric=metric )
def function[metric_path, parameter[cls, project, metric]]: constant[Return a fully-qualified metric string.] return[call[name[google].api_core.path_template.expand, parameter[constant[projects/{project}/metrics/{metric}]]]]
keyword[def] identifier[metric_path] ( identifier[cls] , identifier[project] , identifier[metric] ): literal[string] keyword[return] identifier[google] . identifier[api_core] . identifier[path_template] . identifier[expand] ( literal[string] , identifier[project] = identifier[project] , i...
def metric_path(cls, project, metric): """Return a fully-qualified metric string.""" return google.api_core.path_template.expand('projects/{project}/metrics/{metric}', project=project, metric=metric)
def make_eventlogitem_message(message, condition='contains', negate=False, preserve_case=False): """ Create a node for EventLogItem/message :return: A IndicatorItem represented as an Element node """ document = 'EventLogItem' search = 'EventLogItem/message' content_type = 'string' c...
def function[make_eventlogitem_message, parameter[message, condition, negate, preserve_case]]: constant[ Create a node for EventLogItem/message :return: A IndicatorItem represented as an Element node ] variable[document] assign[=] constant[EventLogItem] variable[search] assign[=...
keyword[def] identifier[make_eventlogitem_message] ( identifier[message] , identifier[condition] = literal[string] , identifier[negate] = keyword[False] , identifier[preserve_case] = keyword[False] ): literal[string] identifier[document] = literal[string] identifier[search] = literal[string] id...
def make_eventlogitem_message(message, condition='contains', negate=False, preserve_case=False): """ Create a node for EventLogItem/message :return: A IndicatorItem represented as an Element node """ document = 'EventLogItem' search = 'EventLogItem/message' content_type = 'string' c...
def find_identifiers(src): """ Search for a valid identifier (DOI, ISBN, arXiv, HAL) in a given file. .. note:: This function returns the first matching identifier, that is the most likely to be relevant for this file. However, it may fail and return an identifier taken from the re...
def function[find_identifiers, parameter[src]]: constant[ Search for a valid identifier (DOI, ISBN, arXiv, HAL) in a given file. .. note:: This function returns the first matching identifier, that is the most likely to be relevant for this file. However, it may fail and return an ...
keyword[def] identifier[find_identifiers] ( identifier[src] ): literal[string] keyword[if] identifier[src] . identifier[endswith] ( literal[string] ): identifier[totext] = identifier[subprocess] . identifier[Popen] ([ literal[string] , identifier[src] , literal[string] ], identifier[stdo...
def find_identifiers(src): """ Search for a valid identifier (DOI, ISBN, arXiv, HAL) in a given file. .. note:: This function returns the first matching identifier, that is the most likely to be relevant for this file. However, it may fail and return an identifier taken from the re...
def get_sensors(): """ Detect and return a list of Sensor objects """ import sensors found_sensors = list() def get_subfeature_value(feature, subfeature_type): subfeature = chip.get_subfeature(feature, subfeature_type) if subfeature: return chip.get_value(subfeature.number) ...
def function[get_sensors, parameter[]]: constant[ Detect and return a list of Sensor objects ] import module[sensors] variable[found_sensors] assign[=] call[name[list], parameter[]] def function[get_subfeature_value, parameter[feature, subfeature_type]]: variable[subfeature] ...
keyword[def] identifier[get_sensors] (): literal[string] keyword[import] identifier[sensors] identifier[found_sensors] = identifier[list] () keyword[def] identifier[get_subfeature_value] ( identifier[feature] , identifier[subfeature_type] ): identifier[subfeature] = identifier[chip] ...
def get_sensors(): """ Detect and return a list of Sensor objects """ import sensors found_sensors = list() def get_subfeature_value(feature, subfeature_type): subfeature = chip.get_subfeature(feature, subfeature_type) if subfeature: return chip.get_value(subfeature.number) ...
def staged_rewards(self): """ Returns staged rewards based on current physical states. Stages consist of reaching, grasping, lifting, and hovering. """ reach_mult = 0.1 grasp_mult = 0.35 lift_mult = 0.5 hover_mult = 0.7 # filter out objects that ...
def function[staged_rewards, parameter[self]]: constant[ Returns staged rewards based on current physical states. Stages consist of reaching, grasping, lifting, and hovering. ] variable[reach_mult] assign[=] constant[0.1] variable[grasp_mult] assign[=] constant[0.35] ...
keyword[def] identifier[staged_rewards] ( identifier[self] ): literal[string] identifier[reach_mult] = literal[int] identifier[grasp_mult] = literal[int] identifier[lift_mult] = literal[int] identifier[hover_mult] = literal[int] identifier[names_to...
def staged_rewards(self): """ Returns staged rewards based on current physical states. Stages consist of reaching, grasping, lifting, and hovering. """ reach_mult = 0.1 grasp_mult = 0.35 lift_mult = 0.5 hover_mult = 0.7 # filter out objects that are already on the correct...
def _igam(a, x): """Left tail of incomplete Gamma function: inf. k a -x - x x e > ---------- - - k=0 | (a+k+1) """ # Compute x**a * exp(-x) / Gamma(a) ax = math.exp(a * math.log(x) - x - math.lgamma(a)) # Power series r ...
def function[_igam, parameter[a, x]]: constant[Left tail of incomplete Gamma function: inf. k a -x - x x e > ---------- - - k=0 | (a+k+1) ] variable[ax] assign[=] call[name[math].exp, parameter[binary_operation[binary_operatio...
keyword[def] identifier[_igam] ( identifier[a] , identifier[x] ): literal[string] identifier[ax] = identifier[math] . identifier[exp] ( identifier[a] * identifier[math] . identifier[log] ( identifier[x] )- identifier[x] - identifier[math] . identifier[lgamma] ( identifier[a] )) identifier[r...
def _igam(a, x): """Left tail of incomplete Gamma function: inf. k a -x - x x e > ---------- - - k=0 | (a+k+1) """ # Compute x**a * exp(-x) / Gamma(a) ax = math.exp(a * math.log(x) - x - math.lgamma(a)) # Power series r =...
def to_valueset(self, state): """ Convert to a ValueSet instance :param state: A state :return: The converted ValueSet instance """ return state.solver.VS(state.arch.bits, self.region, self.region_base_addr, self.address)
def function[to_valueset, parameter[self, state]]: constant[ Convert to a ValueSet instance :param state: A state :return: The converted ValueSet instance ] return[call[name[state].solver.VS, parameter[name[state].arch.bits, name[self].region, name[self].region_base_addr, na...
keyword[def] identifier[to_valueset] ( identifier[self] , identifier[state] ): literal[string] keyword[return] identifier[state] . identifier[solver] . identifier[VS] ( identifier[state] . identifier[arch] . identifier[bits] , identifier[self] . identifier[region] , identifier[self] . identifier[r...
def to_valueset(self, state): """ Convert to a ValueSet instance :param state: A state :return: The converted ValueSet instance """ return state.solver.VS(state.arch.bits, self.region, self.region_base_addr, self.address)
def send_unsigned_transaction(self, tx: Dict[str, any], private_key: Optional[str] = None, public_key: Optional[str] = None, retry: bool = False, block_identifier: Optional[str] = None) -> bytes: """ Send a tx using an unlocked public k...
def function[send_unsigned_transaction, parameter[self, tx, private_key, public_key, retry, block_identifier]]: constant[ Send a tx using an unlocked public key in the node or a private key. Both `public_key` and `private_key` cannot be `None` :param tx: :param private_key: ...
keyword[def] identifier[send_unsigned_transaction] ( identifier[self] , identifier[tx] : identifier[Dict] [ identifier[str] , identifier[any] ], identifier[private_key] : identifier[Optional] [ identifier[str] ]= keyword[None] , identifier[public_key] : identifier[Optional] [ identifier[str] ]= keyword[None] , ident...
def send_unsigned_transaction(self, tx: Dict[str, any], private_key: Optional[str]=None, public_key: Optional[str]=None, retry: bool=False, block_identifier: Optional[str]=None) -> bytes: """ Send a tx using an unlocked public key in the node or a private key. Both `public_key` and `private_key` can...
def predict_distributed(self, data_rdd, batch_size = -1): """ Model inference base on the given data. You need to invoke collect() to trigger those action \ as the returning result is an RDD. :param data_rdd: the data to be predict. :param batch_size: total batch size of...
def function[predict_distributed, parameter[self, data_rdd, batch_size]]: constant[ Model inference base on the given data. You need to invoke collect() to trigger those action as the returning result is an RDD. :param data_rdd: the data to be predict. :param batch_size:...
keyword[def] identifier[predict_distributed] ( identifier[self] , identifier[data_rdd] , identifier[batch_size] =- literal[int] ): literal[string] identifier[result] = identifier[callBigDlFunc] ( identifier[self] . identifier[bigdl_type] , literal[string] , identifier[self] . identifier[va...
def predict_distributed(self, data_rdd, batch_size=-1): """ Model inference base on the given data. You need to invoke collect() to trigger those action as the returning result is an RDD. :param data_rdd: the data to be predict. :param batch_size: total batch size of predict...
def get_handler(id_or_link, project=None): ''' :param id_or_link: String containing an object ID or dict containing a DXLink :type id_or_link: string or dict :param project: String project ID to use as the context if the the object is a data object :type project: string :rtype: :class:`~dxpy.bin...
def function[get_handler, parameter[id_or_link, project]]: constant[ :param id_or_link: String containing an object ID or dict containing a DXLink :type id_or_link: string or dict :param project: String project ID to use as the context if the the object is a data object :type project: string ...
keyword[def] identifier[get_handler] ( identifier[id_or_link] , identifier[project] = keyword[None] ): literal[string] keyword[try] : identifier[cls] = identifier[_guess_link_target_type] ( identifier[id_or_link] ) keyword[except] identifier[Exception] keyword[as] identifier[e] : ...
def get_handler(id_or_link, project=None): """ :param id_or_link: String containing an object ID or dict containing a DXLink :type id_or_link: string or dict :param project: String project ID to use as the context if the the object is a data object :type project: string :rtype: :class:`~dxpy.bin...