text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _searchservices(device, name=None, uuid=None, uuidbad=None):
"""
Searches the given IOBluetoothDevice using the specified parameters.
Returns an empty list if the device has no services.
uuid should be IOBluetoothSDPUUID object.
"""
if not isinstance(device, _IOBluetooth.IOBluetoothDevice):... | 0.00304 |
def read(self, bounds=None, window=None, masked=False):
""" Performs a boundless read against the underlying array source
Parameters
----------
bounds: bounding box
in w, s, e, n order, iterable, optional
window: rasterio-style window, optional
bounds OR ... | 0.001715 |
def quantile(self, qs, interpolation='linear', axis=0):
"""
compute the quantiles of the
Parameters
----------
qs: a scalar or list of the quantiles to be computed
interpolation: type of interpolation, default 'linear'
axis: axis to compute, default 0
Re... | 0.000761 |
def runInParallel(*fns):
"""
Runs multiple processes in parallel.
:type: fns: def
"""
proc = []
for fn in fns:
p = Process(target=fn)
p.start()
proc.append(p)
for p in proc:
p.join() | 0.006969 |
def predicate(self, *args, **kwargs):
"""the default predicate for Support Classifiers invokes any derivied
_predicate function, trapping any exceptions raised in the process. We
are obligated to catch these exceptions to give subsequent rules the
opportunity to act. An error during th... | 0.002628 |
def with_defaults(method, nparams, defaults=None):
"""Call method with nparams positional parameters, all non-specified defaults are passed None.
:method: the method to call
:nparams: the number of parameters the function expects
:defaults: the default values to pass in for the last len(defaults) params
"""
... | 0.013605 |
def history_bars(self, instrument, bar_count, frequency, fields, dt, skip_suspended=True,
include_now=False, adjust_type='pre', adjust_orig=None):
"""
获取历史数据
:param instrument: 合约对象
:type instrument: :class:`~Instrument`
:param int bar_count: 获取的历史数据数量
... | 0.004519 |
def node_inclusion_filter_builder(nodes: Iterable[BaseEntity]) -> NodePredicate:
"""Build a filter that only passes on nodes in the given list.
:param nodes: An iterable of BEL nodes
"""
node_set = set(nodes)
def inclusion_filter(_: BELGraph, node: BaseEntity) -> bool:
"""Pass only for a n... | 0.003968 |
def update(self, sequence):
"""
Update the set with the given iterable sequence, then return the index
of the last element inserted.
Example:
>>> oset = OrderedSet([1, 2, 3])
>>> oset.update([3, 1, 5, 1, 4])
4
>>> print(oset)
O... | 0.003091 |
def transform_incoming(self, son, collection):
"""Replace embedded documents with DBRefs.
"""
def transform_value(value):
if isinstance(value, collections.MutableMapping):
if "_id" in value and "_ns" in value:
return DBRef(value["_ns"], transform_... | 0.002677 |
def properties(self):
'''
Android Properties, extracted from `adb shell getprop`
Returns:
dict of props, for
example:
{'ro.bluetooth.dun': 'true'}
'''
props = {}
for line in self.adb_shell(['getprop']).splitlines():
m ... | 0.004515 |
def from_url(cls, url):
"""
Given a resource uri, return an instance of that cache initialized with the given
parameters. An example usage:
>>> from aiocache import Cache
>>> Cache.from_url('memory://')
<aiocache.backends.memory.SimpleMemoryCache object at 0x1081dbb00>
... | 0.003086 |
def compile_action_bound_constraints(self,
state: Sequence[tf.Tensor]) -> Dict[str, Bounds]:
'''Compiles all actions bounds for the given `state`.
Args:
state (Sequence[tf.Tensor]): The current state fluents.
Returns:
A mapping from action names to a pair of... | 0.002055 |
def _check_port(host, port, socket_type):
"""
Check if an a port is available and raise an OSError if port is not available
:returns: boolean
"""
if socket_type == "UDP":
socket_type = socket.SOCK_DGRAM
else:
socket_type = socket.SOCK_STREAM
... | 0.005789 |
def start(self, hostname=None, port=None, templates_path=None):
"""
Starts the web interface.
Args:
hostname (str, optional): host name to listen from. (Default value = None)
port (int, optional): port to listen from. (Default value = None)
templates_path (str, opt... | 0.00558 |
def make_sftp(self):
"""Make SFTP client from open transport"""
transport = self.client.get_transport()
transport.open_session()
return paramiko.SFTPClient.from_transport(transport) | 0.00939 |
def _getBasicOrbit(self, orbit=None):
"""Load a particular orbit into .data for loaded day.
Parameters
----------
orbit : int
orbit number, 1 indexed, negative indexes allowed, -1 last orbit
Note
----
A day of data must be loaded before this routine ... | 0.002567 |
def set_or_create(self, request, article, form, language):
"""
set or create a title for a particular article and language
"""
base_fields = [
'slug',
'title',
'description',
'meta_description',
'page_title',
'menu_t... | 0.00202 |
def experiments_fmri_delete(self, experiment_id):
"""Delete fMRI data object associated with given experiment.
Raises ValueError if an attempt is made to delete a read-only resource.
Parameters
----------
experiment_id : string
Unique experiment identifier
... | 0.002676 |
def read_bytes(self, addr, number):
"""Read many bytes from the specified device."""
assert self._device is not None, 'Bus must be opened before operations are made against it!'
self._select_device(addr)
return self._device.read(number) | 0.011194 |
def ball_count(cls, ball_tally, strike_tally, pitch_res):
"""
Ball/Strike counter
:param ball_tally: Ball telly
:param strike_tally: Strike telly
:param pitch_res: pitching result(Retrosheet format)
:return: ball count, strike count
"""
b, s = ball_tally, ... | 0.003082 |
def extract_paths(self, paths, *args, **kwargs):
"""
Thin method that just uses the provider
"""
return self.provider.extract_paths(paths, *args, **kwargs) | 0.010695 |
def get_structures(self, chemsys_formula_id, final=True):
"""
Get a list of Structures corresponding to a chemical system, formula,
or materials_id.
Args:
chemsys_formula_id (str): A chemical system (e.g., Li-Fe-O),
or formula (e.g., Fe2O3) or materials_id (e... | 0.002825 |
def pvTvz(self,vT,vz,R,z,gl=True,ngl=_DEFAULTNGL2,nsigma=4.):
"""
NAME:
pvTvz
PURPOSE:
calculate the marginalized (vT,vz) probability at this location (NOT normalized by the density)
INPUT:
vT - tangential velocity (can be Quantity)
vz - ... | 0.014657 |
def _access_user_info(self):
"""
Accesses the :attr:`.user_info_url`.
:returns:
:class:`.UserInfoResponse`
"""
url = self.user_info_url.format(**self.user.__dict__)
return self.access(url) | 0.008 |
def armed(HEARTBEAT):
'''return 1 if armed, 0 if not'''
from . import mavutil
if HEARTBEAT.type == mavutil.mavlink.MAV_TYPE_GCS:
self = mavutil.mavfile_global
if self.motors_armed():
return 1
return 0
if HEARTBEAT.base_mode & mavutil.mavlink.MAV_MODE_FLAG_SAFETY_ARMED... | 0.002849 |
def find_resource_id_for_component(self, component_id):
"""
Given the ID of a component, returns the parent resource ID.
If the immediate parent of the component is itself a component, this method will progress up the tree until a resource is found.
:param long component_id: The ID of ... | 0.004848 |
def _get_template(settings):
"""
Prompt user to pick template from a list.
"""
puts("\nPick a template\n")
template = None
while not template:
_list_templates(settings)
index = raw_input("\nWhich template would you like to use? [1] ")
if not index:
index = "1"... | 0.005405 |
def parse(cls, requester, entries):
"""Parse a JSON array into a list of model instances."""
result_entries = SearchableList()
for entry in entries:
result_entries.append(cls.instance.parse(requester, entry))
return result_entries | 0.007299 |
def apply_array_ufunc(func, *args, dask='forbidden'):
"""Apply a ndarray level function over ndarray objects."""
if any(isinstance(arg, dask_array_type) for arg in args):
if dask == 'forbidden':
raise ValueError('apply_ufunc encountered a dask array on an '
'argu... | 0.001024 |
def compute_coordinates(self):
""" Compute 2D coordinates of the piece. """
self._x, self._y = self.board.index_to_coordinates(self.index) | 0.012987 |
def parse_init_dat(infile):
"""Parse the main init.dat file which contains the modeling results
The first line of the file init.dat contains stuff like::
"120 easy 40 8"
The other lines look like this::
" 161 11.051 1 1guqA MUSTER"
and getting the first 1... | 0.004241 |
def _set_defaults(self):
"""
Set default values to fields. We assume that they are not yet populated
as this method is called just after creation of a new pk.
"""
for field_name in self._fields:
if field_name in self._init_fields:
continue
... | 0.004515 |
def get_parent_ps(self):
"""
Return a :class:`ParameterSet` of all Parameters in the same
:class:`phoebe.frontend.bundle.Bundle` which share the same
meta-tags (except qualifier, twig, uniquetwig)
:return: the parent :class:`ParameterSet`
"""
if self._bundle is N... | 0.00998 |
def _run_and_measure(self, quil_program, qubits, trials, random_seed) -> np.ndarray:
"""
Run a Forest ``run_and_measure`` job.
Users should use :py:func:`WavefunctionSimulator.run_and_measure` instead of calling
this directly.
"""
payload = run_and_measure_payload(quil_p... | 0.0125 |
def majmin(reference_labels, estimated_labels):
"""Compare chords along major-minor rules. Chords with qualities outside
Major/minor/no-chord are ignored.
Examples
--------
>>> (ref_intervals,
... ref_labels) = mir_eval.io.load_labeled_intervals('ref.lab')
>>> (est_intervals,
... est_... | 0.000373 |
def without_property_validation(input_function):
''' Turn off property validation during update callbacks
Example:
.. code-block:: python
@without_property_validation
def update(attr, old, new):
# do things without validation
See Also:
:class:`~boke... | 0.003578 |
def csv(self, path, schema=None, sep=None, encoding=None, quote=None, escape=None,
comment=None, header=None, inferSchema=None, ignoreLeadingWhiteSpace=None,
ignoreTrailingWhiteSpace=None, nullValue=None, nanValue=None, positiveInf=None,
negativeInf=None, dateFormat=None, timestampFo... | 0.008759 |
def geo_haystack(self, name, bucket_size):
""" Create a Haystack index. See:
http://www.mongodb.org/display/DOCS/Geospatial+Haystack+Indexing
:param name: Name of the indexed column
:param bucket_size: Size of the haystack buckets (see mongo docs)
"""
self.c... | 0.004762 |
def download(self, paths, tool, language):
"""Download subtitles via a number of tools."""
if tool not in self.available:
fatal('{!r} is not installed'.format(tool))
try:
from . import plugins
downloader = plugins.__getattribute__(tool)
except Attrib... | 0.003534 |
def end_stream(self, stream_id):
"""
Close the given stream locally.
This may block until the underlying transport becomes writable, or
other coroutines release the wlock on this stream.
:param stream_id: Which stream to close.
"""
with (yield from self._get_str... | 0.004376 |
def set_children(self, value, defined):
"""Set the children of the object."""
self.children = value
self.children_defined = defined
return self | 0.011429 |
def retry_dunder_call_accept_old_params(fn):
"""Decorate cls.__call__ method to accept old "retry" signature."""
@_utils.wraps(fn)
def new_fn(self, attempt=_unset, retry_state=None):
if retry_state is None:
from tenacity import RetryCallState
if attempt is _unset:
... | 0.001133 |
def choosePinentry():
"""
Choose a C{pinentry} that can prompt you for a secret.
@return: An argv list suitable for passing to L{ProcessEndpoint}
@raises: L{RuntimeError} if no C{pinentry} is available.
@see:
U{https://www.gnupg.org/documentation/manuals/gnupg/Common-Problems.html}
""... | 0.000792 |
def try_get_department(department_or_code):
"""
Try to take the first department code, or fall back to string as passed
"""
try:
value = take_first_department_code(department_or_code)
except AssertionError:
value = department_or_code
if value in DEPARTMENT_MAPPING:
value... | 0.002732 |
async def dump_variant(self, elem, elem_type=None, params=None, obj=None):
"""
Dumps variant type to the writer.
Supports both wrapped and raw variant.
:param elem:
:param elem_type:
:param params:
:param obj:
:return:
"""
fvalue = None
... | 0.002419 |
def reload():
"""
Reload ufw
:returns: True if ufw is successfully enabled
"""
output = subprocess.check_output(['ufw', 'reload'],
universal_newlines=True,
env={'LANG': 'en_US',
'PATH... | 0.001555 |
def clear_collection(self, *classes):
''' Clear all objects from the collections associated with the
objects in `*cls`. **use with caution!**'''
for c in classes:
self.queue.append(ClearCollectionOp(self.transaction_id, self, c))
if self.autoflush:
self.flush() | 0.028986 |
def _dict_of_funcs(self, funcs: list) -> pd.Series:
"""Return a pd.Series of functions with index derived from the function name."""
return {func.__name__: func for func in funcs} | 0.015385 |
def _repr_values(self):
"""Return values that are to be shown in repr string."""
def getattr_better(obj, field):
try:
return getattr(obj, field)
except AttributeError as e:
try:
return getattr(obj, '_' + field)
e... | 0.004464 |
def PopupGetFolder(message, title=None, default_path='', no_window=False, size=(None, None), button_color=None,
background_color=None, text_color=None, icon=DEFAULT_WINDOW_ICON, font=None, no_titlebar=False,
grab_anywhere=False, keep_on_top=False, location=(None, None), initial_fol... | 0.005508 |
def kpp(self) -> str:
"""Generate random ``KPP``.
:return: 'KPP'.
:Example:
560058652.
"""
tax_codes = [
'7700', '7800', '5000', '0100',
'0200', '0300', '0500', '0600',
'0700', '0800', '0900', '1000',
'1100', '1200', '... | 0.001286 |
def get_log_entry_ids_by_log(self, log_id):
"""Gets the list of ``LogEntry`` ``Ids`` associated with a ``Log``.
arg: log_id (osid.id.Id): ``Id`` of a ``Log``
return: (osid.id.IdList) - list of related logEntry ``Ids``
raise: NotFound - ``log_id`` is not found
raise: NullAr... | 0.002442 |
def qubo_circuit(
graph: nx.Graph,
steps: int,
beta: Sequence,
gamma: Sequence) -> Circuit:
"""
A QAOA circuit for the Quadratic Unconstrained Binary Optimization
problem (i.e. an Ising model).
Args:
graph : a networkx graph instance with optional edge and node w... | 0.00086 |
def get_asset_query_session_for_repository(self, repository_id=None):
"""Gets an asset query session for the given repository.
arg: repository_id (osid.id.Id): the ``Id`` of the repository
return: (osid.repository.AssetQuerySession) - an
``AssetQuerySession``
raise: ... | 0.003191 |
async def run(self, command, timeout=None):
"""Run command on this unit.
:param str command: The command to run
:param int timeout: Time, in seconds, to wait before command is
considered failed
:returns: A :class:`juju.action.Action` instance.
"""
action = clien... | 0.002591 |
def new_environment_check(srcpath, site_name, ckan_version):
"""
Check if a new environment or site can be created at the given path.
Returns (name, datadir, sitedir, srcdir) or raises DatacatsError
"""
docker.require_images()
workdir, name = path.split(path.abspath(path.expanduser(srcpath)))
... | 0.002789 |
def requires_token_auth(resource):
'''
Flask decorator protecting ressources using token scheme
'''
@functools.wraps(resource)
def decorated(*args, **kwargs):
''' Check provided token '''
token = flask.request.headers.get('Authorization')
user = check_token(token)
if... | 0.001637 |
def previous_calling_points(self):
"""
A list of CallingPoint objects.
This is the list of all previous calling points for the service,
including all associated services if multiple services join together
to form this service.
"""
calling_points = list()
... | 0.004494 |
def select_elements(self, json_string, expr):
"""
Return list of elements from _json_string_, matching [ http://jsonselect.org/ | JSONSelect] expression.
*DEPRECATED* JSON Select query language is outdated and not supported any more.
Use other keywords of this library to query JSON.
... | 0.004963 |
def define_association(self, rel_id, source_kind, source_keys, source_many,
source_conditional, source_phrase, target_kind,
target_keys, target_many, target_conditional,
target_phrase):
'''
Define and return an associatio... | 0.008186 |
def saveAsTable(self, name, format=None, mode=None, partitionBy=None, **options):
"""Saves the content of the :class:`DataFrame` as the specified table.
In the case the table already exists, behavior of this function depends on the
save mode, specified by the `mode` function (default to throwin... | 0.006844 |
def _parse_msg_for_mongodb(self, msgs):
'''
>>> mdbf = MongoDBForwarder('no_host', '27017', 'deadpool',
... 'chimichanga', 'logs', 'collection')
>>> log = [{u'data': {u'_': {u'file': u'log.py',
... u'fn': u'start',
... ... | 0.000937 |
def item(keys, default=''):
'''
Get one or more salt process environment variables.
Returns a dict.
keys
Either a string or a list of strings that will be used as the
keys for environment lookup.
default
If the key is not found in the environment, return this value.
... | 0.001157 |
def save(params, filename, source):
'''
Write a sequence of samples as a WAV file
Currently a 16 bit mono file
'''
writer = wave.open(filename, 'wb');
# Set the WAV file parameters, currently default values
writer.setnchannels(1)
writer.setsampwidth(2)
writer.setframerate(params.samp... | 0.004132 |
def addModel(D, models):
"""
Insert model data into a LiPD dataset
Examples of model naming:
chron0model0
chron0model1
chron1model0
Example of 'models' variable:
{
chron0model0: {
"method": {...},
"summaryTable": [...],
... | 0.00197 |
def get_field_list(self):
"""
Retrieve list of all fields currently configured
"""
list_out = []
for field in self.fields:
list_out.append(field)
return list_out | 0.008969 |
def chmod(path, mode, recursive=True):
""" alternative to os.
"""
if recursive:
cmd = 'chmod -R %s %s' % (mode, path)
else:
cmd = 'chmod %s %s' % (mode, path)
return sh(cmd) | 0.004739 |
def get_attachment(self, ticket_id, attachment_id):
""" Get attachment.
:param ticket_id: ID of ticket
:param attachment_id: ID of attachment for obtain
:returns: Attachment as dictionary with these keys:
* Transaction
* ContentType
... | 0.003033 |
def hyper_parameter_search(
self,
param_distributions,
n_iter=10,
scoring=None,
fit_params={},
n_jobs=1,
iid=True,
refit=True,
cv=None,
verbose=0,
pre_dispatch='2*njobs',
rando... | 0.002295 |
def set_to_default(section, key):
"""Set the value of the given seciton and key to default
:param section: the section of a configspec
:type section: section
:param key: a key of the section
:type key: str
:returns: None
:raises: None
"""
section[key] = section.default_values.get(ke... | 0.002976 |
def besj(self, x, n):
'''
Function BESJ calculates Bessel function of first kind of order n
Arguments:
n - an integer (>=0), the order
x - value at which the Bessel function is required
--------------------
C++ Mathematical Library
Converted from e... | 0.000847 |
def list(self):
"""
List available block devices
"""
response = self._client.raw('disk.list', {})
result = response.get()
if result.state != 'SUCCESS':
raise RuntimeError('failed to list disks: %s' % result.stderr)
if result.level != 20: # 20 is JS... | 0.003745 |
def create_default_layout(app, message='',
lexer=None, is_password=False,
reserve_space_for_menu=False,
get_prompt_tokens=None,
get_bottom_toolbar_tokens=None,
display_completions_in_columns... | 0.000282 |
def pi_version():
"""Detect the version of the Raspberry Pi. Returns either 1, 2 or
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
Raspberry Pi 2 (model B+), or not a Raspberry Pi.
https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/Platform.py
"""
if no... | 0.003591 |
def instance_norm(attrs, inputs, proto_obj):
"""Instance Normalization."""
new_attrs = translation_utils._fix_attribute_names(attrs, {'epsilon' : 'eps'})
new_attrs['eps'] = attrs.get('epsilon', 1e-5)
return 'InstanceNorm', new_attrs, inputs | 0.011719 |
def timescale_sensitivity(T, k):
"""
calculate the sensitivity matrix for timescale k given transition matrix T.
Parameters
----------
T : numpy.ndarray shape = (n, n)
Transition matrix
k : int
timescale index for timescales of descending order (k = 0 for the infinite one)
R... | 0.002964 |
def replace(self, to_replace=None, value=None, inplace=False,
limit=None, regex=False, method='pad', axis=None):
"""Replace values given in 'to_replace' with 'value'.
Wrapper around the :meth:`pandas.DataFrame.replace` method.
"""
if inplace:
self._frame.repl... | 0.003628 |
def create_marker_table(self):
"""
Create marker table if it doesn't exist.
Use a separate connection since the transaction might have to be reset.
"""
connection = self.connect()
try:
connection.execute_non_query(
""" CREATE TABLE {marker_tabl... | 0.002107 |
def iter_annotations(self):
"""Yield a tuple for each Flask handler containing annotated methods.
Each tuple contains a heading, routing rule, the view class associated
with the rule, and the annotations for the methods in that class.
"""
# Need to store a list of route, view_cl... | 0.001014 |
def generate_model_lightcurves(
log,
pathToSpectralDatabase,
pathToOutputDirectory,
pathToOutputPlotDirectory,
explosionDaysFromSettings,
extendLightCurveTail,
polyOrder
):
"""
*Generate the lightcurve plots and polynomials by extracting the data from the ... | 0.002859 |
def volshow(
data,
lighting=False,
data_min=None,
data_max=None,
max_shape=256,
tf=None,
stereo=False,
ambient_coefficient=0.5,
diffuse_coefficient=0.8,
specular_coefficient=0.5,
specular_exponent=5,
downscale=1,
level=[0.1, 0.5, 0.9],
opacity=[0.01, 0.05, 0.1],
... | 0.004857 |
def wrap_ufunc_base(name, n_in, n_out, doc):
"""Return ufunc wrapper for implementation-agnostic ufunc classes."""
ufunc = getattr(np, name)
if n_in == 1:
if n_out == 1:
def wrapper(self, out=None, **kwargs):
if out is None or isinstance(out, (type(self.elem),
... | 0.000784 |
def get_nic_capacity(driver_info, ilo_fw):
"""Gets the FRU data to see if it is NIC data
Gets the FRU data in loop from 0-255 FRU Ids
and check if the returned data is NIC data. Couldn't
find any easy way to detect if it is NIC data. We should't be
hardcoding the FRU Id.
:param driver_info: Co... | 0.000583 |
def path(self):
"""Requested path as unicode. This works a bit like the regular path
info in the WSGI environment but will always include a leading slash,
even if the URL root is accessed.
"""
raw_path = wsgi_decoding_dance(
self.environ.get("PATH_INFO") or "", self.... | 0.007481 |
def importGenome(name, batchSize = 100) :
"""Import a genome shipped with pyGeno. Most of the datawraps only contain URLs towards data provided by third parties."""
path = os.path.join(this_dir, "bootstrap_data", "genomes/" + name)
PG.importGenome(path, batchSize) | 0.029963 |
def request_to_dict(self, request):
'''
Convert Request object to a dict.
modified from scrapy.utils.reqser
'''
req_dict = {
# urls should be safe (safe_string_url)
'url': to_unicode(request.url),
'method': request.method,
'headers'... | 0.006842 |
def ungzip_data(input_data):
"""Return a string of data after gzip decoding
:param the input gziped data
:return the gzip decoded data"""
buf = StringIO(input_data)
f = gzip.GzipFile(fileobj=buf)
return f | 0.004348 |
def validate(self, data):
"""Check range between dates under keys ``from_`` and ``until``."""
if 'verb' in data and data['verb'] != self.__class__.__name__:
raise ValidationError(
# FIXME encode data
'This is not a valid OAI-PMH verb:{0}'.format(data['verb']),... | 0.002618 |
def parse_file(self, filename=None, buffer=None, fileobj=None):
"""Completely parse a file, extracting all tags."""
if filename:
self.file = GzipFile(filename, 'rb')
elif buffer:
if hasattr(buffer, 'name'):
self.filename = buffer.name
self.file... | 0.0016 |
def remove_tar_files(file_list):
"""Public function that removes temporary tar archive files in a local directory"""
for f in file_list:
if file_exists(f) and f.endswith('.tar'):
os.remove(f) | 0.009132 |
def get_gene_seqs(database_path, gene):
"""
This function takes the database path and a gene name as inputs and
returns the gene sequence contained in the file given by the gene name
"""
gene_path = database_path + "/" + gene + ".fsa"
gene_seq = ""
# Open fasta file
with open(gene_path)... | 0.004149 |
def results_path(self) -> str:
"""The path where the project results will be written"""
def possible_paths():
yield self._results_path
yield self.settings.fetch('path_results')
yield environ.configs.fetch('results_directory')
yield environ.paths.results(s... | 0.005051 |
def _getAnnotationAnalysis(self, varFile):
"""
Assembles metadata within the VCF header into a GA4GH Analysis object.
:return: protocol.Analysis
"""
header = varFile.header
analysis = protocol.Analysis()
formats = header.formats.items()
infos = header.inf... | 0.00084 |
def trimmed(self,thresh=0.1):
"""
m.trimmed(,thresh=0.1) -- Return motif with low-information flanks removed. 'thresh' is in bits.
"""
for start in range(0,self.width-1):
if self.bits[start]>=thresh: break
for stop in range(self.width,1,-1):
if self.bit... | 0.033333 |
def build_scoring_scheme( s, gap_open, gap_extend, gap1="-", gap2=None, **kwargs ):
"""
Initialize scoring scheme from a blastz style text blob, first line
specifies the bases for each row/col, subsequent lines contain the
corresponding scores. Slaw extensions allow for unusual and/or
asymmetric al... | 0.027785 |
def server_receives_message(self, *parameters):
"""Receive a message with template defined using `New Message` and
validate field values.
Message template has to be defined with `New Message` before calling
this.
Optional parameters:
- `name` the client name (default is... | 0.00524 |
def allocate_sync_ensembles(self, tolerance = 0.01, indexes = None, iteration = None):
"""!
@brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster.
@param[in] tolerance (double): Maximum error... | 0.02229 |
def __compare_vars(a1, a2, name):
"""
Check that the metadata variable names are the same as the data header variable names
:param list a1: Variable names
:param list a2: Variable names
:param str name: Sheet name
:return bool: Truth
"""
try:
a1 = [i for i in a1 if i]
a2 ... | 0.004792 |
def get_statistics_by_account(self, account_id, term_id):
"""
Returns statistics for the given account_id and term_id.
https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.department_statistics
"""
url = ("/api/v1/accounts/sis_account_id:%s/analytics/"
... | 0.004619 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.