text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _decorate(self, atype, n, o):
"""Decorates the specified object for automatic logging with acorn.
Args:
atype (str): one of the types specified in :attr:`atypes`.
varobj: object instance to decorate; no additional type checking is
performed.
"""
... | 0.00677 |
def add_conversion_step(self, converter: Converter[S, T], inplace: bool = False):
"""
Utility method to add a converter to this chain. If inplace is True, this object is modified and
None is returned. Otherwise, a copy is returned
:param converter: the converter to add
:param in... | 0.006162 |
def napalm_validate(
task: Task,
src: Optional[str] = None,
validation_source: ValidationSourceData = None,
) -> Result:
"""
Gather information with napalm and validate it:
http://napalm.readthedocs.io/en/develop/validate/index.html
Arguments:
src: file to use as validation sou... | 0.001212 |
def type_object_attrgetter(obj, attr, *defargs):
"""
This implements an improved attrgetter for type objects (i.e. classes)
that can handle class attributes that are implemented as properties on
a metaclass.
Normally `getattr` on a class with a `property` (say, "foo"), would return
the `propert... | 0.000555 |
def _handle_file_ast(self, node, scope, ctxt, stream):
"""TODO: Docstring for _handle_file_ast.
:node: TODO
:scope: TODO
:ctxt: TODO
:stream: TODO
:returns: TODO
"""
self._root = ctxt = fields.Dom(stream)
ctxt._pfp__scope = scope
self._ro... | 0.004739 |
def optionIsSet(self, name):
"""
Check whether an option with a given name exists and has been set.
:param name: the name of the option to check; can be short or long name.
:return: true if an option matching the given name exists and it has had
it's value set by the user
"""
name ... | 0.004695 |
def _validate_lambda_funcname_format(self):
'''
Checks if the lambda function name format contains only known elements
:return: True on success, ValueError raised on error
'''
try:
if self._lambda_funcname_format:
known_kwargs = dict(stage='',
... | 0.005236 |
def plot_atacseq_insert_sizes(self, bam, plot, output_csv, max_insert=1500, smallest_insert=30):
"""
Heavy inspiration from here:
https://github.com/dbrg77/ATAC/blob/master/ATAC_seq_read_length_curve_fitting.ipynb
"""
try:
import pysam
import numpy as np
... | 0.003531 |
def _get_summary_struct(self):
"""
Returns a structured description of the model, including (where relevant)
the schema of the training data, description of the training data,
training statistics, and model hyperparameters.
Returns
-------
sections : list (of lis... | 0.009336 |
def options(self, context, module_options):
'''
INJECT If set to true, this allows PowerView to work over 'stealthier' execution methods which have non-interactive contexts (e.g. WMI) (default: True)
'''
self.exec_methods = ['smbexec', 'atexec']
self.inject = True
... | 0.009646 |
def register_admin_models(admin_site):
"""Registers dynamically created preferences models for Admin interface.
:param admin.AdminSite admin_site: AdminSite object.
"""
global __MODELS_REGISTRY
prefs = get_prefs()
for app_label, prefs_items in prefs.items():
model_class = get_pref_m... | 0.005484 |
def find_orfs(fa, seqs):
"""
find orfs and see if they overlap with insertions
# seqs[id] = [gene, model, [[i-gene_pos, i-model_pos, i-length, iseq, [orfs], [introns]], ...]]
"""
faa = '%s.prodigal.faa' % (fa)
fna = '%s.prodigal.fna' % (fa)
gbk = '%s.prodigal.gbk' % (fa)
if os.path.exist... | 0.007584 |
def run_once(self):
"""Pump events to this App instance and then return.
This works in the way described in :any:`App.run` except it immediately
returns after the first :any:`update` call.
Having multiple :any:`App` instances and selectively calling runOnce on
them is a decent ... | 0.006335 |
def spawn(opts, conf):
""" Acts like twistd """
if opts.config is not None:
os.environ["CALLSIGN_CONFIG_FILE"] = opts.config
sys.argv[1:] = [
"-noy", sibpath(__file__, "callsign.tac"),
"--pidfile", conf['pidfile'],
"--logfile", conf['logfile'],
]
twistd.run() | 0.003215 |
def _sprite_file(map, sprite):
"""
Returns the relative path (from the images directory) to the original file
used when construction the sprite. This is suitable for passing to the
image_width and image_height helpers.
"""
map = StringValue(map).value
sprite_name = StringValue(sprite).value
... | 0.001477 |
def pixel_scale_angle_at_skycoord(skycoord, wcs, offset=1. * u.arcsec):
"""
Calculate the pixel scale and WCS rotation angle at the position of
a SkyCoord coordinate.
Parameters
----------
skycoord : `~astropy.coordinates.SkyCoord`
The SkyCoord coordinate.
wcs : `~astropy.wcs.WCS`
... | 0.000501 |
def substitute_ref_with_url(self, txt):
"""
In the string `txt`, replace sphinx references with
corresponding links to online docs.
"""
# Find sphinx cross-references
mi = re.finditer(r':([^:]+):`([^`]+)`', txt)
if mi:
# Iterate over match objects in ... | 0.001046 |
def findMin(arr):
"""
in comparison to argrelmax() more simple and reliable peak finder
"""
out = np.zeros(shape=arr.shape, dtype=bool)
_calcMin(arr, out)
return out | 0.005263 |
def strings_to_integers(strings: Iterable[str]) -> Iterable[int]:
"""
Convert a list of strings to a list of integers.
:param strings: a list of string
:return: a list of converted integers
.. doctest::
>>> strings_to_integers(['1', '1.0', '-0.2'])
[1, 1, 0]
"""
return str... | 0.002762 |
def log_warning(self, msg):
"""
Log a warning if ``logger`` exists.
Args:
msg: Warning to log.
Warning:
Can raise a ``RuntimeError`` if this was asked in the constructor.
"""
if self.__logger:
self.__logger.warning(msg)
if s... | 0.005141 |
def append_dist_to_stop_times(feed: "Feed", trip_stats: DataFrame) -> "Feed":
"""
Calculate and append the optional ``shape_dist_traveled`` field in
``feed.stop_times`` in terms of the distance units
``feed.dist_units``.
Need trip stats in the form output by
:func:`.trips.compute_trip_stats` for... | 0.000202 |
def find_tracker_url(ticket_url):
"""
Given http://tracker.ceph.com/issues/16673 or
tracker.ceph.com/issues/16673, return "http://tracker.ceph.com".
"""
if ticket_url.startswith('http://') or ticket_url.startswith('https://'):
o = urlparse(ticket_url)
scheme, netloc = o.scheme, o.net... | 0.002252 |
def filter_queryset(self, attrs, queryset):
"""
Filter the queryset to all instances matching the given attributes.
"""
# If this is an update, then any unprovided field should
# have it's value set based on the existing instance attribute.
if self.instance is not None:
... | 0.002766 |
def forward(self, images, features, targets=None):
"""
Arguments:
images (ImageList): images for which we want to compute the predictions
features (list[Tensor]): features computed from the images that are
used for computing the predictions. Each tensor in the lis... | 0.00661 |
def _varslist2axis(cls, fluent: 'TensorFluent', vars_list: List[str]) -> List[int]:
'''Maps the `vars_list` into a list of axis indices
corresponding to the `fluent` scope.
Args:
x: The fluent.
vars_list: The list of variables to be aggregated over.
Returns:
... | 0.004847 |
def _decode_header(auth_header, client_id, client_secret):
"""
Takes the header and tries to return an active token and decoded
payload.
:param auth_header:
:param client_id:
:param client_secret:
:return: (token, profile)
"""
try:
token = auth_header.split()[1]
paylo... | 0.000932 |
def in_reply_to(self) -> Optional[UnstructuredHeader]:
"""The ``In-Reply-To`` header."""
try:
return cast(UnstructuredHeader, self[b'in-reply-to'][0])
except (KeyError, IndexError):
return None | 0.008299 |
def _normalize_basedir(basedir=None):
'''
Takes a basedir argument as a string or a list. If the string or list is
empty, then look up the default from the 'reposdir' option in the yum
config.
Returns a list of directories.
'''
# if we are passed a string (for backward compatibility), conve... | 0.001292 |
def strip_command(self, command_string, output):
"""Strip command_string from output string."""
output_list = output.split(command_string)
return self.RESPONSE_RETURN.join(output_list) | 0.009615 |
def fit_size(min_length: int = 0, max_length: int = None,
message=None) -> Filter_T:
"""
Validate any sized object to ensure the size/length
is in a given range [min_length, max_length].
"""
def validate(value):
length = len(value) if value is not None else 0
if length ... | 0.002079 |
def execute_pubsub(self, command, *channels):
"""Executes Redis (p)subscribe/(p)unsubscribe commands.
ConnectionsPool picks separate connection for pub/sub
and uses it until explicitly closed or disconnected
(unsubscribing from all channels/patterns will leave connection
locked... | 0.002663 |
def resolve_module(module, definitions):
"""Resolve (through indirections) the program contents of a module definition.
The result is a list of program chunks."""
assert module in definitions, "No definition for module '%s'" % module
d = definitions[module]
if type(d) == dict:
if 'filename' in d:
... | 0.021739 |
def do_thaw(client, args):
"""Execute the thaw operation, pulling in an actual Vault
client if neccesary"""
vault_client = None
if args.gpg_pass_path:
vault_client = client.connect(args)
aomi.filez.thaw(vault_client, args.icefile, args)
sys.exit(0) | 0.003559 |
def _interpret_contents(contentstream, initial_shorthand=UNIT_SQUARE):
"""Interpret the PDF content stream.
The stack represents the state of the PDF graphics stack. We are only
interested in the current transformation matrix (CTM) so we only track
this object; a full implementation would need to trac... | 0.000894 |
def _connect(self):
"""Connects via SSH.
"""
ssh = self._ssh_client()
logger.debug("Connecting with %s",
', '.join('%s=%r' % (k, v if k != "password" else "***")
for k, v in iteritems(self.destination)))
ssh.connect(**self.desti... | 0.004751 |
def session_preparation(self):
"""Prepare the session after the connection has been established."""
# 0 will defer to the global delay factor
delay_factor = self.select_delay_factor(delay_factor=0)
self._test_channel_read()
self.set_base_prompt()
cmd = "{}set cli mode -pa... | 0.003717 |
def make_chunk_iter(stream, separator, limit=None, buffer_size=10 * 1024):
"""Works like :func:`make_line_iter` but accepts a separator
which divides chunks. If you want newline based processing
you should use :func:`make_line_iter` instead as it
supports arbitrary newline markers.
.. versionadded... | 0.000597 |
def remove(self, auto_confirm=False):
"""Remove paths in ``self.paths`` with confirmation (unless
``auto_confirm`` is True)."""
if not self._can_uninstall():
return
if not self.paths:
logger.info(
"Can't uninstall '%s'. No files were found to unins... | 0.001194 |
def _createGaVariantAnnotation(self):
"""
Convenience method to set the common fields in a GA VariantAnnotation
object from this variant set.
"""
ret = protocol.VariantAnnotation()
ret.created = self._creationTime
ret.variant_annotation_set_id = self.getId()
... | 0.006006 |
def close(self) -> None:
"""Closes all loaded tables."""
self.available_tables.clear()
self.zipinfo.clear()
self.block_age = 0
self.block_cache.clear()
while self.streams:
_, stream = self.streams.popitem()
stream.close() | 0.006757 |
def get_item(self, *key):
"""
The recommended way of retrieving an item by key when extending configmanager's behaviour.
Attribute and dictionary key access is configurable and may not always return items
(see PlainConfig for example), whereas this method will always return the correspon... | 0.007474 |
def get_farthest_entries(self, type_measurement):
"""!
@brief Find pair of farthest entries of the node.
@param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest entries.
@return (list) Pair of farthest entries of the no... | 0.020852 |
def to_hsl(self):
''' Return a corresponding HSL color for this RGB color.
Returns:
:class:`~bokeh.colors.rgb.RGB`
'''
from .hsl import HSL # prevent circular import
h, l, s = colorsys.rgb_to_hls(float(self.r)/255, float(self.g)/255, float(self.b)/255)
retur... | 0.011331 |
def delete(self, table_id):
""" Delete a table in Google BigQuery
Parameters
----------
table : str
Name of table to be deleted
"""
from google.api_core.exceptions import NotFound
if not self.exists(table_id):
raise NotFoundException("Tab... | 0.003003 |
def set_alt(self, i, alt, break_alt=None, change_time=True):
'''set rally point altitude(s)'''
if i < 1 or i > self.rally_count():
print("Inavlid rally point number %u" % i)
return
self.rally_points[i-1].alt = int(alt)
if (break_alt != None):
self.rall... | 0.007109 |
def prt_details(self, prt=sys.stdout):
"""Print summary of codes and groups that can be inputs to get_evcodes."""
prt.write('EVIDENCE CODES:\n')
for grp, code2nt in self.grp2code2nt.items():
prt.write(' {GROUP}:\n'.format(GROUP=grp))
for code, ntd in code2nt.items():
... | 0.009828 |
def combine_counts(
fns,
define_sample_name=None,
):
"""
Combine featureCounts output files for multiple samples.
Parameters
----------
fns : list of strings
Filenames of featureCounts output files to combine.
define_sample_name : function
A function mapping the featur... | 0.003093 |
def shorten_go_name_ptbl3(self, name, dcnt):
"""Shorten GO description for Table 3 in manuscript."""
if self._keep_this(name):
return name
name = name.replace("positive regulation of immune system process",
"+ reg. of immune sys. process")
name = n... | 0.005174 |
def writer(path):
"""
Creates a compressed file writer from for a path with a specified
compression type.
"""
filename, extension = extract_extension(path)
if extension in FILE_WRITERS:
writer_func = FILE_WRITERS[extension]
return writer_func(path)
else:
raise Runtime... | 0.002222 |
def add_event(self, name, subfolder, session):
"""
Add an event
"""
if self._similar_event_exists(subfolder):
subfolder += "_{0}".format(self.next_id(subfolder))
new_event = ProjectFileEvent(name=name, subfolder=subfolder)
session.add(new_event)
self.e... | 0.005089 |
def get_values_fix_params(self, exp, rep, tag, which='last', **kwargs):
""" this function uses get_value(..) but returns all values where the
subexperiments match the additional kwargs arguments. if alpha=1.0,
beta=0.01 is given, then only those experiment values are returned,
... | 0.012262 |
def get_parent_tags(self, rev=None):
"""
Return the tags for the parent revision (or None if no single
parent can be identified).
"""
try:
parent_rev = one(self.get_parent_revs(rev))
except Exception:
return None
return self.get_tags(parent_rev) | 0.041353 |
def output_error(msg):
"""
Prints the specified string to ``stderr``.
:param msg: the message to print
:type msg: str
"""
click.echo(click.style(msg, fg='red'), err=True) | 0.005102 |
def queryset(self, request, queryset):
"""
Return the filtered queryset based on the value provided in the query string.
source: https://docs.djangoproject.com/en/1.10/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_filter
"""
filter_args = {self._filter_arg_key: None}
if self.value() == "yes":
... | 0.028103 |
def ownership(self, ownership):
"""
A list of dictionaries in format {'party_id': 'XYZ', 'split': Decimal('0.5')}
:param ownership:
:return:
"""
error_msg = 'ownership must be a list of dictionaries'
if ownership:
if not isinstance(ownership, list):
... | 0.003185 |
def __collect_file(self, filename, keep_original=False):
"""
Move or copy single file to artifacts dir
"""
dest = self.artifacts_dir + '/' + os.path.basename(filename)
logger.debug("Collecting file: %s to %s", filename, dest)
if not filename or not os.path.exists(filename... | 0.002618 |
def sround(x, precision=0):
"""
Round a single number using default non-deterministic generator.
@param x: to round.
@param precision: decimal places to round.
"""
sr = StochasticRound(precision=precision)
return sr.round(x) | 0.011583 |
def wrap_call(self, call_cmd):
"""
"wraps" the call_cmd so it can be executed by subprocess.call (and related flavors) as "args" argument
:param call_cmd: original args like argument (string or sequence)
:return: a sequence with the original command "executed" under trickle
"""... | 0.007692 |
def bna_config_cmd_status_input_session_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
bna_config_cmd_status = ET.Element("bna_config_cmd_status")
config = bna_config_cmd_status
input = ET.SubElement(bna_config_cmd_status, "input")
se... | 0.003945 |
def dedent(text):
"""Equivalent of textwrap.dedent that ignores unindented first line.
This means it will still dedent strings like:
'''foo
is a bar
'''
For use in wrap_paragraphs.
"""
if text.startswith('\n'):
# text starts with blank line, don't ignore the first line
... | 0.00318 |
def _sigma_pi_loE(self, Tp):
"""
inclusive cross section for Tth < Tp < 2 GeV
Fit from experimental data
"""
m_p = self._m_p
m_pi = self._m_pi
Mres = 1.1883 # GeV
Gres = 0.2264 # GeV
s = 2 * m_p * (Tp + 2 * m_p) # center of mass energy
g... | 0.00186 |
def render_diagram(out_base):
"""Render a data model diagram
Included in the diagram are all classes from the model registry.
For your project, write a small script that imports all models that you would like to
have included and then calls this function.
.. note:: This function requires the 'dot'... | 0.003643 |
def set_process_type(self, value):
"""
Setter for 'process_type' field.
:param value - a new value of 'process_type' field.
"""
if value is None or not isinstance(value, str):
raise TypeError("ProcessType must be set to a String")
elif value not in Process.__p... | 0.006048 |
def calc_cagr(prices):
"""
Calculates the `CAGR (compound annual growth rate) <https://www.investopedia.com/terms/c/cagr.asp>`_ for a given price series.
Args:
* prices (pandas.Series): A Series of prices.
Returns:
* float -- cagr.
"""
start = prices.index[0]
end = prices.i... | 0.007335 |
def range(self, index, *args):
"""
Set the range of each axis, one at a time
args are of the form <start of range>,<end of range>,<interval>
APIPARAM: chxr
"""
self.data['ranges'].append('%s,%s'%(index,
','.join(map(smart_str, args))))
... | 0.011561 |
def delete_stack(name=None, poll=0, timeout=60, profile=None):
'''
Delete a stack (heat stack-delete)
name
Name of the stack
poll
Poll and report events until stack complete
timeout
Stack creation timeout in minute
profile
Profile to use
CLI Examples:
... | 0.002175 |
def report_import(self, name, filename):
"""report_import Report_Name, filename
Uploads a report template to the current user's reports
UN-DOCUMENTED CALL: This function is not considered stable.
"""
data = self._upload(filename)
return self.raw_query('report', 'import',... | 0.004926 |
def list_data(
self, previous_data=False, prompt=False, console_row=False,
console_row_to_cursor=False, console_row_from_cursor=False
):
""" Return list of strings. Where each string is fitted to windows width. Parameters are the same as
they are in :meth:`.WConsoleWindow.data` method
:return: list of str
... | 0.03139 |
def update_reportnumbers(self):
"""Handle reportnumbers. """
rep_088_fields = record_get_field_instances(self.record, '088')
for field in rep_088_fields:
subs = field_get_subfields(field)
if '9' in subs:
for val in subs['9']:
if val.sta... | 0.001671 |
def removeIterator(self, login, tableName, iterName, scopes):
"""
Parameters:
- login
- tableName
- iterName
- scopes
"""
self.send_removeIterator(login, tableName, iterName, scopes)
self.recv_removeIterator() | 0.004016 |
def cublasSsyr(handle, uplo, n, alpha, x, incx, A, lda):
"""
Rank-1 operation on real symmetric matrix.
"""
status = _libcublas.cublasSsyr_v2(handle,
_CUBLAS_FILL_MODE[uplo], n,
ctypes.byref(ctypes.c_float(alpha)),
... | 0.009804 |
def updateDisplayLabel(self, value=None):
"""Update the display label to reflect the value of the parameter."""
if value is None:
value = self.param.value()
opts = self.param.opts
if isinstance(self.widget, QtWidgets.QAbstractSpinBox):
text = asUnicode(self.widget... | 0.003752 |
def create_new_dispatch(self, dispatch):
"""
Create a new dispatch
:param dispatch:
is the new dispatch that the client wants to create
"""
self._validate_uuid(dispatch.dispatch_id)
# Create new dispatch
url = "/notification/v1/dispatch"
post_resp... | 0.003311 |
def start(self):
""" Starts the clock from 0.
Uses a separate thread to handle the timing functionalities. """
if not hasattr(self,"thread") or not self.thread.isAlive():
self.thread = threading.Thread(target=self.__run)
self.status = RUNNING
self.reset()
self.thread.start()
else:
print("Clock a... | 0.038576 |
def _get_taulny(self, C, mag):
"""
Returns the inter-event random effects coefficient (tau)
Equation 28.
"""
if mag <= 4.5:
return C["tau1"]
elif mag >= 5.5:
return C["tau2"]
else:
return C["tau2"] + (C["tau1"] - C["tau2"]) * (5... | 0.006079 |
def _simple_name(distribution):
"""Infer the original name passed into a distribution constructor.
Distributions typically follow the pattern of
with.name_scope(name) as name:
super(name=name)
so we attempt to reverse the name-scope transformation to allow
addressing of RVs by the distribution's original... | 0.009534 |
def closeEvent(self, event):
"""Closes listening threads and saves GUI data for later use.
Re-implemented from :qtdoc:`QWidget`
"""
self.acqmodel.stop_listening() # close listener threads
self.saveInputs(self.inputsFilename)
# save GUI size
settings = QtCore.QSe... | 0.004992 |
def from_file(cls, f, filename=None, includedir='', seenfiles=None):
'''Create a token stream by reading an input file
Read tokens from `f`. If an include directive ('@include "file.cfg"')
is found, read its contents as well.
The `filename` argument is used for error messages and to de... | 0.000951 |
def eigh(a, eigvec=True, rcond=None):
""" Eigenvalues and eigenvectors of symmetric matrix ``a``.
Args:
a: Two-dimensional, square Hermitian matrix/array of numbers
and/or :class:`gvar.GVar`\s. Array elements must be
real-valued if `gvar.GVar`\s are involved (i.e., symmetric
... | 0.002022 |
def revoke_permissions(self, ctype):
"""
Remove all permissions for the content type to be removed
"""
ContentType = apps.get_model('contenttypes', 'ContentType')
try:
Permission = apps.get_model('auth', 'Permission')
except LookupError:
return
... | 0.006182 |
def is_scalar(self):
"""
:return:
:rtype: bool
"""
return \
isinstance(self._element_template, Boolean) or \
isinstance(self._element_template, Float) or \
isinstance(self._element_template, Integer) or \
isinstance(self._element_t... | 0.005952 |
def snpsift(self):
"""SnpSift"""
tstart = datetime.now()
# command = 'python %s/snpsift.py -i sanity_check/checked.vcf 2>log/snpsift.log' % (scripts_dir)
# self.shell(command)
ss = snpsift.SnpSift(self.vcf_file)
ss.run()
tend = datetime.now()
execution... | 0.008798 |
def cudnnSetTensor(handle, srcDesc, srcData, value):
""""
Set all data points of a tensor to a given value : srcDest = alpha.
Parameters
----------
handle : cudnnHandle
Handle to a previously created cuDNN context.
srcDesc : cudnnTensorDescriptor
Handle to a previously initializ... | 0.00114 |
def _upsampling(lr_array, rescale, reference_shape, interp='linear'):
""" Upsample the low-resolution array to the original high-resolution grid
:param lr_array: Low-resolution array to be upsampled
:param rescale: Rescale factor for rows/columns
:param reference_shape: Original size of... | 0.006748 |
def get_pin_and_cookie_name(app):
"""Given an application object this returns a semi-stable 9 digit pin
code and a random key. The hope is that this is stable between
restarts to not make debugging particularly frustrating. If the pin
was forcefully disabled this returns `None`.
Second item in th... | 0.000734 |
def split(self):
"""
Returns a pair of CipherState objects for encrypting/decrypting transport messages.
:return: tuple (CipherState, CipherState)
"""
# Sets temp_k1, temp_k2 = HKDF(ck, b'', 2).
temp_k1, temp_k2 = self.noise_protocol.hkdf(self.ck, b'', 2)
... | 0.003255 |
def serializer_for(self, obj):
"""
Searches for a serializer for the provided object
Serializers will be searched in this order;
1-NULL serializer
2-Default serializers, like primitives, arrays, string and some default types
3-Custom registered types... | 0.003569 |
def wrap(self, message):
"""
NTM GSSwrap()
:param message: The message to be encrypted
:return: The signed and encrypted message
"""
cipher_text = _Ntlm1Session.encrypt(self, message)
signature = _Ntlm1Session.sign(self, message)
return cipher_text, signat... | 0.006192 |
def search(self, buffer, freshlen, searchwindowsize=None):
"""This searches 'buffer' for the first occurence of one of the search
strings. 'freshlen' must indicate the number of bytes at the end of
'buffer' which have not been searched before. It helps to avoid
searching the same, poss... | 0.001034 |
def _create_cell(args, cell_body):
"""Implements the pipeline cell create magic used to create Pipeline objects.
The supported syntax is:
%%pipeline create <args>
[<inline YAML>]
Args:
args: the arguments following '%%pipeline create'.
cell_body: the contents of the cell
"""
name = args.ge... | 0.012245 |
def _pick_best_quality_score(vrn_file):
"""Flexible quality score selection, picking the best available.
Implementation based on discussion:
https://github.com/bcbio/bcbio-nextgen/commit/a538cecd86c0000d17d3f9d4f8ac9d2da04f9884#commitcomment-14539249
(RTG=AVR/GATK=VQSLOD/MuTect=t_lod_fstar, otherwise... | 0.003576 |
def fetch(method, uri, params_prefix=None, **params):
"""Fetch the given uri and return the contents of the response."""
params = _prepare_params(params, params_prefix)
if method == "POST" or method == "PUT":
r_data = {"data": params}
else:
r_data = {"params": params}
# build the H... | 0.001155 |
def ToMicroseconds(self):
"""Converts a Duration to microseconds."""
micros = _RoundTowardZero(self.nanos, _NANOS_PER_MICROSECOND)
return self.seconds * _MICROS_PER_SECOND + micros | 0.005208 |
def call(self, command, *args):
"""
Sends call to the function, whose name is specified by command.
Used by Script invocations and normalizes calls using standard
Redis arguments to use the expected redis-py arguments.
"""
command = self._normalize_command_name(command)
... | 0.003774 |
def do_rm(self, line):
"rm [:tablename] [!fieldname:expectedvalue] [-v] {haskkey [rangekey]}"
table, line = self.get_table_params(line)
expected, line = self.get_expected(line)
args = self.getargs(line)
if "-v" in args:
ret = "ALL_OLD"
args.remove("-v")
... | 0.003989 |
def launch_process(self, command):
# type: (Union[bytes,text_type])->None
"""* What you can do
- It starts process and keep it.
"""
if not self.option is None:
command_plus_option = self.command + " " + self.option
else:
command_plus_option = self.... | 0.003949 |
def startswith(self, prefix, start=0, end=-1):
"""Return True if string starts with the specified prefix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position. prefix
can also be a tuple of strings to try.
:param str ... | 0.007576 |
def set_display_sleep(minutes):
'''
Set the amount of idle time until the display sleeps. Pass "Never" of "Off"
to never sleep.
:param minutes: Can be an integer between 1 and 180 or "Never" or "Off"
:ptype: int, str
:return: True if successful, False if not
:rtype: bool
CLI Example:
... | 0.001437 |
def draw_key(self, surface, key):
"""Default drawing method for key.
Draw the key accordingly to it type.
:param surface: Surface background should be drawn in.
:param key: Target key to be drawn.
"""
if isinstance(key, VSpaceKey):
self.draw_space_key(surfa... | 0.004464 |
def verify(self, smessage, signature=None, encoder=encoding.RawEncoder):
"""
Verifies the signature of a signed message, returning the message
if it has not been tampered with else raising
:class:`~nacl.signing.BadSignatureError`.
:param smessage: [:class:`bytes`] Either the ori... | 0.001914 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.