code
stringlengths
64
7.01k
docstring
stringlengths
2
15.8k
text
stringlengths
144
19.2k
#vtb def increment(version): release_version = os.environ.get("RELEASE_VERSION", None) if release_version is not None: return release_version if isinstance(version, LegacyVersion): msg = raise Exception(msg.format(version)) release_type = os....
Return an incremented version string.
### Input: Return an incremented version string. ### Response: #vtb def increment(version): release_version = os.environ.get("RELEASE_VERSION", None) if release_version is not None: return release_version if isinstance(version, LegacyVersion): msg = ...
#vtb def convert_batchnorm(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) momentum = float(attrs.get("momentum", 0.9)) eps = float(attrs.get("eps", 0.001)) bn_node = onnx.helper.make_node( "BatchNormalization", input_nodes, [name], name=name, ...
Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node.
### Input: Map MXNet's BatchNorm operator attributes to onnx's BatchNormalization operator and return the created node. ### Response: #vtb def convert_batchnorm(node, **kwargs): name, input_nodes, attrs = get_inputs(node, kwargs) momentum = float(attrs.get("momentum", 0.9)) eps = float(attrs.get...
#vtb def discover_all_plugins(self): for v in pkg_resources.iter_entry_points(): m = v.load() m.setup(self)
Load all plugins from dgit extension
### Input: Load all plugins from dgit extension ### Response: #vtb def discover_all_plugins(self): for v in pkg_resources.iter_entry_points(): m = v.load() m.setup(self)
#vtb def align_unaligned_seqs(seqs, moltype=DNA, params=None): if not params: params = {} seq_collection = SequenceCollection(seqs,MolType=moltype) int_map, int_keys = seq_collection.getIntMap() int_map = SequenceCollection(int_map,MolType=moltype) params.update({:ge...
Returns an Alignment object from seqs. seqs: SequenceCollection object, or data that can be used to build one. moltype: a MolType object. DNA, RNA, or PROTEIN. params: dict of parameters to pass in to the Muscle app controller. Result will be an Alignment object.
### Input: Returns an Alignment object from seqs. seqs: SequenceCollection object, or data that can be used to build one. moltype: a MolType object. DNA, RNA, or PROTEIN. params: dict of parameters to pass in to the Muscle app controller. Result will be an Alignment object. ### Response: #vtb def...
#vtb def dilated_attention_1d(x, hparams, attention_type="masked_dilated_1d", q_padding="VALID", kv_padding="VALID", gap_size=2): x, x_shape, is_4d = maybe_reshape_4d_to_3d(x) with tf.v...
Dilated 1d self attention.
### Input: Dilated 1d self attention. ### Response: #vtb def dilated_attention_1d(x, hparams, attention_type="masked_dilated_1d", q_padding="VALID", kv_padding="VALID", gap_size=2): x, ...
#vtb def hasDependencyRecursively(self, name, target=None, test_dependencies=False): dependencies = self.getDependenciesRecursive( target = target, test = test_dependencies ) return (name in dependencies)
Check if this module, or any of its dependencies, have a dependencies with the specified name in their dependencies, or in their targetDependencies corresponding to the specified target. Note that if recursive dependencies are not installed, this test may return a false-...
### Input: Check if this module, or any of its dependencies, have a dependencies with the specified name in their dependencies, or in their targetDependencies corresponding to the specified target. Note that if recursive dependencies are not installed, this test may ret...
#vtb def raw_conf_process_pyramid(raw_conf): return BufferedTilePyramid( raw_conf["pyramid"]["grid"], metatiling=raw_conf["pyramid"].get("metatiling", 1), pixelbuffer=raw_conf["pyramid"].get("pixelbuffer", 0) )
Loads the process pyramid of a raw configuration. Parameters ---------- raw_conf : dict Raw mapchete configuration as dictionary. Returns ------- BufferedTilePyramid
### Input: Loads the process pyramid of a raw configuration. Parameters ---------- raw_conf : dict Raw mapchete configuration as dictionary. Returns ------- BufferedTilePyramid ### Response: #vtb def raw_conf_process_pyramid(raw_conf): return BufferedTilePyramid( raw...
#vtb def tag(collector, image, artifact, **kwargs): if artifact in (None, "", NotSpecified): raise BadOption("Please specify a tag using the artifact option") if image.image_index in (None, "", NotSpecified): raise BadOption("Please specify an image with an image_index option") tag = ...
Tag an image!
### Input: Tag an image! ### Response: #vtb def tag(collector, image, artifact, **kwargs): if artifact in (None, "", NotSpecified): raise BadOption("Please specify a tag using the artifact option") if image.image_index in (None, "", NotSpecified): raise BadOption("Please specify an image...
#vtb def get(self, name, default=None): value = self.parameters.get(name) self._processed_parameters.append(name) if value is None: return default return value
Return the value of the requested parameter or `default` if None.
### Input: Return the value of the requested parameter or `default` if None. ### Response: #vtb def get(self, name, default=None): value = self.parameters.get(name) self._processed_parameters.append(name) if value is None: return default return value
#vtb def _zeropad(sig, N, axis=0): sig = np.moveaxis(sig, axis, 0) out = np.zeros((sig.shape[0] + N,) + sig.shape[1:]) out[:sig.shape[0], ...] = sig out = np.moveaxis(out, 0, axis) return out
pads with N zeros at the end of the signal, along given axis
### Input: pads with N zeros at the end of the signal, along given axis ### Response: #vtb def _zeropad(sig, N, axis=0): sig = np.moveaxis(sig, axis, 0) out = np.zeros((sig.shape[0] + N,) + sig.shape[1:]) out[:sig.shape[0], ...] = sig out = np.moveaxis(out, 0, axis) return out
#vtb def instantiate(repo, validator_name=None, filename=None, rulesfiles=None): default_validators = repo.options.get(, {}) validators = {} if validator_name is not None: if validator_name in default_validators: validators = { validator_name : default_val...
Instantiate the validation specification
### Input: Instantiate the validation specification ### Response: #vtb def instantiate(repo, validator_name=None, filename=None, rulesfiles=None): default_validators = repo.options.get(, {}) validators = {} if validator_name is not None: if validator_name in default_validators: ...
#vtb def erosion(mapfile, dilated): ll = mappyfile.find(mapfile["layers"], "name", "line") ll["status"] = "OFF" pl = mappyfile.find(mapfile["layers"], "name", "polygon") pl2 = deepcopy(pl) pl2["name"] = "newpolygon" mapfile["layers"].append(pl2) dilated = dilated.bu...
We will continue to work with the modified Mapfile If we wanted to start from scratch we could simply reread it
### Input: We will continue to work with the modified Mapfile If we wanted to start from scratch we could simply reread it ### Response: #vtb def erosion(mapfile, dilated): ll = mappyfile.find(mapfile["layers"], "name", "line") ll["status"] = "OFF" pl = mappyfile.find(mapfile["layers"], "name", ...
#vtb def set_emission_scenario_setup(self, scenario, config_dict): self.write(scenario, self._scen_file_name) config_dict["file_emissionscenario"] = self._scen_file_name config_dict = self._fix_any_backwards_emissions_scen_key_in_config(config_dict) return config_dict
Set the emissions flags correctly. Parameters ---------- scenario : :obj:`pymagicc.io.MAGICCData` Scenario to run. config_dict : dict Dictionary with current input configurations which is to be validated and updated where necessary. Returns ...
### Input: Set the emissions flags correctly. Parameters ---------- scenario : :obj:`pymagicc.io.MAGICCData` Scenario to run. config_dict : dict Dictionary with current input configurations which is to be validated and updated where necessary. ...
#vtb def _make_child_iterator(node, with_links, current_depth=0): cdp1 = current_depth + 1 if with_links: iterator = ((cdp1, x[0], x[1]) for x in node._children.items()) else: leaves = ((cdp1, x[0], x[1]) for x in node._leaves.items()) groups = ((cdp1...
Returns an iterator over a node's children. In case of using a trajectory as a run (setting 'v_crun') some sub branches that do not belong to the run are blinded out.
### Input: Returns an iterator over a node's children. In case of using a trajectory as a run (setting 'v_crun') some sub branches that do not belong to the run are blinded out. ### Response: #vtb def _make_child_iterator(node, with_links, current_depth=0): cdp1 = current_depth + 1 ...
#vtb def date_to_um_date(date): assert date.hour == 0 and date.minute == 0 and date.second == 0 return [date.year, date.month, date.day, 0, 0, 0]
Convert a date object to 'year, month, day, hour, minute, second.'
### Input: Convert a date object to 'year, month, day, hour, minute, second.' ### Response: #vtb def date_to_um_date(date): assert date.hour == 0 and date.minute == 0 and date.second == 0 return [date.year, date.month, date.day, 0, 0, 0]
#vtb def _shift2boolean(self, q_mesh_shift, is_gamma_center=False, tolerance=1e-5): if q_mesh_shift is None: shift = np.zeros(3, dtype=) else: shift = np.array(q_mesh_shift, dtype=) diffby2 = n...
Tolerance is used to judge zero/half gird shift. This value is not necessary to be changed usually.
### Input: Tolerance is used to judge zero/half gird shift. This value is not necessary to be changed usually. ### Response: #vtb def _shift2boolean(self, q_mesh_shift, is_gamma_center=False, tolerance=1e-5): if q_mesh_shift...
#vtb def next(self): while True: if not hasattr(self, "_cur_handle") or self._cur_handle is None: self._cur_handle = super(GCSRecordInputReader, self).next() if not hasattr(self, "_record_reader") or self._record_reader is None: self._record_reader = records.RecordsReader(s...
Returns the next input from this input reader, a record. Returns: The next input from this input reader in the form of a record read from an LevelDB file. Raises: StopIteration: The ordered set records has been exhausted.
### Input: Returns the next input from this input reader, a record. Returns: The next input from this input reader in the form of a record read from an LevelDB file. Raises: StopIteration: The ordered set records has been exhausted. ### Response: #vtb def next(self): while True: ...
#vtb def rpoplpush(self, src, dst): with self.pipe as pipe: f = Future() res = pipe.rpoplpush(self.redis_key(src), self.redis_key(dst)) def cb(): f.set(self.valueparse.decode(res.result)) pipe.on_execute(cb) return f
RPOP a value off of the ``src`` list and atomically LPUSH it on to the ``dst`` list. Returns the value.
### Input: RPOP a value off of the ``src`` list and atomically LPUSH it on to the ``dst`` list. Returns the value. ### Response: #vtb def rpoplpush(self, src, dst): with self.pipe as pipe: f = Future() res = pipe.rpoplpush(self.redis_key(src), self.redis_key(dst)) ...
#vtb def load_srm(filename): name = "SRMLOAD" version = 0 return Project(name, version, size_in_blocks, raw_data)
Load a Project from an ``.srm`` file. :param filename: the name of the file from which to load :rtype: :py:class:`pylsdj.Project`
### Input: Load a Project from an ``.srm`` file. :param filename: the name of the file from which to load :rtype: :py:class:`pylsdj.Project` ### Response: #vtb def load_srm(filename): name = "SRMLOAD" version = 0 return Project(name, version, size_in_blocks, raw_data)
#vtb def equiv(self, other): if self == other: return True elif (not isinstance(other, Weighting) or self.exponent != other.exponent): return False elif isinstance(other, MatrixWeighting): return other.equiv(self) elif i...
Return True if other is an equivalent weighting. Returns ------- equivalent : bool ``True`` if ``other`` is a `Weighting` instance with the same `Weighting.impl`, which yields the same result as this weighting for any input, ``False`` otherwise. This is check...
### Input: Return True if other is an equivalent weighting. Returns ------- equivalent : bool ``True`` if ``other`` is a `Weighting` instance with the same `Weighting.impl`, which yields the same result as this weighting for any input, ``False`` otherwise. T...
#vtb def __value_compare(self, target): if self.expectation == "__ANY__": return True elif self.expectation == "__DEFINED__": return True if target is not None else False elif self.expectation == "__TYPE__": return True if type(target) == self.target_...
Comparing result based on expectation if arg_type is "VALUE" Args: Anything Return: Boolean
### Input: Comparing result based on expectation if arg_type is "VALUE" Args: Anything Return: Boolean ### Response: #vtb def __value_compare(self, target): if self.expectation == "__ANY__": return True elif self.expectation == "__DEFINED__": return Tru...
#vtb def is_active(self): return bool( self._grpc_port is not None and self._event_multiplexer and self._event_multiplexer.PluginRunToTagToContent( constants.DEBUGGER_PLUGIN_NAME))
Determines whether this plugin is active. This plugin is active if any health pills information is present for any run. Returns: A boolean. Whether this plugin is active.
### Input: Determines whether this plugin is active. This plugin is active if any health pills information is present for any run. Returns: A boolean. Whether this plugin is active. ### Response: #vtb def is_active(self): return bool( self._grpc_port is not None and self._...
#vtb def writexlsx(self, path, sheetname="default"): writer = ExcelRW.UnicodeWriter(path) writer.set_active_sheet(sheetname) writer.writerow(self.fields) writer.writerows(self) writer.save()
Writes this table to an .xlsx file at the specified path. If you'd like to specify a sheetname, you may do so. If you'd like to write one workbook with different DataTables for each sheet, import the `excel` function from acrylic. You can see that code in `utils.py`. Note that...
### Input: Writes this table to an .xlsx file at the specified path. If you'd like to specify a sheetname, you may do so. If you'd like to write one workbook with different DataTables for each sheet, import the `excel` function from acrylic. You can see that code in `utils.py`. ...
#vtb def process_bind_param(self, value, dialect): bitmask = 0x00 for e in value: bitmask = bitmask | e.value return bitmask
Returns the integer value of the usage mask bitmask. This value is stored in the database. Args: value(list<enums.CryptographicUsageMask>): list of enums in the usage mask dialect(string): SQL dialect
### Input: Returns the integer value of the usage mask bitmask. This value is stored in the database. Args: value(list<enums.CryptographicUsageMask>): list of enums in the usage mask dialect(string): SQL dialect ### Response: #vtb def process_bind_param(self, value...
#vtb def list_packages(conn=None): close = False if conn is None: close = True conn = init() ret = [] data = conn.execute() for pkg in data.fetchall(): ret.append(pkg) if close: conn.close() return ret
List files for an installed package
### Input: List files for an installed package ### Response: #vtb def list_packages(conn=None): close = False if conn is None: close = True conn = init() ret = [] data = conn.execute() for pkg in data.fetchall(): ret.append(pkg) if close: conn.close() ...
#vtb def _ReadPartial(self, length): chunk = self.offset // self.chunksize chunk_offset = self.offset % self.chunksize if chunk > self.last_chunk: return "" available_to_read = min(length, self.chunksize - chunk_offset) fd = self._GetChunkForReading(chunk) fd.seek(c...
Read as much as possible, but not more than length.
### Input: Read as much as possible, but not more than length. ### Response: #vtb def _ReadPartial(self, length): chunk = self.offset // self.chunksize chunk_offset = self.offset % self.chunksize if chunk > self.last_chunk: return "" available_to_read = min(length, self.chu...
#vtb def store_atomic(self, value, ptr, ordering, align): if not isinstance(ptr.type, types.PointerType): raise TypeError("cannot store to value of type %s (%r): not a pointer" % (ptr.type, str(ptr))) if ptr.type.pointee != value.type: raise T...
Store value to pointer, with optional guaranteed alignment: *ptr = name
### Input: Store value to pointer, with optional guaranteed alignment: *ptr = name ### Response: #vtb def store_atomic(self, value, ptr, ordering, align): if not isinstance(ptr.type, types.PointerType): raise TypeError("cannot store to value of type %s (%r): not a pointer" ...
#vtb async def verify_credentials(self): _, public_key = self.srp.initialize() msg = messages.crypto_pairing({ tlv8.TLV_SEQ_NO: b, tlv8.TLV_PUBLIC_KEY: public_key}) resp = await self.protocol.send_and_receive( msg, generate_identifier=False) ...
Verify credentials with device.
### Input: Verify credentials with device. ### Response: #vtb async def verify_credentials(self): _, public_key = self.srp.initialize() msg = messages.crypto_pairing({ tlv8.TLV_SEQ_NO: b, tlv8.TLV_PUBLIC_KEY: public_key}) resp = await self.protocol.send_and_re...
#vtb def normalize_range(e, n): if e.step > 0: count = max(0, (e.stop - e.start - 1) // e.step + 1) else: count = max(0, (e.start - e.stop - 1) // -e.step + 1) if count == 0: return (0, 0, e.step) start = e.start finish = e.start + (count - 1) * e.step if start >= ...
Return the range tuple normalized for an ``n``-element object. The semantics of a range is slightly different than that of a slice. In particular, a range is similar to a list in meaning (and on Py2 it was eagerly expanded into a list). Thus we do not allow the range to generate indices that would be ...
### Input: Return the range tuple normalized for an ``n``-element object. The semantics of a range is slightly different than that of a slice. In particular, a range is similar to a list in meaning (and on Py2 it was eagerly expanded into a list). Thus we do not allow the range to generate indices th...
#vtb def _control_longitude(self): if self.lonm < 0.0: self.lonm = 360.0 + self.lonm if self.lonM < 0.0: self.lonM = 360.0 + self.lonM if self.lonm > 360.0: self.lonm = self.lonm - 360.0 if self.lonM > 360.0: self.lonM = self.lonM...
Control on longitude values
### Input: Control on longitude values ### Response: #vtb def _control_longitude(self): if self.lonm < 0.0: self.lonm = 360.0 + self.lonm if self.lonM < 0.0: self.lonM = 360.0 + self.lonM if self.lonm > 360.0: self.lonm = self.lonm - 360.0 ...
#vtb def cylinder(radius=1.0, height=1.0, sections=32, segment=None, transform=None, **kwargs): if segment is not None: segment = np.asanyarray(segment, dtype=np.float64) if segment.shape != (2, 3): raise ValueError()...
Create a mesh of a cylinder along Z centered at the origin. Parameters ---------- radius : float The radius of the cylinder height : float The height of the cylinder sections : int How many pie wedges should the cylinder have segment : (2, 3) float Endpoints of axis, ove...
### Input: Create a mesh of a cylinder along Z centered at the origin. Parameters ---------- radius : float The radius of the cylinder height : float The height of the cylinder sections : int How many pie wedges should the cylinder have segment : (2, 3) float Endpoints ...
#vtb def map_element(self, obj, name, event): canvas = self.diagram.diagram_canvas parser = XDotParser() for element in event.added: logger.debug("Mapping new element [%s] to diagram node" % element) for node_mapping in self.nodes: ct = name[:-6...
Handles mapping elements to diagram components
### Input: Handles mapping elements to diagram components ### Response: #vtb def map_element(self, obj, name, event): canvas = self.diagram.diagram_canvas parser = XDotParser() for element in event.added: logger.debug("Mapping new element [%s] to diagram node" % element)...
#vtb def _process_glsl_template(template, colors): for i in range(len(colors) - 1, -1, -1): color = colors[i] assert len(color) == 4 vec4_color = % tuple(color) template = template.replace( % i, vec4_color) return template
Replace $color_i by color #i in the GLSL template.
### Input: Replace $color_i by color #i in the GLSL template. ### Response: #vtb def _process_glsl_template(template, colors): for i in range(len(colors) - 1, -1, -1): color = colors[i] assert len(color) == 4 vec4_color = % tuple(color) template = template.replace( % i, vec4_...
#vtb def _bumpUpWeakColumns(self): weakColumns = numpy.where(self._overlapDutyCycles < self._minOverlapDutyCycles)[0] for columnIndex in weakColumns: perm = self._permanences[columnIndex].astype(realDType) maskPotential = numpy.where(self._potentialPools[columnIn...
This method increases the permanence values of synapses of columns whose activity level has been too low. Such columns are identified by having an overlap duty cycle that drops too much below those of their peers. The permanence values for such columns are increased.
### Input: This method increases the permanence values of synapses of columns whose activity level has been too low. Such columns are identified by having an overlap duty cycle that drops too much below those of their peers. The permanence values for such columns are increased. ### Response: #vtb def _bum...
#vtb def set_state(key, value, namespace=None, table_name=None, environment=None, layer=None, stage=None, shard_id=None, consistent=True, serializer=json.dumps, wait_exponential_multiplier=500, wait_exponential_max=5000, stop_max_delay=10000, ttl=None): if table_name i...
Set Lambda state value.
### Input: Set Lambda state value. ### Response: #vtb def set_state(key, value, namespace=None, table_name=None, environment=None, layer=None, stage=None, shard_id=None, consistent=True, serializer=json.dumps, wait_exponential_multiplier=500, wait_exponential_max=5000, stop_m...
#vtb def add_instance(self, inst, index=None): if index is None: self.__append_instance(inst.jobject) else: self.__insert_instance(index, inst.jobject)
Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int
### Input: Adds the specified instance to the dataset. :param inst: the Instance to add :type inst: Instance :param index: the 0-based index where to add the Instance :type index: int ### Response: #vtb def add_instance(self, inst, index=None): if index is None: ...
#vtb def add_mixl_specific_results_to_estimation_res(estimator, results_dict): prob_res = mlc.calc_choice_sequence_probs(results_dict["long_probs"], estimator.choice_vector, estimator.rows_to_mixers, ...
Stores particular items in the results dictionary that are unique to mixed logit-type models. In particular, this function calculates and adds `sequence_probs` and `expanded_sequence_probs` to the results dictionary. The `constrained_pos` object is also stored to the results_dict. Parameters ------...
### Input: Stores particular items in the results dictionary that are unique to mixed logit-type models. In particular, this function calculates and adds `sequence_probs` and `expanded_sequence_probs` to the results dictionary. The `constrained_pos` object is also stored to the results_dict. Parameter...
#vtb def measure_all(fbasename=None, log=None, ml_version=ml_version): ml_script1_file = if ml_version == : file_out = else: file_out = None ml_script1 = mlx.FilterScript(file_in=fbasename, file_out=file_out, ml_version=ml_version) compute.measure_geometry(ml_script1) com...
Measures mesh geometry, aabb and topology.
### Input: Measures mesh geometry, aabb and topology. ### Response: #vtb def measure_all(fbasename=None, log=None, ml_version=ml_version): ml_script1_file = if ml_version == : file_out = else: file_out = None ml_script1 = mlx.FilterScript(file_in=fbasename, file_out=file_out, m...
#vtb def get_fqhostname(): fqdn = None try: addrinfo = socket.getaddrinfo( socket.gethostname(), 0, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.SOL_TCP, socket.AI_CANONNAME ) for info in addrinfo: if le...
Returns the fully qualified hostname
### Input: Returns the fully qualified hostname ### Response: #vtb def get_fqhostname(): fqdn = None try: addrinfo = socket.getaddrinfo( socket.gethostname(), 0, socket.AF_UNSPEC, socket.SOCK_STREAM, socket.SOL_TCP, socket.AI_CANONNAME ) for info in ad...
#vtb def delete_events( self, project_name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): if "delete_events" not in self._inner_api_calls: self._inner_api_calls[ ...
Deletes all error events of a given project. Example: >>> from google.cloud import errorreporting_v1beta1 >>> >>> client = errorreporting_v1beta1.ErrorStatsServiceClient() >>> >>> project_name = client.project_path('[PROJECT]') >>> ...
### Input: Deletes all error events of a given project. Example: >>> from google.cloud import errorreporting_v1beta1 >>> >>> client = errorreporting_v1beta1.ErrorStatsServiceClient() >>> >>> project_name = client.project_path('[PROJECT]') ...
#vtb def size_of_varint(value): value = (value << 1) ^ (value >> 63) if value <= 0x7f: return 1 if value <= 0x3fff: return 2 if value <= 0x1fffff: return 3 if value <= 0xfffffff: return 4 if value <= 0x7ffffffff: return 5 if value <= 0x3ffffffffff...
Number of bytes needed to encode an integer in variable-length format.
### Input: Number of bytes needed to encode an integer in variable-length format. ### Response: #vtb def size_of_varint(value): value = (value << 1) ^ (value >> 63) if value <= 0x7f: return 1 if value <= 0x3fff: return 2 if value <= 0x1fffff: return 3 if value <= 0xfff...
#vtb def next_chunk(self): raise NotImplementedError("%s not implemented for %s" % (self.next_chunk.__func__.__name__, self.__class__.__name__))
Returns the chunk immediately following (and adjacent to) this one.
### Input: Returns the chunk immediately following (and adjacent to) this one. ### Response: #vtb def next_chunk(self): raise NotImplementedError("%s not implemented for %s" % (self.next_chunk.__func__.__name__, self.__class__.__name__)...
#vtb def get_cell_length(flow_model): assert flow_model.lower() in FlowModelConst.d8_lens return FlowModelConst.d8_lens.get(flow_model.lower())
Get flow direction induced cell length dict. Args: flow_model: Currently, "TauDEM", "ArcGIS", and "Whitebox" are supported.
### Input: Get flow direction induced cell length dict. Args: flow_model: Currently, "TauDEM", "ArcGIS", and "Whitebox" are supported. ### Response: #vtb def get_cell_length(flow_model): assert flow_model.lower() in FlowModelConst.d8_lens return FlowModelConst.d8_lens.get(...
#vtb def turbulent_Nunner(Re, Pr, fd, fd_smooth): r return Re*Pr*fd/8./(1 + 1.5*Re**-0.125*Pr**(-1/6.)*(Pr*fd/fd_smooth - 1.))
r'''Calculates internal convection Nusselt number for turbulent flows in pipe according to [2]_ as shown in [1]_. .. math:: Nu = \frac{RePr(f/8)}{1 + 1.5Re^{-1/8}Pr^{-1/6}[Pr(f/f_s)-1]} Parameters ---------- Re : float Reynolds number, [-] Pr : float Prandtl number, [-]...
### Input: r'''Calculates internal convection Nusselt number for turbulent flows in pipe according to [2]_ as shown in [1]_. .. math:: Nu = \frac{RePr(f/8)}{1 + 1.5Re^{-1/8}Pr^{-1/6}[Pr(f/f_s)-1]} Parameters ---------- Re : float Reynolds number, [-] Pr : float Prandtl...
#vtb def match_config(filters, device, kind, default): if device is None: return default matches = (f.value(kind, device) for f in filters if f.has_value(kind) and f.match(device)) return next(matches, default)
Matches devices against multiple :class:`DeviceFilter`s. :param list filters: device filters :param Device device: device to be mounted :param str kind: value kind :param default: default value :returns: value of the first matching filter
### Input: Matches devices against multiple :class:`DeviceFilter`s. :param list filters: device filters :param Device device: device to be mounted :param str kind: value kind :param default: default value :returns: value of the first matching filter ### Response: #vtb def match_config(filters, de...
#vtb def set_lic_text(self, doc, text): if self.has_extr_lic(doc): if not self.extr_text_set: self.extr_text_set = True if validations.validate_is_free_form_text(text): self.extr_lic(doc).text = str_from_text(text) retu...
Sets license extracted text. Raises SPDXValueError if text is not free form text. Raises OrderError if no license ID defined.
### Input: Sets license extracted text. Raises SPDXValueError if text is not free form text. Raises OrderError if no license ID defined. ### Response: #vtb def set_lic_text(self, doc, text): if self.has_extr_lic(doc): if not self.extr_text_set: self.extr_te...
#vtb def show_inputs(client, workflow): for input_ in workflow.inputs: click.echo( .format( id=input_.id, default=_format_default(client, input_.default), ) ) sys.exit(0)
Show workflow inputs and exit.
### Input: Show workflow inputs and exit. ### Response: #vtb def show_inputs(client, workflow): for input_ in workflow.inputs: click.echo( .format( id=input_.id, default=_format_default(client, input_.default), ) ) sys.exit(0)
#vtb def get_folder_contents_iter(self, uri): resource = self.get_resource_by_uri(uri) if not isinstance(resource, Folder): raise NotAFolderError(uri) folder_key = resource[] for item in self._folder_get_content_iter(folder_key): if in item: ...
Return iterator for directory contents. uri -- mediafire URI Example: for item in get_folder_contents_iter('mf:///Documents'): print(item)
### Input: Return iterator for directory contents. uri -- mediafire URI Example: for item in get_folder_contents_iter('mf:///Documents'): print(item) ### Response: #vtb def get_folder_contents_iter(self, uri): resource = self.get_resource_by_uri(uri) ...
#vtb async def create_collection(db, model_class: MongoCollectionMixin): s ``Meta`` class :param db: A database handle :type db: motor.motor_asyncio.AsyncIOMotorClient :param model_class: The model to create :type model_class: Subclass of ``Model`` mixed with ``Mong...
Creates a MongoDB collection and all the declared indices in the model's ``Meta`` class :param db: A database handle :type db: motor.motor_asyncio.AsyncIOMotorClient :param model_class: The model to create :type model_class: Subclass of ``Model`` mixed with ``MongoColle...
### Input: Creates a MongoDB collection and all the declared indices in the model's ``Meta`` class :param db: A database handle :type db: motor.motor_asyncio.AsyncIOMotorClient :param model_class: The model to create :type model_class: Subclass of ``Model`` mixed with ...
#vtb def remove_sister(self, sister=None): sisters = self.get_sisters() if len(sisters) > 0: if sister is None: sister = sisters.pop(0) return self.up.remove_child(sister)
Removes a sister node. It has the same effect as **`TreeNode.up.remove_child(sister)`** If a sister node is not supplied, the first sister will be deleted and returned. :argument sister: A node instance :return: The node removed
### Input: Removes a sister node. It has the same effect as **`TreeNode.up.remove_child(sister)`** If a sister node is not supplied, the first sister will be deleted and returned. :argument sister: A node instance :return: The node removed ### Response: #vtb def remove_siste...
#vtb def get_study_items(self): study_items = set() for rec in self.goea_results: study_items |= rec.study_items return study_items
Get all study items (e.g., geneids).
### Input: Get all study items (e.g., geneids). ### Response: #vtb def get_study_items(self): study_items = set() for rec in self.goea_results: study_items |= rec.study_items return study_items
#vtb def _save_message(self, stack, type_, message, context=None, from_merge=False): uid = uuid.uuid4().hex message[] = uid if message[]: if not self.supports_version(message[]): if self.instant: ...
Stores a message in the appropriate message stack.
### Input: Stores a message in the appropriate message stack. ### Response: #vtb def _save_message(self, stack, type_, message, context=None, from_merge=False): uid = uuid.uuid4().hex message[] = uid if message[]: if not s...
#vtb async def receive_events(self, request: HttpRequest): body = await request.read() s = self.settings() try: content = ujson.loads(body) except ValueError: return json_response({ : True, : }, status=400) ...
Events received from Facebook
### Input: Events received from Facebook ### Response: #vtb async def receive_events(self, request: HttpRequest): body = await request.read() s = self.settings() try: content = ujson.loads(body) except ValueError: return json_response({ ...
#vtb def param(name, help=""): def decorator(func): params = getattr(func, "params", []) _param = Param(name, help) params.insert(0, _param) func.params = params return func return decorator
Decorator that add a parameter to the wrapped command or function.
### Input: Decorator that add a parameter to the wrapped command or function. ### Response: #vtb def param(name, help=""): def decorator(func): params = getattr(func, "params", []) _param = Param(name, help) params.insert(0, _param) func.params = params return...
#vtb def assemble_tlg_author_filepaths(): plaintext_dir_rel = plaintext_dir = os.path.expanduser(plaintext_dir_rel) filepaths = [os.path.join(plaintext_dir, x + ) for x in TLG_INDEX] return filepaths
Reads TLG index and builds a list of absolute filepaths.
### Input: Reads TLG index and builds a list of absolute filepaths. ### Response: #vtb def assemble_tlg_author_filepaths(): plaintext_dir_rel = plaintext_dir = os.path.expanduser(plaintext_dir_rel) filepaths = [os.path.join(plaintext_dir, x + ) for x in TLG_INDEX] return filepaths
#vtb def create_crop(self, name, file_obj, x=None, x2=None, y=None, y2=None): if name not in self._registry: return file_obj.seek(0) im = Image.open(file_obj) config = self._registry[name] if x is not None and x2 and y is not None and y...
Generate Version for an Image. value has to be a serverpath relative to MEDIA_ROOT. Returns the spec for the crop that was created.
### Input: Generate Version for an Image. value has to be a serverpath relative to MEDIA_ROOT. Returns the spec for the crop that was created. ### Response: #vtb def create_crop(self, name, file_obj, x=None, x2=None, y=None, y2=None): if name not in self._registr...
#vtb def _swap_bytes(data): a, b = data[1::2], data[::2] data = bytearray().join(bytearray(x) for x in zip(a, b)) if len(b) > len(a): data += b[-1:] return bytes(data)
swaps bytes for 16 bit, leaves remaining trailing bytes alone
### Input: swaps bytes for 16 bit, leaves remaining trailing bytes alone ### Response: #vtb def _swap_bytes(data): a, b = data[1::2], data[::2] data = bytearray().join(bytearray(x) for x in zip(a, b)) if len(b) > len(a): data += b[-1:] return bytes(data)
#vtb def walk(self, start, end): s = start.path e = end.path if start.root != end.root: msg = "%r and %r are not part of the same tree." % (start, end) raise WalkError(msg) c = Walker.__calc_common(s, e) assert c[0] is start.root ...
Walk from `start` node to `end` node. Returns: (upwards, common, downwards): `upwards` is a list of nodes to go upward to. `common` top node. `downwards` is a list of nodes to go downward to. Raises: WalkError: on no common root node. >>> from anytree impor...
### Input: Walk from `start` node to `end` node. Returns: (upwards, common, downwards): `upwards` is a list of nodes to go upward to. `common` top node. `downwards` is a list of nodes to go downward to. Raises: WalkError: on no common root node. >>> from a...
#vtb def input(self, data): self.data = data self.lexer.input(data)
Set the input text data.
### Input: Set the input text data. ### Response: #vtb def input(self, data): self.data = data self.lexer.input(data)
#vtb def subprocess_run(*popenargs, input=None, timeout=None, check=False, **kwargs): if input is not None: if in kwargs: raise ValueError() kwargs[] = subprocess.PIPE with subprocess.Popen(*popenargs, **kwargs) as process: try: stdout, stderr = proces...
Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. If check i...
### Input: Run command with arguments and return a CompletedProcess instance. The returned instance will have attributes args, returncode, stdout and stderr. By default, stdout and stderr are not captured, and those attributes will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them. ...
#vtb def join_event_view(request, id): event = get_object_or_404(Event, id=id) if request.method == "POST": if not event.show_attending: return redirect("events") if "attending" in request.POST: attending = request.POST.get("attending") attending = (att...
Join event page. If a POST request, actually add or remove the attendance of the current user. Otherwise, display a page with confirmation. id: event id
### Input: Join event page. If a POST request, actually add or remove the attendance of the current user. Otherwise, display a page with confirmation. id: event id ### Response: #vtb def join_event_view(request, id): event = get_object_or_404(Event, id=id) if request.method == "POST": ...
#vtb def OnSelectReader(self, reader): SimpleSCardAppEventObserver.OnSelectReader(self, reader) self.feedbacktext.SetLabel( + repr(reader)) self.transmitbutton.Disable()
Called when a reader is selected by clicking on the reader tree control or toolbar.
### Input: Called when a reader is selected by clicking on the reader tree control or toolbar. ### Response: #vtb def OnSelectReader(self, reader): SimpleSCardAppEventObserver.OnSelectReader(self, reader) self.feedbacktext.SetLabel( + repr(reader)) self.transmitbutton.Disable(...
#vtb def fill_parameters(self, path, blocks, exclude_free_params=False, check_parameters=False): if not os.path.exists(path): raise Exception("model {} does not exist".format(path)) normal_params = sum([nn.parameters for nn in blocks], []) all_params = sum([nn.all_p...
Load parameters from file to fill all blocks sequentially. :type blocks: list of deepy.layers.Block
### Input: Load parameters from file to fill all blocks sequentially. :type blocks: list of deepy.layers.Block ### Response: #vtb def fill_parameters(self, path, blocks, exclude_free_params=False, check_parameters=False): if not os.path.exists(path): raise Exception("model {} does...
#vtb def crc16(cmd, use_byte=False): crc = 0xFFFF if hasattr(cmd, ): cmd = bytes.fromhex(cmd) for _ in cmd: c = _ & 0x00FF crc ^= c for i in range(8): if crc & 0x0001 > 0: crc >>= 1 crc ^= 0xA001 else: ...
CRC16 检验 - 启用``use_byte`` 则返回 bytes 类型. :param cmd: 无crc检验的指令 :type cmd: :param use_byte: 是否返回byte类型 :type use_byte: :return: 返回crc值 :rtype:
### Input: CRC16 检验 - 启用``use_byte`` 则返回 bytes 类型. :param cmd: 无crc检验的指令 :type cmd: :param use_byte: 是否返回byte类型 :type use_byte: :return: 返回crc值 :rtype: ### Response: #vtb def crc16(cmd, use_byte=False): crc = 0xFFFF if hasattr(cmd, ): cmd = bytes.fromhex(cmd...
#vtb def entities(self, entity_ids): url = % self.url for entity_id in entity_ids: url += % _get_path(entity_id) url = url[:-1] data = self._get(url) return data.json()
Get the default data for entities. @param entity_ids A list of entity ids either as strings or references.
### Input: Get the default data for entities. @param entity_ids A list of entity ids either as strings or references. ### Response: #vtb def entities(self, entity_ids): url = % self.url for entity_id in entity_ids: url += % _get_path(entity_id) url = ur...
#vtb def remove_dups(head): hashset = set() prev = Node() while head: if head.val in hashset: prev.next = head.next else: hashset.add(head.val) prev = head head = head.next
Time Complexity: O(N) Space Complexity: O(N)
### Input: Time Complexity: O(N) Space Complexity: O(N) ### Response: #vtb def remove_dups(head): hashset = set() prev = Node() while head: if head.val in hashset: prev.next = head.next else: hashset.add(head.val) prev = head head = head...
#vtb def select(self, comp_name, options=None): self._logger.info("select comp for block (options: %s)" % (comp_name, self._name, options)) if comp_name not in self._components: raise ValueError(" has no component (components are: %s)"\ % (self._name, comp_name,...
Select the components that will by played (with given options). `options` will be passed to :func:`.Optionable.parse_options` if the component is a subclass of :class:`Optionable`. .. Warning:: this function also setup the options (if given) of the selected component. Use :func:`cl...
### Input: Select the components that will by played (with given options). `options` will be passed to :func:`.Optionable.parse_options` if the component is a subclass of :class:`Optionable`. .. Warning:: this function also setup the options (if given) of the selected component. U...
#vtb def to_javascript_(self, table_name: str="data") -> str: try: renderer = pytablewriter.JavaScriptTableWriter data = self._build_export(renderer, table_name) return data except Exception as e: self.err(e, "Can not convert data to javascript co...
Convert the main dataframe to javascript code :param table_name: javascript variable name, defaults to "data" :param table_name: str, optional :return: a javascript constant with the data :rtype: str :example: ``ds.to_javastript_("myconst")``
### Input: Convert the main dataframe to javascript code :param table_name: javascript variable name, defaults to "data" :param table_name: str, optional :return: a javascript constant with the data :rtype: str :example: ``ds.to_javastript_("myconst")`` ### Response: #vtb def...
#vtb def rmtree (self, errors=): import shutil if errors == : ignore_errors = True onerror = None elif errors == : ignore_errors = False from .cli import warn def onerror (func, path, exc_info): warn (t rmtree...
Recursively delete this directory and its contents. The *errors* keyword specifies how errors are handled: "warn" (the default) Print a warning to standard error. "ignore" Ignore errors.
### Input: Recursively delete this directory and its contents. The *errors* keyword specifies how errors are handled: "warn" (the default) Print a warning to standard error. "ignore" Ignore errors. ### Response: #vtb def rmtree (self, errors=): import shut...
#vtb def _defer_to_worker(deliver, worker, work, *args, **kwargs): deferred = Deferred() def wrapped_work(): try: result = work(*args, **kwargs) except BaseException: f = Failure() deliver(lambda: deferred.errback(f)) else: deliver(la...
Run a task in a worker, delivering the result as a ``Deferred`` in the reactor thread.
### Input: Run a task in a worker, delivering the result as a ``Deferred`` in the reactor thread. ### Response: #vtb def _defer_to_worker(deliver, worker, work, *args, **kwargs): deferred = Deferred() def wrapped_work(): try: result = work(*args, **kwargs) except BaseExce...
#vtb def ldap_server_host_use_vrf(self, **kwargs): config = ET.Element("config") ldap_server = ET.SubElement(config, "ldap-server", xmlns="urn:brocade.com:mgmt:brocade-aaa") host = ET.SubElement(ldap_server, "host") hostname_key = ET.SubElement(host, "hostname") hostname...
Auto Generated Code
### Input: Auto Generated Code ### Response: #vtb def ldap_server_host_use_vrf(self, **kwargs): config = ET.Element("config") ldap_server = ET.SubElement(config, "ldap-server", xmlns="urn:brocade.com:mgmt:brocade-aaa") host = ET.SubElement(ldap_server, "host") hostname_key = E...
#vtb def _is_sub_intrinsic(data): return isinstance(data, dict) and len(data) == 1 and LambdaUri._FN_SUB in data
Is this input data a Fn::Sub intrinsic function Parameters ---------- data Data to check Returns ------- bool True if the data Fn::Sub intrinsic function
### Input: Is this input data a Fn::Sub intrinsic function Parameters ---------- data Data to check Returns ------- bool True if the data Fn::Sub intrinsic function ### Response: #vtb def _is_sub_intrinsic(data): return isinsta...
#vtb def parse_date_range_arguments(options: dict, default_range=) -> (datetime, datetime, list): begin, end = get_date_range_by_name(default_range) for range_name in TIME_RANGE_NAMES: if options.get(range_name): begin, end = get_date_range_by_name(range_name) if options.get(): ...
:param options: :param default_range: Default datetime range to return if no other selected :return: begin, end, [(begin1,end1), (begin2,end2), ...]
### Input: :param options: :param default_range: Default datetime range to return if no other selected :return: begin, end, [(begin1,end1), (begin2,end2), ...] ### Response: #vtb def parse_date_range_arguments(options: dict, default_range=) -> (datetime, datetime, list): begin, end = get_date_range_b...
#vtb def decode_value(stream): length = decode_length(stream) (value,) = unpack_value(">{:d}s".format(length), stream) return value
Decode the contents of a value from a serialized stream. :param stream: Source data stream :type stream: io.BytesIO :returns: Decoded value :rtype: bytes
### Input: Decode the contents of a value from a serialized stream. :param stream: Source data stream :type stream: io.BytesIO :returns: Decoded value :rtype: bytes ### Response: #vtb def decode_value(stream): length = decode_length(stream) (value,) = unpack_value(">{:d}s".format(length)...
#vtb def posterior_covariance_between_points(self, X1, X2): return self.posterior.covariance_between_points(self.kern, self.X, X1, X2)
Computes the posterior covariance between points. :param X1: some input observations :param X2: other input observations
### Input: Computes the posterior covariance between points. :param X1: some input observations :param X2: other input observations ### Response: #vtb def posterior_covariance_between_points(self, X1, X2): return self.posterior.covariance_between_points(self.kern, self.X, X1, X2)
#vtb def addView(self, viewType): if not viewType: return None view = viewType.createInstance(self, self.viewWidget()) self.addTab(view, view.windowTitle()) return view
Adds a new view of the inputed view type. :param viewType | <subclass of XView> :return <XView> || None
### Input: Adds a new view of the inputed view type. :param viewType | <subclass of XView> :return <XView> || None ### Response: #vtb def addView(self, viewType): if not viewType: return None view = viewType.createInstance(self, ...
#vtb def dump_hash_prefix_values(self): q = output = [] with self.get_cursor() as dbc: dbc.execute(q) output = [bytes(r[0]) for r in dbc.fetchall()] return output
Export all hash prefix values. Returns a list of known hash prefix values
### Input: Export all hash prefix values. Returns a list of known hash prefix values ### Response: #vtb def dump_hash_prefix_values(self): q = output = [] with self.get_cursor() as dbc: dbc.execute(q) output = [bytes(r[0]) for r in dbc.fetchall()] ...
#vtb def is_domain(value, **kwargs): try: value = validators.domain(value, **kwargs) except SyntaxError as error: raise error except Exception: return False return True
Indicate whether ``value`` is a valid domain. .. caution:: This validator does not verify that ``value`` **exists** as a domain. It merely verifies that its contents *might* exist as a domain. .. note:: This validator checks to validate that ``value`` resembles a valid domain name. I...
### Input: Indicate whether ``value`` is a valid domain. .. caution:: This validator does not verify that ``value`` **exists** as a domain. It merely verifies that its contents *might* exist as a domain. .. note:: This validator checks to validate that ``value`` resembles a valid do...
#vtb def pipe_to_process(self, payload): message = payload[] key = payload[] if not self.process_handler.is_running(key): return {: , : } self.process_handler.send_to_process(message, key) return {: , : }
Send something to stdin of a specific process.
### Input: Send something to stdin of a specific process. ### Response: #vtb def pipe_to_process(self, payload): message = payload[] key = payload[] if not self.process_handler.is_running(key): return {: , : } self.process_handler.send_to_proces...
#vtb def search(self, q=None, has_geo=False, callback=None, errback=None): if not self.data: raise ZoneException() return self._rest.search(self.zone, q, has_geo, callback, errback)
Search within a zone for specific metadata. Zone must already be loaded.
### Input: Search within a zone for specific metadata. Zone must already be loaded. ### Response: #vtb def search(self, q=None, has_geo=False, callback=None, errback=None): if not self.data: raise ZoneException() return self._rest.search(self.zone, q, has_geo, callback, errback)
#vtb def make_folium_polyline(edge, edge_color, edge_width, edge_opacity, popup_attribute=None): if not folium: raise ImportError() locations = list([(lat, lon) for lon, lat in edge[].coords]) if popup_attribute is None: popup = None else: ...
Turn a row from the gdf_edges GeoDataFrame into a folium PolyLine with attributes. Parameters ---------- edge : GeoSeries a row from the gdf_edges GeoDataFrame edge_color : string color of the edge lines edge_width : numeric width of the edge lines edge_opacity : num...
### Input: Turn a row from the gdf_edges GeoDataFrame into a folium PolyLine with attributes. Parameters ---------- edge : GeoSeries a row from the gdf_edges GeoDataFrame edge_color : string color of the edge lines edge_width : numeric width of the edge lines edge_o...
#vtb def print_vessel_errors(retdict): ERROR_RESPONSES = { "Node Manager error ": { : "You lack sufficient permissions to perform this action.", : "Did you release the resource(s) by accident?"}, : { :}, "file not found": { : "The specified file(s) could not be found.", : ...
<Purpose> Prints out any errors that occurred while performing an action on vessels, in a human readable way. Errors will be printed out in the following format: description [reason] Affected vessels: nodelist To define a new error, add the following entry to ERROR_RESPONSES in this functi...
### Input: <Purpose> Prints out any errors that occurred while performing an action on vessels, in a human readable way. Errors will be printed out in the following format: description [reason] Affected vessels: nodelist To define a new error, add the following entry to ERROR_RESPONSES in thi...
#vtb def _get_tau_vector(self, tau_mean, tau_std, imt_list): self.magnitude_limits = MAG_LIMS_KEYS[self.tau_model]["mag"] self.tau_keys = MAG_LIMS_KEYS[self.tau_model]["keys"] t_bar = {} t_std = {} for imt in imt_list: t_bar[imt] = [] t_std[imt] =...
Gets the vector of mean and variance of tau values corresponding to the specific model and returns them as dictionaries
### Input: Gets the vector of mean and variance of tau values corresponding to the specific model and returns them as dictionaries ### Response: #vtb def _get_tau_vector(self, tau_mean, tau_std, imt_list): self.magnitude_limits = MAG_LIMS_KEYS[self.tau_model]["mag"] self.tau_keys = MA...
#vtb def transform(src, dst, converter, overwrite=False, stream=True, chunksize=1024**2, **kwargs): if not overwrite: if Path(dst).exists(): raise EnvironmentError(" already exists!" % dst) with open(src, "rb") as f_input: with open(dst, "wb") as f_output: ...
A file stream transform IO utility function. :param src: original file path :param dst: destination file path :param converter: binary content converter function :param overwrite: default False, :param stream: default True, if True, use stream IO mode, chunksize has to be specified. :para...
### Input: A file stream transform IO utility function. :param src: original file path :param dst: destination file path :param converter: binary content converter function :param overwrite: default False, :param stream: default True, if True, use stream IO mode, chunksize has to be specifie...
#vtb def assign_descriptors(mol): topology.recognize(mol) descriptor.assign_valence(mol) descriptor.assign_rotatable(mol) topology.minify_ring(mol) descriptor.assign_aromatic(mol)
Throws: RuntimeError: if minify_ring failed
### Input: Throws: RuntimeError: if minify_ring failed ### Response: #vtb def assign_descriptors(mol): topology.recognize(mol) descriptor.assign_valence(mol) descriptor.assign_rotatable(mol) topology.minify_ring(mol) descriptor.assign_aromatic(mol)
#vtb def get_members(self, selector): members = [] for member in self.get_member_list(): if selector.select(member): members.append(member) return members
Returns the members that satisfy the given selector. :param selector: (:class:`~hazelcast.core.MemberSelector`), Selector to be applied to the members. :return: (List), List of members.
### Input: Returns the members that satisfy the given selector. :param selector: (:class:`~hazelcast.core.MemberSelector`), Selector to be applied to the members. :return: (List), List of members. ### Response: #vtb def get_members(self, selector): members = [] for member in ...
#vtb def get_private_key_from_wif(wif: str) -> bytes: if wif is None or wif is "": raise Exception("none wif") data = base58.b58decode(wif) if len(data) != 38 or data[0] != 0x80 or data[33] != 0x01: raise Exception("wif wrong") checksum = Digest.hash256(d...
This interface is used to decode a WIF encode ECDSA private key. :param wif: a WIF encode private key. :return: a ECDSA private key in the form of bytes.
### Input: This interface is used to decode a WIF encode ECDSA private key. :param wif: a WIF encode private key. :return: a ECDSA private key in the form of bytes. ### Response: #vtb def get_private_key_from_wif(wif: str) -> bytes: if wif is None or wif is "": raise Exce...
#vtb def filter_to_pass_and_reject(in_file, paired, out_dir=None): from bcbio.heterogeneity import bubbletree out_file = "%s-prfilter.vcf.gz" % utils.splitext_plus(in_file)[0] if out_dir: out_file = os.path.join(out_dir, os.path.basename(out_file)) if not utils.file_uptodate(out_file, in_fi...
Filter VCF to only those with a strict PASS/REJECT: somatic + germline. Removes low quality calls filtered but also labeled with REJECT.
### Input: Filter VCF to only those with a strict PASS/REJECT: somatic + germline. Removes low quality calls filtered but also labeled with REJECT. ### Response: #vtb def filter_to_pass_and_reject(in_file, paired, out_dir=None): from bcbio.heterogeneity import bubbletree out_file = "%s-prfilter.vcf....
#vtb def sitetree_tree(parser, token): tokens = token.split_contents() use_template = detect_clause(parser, , tokens) tokens_num = len(tokens) if tokens_num in (3, 5): tree_alias = parser.compile_filter(tokens[2]) return sitetree_treeNode(tree_alias, use_template) else: ...
Parses sitetree tag parameters. Two notation types are possible: 1. Two arguments: {% sitetree_tree from "mytree" %} Used to render tree for "mytree" site tree. 2. Four arguments: {% sitetree_tree from "mytree" template "sitetree/mytree.html" %} Used to ...
### Input: Parses sitetree tag parameters. Two notation types are possible: 1. Two arguments: {% sitetree_tree from "mytree" %} Used to render tree for "mytree" site tree. 2. Four arguments: {% sitetree_tree from "mytree" template "sitetree/mytree.html" %} ...
#vtb def compute_tls13_resumption_secret(self): if self.connection_end == "server": hkdf = self.prcs.hkdf elif self.connection_end == "client": hkdf = self.pwcs.hkdf rs = hkdf.derive_secret(self.tls13_master_secret, b"resumption ma...
self.handshake_messages should be ClientHello...ClientFinished.
### Input: self.handshake_messages should be ClientHello...ClientFinished. ### Response: #vtb def compute_tls13_resumption_secret(self): if self.connection_end == "server": hkdf = self.prcs.hkdf elif self.connection_end == "client": hkdf = self.pwcs.hkdf rs = h...
#vtb def init_app(self, app): app.cli.add_command(upgrader_cmd) app.extensions[] = self
Flask application initialization.
### Input: Flask application initialization. ### Response: #vtb def init_app(self, app): app.cli.add_command(upgrader_cmd) app.extensions[] = self
#vtb def express_route_connections(self): api_version = self._get_api_version() if api_version == : from .v2018_08_01.operations import ExpressRouteConnectionsOperations as OperationClass else: raise NotImplementedError("APIVersion {} is not available".format(api...
Instance depends on the API version: * 2018-08-01: :class:`ExpressRouteConnectionsOperations<azure.mgmt.network.v2018_08_01.operations.ExpressRouteConnectionsOperations>`
### Input: Instance depends on the API version: * 2018-08-01: :class:`ExpressRouteConnectionsOperations<azure.mgmt.network.v2018_08_01.operations.ExpressRouteConnectionsOperations>` ### Response: #vtb def express_route_connections(self): api_version = self._get_api_version() if ap...
#vtb def upcoming_viewings(self): upcoming_viewings = [] try: if self._data_from_search: viewings = self._data_from_search.find_all( , {: }) else: viewings = [] except Exception as e: if self._debug:...
Returns an array of upcoming viewings for a property. :return:
### Input: Returns an array of upcoming viewings for a property. :return: ### Response: #vtb def upcoming_viewings(self): upcoming_viewings = [] try: if self._data_from_search: viewings = self._data_from_search.find_all( , {: }) ...
#vtb def main(ylib: str = None, path: str = None, scope: ValidationScope = ValidationScope.all, ctype: ContentType = ContentType.config, set_id: bool = False, tree: bool = False, no_types: bool = False, digest: bool = False, validate: str = None) -> int: if ylib is None: ...
Entry-point for a validation script. Args: ylib: Name of the file with YANG library path: Colon-separated list of directories to search for YANG modules. scope: Validation scope (syntax, semantics or all). ctype: Content type of the data instance (config, nonconfig or all) ...
### Input: Entry-point for a validation script. Args: ylib: Name of the file with YANG library path: Colon-separated list of directories to search for YANG modules. scope: Validation scope (syntax, semantics or all). ctype: Content type of the data instance (config, nonconfig or a...
#vtb def queryProxy(self, query): valid_proxies = [] query_scheme = query.url().scheme() query_host = query.url().host() query_scheme_host = .format(query_scheme, query_host) proxy_servers = process_proxy_servers(self.proxy_servers) if proxy_servers: ...
Override Qt method.
### Input: Override Qt method. ### Response: #vtb def queryProxy(self, query): valid_proxies = [] query_scheme = query.url().scheme() query_host = query.url().host() query_scheme_host = .format(query_scheme, query_host) proxy_servers = process_proxy_servers(s...
#vtb def get_channel(self, name): return self._api_get(.format( urllib.parse.quote_plus(name) ))
Details about an individual channel. :param name: The channel name :type name: str
### Input: Details about an individual channel. :param name: The channel name :type name: str ### Response: #vtb def get_channel(self, name): return self._api_get(.format( urllib.parse.quote_plus(name) ))
#vtb def generatorInit(self, U0): j = 0 + 1j generators = self.dyn_generators Efd0 = zeros(len(generators)) Xgen0 = zeros((len(generators), 4)) typ1 = [g._i for g in generators if g.model == CLASSICAL] typ2 = [g._i for g in generators if g.model == FOURTH_ORDER...
Based on GeneratorInit.m from MatDyn by Stijn Cole, developed at Katholieke Universiteit Leuven. See U{http://www.esat.kuleuven.be/ electa/teaching/matdyn/} for more information. @rtype: tuple @return: Initial generator conditions.
### Input: Based on GeneratorInit.m from MatDyn by Stijn Cole, developed at Katholieke Universiteit Leuven. See U{http://www.esat.kuleuven.be/ electa/teaching/matdyn/} for more information. @rtype: tuple @return: Initial generator conditions. ### Response: #vtb def generatorInit(self,...
#vtb def _aloadstr(ins): output = _addr(ins.quad[2]) output.append() output.append() REQUIRES.add() return output
Loads a string value from a memory address.
### Input: Loads a string value from a memory address. ### Response: #vtb def _aloadstr(ins): output = _addr(ins.quad[2]) output.append() output.append() REQUIRES.add() return output
#vtb def extract(self): if not self.package_request.conflict: new_slice, package_request = self.variant_slice.extract() if package_request: assert(new_slice is not self.variant_slice) scope = copy.copy(self) scope.variant_slice = n...
Extract a common dependency. Returns: A (_PackageScope, Requirement) tuple, containing the new scope copy with the extraction, and the extracted package range. If no package was extracted, then (self,None) is returned.
### Input: Extract a common dependency. Returns: A (_PackageScope, Requirement) tuple, containing the new scope copy with the extraction, and the extracted package range. If no package was extracted, then (self,None) is returned. ### Response: #vtb def extract(self): ...
#vtb def dotted(self): v = str(self.geoid.tract).zfill(6) return v[0:4] + + v[4:]
Return just the tract number, excluding the state and county, in the dotted format
### Input: Return just the tract number, excluding the state and county, in the dotted format ### Response: #vtb def dotted(self): v = str(self.geoid.tract).zfill(6) return v[0:4] + + v[4:]