text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def set_interval(self, timer_id, interval):
"""
Set timer interval. Returns 0 if OK, -1 on failure.
This method is slow, canceling the timer and adding a new one yield better performance.
"""
return lib.ztimerset_set_interval(self._as_parameter_, timer_id, interval) | 0.013423 |
def read_sps(path):
"""Read a LibSVM file line-by-line.
Args:
path (str): A path to the LibSVM file to read.
Yields:
data (list) and target (int).
"""
for line in open(path):
# parse x
xs = line.rstrip().split(' ')
yield xs[1:], int(xs[0]) | 0.0033 |
def _parseAttrs(self, attrsStr):
"""
Parse the attributes and values
"""
attributes = dict()
for attrStr in self.SPLIT_ATTR_COL_RE.split(attrsStr):
name, vals = self._parseAttrVal(attrStr)
if name in attributes:
raise GFF3Exception(
... | 0.004065 |
def gelu(x):
"""An approximation of gelu.
See: https://arxiv.org/pdf/1606.08415.pdf
"""
return 0.5 * x * (1.0 + K.tanh(math.sqrt(2.0 / math.pi) * (x + 0.044715 * K.pow(x, 3)))) | 0.010363 |
def do_output(self, *args):
"""Pass a command directly to the current output processor
"""
if args:
action, params = args[0], args[1:]
log.debug("Pass %s directly to output with %s", action, params)
function = getattr(self.output, "do_" + action, None)
... | 0.005391 |
def import_lib(self):
"""Import the lib.py file into the bundle module"""
try:
import ambry.build
module = sys.modules['ambry.build']
except ImportError:
module = imp.new_module('ambry.build')
sys.modules['ambry.build'] = module
bf = self... | 0.004261 |
def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True,
encoding=None, tupleize_cols=None,
infer_datetime_format=False):
"""
Read CSV file.
.. deprecated:: 0.21.0
Use :func:`read_csv` instead.
It is preferable to use the m... | 0.001462 |
def count_star(session: Union[Session, Engine, Connection],
tablename: str,
*criteria: Any) -> int:
"""
Returns the result of ``COUNT(*)`` from the specified table (with
additional ``WHERE`` criteria if desired).
Args:
session: SQLAlchemy :class:`Session`, :class:`... | 0.001284 |
def get_valid_class_name(s: str) -> str:
"""Return the given string converted so that it can be used for a class name
Remove leading and trailing spaces; removes spaces and capitalizes each
word; and remove anything that is not alphanumeric. Returns a pep8
compatible class name.
:param s: The str... | 0.004024 |
def parquet(self, path):
"""Loads a Parquet file stream, returning the result as a :class:`DataFrame`.
You can set the following Parquet-specific option(s) for reading Parquet files:
* ``mergeSchema``: sets whether we should merge schemas collected from all \
Parquet part-fi... | 0.009091 |
def find_patches(modules, recursive=True):
"""Find all the patches created through decorators.
Parameters
----------
modules : list of module
Modules and/or packages to search the patches in.
recursive : bool
``True`` to search recursively in subpackages.
Returns
-------
... | 0.000994 |
def body_echo(cls, request,
foo: (Ptypes.body, String('A body parameter'))) -> [
(200, 'Ok', String)]:
'''Echo the body parameter.'''
log.info('Echoing body param, value is: {}'.format(foo))
for i in range(randint(0, MAX_LOOP_DURATION)):
yield
ms... | 0.007772 |
def beacon(config):
'''
Watch the configured files
Example Config
.. code-block:: yaml
beacons:
inotify:
- files:
/path/to/file/or/dir:
mask:
- open
- create
- close_write
... | 0.001082 |
async def asynchronously_get_data(self, url):
""" Asynchronously get data from Chunked transfer encoding of https://smartcity.rbccps.org/api/0.1.0/subscribe.
(Only this function requires Python 3. Rest of the functions can be run in python2.
Args:
url (string): url to subscribe
... | 0.006863 |
def convolutional_layer_series(initial_size, layer_sequence):
""" Execute a series of convolutional layer transformations to the size number """
size = initial_size
for filter_size, padding, stride in layer_sequence:
size = convolution_size_equation(size, filter_size, padding, stride)
return s... | 0.006192 |
def _update_names(self):
"""Update the derived names"""
d = dict(
table=self.table_name,
time=self.time,
space=self.space,
grain=self.grain,
variant=self.variant,
segment=self.segment
)
assert self.dataset
... | 0.003636 |
def readall(self):
"""
Read and return all the bytes from the stream until EOF.
Returns:
bytes: Object content
"""
if not self._readable:
raise UnsupportedOperation('read')
with self._seek_lock:
# Get data starting from seek
... | 0.00314 |
def parse_stage_name(stage):
"""
Determine the name of a stage.
The stage may be provided already as a name, as a Stage object, or as a
callable with __name__ (e.g., function).
:param str | pypiper.Stage | function stage: Object representing a stage,
from which to obtain name.
:return ... | 0.001575 |
def enroll_user_courses(self, course_id, enrollment_type, enrollment_user_id, enrollment_associated_user_id=None, enrollment_course_section_id=None, enrollment_enrollment_state=None, enrollment_limit_privileges_to_course_section=None, enrollment_notify=None, enrollment_role=None, enrollment_role_id=None, enrollment_sel... | 0.003254 |
def _handle_result_by_key_slice(self, key_slice):
"""
Handle processing when the result argument provided is a key slice.
"""
invalid_options = ('key', 'keys', 'startkey', 'endkey')
if any(x in invalid_options for x in self.options):
raise ResultException(102, invalid... | 0.00186 |
def escape_query(query):
"""Escapes certain filter characters from an LDAP query."""
return query.replace("\\", r"\5C").replace("*", r"\2A").replace("(", r"\28").replace(")", r"\29") | 0.010471 |
def _get_replacement_pdb_id(self):
'''Checks to see if the PDB file has been deprecated and, if so, what the new ID is.'''
deprecation_lines = self.parsed_lines['OBSLTE']
date_regex = re.compile('(\d+)-(\w{3})-(\d+)')
if deprecation_lines:
assert(len(deprecation_lines) == 1)
... | 0.008576 |
def _secret_event_lifecycle_cb(conn, secret, event, detail, opaque):
'''
Secret lifecycle events handler
'''
_salt_send_event(opaque, conn, {
'secret': {
'uuid': secret.UUIDString()
},
'event': _get_libvirt_enum_string('VIR_SECRET_EVENT_', event),
'detail': 'u... | 0.002825 |
def generate_api_doc(self, uri):
'''Make autodoc documentation template string for a module
Parameters
----------
uri : string
python location of module - e.g 'sphinx.builder'
Returns
-------
S : string
Contents of API doc
'''
... | 0.003173 |
def skew(xi):
"""Return the skew-symmetric matrix that can be used to calculate
cross-products with vector xi.
Multiplying this matrix by a vector `v` gives the same result
as `xi x v`.
Parameters
----------
xi : :obj:`numpy.ndarray` of float
A 3-entry vector.
Returns
----... | 0.001783 |
def physical_drives_maximum_size_mib(self):
"""Gets the biggest disk
:returns the size in MiB.
"""
return utils.max_safe([member.physical_drives.maximum_size_mib
for member in self.get_members()]) | 0.007692 |
def get_xpath_frequencydistribution(paths):
""" Build and return a frequency distribution over xpath occurrences."""
# "html/body/div/div/text" -> [ "html", "body", "div", "div", "text" ]
splitpaths = [p.split('/') for p in paths]
# get list of "parentpaths" by right-stripping off the last xpath-n... | 0.001795 |
def options(allow_partial=False, read=False):
'''
Get the object containing the values of the parsed command line options.
:param bool allow_partial: If `True`, ignore unrecognized arguments and allow
the options to be re-parsed next time `options` is called. This
also suppresses overwrite ... | 0.005587 |
def _find_scalar_parameter(expr):
"""Find all :class:`~ibis.expr.types.ScalarParameter` instances.
Parameters
----------
expr : ibis.expr.types.Expr
Returns
-------
Tuple[bool, object]
The operation and the parent expresssion's resolved name.
"""
op = expr.op()
if isi... | 0.002208 |
def parse_size(image, size):
"""
Parse a size string (i.e. "200", "200x100", "x200", etc.) into a
(width, height) tuple.
"""
bits = size.split("x")
if image.size[0] == 0 or image.size[1] == 0:
ratio = 1.0
else:
ratio = float(image.size[0]) ... | 0.003086 |
def schedule(self, name, timer, func, *args, **kwargs):
'''
ts = Scheduler('my_task')
ts.schedule(every(seconds=10), handle_message, "Every 10 seconds")
ts.schedule(every(seconds=30), fetch_url, url="http://yahoo.com", section="stock_ticker")
ts.run_forever()
'''
... | 0.006479 |
def toggle(self):
"""
Reverse the state of the device. If it's on, turn it off; if it's off,
turn it on.
"""
with self._lock:
if self.is_active:
self.off()
else:
self.on() | 0.007491 |
def add_alias(self, name, *alt_names):
"""
Add some duplicate names for a given function. The original function's implementation must already be
registered.
:param name: The name of the function for which an implementation is already present
:param alt_names: Any number... | 0.008292 |
def execute(helper, config, args):
"""
Deletes an environment
"""
env_config = parse_env_config(config, args.environment)
environments_to_wait_for_term = []
environments = helper.get_environments()
for env in environments:
if env['EnvironmentName'] == args.environment:
... | 0.000996 |
def htmlCtxtReadDoc(self, cur, URL, encoding, options):
"""parse an XML in-memory document and build a tree. This
reuses the existing @ctxt parser context """
ret = libxml2mod.htmlCtxtReadDoc(self._o, cur, URL, encoding, options)
if ret is None:raise treeError('htmlCtxtReadDoc() faile... | 0.01061 |
def get_command(arguments):
"""Utility function to extract command from docopt arguments.
:param arguments:
:return: command
"""
cmds = list(filter(lambda k: not (k.startswith('-') or
k.startswith('<')) and arguments[k],
arguments.keys()))
if l... | 0.007463 |
def setBatchSize(self, size):
"""
Sets the batch size of records to look up for this record box.
:param size | <int>
"""
self._batchSize = size
try:
self._worker.setBatchSize(size)
except AttributeError:
pass | 0.009615 |
def setup_multiprocessing_logging(queue=None):
'''
This code should be called from within a running multiprocessing
process instance.
'''
from salt.utils.platform import is_windows
global __MP_LOGGING_CONFIGURED
global __MP_LOGGING_QUEUE_HANDLER
if __MP_IN_MAINPROCESS is True and not i... | 0.001908 |
def _grouped(input_type, output_type, base_class, output_type_method):
"""Define a user-defined function that is applied per group.
Parameters
----------
input_type : List[ibis.expr.datatypes.DataType]
A list of the types found in :mod:`~ibis.expr.datatypes`. The
... | 0.000533 |
def load(self, filename, bs=512):
"""Starts filesystem analysis. Detects supported filesystems and \
loads :attr:`partitions` array.
Args:
filename - Path to file or device for reading.
Raises:
IOError - File/device does not exist or is not readable.
"""... | 0.001453 |
def validatePage(self):
"""
Validates the page against the scaffold information, setting the
values along the way.
"""
widgets = self.propertyWidgetMap()
failed = ''
for prop, widget in widgets.items():
val, success = projexui.widgetValue(widge... | 0.00598 |
def send_raw_tx(self, serialized_tx, id=None, endpoint=None):
"""
Submits a serialized tx to the network
Args:
serialized_tx: (str) a hexlified string of a transaction
id: (int, optional) id to use for response tracking
endpoint: (RPCEndpoint, optional) endpoi... | 0.005814 |
def to_dict(self):
"""
Return the node as a dictionary.
Returns
-------
dict: All the attributes of this node as a dictionary (minus the left
and right).
"""
out = {}
for key in self.__dict__.keys():
if key not in ['left', 'right... | 0.00489 |
def _update(self):
"""Update the current model using one round of Gibbs sampling.
"""
initial_time = time.time()
self._updateHiddenStateTrajectories()
self._updateEmissionProbabilities()
self._updateTransitionMatrix()
final_time = time.time()
elapsed_ti... | 0.004717 |
def server_handler(args):
"""server_handler."""
if not db.setup(url=args.db, echo=args.db_echo):
return
if not _check_db_revision():
return
app = create_app()
listener = '{:s}:{:d}'.format(args.host, args.port)
if args.debug:
logging.getLogger('werkzeug').disabled = True... | 0.000755 |
def request(self,
method,
url,
user_id=None,
hash_meth='sha1',
**req_kwargs):
'''
A loose wrapper around Requests' :class:`~requests.sessions.Session`
which injects Ofly parameters.
:param method: A string r... | 0.005895 |
def getfile(self):
"""Gets the full file path of the entered/selected file
:returns: str -- the name of the data file to open/create
"""
current_file = str(self.selectedFiles()[0])
if os.path.isfile(current_file):
print 'current_file', current_file
if cur... | 0.004573 |
def get_git_status(self):
"""
Gets git and init versions and commits since the init version
"""
## get git branch
self._get_git_branch()
## get tag in the init file
self._get_init_release_tag()
## get log commits since <tag>
try:
self... | 0.007729 |
def decode(self, integers):
"""List of ints to str."""
integers = list(np.squeeze(integers))
return self.encoders["inputs"].decode(integers) | 0.006579 |
def getGeneAssociation(URL_or_file):
"""
This function collects GO annotation from http://geneontology.org/page/download-annotations.
:param URL_or_file: either a link to a file on geneontology.org eg. http://geneontology.org/gene-associations/gene_association.fb.gz or the path for the respective downlode... | 0.039872 |
def children(self):
"""~TermList: the children of all the terms in the list.
"""
return TermList(unique_everseen(
y for x in self for y in x.children
)) | 0.010204 |
def install(args):
" Install site from sources or module "
# Deactivate virtualenv
if 'VIRTUAL_ENV' in environ:
LOGGER.warning('Virtualenv enabled: %s' % environ['VIRTUAL_ENV'])
# Install from base modules
if args.module:
args.src = op.join(settings.MOD_DIR, args.module)
as... | 0.00155 |
def find_exception_by_code(code):
"""Find name of exception by WebDriver defined error code.
Args:
code(str): Error code defined in protocol.
Returns:
The error name defined in protocol.
"""
errorName = None
for error in WebDriverError:
if error.value.code == code:
... | 0.002604 |
def nanargmin(values, axis=None, skipna=True, mask=None):
"""
Parameters
----------
values : ndarray
axis: int, optional
skipna : bool, default True
mask : ndarray[bool], optional
nan-mask if known
Returns
--------
result : int
The index of min value in specified... | 0.001393 |
def process_python_objects(data, filepath=None):
"""Replace certain values in the given package data dict.
Does things like:
* evaluates @early decorated functions, and replaces with return value;
* converts functions into `SourceCode` instances so they can be serialized
out to installed packages... | 0.001276 |
def safe_makedirs(path):
"""A safe function for creating a directory tree."""
try:
os.makedirs(path)
except OSError as err:
if err.errno == errno.EEXIST:
if not os.path.isdir(path):
raise
else:
raise | 0.003636 |
def temporarily_disabled(self):
"""
Temporarily disable the cache (useful for testing)
"""
old_setting = self.options.enabled
self.disable(clear_cache=False)
try:
yield
finally:
self.options.enabled = old_setting | 0.006849 |
def merge(a, b):
"""Merge two deep dicts non-destructively
Uses a stack to avoid maximum recursion depth exceptions
>>> a = {'a': 1, 'b': {1: 1, 2: 2}, 'd': 6}
>>> b = {'c': 3, 'b': {2: 7}, 'd': {'z': [1, 2, 3]}}
>>> c = merge(a, b)
>>> from pprint import pprint; pprint(c)
{'a': 1, 'b': {1... | 0.000879 |
def getxattr(self, req, ino, name, size):
""" Set an extended attribute
Valid replies:
reply_buf
reply_data
reply_xattr
reply_err
"""
self.reply_err(req, errno.ENOSYS) | 0.04661 |
def validate(self, val):
"""
Validates that the val matches the expected fields for this struct.
val must be a dict, and must contain only fields represented by this struct and its
ancestors.
Returns two element tuple: (bool, string)
- `bool` - True if valid, False if n... | 0.004992 |
def tokenize_documents(docs):
"""Convert the imported documents to :py:class:'~estnltk.text.Text' instances."""
sep = '\n\n'
texts = []
for doc in docs:
text = '\n\n'.join(['\n'.join(para[SENTENCES]) for para in doc[PARAGRAPHS]])
doc[TEXT] = text
del doc[PARAGRAPHS]
texts... | 0.008451 |
def _ReadStorageMetadata(self):
"""Reads the task storage metadata."""
query = 'SELECT key, value FROM metadata'
self._cursor.execute(query)
metadata_values = {row[0]: row[1] for row in self._cursor.fetchall()}
self._compression_format = metadata_values['compression_format'] | 0.003367 |
def buildCliString(self):
"""
Collect all of the required information from the config screen and
build a CLI string which can be used to invoke the client program
"""
config = self.navbar.getActiveConfig()
group = self.buildSpec['widgets'][self.navbar.getSelectedGro... | 0.002677 |
def manage_results(self, action): # pylint: disable=too-many-branches,too-many-statements
"""Get result from pollers/reactionners (actives ones)
:param action: check / action / event handler to handle
:type action:
:return: None
"""
logger.debug('manage_results: %s ', a... | 0.003624 |
def get_field_label(self, trans, field):
"""
Get the field label from the _meta api of the model
:param trans:
:param field:
:return:
"""
try:
# get from the instance
object_field_label = trans._meta.get_field_by_name(field)[0].verbose_nam... | 0.005908 |
def get_xml(self, fp, format=FORMAT_NATIVE):
"""
Returns the XML metadata for this source, converted to the requested format.
Converted metadata may not contain all the same information as the native format.
:param file fp: A path, or an open file-like object which the content should be... | 0.009547 |
def record_rename(object_id, input_params={}, always_retry=True, **kwargs):
"""
Invokes the /record-xxxx/rename API method.
For more info, see: https://wiki.dnanexus.com/API-Specification-v1.0.0/Name#API-method%3A-%2Fclass-xxxx%2Frename
"""
return DXHTTPRequest('/%s/rename' % object_id, input_param... | 0.008357 |
def fetch(self):
"""
Fetch a FeedbackInstance
:returns: Fetched FeedbackInstance
:rtype: twilio.rest.api.v2010.account.call.feedback.FeedbackInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
... | 0.003704 |
def tickerId(self, contract_identifier):
"""
returns the tickerId for the symbol or
sets one if it doesn't exits
"""
# contract passed instead of symbol?
symbol = contract_identifier
if isinstance(symbol, Contract):
symbol = self.contractString(symbol)... | 0.003478 |
def _parse_get_snapshot_schedule(cls, args):
"""
Parse command line arguments for updating hbase snapshot schedule or to get details.
"""
argparser = ArgumentParser(prog="cluster snapshot_schedule")
group = argparser.add_mutually_exclusive_group(required=True)
group.add_... | 0.00813 |
def get_resources(cls):
"""Returns Ext Resources."""
plugin = directory.get_plugin()
controller = MacAddressRangesController(plugin)
return [extensions.ResourceExtension(Mac_address_ranges.get_alias(),
controller)] | 0.006873 |
def exists(self, client=None):
"""API call: test for the existence of the taskqueue via a GET request
See
https://cloud.google.com/appengine/docs/python/taskqueue/rest/taskqueues/get
:type client: :class:`taskqueue.client.Client` or ``NoneType``
:param client: the client to us... | 0.004941 |
def differing_constants(block_a, block_b):
"""
Compares two basic blocks and finds all the constants that differ from the first block to the second.
:param block_a: The first block to compare.
:param block_b: The second block to compare.
:returns: Returns a list of differing constants in the ... | 0.004564 |
def _lml_gradient(self):
"""
Gradient of the log of the marginal likelihood.
Let 𝐲 = vec(Y), 𝕂 = K⁻¹∂(K)K⁻¹, and H = MᵀK⁻¹M. The gradient is given by::
2⋅∂log(p(𝐲)) = -tr(K⁻¹∂K) - tr(H⁻¹∂H) + 𝐲ᵀ𝕂𝐲 - 𝐦ᵀ𝕂(2⋅𝐲-𝐦)
- 2⋅(𝐦-𝐲)ᵀK⁻¹∂(𝐦).
Observe that
... | 0.001188 |
def _get_instances(self, page_number=None):
"""
Returns the service instances activated in this space.
"""
instances = []
uri = '/v2/spaces/%s/service_instances' % self.guid
json_response = self.api.get(uri)
instances += json_response['resources']
while js... | 0.003984 |
def getControls(self):
'''
Calculates consumption for each consumer of this type using the consumption functions.
Parameters
----------
None
Returns
-------
None
'''
cNrmNow = np.zeros(self.AgentCount) + np.nan
for t in range(self... | 0.005051 |
def update(self):
"""
This method should be called to ensure all cached attributes
are in sync with the metadata at runtime.
This happens because attributes could store mutable objects and be
modified outside the scope of this class.
The most common idiom that isn't autom... | 0.004251 |
def naryOp(self, operator, opCreateDelegate, *otherOps) -> RtlSignalBase:
"""
Try lookup operator with this parameters in _usedOps
if not found create new one and soter it in _usedOps
:param operator: instance of OpDefinition
:param opCreateDelegate: function (*ops) to create op... | 0.001161 |
def ls(params="", directory=".", printed=True):
"""Know the best python implantation of ls? It's just to subprocess ls...
(uses dir on windows).
:param params: options to pass to ls or dir
:param directory: if not this directory
:param printed: If you're using this, you probably wanted it just prin... | 0.001399 |
def get_option(self, name, section=None, vars=None, expect=None):
"""Return an option from ``section`` with ``name``.
:param section: section in the ini file to fetch the value; defaults to
constructor's ``default_section``
"""
vars = vars if vars else self.default_vars
... | 0.002915 |
def softmax_cross_entropy_one_hot(logits, labels, weights_fn=None):
"""Calculate softmax cross entropy given one-hot labels and logits.
Args:
logits: Tensor of size [batch-size, o=1, p=1, num-classes]
labels: Tensor of size [batch-size, o=1, p=1, num-classes]
weights_fn: Function that takes in labels a... | 0.004484 |
def save_nd_to_pickle(nd, path='', filename=None):
"""Use pickle to save the whole nd-object to disc
The network instance is entirely pickled to a file.
Parameters
----------
nd : NetworkDing0
Ding0 grid container object
path : str
Absolute or relative path where pickle should ... | 0.001998 |
def read_resfile(resfile):
"""load a residual file into a pandas.DataFrame
Parameters
----------
resfile : str
residual file name
Returns
-------
pandas.DataFrame : pandas.DataFrame
"""
assert os.path.exists(resfile),"read_resfile() ... | 0.005814 |
def VerifyServerControlResponse(self, http_object):
"""Verify the server response to a 'control' endpoint POST message.
We consider the message correct if and only if we can decrypt it
properly. Note that in practice we can not use the HTTP status to figure out
if the request worked because captive pro... | 0.006306 |
def initialize_aggregate_metric(section, aggr_hosts, aggr_metrics, metrics, outdir_default, resource_path, label, ts_start, ts_end, rule_strings,
important_sub_metrics, anomaly_detection_metrics, other_options):
"""
Initialize aggregate metric
:param: section: config section name
... | 0.008871 |
def update(self, *others):
"""Update the set, adding elements from all others."""
self.db.sunionstore(self.key, [self.key] + [o.key for o in others]) | 0.012121 |
def MultiReadClientFullInfo(self, client_ids, min_last_ping=None):
"""Reads full client information for a list of clients."""
res = {}
for client_id in client_ids:
try:
md = self.ReadClientMetadata(client_id)
except db.UnknownClientError:
continue
if md and min_last_ping a... | 0.010676 |
def save(self, project_file=''):
"""Save the description as a YML file. Prompt if no file given."""
self._request_project_file(project_file)
data_file.dump(self.desc.as_dict(), self.project_file) | 0.009132 |
def connect(self):
"""
Creates a new KazooClient and establishes a connection.
Passes the client the `handle_connection_change` method as a callback
to fire when the Zookeeper connection changes state.
"""
self.client = client.KazooClient(hosts=",".join(self.hosts))
... | 0.004831 |
def p_factor_id(self, p):
"""
factor : ID
"""
def resolve_id(key, context):
try:
return context[key]
except KeyError:
raise NameError("name '{}' is not defined".format(key))
p[0] = Instruction('resolve_id(key, context)', c... | 0.004566 |
def bismark_stats_table(self):
""" Take the parsed stats from the Bismark reports and add them to the
basic stats table at the top of the report """
headers = {
'alignment': OrderedDict(),
'dedup': OrderedDict(),
'methextract': OrderedDict(),
'bam... | 0.002409 |
def update_title(self, _, info):
# type: (object, TitleInfo) -> None
"""Set the label of the Block Meta object"""
with self._lock:
self._block.meta.set_label(info.title) | 0.014634 |
def quniform(low, high, q, random_state):
'''
low: an float that represent an lower bound
high: an float that represent an upper bound
q: sample step
random_state: an object of numpy.random.RandomState
'''
return np.round(uniform(low, high, random_state) / q) * q | 0.003436 |
def console_main():
"""This serves as CLI entry point and will not show a Python traceback if a called command fails"""
cmd = main(check=False)
if cmd is not None:
sys.exit(cmd.returncode) | 0.009615 |
def results(self):
"""If successfully created, add the cleaned `CifData` and `StructureData` as output nodes to the workchain.
The filter and select calculations were successful, so we return the cleaned CifData node. If the `group_cif`
was defined in the inputs, the node is added to it. If the... | 0.006178 |
def specialspaceless(parser, token):
"""
Removes whitespace between HTML tags, and introduces a whitespace
after buttons an inputs, necessary for Bootstrap to place them
correctly in the layout.
"""
nodelist = parser.parse(('endspecialspaceless',))
parser.delete_first_token()
return Spe... | 0.002882 |
def del_contact_downtime(self, downtime_id):
"""Delete a contact downtime
Format of the line that triggers function call::
DEL_CONTACT_DOWNTIME;<downtime_id>
:param downtime_id: downtime id to delete
:type downtime_id: int
:return: None
"""
for item in s... | 0.004286 |
def dispatch_reply(self, reply, value):
"""Dispatches the reply to the proper queue."""
method = reply.method
call_id = reply.call_id
task_id = reply.task_id
if method & ACK:
try:
result_queue = self.result_queues[call_id]
except KeyError:
... | 0.002389 |
def calc_point_dist(vsA, entryA):
"""
This function is used to determine the distance between two points.
Parameters
----------
vsA : list or numpy.array or similar
An array of point 1's position in the \chi_i coordinate system
entryA : list or numpy.array or similar
An array of... | 0.004724 |
async def get_movie(self, id_):
"""Retrieve movie data by ID.
Arguments:
id_ (:py:class:`int`): The movie's TMDb ID.
Returns:
:py:class:`~.Movie`: The requested movie.
"""
url = self.url_builder(
'movie/{movie_id}',
dict(movie_id=id_... | 0.00361 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.