text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def deep_copy(numpy_dict):
"""
Returns a copy of a dictionary whose values are numpy arrays.
Copies their values rather than copying references to them.
"""
out = {}
for key in numpy_dict:
out[key] = numpy_dict[key].copy()
return out | 0.01992 |
def write(bar, offset, data):
"""Write data to PCI board.
Parameters
----------
bar : BaseAddressRegister
BAR to write.
offset : int
Address offset in BAR to write.
data : bytes
Data to write.
Returns
-------
None
Examples
... | 0.012731 |
def transformer_tall_pretrain_lm_tpu_adafactor_large():
"""Hparams for transformer on LM pretraining on TPU, large model."""
hparams = transformer_tall_pretrain_lm_tpu_adafactor()
hparams.hidden_size = 1024
hparams.num_heads = 16
hparams.filter_size = 32768 # max fitting in 16G memory is 49152, batch 2
hpa... | 0.019749 |
def addPendingResult( self, ps, jobid ):
"""Add a "pending" result that we expect to get results for.
:param ps: the parameters for the result
:param jobid: an identifier for the pending result"""
k = self._parametersAsIndex(ps)
# retrieve or create the result list
if k... | 0.006579 |
def set_classifier_mask(self, v, base_mask=True):
"""Computes the mask used to create the training and validation set"""
base = self._base
v = tonparray(v)
a = np.unique(v)
if a[0] != -1 or a[1] != 1:
raise RuntimeError("The labels must be -1 and 1 (%s)" % a)
... | 0.002963 |
def addSuccess(self, test, capt):
"""
After test completion, we want to record testcase run information.
"""
self.__insert_test_result(constants.State.PASS, test) | 0.010309 |
def _design_poll(self, name, mode, oldres, timeout=5, use_devmode=False):
"""
Poll for an 'async' action to be complete.
:param string name: The name of the design document
:param string mode: One of ``add`` or ``del`` to indicate whether
we should check for addition or delet... | 0.001225 |
def count(self):
""" Compute count of group, excluding missing values """
ids, _, ngroups = self.grouper.group_info
val = self.obj.get_values()
mask = (ids != -1) & ~isna(val)
ids = ensure_platform_int(ids)
minlength = ngroups or 0
out = np.bincount(ids[mask], mi... | 0.003945 |
def _initialize_precalculated_series(self,
asset,
trading_calendar,
trading_days,
data_portal):
"""
Internal method that pre-calculates the ... | 0.001418 |
def check_drives(drivename, drivestatus):
""" check the drive status """
return DISK_STATES[int(drivestatus)]["icingastatus"], "Drive '{}': {}".format(
drivename, DISK_STATES[int(drivestatus)]["result"]) | 0.012987 |
def add_edge_fun(graph):
"""
Returns a function that adds an edge to the `graph` checking only the out
node.
:param graph:
A directed graph.
:type graph: networkx.classes.digraph.DiGraph
:return:
A function that adds an edge to the `graph`.
:rtype: callable
"""
# N... | 0.001637 |
def needed_inputs(self):
""" List all the needed inputs of a configured engine
>>> engine = Engine("op1", "op2")
>>> engine.op1.setup(in_name="in", out_name="middle", required=False)
>>> engine.op2.setup(in_name="middle", out_name="out")
>>> engine.op1.append(lambda x:x+2)
... | 0.002148 |
def wcs_update(self, wcs_text, fb=None):
"""
parses the wcs_text and populates the fields
of a coord_tran instance.
we start from the coord_tran of the input
frame buffer, if any
"""
if (fb):
ct = fb.ct
else:
ct = coord_tran()
... | 0.000902 |
def route_present(name, address_prefix, next_hop_type, route_table, resource_group, next_hop_ip_address=None,
connection_auth=None, **kwargs):
'''
.. versionadded:: 2019.2.0
Ensure a route exists within a route table.
:param name:
Name of the route.
:param address_prefix... | 0.001913 |
def store_equal(self):
"""
Takes a tetrad class object and populates array with random
quartets sampled equally among splits of the tree so that
deep splits are not overrepresented relative to rare splits,
like those near the tips.
"""
with h5py.File(self.database.input, 'a') as io5:
... | 0.009506 |
async def edit_message_caption(self, chat_id: typing.Union[base.Integer, base.String, None] = None,
message_id: typing.Union[base.Integer, None] = None,
inline_message_id: typing.Union[base.String, None] = None,
cap... | 0.00833 |
def to_cdms2(dataarray, copy=True):
"""Convert a DataArray into a cdms2 variable
"""
# we don't want cdms2 to be a hard dependency
import cdms2
def set_cdms2_attrs(var, attrs):
for k, v in attrs.items():
setattr(var, k, v)
# 1D axes
axes = []
for dim in dataarray.di... | 0.000504 |
def update_short(self, **kwargs):
"""
Update the short optional arguments (those with one leading '-')
This method updates the short argument name for the specified function
arguments as stored in :attr:`unfinished_arguments`
Parameters
----------
``**kwargs``
... | 0.001776 |
def dispatch_event(self, event_, **kwargs):
"""
Dispatch section event.
Notes:
You MUST NOT call event.trigger() directly because
it will circumvent the section settings as well
as ignore the section tree.
If hooks are disabled somewhere up in th... | 0.001976 |
def persistent_id(self, obj):
"""
Provide a persistent ID for "saving" GLC objects by reference. Return
None for all non GLC objects.
Parameters
----------
obj: Name of the object whose persistent ID is extracted.
Returns
--------
None if the ob... | 0.003398 |
def correlation_decomp(P, obs1, obs2=None, times=[1], k=None):
r"""Time-correlation for equilibrium experiment - via decomposition.
Parameters
----------
P : (M, M) ndarray
Transition matrix
obs1 : (M,) ndarray
Observable, represented as vector on state space
obs2 : (M,) ndarray... | 0.000834 |
def _get_all_unmapped_reads(self, fout):
'''Writes all unmapped reads to fout'''
sam_reader = pysam.Samfile(self.bam, "rb")
for read in sam_reader.fetch(until_eof=True):
if read.is_unmapped:
print(mapping.aligned_read_to_read(read, ignore_quality=not self.fastq_out), ... | 0.009091 |
def display_latex(*objs, **kwargs):
"""Display the LaTeX representation of an object.
Parameters
----------
objs : tuple of objects
The Python objects to display, or if raw=True raw latex data to
display.
raw : bool
Are the data objects raw data or Python objects that need t... | 0.005405 |
def write(self, data, multithread=True, **kwargs):
'''
:param data: Data to be written
:type data: str or mmap object
:param multithread: If True, sends multiple write requests asynchronously
:type multithread: boolean
Writes the data *data* to the file.
.. note... | 0.005248 |
def dry_run_scan(self, scan_id, targets):
""" Dry runs a scan. """
os.setsid()
for _, target in enumerate(targets):
host = resolve_hostname(target[0])
if host is None:
logger.info("Couldn't resolve %s.", target[0])
continue
por... | 0.003466 |
def _populate_user_from_dn_regex_negation(self):
"""
Populate the given profile object flags from AUTH_LDAP_PROFILE_FLAGS_BY_DN_REGEX.
Returns True if the profile was modified
"""
for field, regex in self.settings.USER_FLAGS_BY_DN_REGEX_NEGATION.items():
field_value =... | 0.008299 |
def initialize_path(self, path_num=None):
"""
initialize consumer for next path
"""
self.state = copy(self.initial_state)
return self.state | 0.011173 |
def bundle_biomass_components(model, reaction):
"""
Return bundle biomass component reactions if it is not one lumped reaction.
There are two basic ways of specifying the biomass composition. The most
common is a single lumped reaction containing all biomass precursors.
Alternatively, the biomass e... | 0.000298 |
async def finish_pairing(self, pin):
"""Finish pairing process."""
self.srp.step1(pin)
pub_key, proof = self.srp.step2(self._atv_pub_key, self._atv_salt)
msg = messages.crypto_pairing({
tlv8.TLV_SEQ_NO: b'\x03',
tlv8.TLV_PUBLIC_KEY: pub_key,
tlv8.TLV... | 0.001972 |
def _create_fw_fab_dev_te(self, tenant_id, drvr_name, fw_dict):
"""Prepares the Fabric and configures the device.
This routine calls the fabric class to prepare the fabric when
a firewall is created. It also calls the device manager to
configure the device. It updates the database with ... | 0.001577 |
async def check_authorized(self, identity):
"""
Works like :func:`Security.identity`, but when check is failed
:func:`UnauthorizedError` exception is raised.
:param identity: Claim
:return: Checked claim or return ``None``
:raise: :func:`UnauthorizedError`
"""
... | 0.004376 |
def render_stmt_graph(statements, reduce=True, english=False, rankdir=None,
agent_style=None):
"""Render the statement hierarchy as a pygraphviz graph.
Parameters
----------
stmts : list of :py:class:`indra.statements.Statement`
A list of top-level statements with associat... | 0.000475 |
def _get_context_name(self, app=None):
"""Generate the name of the context variable for this component & app.
Because we store the ``context`` in a Local so the component
can be used across multiple apps, we cannot store the context on the
instance itself. This function will generate a ... | 0.002273 |
def GetReportDescriptor(cls):
"""Returns plugins' metadata in ApiReportDescriptor."""
if cls.TYPE is None:
raise ValueError("%s.TYPE is unintialized." % cls)
if cls.TITLE is None:
raise ValueError("%s.TITLE is unintialized." % cls)
if cls.SUMMARY is None:
raise ValueError("%s.SUMMARY... | 0.00722 |
def by_pdb(self, pdb_id, take_top_percentile = 30.0, cut_off = None, matrix = None, sequence_identity_cut_off = None, silent = None):
'''Returns a list of all PDB files which contain protein sequences similar to the protein sequences of pdb_id.
Only protein chains are considered in the matching so e.... | 0.023914 |
def gradient_compression_params(args: argparse.Namespace) -> Optional[Dict[str, Any]]:
"""
:param args: Arguments as returned by argparse.
:return: Gradient compression parameters or None.
"""
if args.gradient_compression_type is None:
return None
else:
return {'type': args.gradi... | 0.007673 |
def in1d_sorted(ar1, ar2):
"""
Does the same than np.in1d but uses the fact that ar1 and ar2 are sorted. Is therefore much faster.
"""
if ar1.shape[0] == 0 or ar2.shape[0] == 0: # check for empty arrays to avoid crash
return []
inds = ar2.searchsorted(ar1)
inds[inds == len(ar2)] = 0
... | 0.008696 |
def data(self):
"""Data representation of the datasource sent to the frontend"""
order_by_choices = []
# self.column_names return sorted column_names
for s in self.column_names:
s = str(s or '')
order_by_choices.append((json.dumps([s, True]), s + ' [asc]'))
... | 0.001042 |
def JoinPath(stem="", *parts):
"""A sane version of os.path.join.
The intention here is to append the stem to the path. The standard module
removes the path if the stem begins with a /.
Args:
stem: The stem to join to.
*parts: parts of the path to join. The first arg is always the root and
di... | 0.011419 |
def create_chart(self, html_path='index.html', data_path='data.json',
js_path='rickshaw.min.js', css_path='rickshaw.min.css',
html_prefix=''):
'''Save bearcart output to HTML and JSON.
Parameters
----------
html_path: string, default 'index.html... | 0.001931 |
def _get_external_workers(worker):
"""
This returns a dict with a set of tasks for all of the other workers
"""
worker_that_blocked_task = collections.defaultdict(set)
get_work_response_history = worker._get_work_response_history
for get_work_response in get_work_response_history:
if get... | 0.001229 |
def documentation(default=None, api_version=None, api=None, **kwargs):
"""returns documentation for the current api"""
api_version = default or api_version
if api:
return api.http.documentation(base_url="", api_version=api_version) | 0.003984 |
def tgread_bytes(self):
"""
Reads a Telegram-encoded byte array, without the need of
specifying its length.
"""
first_byte = self.read_byte()
if first_byte == 254:
length = self.read_byte() | (self.read_byte() << 8) | (
self.read_byte() << 16)
... | 0.003442 |
def getModelPosterior(self,min):
"""
USES LAPLACE APPROXIMATION TO CALCULATE THE BAYESIAN MODEL POSTERIOR
"""
Sigma = self.getLaplaceCovar(min)
n_params = self.vd.getNumberScales()
ModCompl = 0.5*n_params*SP.log(2*SP.pi)+0.5*SP.log(SP.linalg.det(Sigma))
RV = min['... | 0.011364 |
def _add_details(self, info):
"""
The 'id' and 'claim_id' attributes are not supplied directly, but
included as part of the 'href' value.
"""
super(QueueMessage, self)._add_details(info)
if self.href is None:
return
parsed = urllib.parse.urlparse(self.... | 0.004184 |
def parse_dereplicated_uc(dereplicated_uc_lines):
""" Return dict of seq ID:dereplicated seq IDs from dereplicated .uc lines
dereplicated_uc_lines: list of lines of .uc file from dereplicated seqs from
usearch61 (i.e. open file of abundance sorted .uc data)
"""
dereplicated_clusters = {}
see... | 0.002389 |
def srv_event(token, hits, url=RBA_URL):
"""Serve event to RainbowAlga"""
if url is None:
log.error("Please provide a valid RainbowAlga URL.")
return
ws_url = url + '/message'
if isinstance(hits, pd.core.frame.DataFrame):
pos = [tuple(x) for x in hits[['x', 'y', 'z']].values]
... | 0.00114 |
def difference_update(self, other):
"""Update self to include only the difference with other."""
other = set(other)
indices_to_delete = set()
for i, elem in enumerate(self):
if elem in other:
indices_to_delete.add(i)
if indices_to_delete:
self._delete_values_by_index(indices_to_delete) | 0.03268 |
def from_shypo(cls, xml, encoding='utf-8'):
"""Constructor from xml element *SHYPO*
:param xml.etree.ElementTree xml: the xml *SHYPO* element
:param string encoding: encoding of the xml
"""
score = float(xml.get('SCORE'))
words = [Word.from_whypo(w_xml, encoding) for w_... | 0.007059 |
def sync(self, command, arguments, tags=None, id=None):
"""
Same as self.raw except it do a response.get() waiting for the command execution to finish and reads the result
:param command: Command name to execute supported by the node (ex: core.system, info.cpu, etc...)
ch... | 0.007335 |
def digit_to_query_time(digit: str) -> List[int]:
"""
Given a digit in the utterance, return a list of the times that it corresponds to.
"""
if len(digit) > 2:
return [int(digit), int(digit) + TWELVE_TO_TWENTY_FOUR]
elif int(digit) % 12 == 0:
return [0, 1200, 2400]
return [int(di... | 0.006912 |
def report(self):
"""
Create reports of the findings
"""
# Initialise a variable to store the results
data = ''
for sample in self.metadata:
if sample[self.analysistype].primers != 'NA':
# Set the name of the strain-specific report
... | 0.005489 |
def _translate_special_values(self, obj_to_translate):
"""
you may want to write plugins for values which are not known before build:
e.g. id of built image, base image name,... this method will therefore
translate some reserved values to the runtime values
"""
translatio... | 0.003912 |
def is_searchable(self):
"""A bool value that indicates whether the address is a valid address
to search by."""
return self.raw or (self.is_valid_country and
(not self.state or self.is_valid_state)) | 0.015625 |
def prepare_parser(program):
"""Create and populate an argument parser."""
parser = ArgumentParser(
description=PROG_DESCRIPTION, prog=program,
formatter_class=HelpFormatter,
add_help=False)
parser.add_argument(
"-h", "--help", action=MinimalHelpAction, help=argparse.SUPPRESS... | 0.001164 |
def from_bytearray(self, stream):
"""
Constructs this frame from input data stream, consuming as many bytes as necessary from
the beginning of the stream.
If stream does not contain enough data to construct a complete modbus frame, an EOFError
is raised and no data is consumed.
... | 0.003883 |
def join_cwd(self, path=None):
"""
Join the path with the current working directory. If it is
specified for this instance of the object it will be used,
otherwise rely on the global value.
"""
if self.working_dir:
logger.debug(
"'%s' instance... | 0.002597 |
def workflow(ctx, client):
"""List or manage workflows with subcommands."""
if ctx.invoked_subcommand is None:
from renku.models.refs import LinkReference
names = defaultdict(list)
for ref in LinkReference.iter_items(client, common_path='workflows'):
names[ref.reference.name... | 0.00142 |
def is_repository_file(self, relativePath):
"""
Check whether a given relative path is a repository file path
:Parameters:
#. relativePath (string): File relative path
:Returns:
#. isRepoFile (boolean): Whether file is a repository file.
#. isFileOnD... | 0.009454 |
def typed_assign_stmt_handle(self, tokens):
"""Process Python 3.6 variable type annotations."""
if len(tokens) == 2:
if self.target_info >= (3, 6):
return tokens[0] + ": " + self.wrap_typedef(tokens[1])
else:
return tokens[0] + " = None" + self.wra... | 0.008119 |
def parse_rule(rule):
"""Parse a rule and return it as generator. Each iteration yields tuples
in the form ``(converter, parameters, variable)``. If the converter is
`None` it's a static url part, otherwise it's a dynamic one.
:internal:
"""
m = _rule_re.match(rule)
if m is None or m.end() ... | 0.001869 |
async def set_active_client(self, set_active_client_request):
"""Set the active client."""
response = hangouts_pb2.SetActiveClientResponse()
await self._pb_request('clients/setactiveclient',
set_active_client_request, response)
return response | 0.006536 |
def backward_inference(self, variables, evidence=None):
"""
Backward inference method using belief propagation.
Parameters:
----------
variables: list
list of variables for which you want to compute the probability
evidence: dict
a dict key, value... | 0.003209 |
def register_standard (id, source_types, target_types, requirements = []):
""" Creates new instance of the 'generator' class and registers it.
Returns the creates instance.
Rationale: the instance is returned so that it's possible to first register
a generator and then call 'run' method on t... | 0.014374 |
def info_gen(self, code, message, compressed=False):
"""Dispatcher for the info generators.
Determines which __info_*_gen() should be used based on the supplied
parameters.
Args:
code: The status code for the command response.
message: The status message for the... | 0.003044 |
def resource(self, api_path=None, base_path='/api/now', chunk_size=None, **kwargs):
"""Creates a new :class:`Resource` object after validating paths
:param api_path: Path to the API to operate on
:param base_path: (optional) Base path override
:param chunk_size: Response stream parser c... | 0.00309 |
def normalize_excludes(rootpath, excludes):
"""
Normalize the excluded directory list:
* must be either an absolute path or start with rootpath,
* otherwise it is joined with rootpath
* with trailing slash
"""
sep = os.path.sep
f_excludes = []
for exclude in excludes:
if not ... | 0.001799 |
def subclass_genesis(self, genesisclass):
"""Subclass the given genesis class and implement all abstract methods
:param genesisclass: the GenesisWin class to subclass
:type genesisclass: :class:`GenesisWin`
:returns: the subclass
:rtype: subclass of :class:`GenesisWin`
:... | 0.003257 |
def get_attribute_from_indices(self, indices: list, attribute_name: str):
"""Get attribute values for the requested indices.
:param indices: Indices of vertices for which the attribute values are requested.
:param attribute_name: The name of the attribute.
:return: A list of attribute v... | 0.006912 |
def invoke(tok: str, props: Inputs, opts: InvokeOptions = None) -> Awaitable[Any]:
"""
invoke dynamically invokes the function, tok, which is offered by a provider plugin. The inputs
can be a bag of computed values (Ts or Awaitable[T]s), and the result is a Awaitable[Any] that
resolves when the invoke ... | 0.004212 |
def create_access_key(name, is_active=True, permitted=[], options={}):
""" Creates a new access key. A master key must be set first.
:param name: the name of the access key to create
:param is_active: Boolean value dictating whether this key is currently active (default True)
:param permitted: list of ... | 0.005869 |
def plot_fit(self, intervals=True, **kwargs):
""" Plots the fit of the model
Parameters
----------
intervals : Boolean
Whether to plot 95% confidence interval of states
Returns
----------
None (plots data and the fit)
"""
import matpl... | 0.016803 |
def register_index(self, index):
"""Registers a given index:
* Creates and opens an index for it (if it doesn't exist yet)
* Sets some default values on it (unless they're already set)
Args:
index (PonyWhoosh.Index): An instance of PonyWhoosh.Index class
"""
self._indexes[index._name]... | 0.002674 |
def _inject_selenium(self, test):
"""
Injects a selenium instance into the method.
"""
from django.conf import settings
test_case = get_test_case_class(test)
test_case.selenium_plugin_started = True
# Provide some reasonable default values
sel = selenium... | 0.001548 |
def create(self, equipments):
"""
Method to create equipments
:param equipments: List containing equipments desired to be created on database
:return: None
"""
data = {'equipments': equipments}
return super(ApiEquipment, self).post('api/v3/equipment/', data) | 0.009494 |
def load_config(self):
"""
Load configuration for the service
Args:
config_file: Configuration file path
"""
logger.debug('loading config file: %s', self.config_file)
if os.path.exists(self.config_file):
with open(self.config_file) as file_handle:... | 0.003155 |
def delete_file(self, path, prefixed_path, source_storage):
"""
Override delete_file to skip modified time and exists lookups.
"""
if not self.collectfast_enabled:
return super(Command, self).delete_file(
path, prefixed_path, source_storage)
if not sel... | 0.003899 |
def generate_module(spec, out):
"""
Given an AMQP spec parsed into an xml.etree.ElemenTree,
and a file-like 'out' object to write to, generate
the skeleton of a Python module.
"""
#
# HACK THE SPEC so that 'access' is handled by 'channel' instead of 'connection'
#
for amqp_class in ... | 0.003458 |
def update_not_existing_kwargs(to_update, update_from):
"""
This function updates the keyword aguments from update_from in
to_update, only if the keys are not set in to_update.
This is used for updated kwargs from the default dicts.
"""
if to_update is None:
to_update = {}
to_update... | 0.009804 |
def _multi_permission_mask(mode):
"""
Support multiple, comma-separated Unix chmod symbolic modes.
>>> _multi_permission_mask('a=r,u+w')(0) == 0o644
True
"""
def compose(f, g):
return lambda *args, **kwargs: g(f(*args, **kwargs))
return functools.reduce(compose, map(_permission_mask... | 0.00295 |
def data_storage_dir(self):
"""
Temporary folder used to store intermediate calculation data in case the memory is saturated
"""
if self._data_storage_dir is None:
self._data_storage_dir = tempfile.mkdtemp(prefix = "openfisca_")
log.warn((
"Interme... | 0.012281 |
def update_count(self):
""" updates likes and dislikes count """
node_rating_count = self.node.rating_count
node_rating_count.likes = self.node.vote_set.filter(vote=1).count()
node_rating_count.dislikes = self.node.vote_set.filter(vote=-1).count()
node_rating_count.save() | 0.00641 |
def modify_calendar_resource(self, calres, attrs):
"""
:param calres: a zobjects.CalendarResource
:param attrs: a dictionary of attributes to set ({key:value,...})
"""
attrs = [{'n': k, '_content': v} for k, v in attrs.items()]
self.request('ModifyCalendarResource', {
... | 0.004474 |
def ext_language(ext, exts=None):
"""Language of the extension in those extensions
If exts is supplied, then restrict recognition to those exts only
If exts is not supplied, then use all known extensions
>>> ext_language('.py') == 'python'
True
"""
languages = {
'.py': 'python',
... | 0.001631 |
def folderitems(self):
"""TODO: Refactor to non-classic mode
"""
items = super(ReferenceResultsView, self).folderitems()
self.categories.sort()
return items | 0.010204 |
def check_on_curve(self):
"""raise :class:`NoSuchPointError` if the point is not actually on the curve."""
if not self._curve.contains_point(*self):
raise NoSuchPointError('({},{}) is not on the curve {}'.format(self[0], self[1], self._curve)) | 0.01476 |
def minimum_image_dr( self, r1, r2, cutoff=None ):
"""
Calculate the shortest distance between two points in the cell,
accounting for periodic boundary conditions.
Args:
r1 (np.array): fractional coordinates of point r1.
r2 (np.array): fractional coordinates of ... | 0.02099 |
def create_run(cmd, project, exp, grp):
"""
Create a new 'run' in the database.
This creates a new transaction in the database and creates a new
run in this transaction. Afterwards we return both the transaction as
well as the run itself. The user is responsible for committing it when
the time ... | 0.000953 |
def _filter_validate(filepath, location, values, validate):
"""Generator for validate() results called against all given values. On
errors, fields are warned about and ignored, unless strict mode is set in
which case a compiler error is raised.
"""
for value in values:
if not isinstance(valu... | 0.001374 |
def get_extreme(self, target_prop, maximize=True, min_temp=None,
max_temp=None, min_doping=None, max_doping=None,
isotropy_tolerance=0.05, use_average=True):
"""
This method takes in eigenvalues over a range of carriers,
temperatures, and doping levels, a... | 0.001938 |
def member(self, phlo_id, node_id,
member_id, action,
node_type='conference_bridge'):
"""
:param phlo_id:
:param node_id:
:param member_id:
:param action:
:param node_type: default value `conference_bridge`
:return:
"""
... | 0.007156 |
def _handle_response(self, response):
"""Internal helper for handling API responses from the Binance server.
Raises the appropriate exceptions when necessary; otherwise, returns the
response.
"""
if not str(response.status_code).startswith('2'):
raise BinanceAPIExcept... | 0.008163 |
def emit(self, signal, value=None, gather=False):
"""Emits a signal, causing all slot methods connected with the signal to be called (optionally w/ related value)
signal: the name of the signal to emit, must be defined in the classes 'signals' list.
value: the value to pass to all connect... | 0.002809 |
async def async_send_to_pipe_channel(channel_name,
label,
value):
'Send message asynchronously through pipe to client component'
pcn = _form_pipe_channel_name(channel_name)
channel_layer = get_channel_layer()
await channel_layer.... | 0.008081 |
def run_profiler(self):
"""Run profiler"""
if self.main.editor.save():
self.switch_to_plugin()
self.analyze(self.main.editor.get_current_filename()) | 0.010638 |
def write_antenna(page, args, seg_plot=None, grid=False, ipn=False):
"""
Write antenna factors to merkup.page object page and generate John's
detector response plot.
"""
from pylal import antenna
page.h3()
page.add('Antenna factors and sky locations')
page.h3.close()
th = []
t... | 0.002552 |
def _generate_contents(self, tar):
"""
Adds configuration files to tarfile instance.
:param tar: tarfile instance
:returns: None
"""
text = self.render(files=False)
# create a list with all the packages (and remove empty entries)
vpn_instances = vpn_patte... | 0.00223 |
def mongorestore(mongo_user, mongo_password, backup_directory_path, drop_database=False, silent=False):
""" Warning: Setting drop_database to True will drop the ENTIRE
CURRENTLY RUNNING DATABASE before restoring.
Mongorestore requires a running mongod process, in addition the provided
... | 0.007826 |
def profile_solver(ml, accel=None, **kwargs):
"""Profile a particular multilevel object.
Parameters
----------
ml : multilevel
Fully constructed multilevel object
accel : function pointer
Pointer to a valid Krylov solver (e.g. gmres, cg)
Returns
-------
residuals : arra... | 0.000734 |
def is_parent_of_log(self, id_, log_id):
"""Tests if an ``Id`` is a direct parent of a log.
arg: id (osid.id.Id): an ``Id``
arg: log_id (osid.id.Id): the ``Id`` of a log
return: (boolean) - ``true`` if this ``id`` is a parent of
``log_id,`` ``false`` otherwise
... | 0.002962 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.