text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def ensembl_request(self, ext, headers):
""" obtain sequence via the ensembl REST API
"""
self.attempt += 1
if self.attempt > 5:
raise ValueError("too many attempts, figure out why its failing")
response, status, requested_headers = self.open_url(sel... | 0.00692 |
def update_metric_by_name(self, metric_name, metric_type, description=None,
custom_properties=None, tags=None, **kwargs):
"""
Create or update a metric object
Args:
metric_name (string): name of metric
type (string): metric type, must be one... | 0.002852 |
def _process_args_as_rows_or_columns(self, arg, unpack=False):
"""
We must be able to interpret the args as as either a column name or
row number, or sequences thereof. Numpy arrays and slices are also
fine.
Examples:
'field'
35
[35,55,86]
... | 0.001477 |
def print_page_cb(self, print_op, print_context, page_nb, keep_refs={}):
"""
Called for printing operation by Gtk
"""
page = ImgPage(self, page_nb)
page.print_page_cb(print_op, print_context, keep_refs=keep_refs) | 0.007937 |
def run_mrbayes(self, ipyclient, force=False, quiet=False):
"""
calls the mrbayes block in each nexus file.
"""
## get all the nexus files for this object
minidir = os.path.realpath(os.path.join(self.workdir, self.name))
nexus_files = glob.glob(os.path.join(minidir, "*.n... | 0.011136 |
def _get_ownership(self, data):
"""Determine on which rank each subject currently resides
Parameters
----------
data: list of 4D arrays with subject data
Returns
-------
list of ranks indicating the owner of each subject
"""
rank = self.comm.ra... | 0.003623 |
def add_header(self, name: str, value: _HeaderTypes) -> None:
"""Adds the given response header and value.
Unlike `set_header`, `add_header` may be called multiple times
to return multiple values for the same header.
"""
self._headers.add(name, self._convert_header_value(value)) | 0.00625 |
def get_media_formats(self, media_id):
"""CR doesn't seem to provide the video_format and video_quality params
through any of the APIs so we have to scrape the video page
"""
url = (SCRAPER.API_URL + 'media-' + media_id).format(
protocol=SCRAPER.PROTOCOL_INSECURE)
for... | 0.002301 |
def _make_crl_distribution_points(self, name, value):
"""
Constructs an asn1crypto.x509.CRLDistributionPoints object
:param name:
A unicode string of the attribute name to use in exceptions
:param value:
Either a unicode string of a URL, or a 2-element tuple of ... | 0.001162 |
def portrait_image(model, request):
"""XXX: needs polishing. Return configured default portrait if not set
on user.
"""
response = Response()
cfg = ugm_general(model)
response.body = model.attrs[cfg.attrs['users_portrait_attr']]
response.headers['Content-Type'] = 'image/jpeg'
response.he... | 0.00266 |
async def connect(self, loop, port, baudrate=9600,
bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE,
stopbits=serial.STOPBITS_ONE, connection_timeout=10,
inactivity_timeout=5):
"""
Connect to Opentherm Gateway at @port.
Initia... | 0.001761 |
def create_from_boosted_machine(self, boosted_machine, classifiers_per_round, classification_thresholds=-5.):
"""Creates this cascade from the given boosted machine, by simply splitting off strong classifiers that have classifiers_per_round weak classifiers.
**Parameters:**
``boosted_machine`` : :py:class... | 0.008791 |
def all_other_enabled_satchels(self):
"""
Returns a dictionary of satchels used in the current configuration, excluding ourselves.
"""
return dict(
(name, satchel)
for name, satchel in self.all_satchels.items()
if name != self.name.upper() and name.low... | 0.010753 |
def receive(self, transport, myname = None):
"""Receive an XMPP connection over the `transport`.
:Parameters:
- `transport`: an XMPP transport instance
- `myname`: local stream endpoint name (defaults to own jid domain
part).
"""
if myname is None:
... | 0.009547 |
def cdf(self, x):
"""
Computes the cdf of a specific value, ie. computes F(x) where F denotes
the CDF of the distribution.
"""
t = 0
N = float(self.n)
if len(self) == 1: # only one centroid
return int(x >= self.C.min_key())
for i, key in enu... | 0.002688 |
def lists(self, value, key=None):
"""
Get a list with the values of a given key
:rtype: list
"""
results = map(lambda x: x[value], self._items)
return list(results) | 0.009346 |
def _block_width(self):
"""
Return a |Length| object specifying the width of available "writing"
space between the margins of the last section of this document.
"""
section = self.sections[-1]
return Emu(
section.page_width - section.left_margin - section.righ... | 0.005917 |
def delete(self, alias_name, timeout=-1):
"""
Revokes a certificate signed by the internal CA. If client certificate to be revoked is RabbitMQ_readonly,
then the internal CA root certificate, RabbitMQ client certificate and RabbitMQ server certificate will be
regenerated. This will inval... | 0.007238 |
def get_caller_name(N=0, strict=True):
""" Standalone version of get_caller_name """
if isinstance(N, (list, tuple)):
name_list = []
for N_ in N:
try:
name_list.append(get_caller_name(N_))
except AssertionError:
name_list.append('X')
... | 0.001182 |
def create_entity(self):
"""Create entity if `flow_collection` is defined in process.
Following rules applies for adding `Data` object to `Entity`:
* Only add `Data object` to `Entity` if process has defined
`flow_collection` field
* Add object to existing `Entity`, if all paren... | 0.003244 |
def _setChoiceDict(self):
"""Create dictionary for choice list"""
# value is name of choice parameter (same as key)
self.choiceDict = {}
for c in self.choice: self.choiceDict[c] = c | 0.014085 |
def point(self, t):
"""Evaluate the cubic Bezier curve at t using Horner's rule."""
# algebraically equivalent to
# P0*(1-t)**3 + 3*P1*t*(1-t)**2 + 3*P2*(1-t)*t**2 + P3*t**3
# for (P0, P1, P2, P3) = self.bpoints()
return self.start + t*(
3*(self.control1 - self.start)... | 0.004032 |
def load_items(self, items):
"""Loads any number of items in chunks, handling continuation tokens.
:param items: Unpacked in chunks into "RequestItems" for :func:`boto3.DynamoDB.Client.batch_get_item`.
"""
loaded_items = {}
requests = collections.deque(create_batch_get_chunks(it... | 0.005556 |
def initialize_users(self) -> None:
"""Load device user data and initialize user management."""
users = self.request('get', pwdgrp_url)
self.users = Users(users, self.request) | 0.01005 |
def get_session_cookie(self):
"""
Create a session cookie object for use by aiohttp
"""
if self._login is not None and self._password is not None:
session_key = self.encode_user(self._login, self._password)
return {'sessionkey': session_key}
else:
... | 0.005882 |
def setPWMFrequency(self, pwm, device=DEFAULT_DEVICE_ID, message=True):
"""
Set the PWM frequency.
:Parameters:
pwm : `int`
The PWN frequency to set in hertz.
:Keywords:
device : `int`
The device is the integer number of the hardware devices ... | 0.002195 |
def sg_pool(tensor, opt):
r"""Performs the 2-D pooling on the `tensor`.
Mostly used with sg_conv().
Args:
tensor: A 4-D `Tensor` (automatically given by chain).
opt:
size: A tuple or list of integers of length 2 representing `[kernel height, kernel width]`.
Can be an int if bo... | 0.005187 |
def run_job(args):
"""Starts the wrapper script to execute a job, interpreting the JOB_ID and SGE_TASK_ID keywords that are set by the grid or by us."""
jm = setup(args)
job_id = int(os.environ['JOB_ID'])
array_id = int(os.environ['SGE_TASK_ID']) if os.environ['SGE_TASK_ID'] != 'undefined' else None
jm.run_jo... | 0.023599 |
def getInput():
"""Read the input buffer without blocking the system."""
input = ''
if sys.platform == 'win32':
import msvcrt
if msvcrt.kbhit(): # Check for a keyboard hit.
input += msvcrt.getch()
print_(input)
else:
time.sleep(.1)
else: # ... | 0.001229 |
def get_access_token(self):
"""Method to return the current requests' access_token.
:returns: Access token or None
:rtype: str
.. versionadded:: 1.2
"""
try:
credentials = OAuth2Credentials.from_json(
self.credentials_store[g.oidc_id_token['s... | 0.00381 |
def render_columns(columns, write_borders=True, column_colors=None):
"""
Renders a list of columns.
:param columns: A list of columns, where each column is a list of strings.
:type columns: [[``str``]]
:param write_borders: Whether to write the top and bottom borders.
:type write_borders: ``boo... | 0.000886 |
def _valid_other_type(x, types):
"""
Do all elements of x have a type from types?
"""
return all(any(isinstance(el, t) for t in types) for el in np.ravel(x)) | 0.00578 |
def PlugIn(self):
"""Take next available controller id and plug in to Virtual USB Bus"""
ids = self.available_ids()
if len(ids) == 0:
raise MaxInputsReachedError('Max Inputs Reached')
self.id = ids[0]
_xinput.PlugIn(self.id)
while self.id in self.available_i... | 0.005848 |
def load_plugin(self, p):
"""Load the specified plugin
:param p: The plugin to load
:type p: Subclass of JB_Plugin
:returns: None
:rtype: None
:raises: errors.PluginInitError
"""
if p.is_loaded():
return
# load required plugins first
... | 0.005937 |
def set_context(self, expr, ctx):
"""Set the context of an expression to Store or Del if possible."""
t = type(expr)
try:
# TODO: check if Starred is ok
if t in (ast.Attribute, ast.Name):
if type(ctx) == ast.Store():
mis.check_forbidden... | 0.005548 |
def start_server(self, event=None, server=None):
"""
Negotiate a new SSH2 session as a server. This is the first step after
creating a new L{Transport} and setting up your server host key(s). A
separate thread is created for protocol negotiation.
If an event is passed in, this... | 0.000737 |
def to_kaf(self):
"""
Converts the object to KAF (if it is NAF)
"""
if self.type == 'NAF':
self.type = 'KAF'
for node in self.__get_node_terms():
node.set('cid', node.get('id'))
del node.attrib['id'] | 0.006969 |
def Start(self):
"""Start HTTPServer."""
try:
self._http_server = http_server.HTTPServer(("", self.port),
StatsServerHandler)
except socket.error as e:
if e.errno == errno.EADDRINUSE:
raise base_stats_server.PortInUseError(self.port)
... | 0.007952 |
def status(self):
""" The HTTP status line as a string (e.g. ``404 Not Found``)."""
status = _HTTP_STATUS_LINES.get(self._status_code)
return str(status or ('{} Unknown'.format(self._status_code))) | 0.00905 |
def is_parent_of_objective_bank(self, id_, objective_bank_id):
"""Tests if an ``Id`` is a direct parent of an objective bank.
arg: id (osid.id.Id): an ``Id``
arg: objective_bank_id (osid.id.Id): the ``Id`` of an
objective bank
return: (boolean) - ``true`` if this `... | 0.003457 |
def loglike(self, endog, mu, freq_weights=1, scale=1.):
r"""
The log-likelihood function in terms of the fitted mean response.
Parameters
----------
endog : array-like
Endogenous response variable
mu : array-like
Fitted mean response variable
... | 0.00157 |
def CalculateWaitForRetry(retry_attempt, max_wait=60):
"""Calculates amount of time to wait before a retry attempt.
Wait time grows exponentially with the number of attempts. A
random amount of jitter is added to spread out retry attempts from
different clients.
Args:
retry_attempt: Retry at... | 0.00157 |
def mates(args):
"""
%prog mates bedfile
Generate the mates file by inferring from the names.
"""
p = OptionParser(mates.__doc__)
p.add_option("--lib", default=False, action="store_true",
help="Output library information along with pairs [default: %default]")
p.add_option("--noi... | 0.005267 |
def _cursor_up(self, value):
"""
Moves the cursor up by ``value``.
"""
value = int(value)
if value == 0:
value = 1
self._cursor.clearSelection()
self._cursor.movePosition(self._cursor.Up, self._cursor.MoveAnchor, value)
self._last_cursor_pos = ... | 0.008746 |
def get_children(self):
"""Get the child nodes below this node.
:returns: The children.
:rtype: iterable(NodeNG)
"""
for expr, var in self.items:
yield expr
if var:
yield var
yield from self.body | 0.007042 |
def update_parent(self, fut):
"""Add a callback to the parent to update the state.
This handles the case where the user has called result on the AppFuture
before the parent exists.
"""
self.parent = fut
try:
fut.add_done_callback(self.parent_callback)
... | 0.006787 |
def _get_dependencies_of(name, location=None):
'''
Returns list of first level dependencies of the given installed dap
or dap from Dapi if not installed
If a location is specified, this only checks for dap installed in that path
and return [] if the dap is not located there
'''
if not locat... | 0.001362 |
def _set_error_handler_callbacks(self, app):
"""
Sets the error handler callbacks used by this extension
"""
@app.errorhandler(NoAuthorizationError)
def handle_auth_error(e):
return self._unauthorized_callback(str(e))
@app.errorhandler(CSRFError)
def ... | 0.001587 |
def close_connection(self, connection, force=False):
"""overriding the baseclass function, this routine will decline to
close a connection at the end of a transaction context. This allows
for reuse of connections."""
if force:
try:
connection.close()
... | 0.003231 |
def get_current_branch(self, location):
"""
Return the current branch, or None if HEAD isn't at a branch
(e.g. detached HEAD).
"""
# git-symbolic-ref exits with empty stdout if "HEAD" is a detached
# HEAD rather than a symbolic ref. In addition, the -q causes the
... | 0.002699 |
def reduced_dependencies(self, exported_target):
"""Calculates the reduced transitive dependencies for an exported target.
The reduced set of dependencies will be just those transitive dependencies "owned" by
the `exported_target`.
A target is considered "owned" if:
1. It's "3rdparty" and "directl... | 0.008607 |
def optsChanged(self, param, opts):
"""Called when any options are changed that are not
name, value, default, or limits"""
# print "opts changed:", opts
ParameterItem.optsChanged(self, param, opts)
w = self.widget
if 'readonly' in opts:
self.updateDefaultBtn()... | 0.002782 |
def _after_flush_handler(session, _flush_context):
"""Archive all new/updated/deleted data"""
dialect = get_dialect(session)
handlers = [
(_versioned_delete, session.deleted),
(_versioned_insert, session.new),
(_versioned_update, session.dirty),
]
for handler, rows in handler... | 0.001408 |
def missing_input_files(self):
"""Make and return a dictionary of the missing input files.
This returns a dictionary mapping
filepath to list of `Link` that use the file as input.
"""
missing = self.check_input_files(return_found=False)
ret_dict = {}
for miss_fil... | 0.004914 |
def scrub(zpool, stop=False, pause=False):
'''
Scrub a storage pool
zpool : string
Name of storage pool
stop : boolean
If ``True``, cancel ongoing scrub
pause : boolean
If ``True``, pause ongoing scrub
.. versionadded:: 2018.3.0
.. note::
Pau... | 0.002597 |
def main_nonexecutable_region_limbos_contain(self, addr, tolerance_before=64, tolerance_after=64):
"""
Sometimes there exists a pointer that points to a few bytes before the beginning of a section, or a few bytes
after the beginning of the section. We take care of that here.
:param int ... | 0.00363 |
def import_file(self, file_obj, folder):
"""
Create a File or an Image into the given folder
"""
created = False
for cls in MEDIA_MODELS:
if cls.matches_file_type(file_obj.name):
obj, created = cls.objects.get_or_create(
original_f... | 0.004115 |
def packet_handle(self):
"""Incoming packet handler dispatcher."""
cmd = self.in_packet.command & 0xF0
if cmd == NC.CMD_CONNACK:
return self.handle_connack()
elif cmd == NC.CMD_PINGRESP:
return self.handle_pingresp()
elif cmd == NC.CMD_PUBLISH:
... | 0.00273 |
def items(self, query=None, **kwargs):
"""
Return the items to be sent to the client
"""
# Cut this, we don't need no empty query
if not query:
self.__final_queryset = self.get_model().objects.none()
return self.serialize(self.__final_queryset)
# Q... | 0.00175 |
def create_job(self, project_id, job, use_existing_job_fn=None):
"""
Launches a MLEngine job and wait for it to reach a terminal state.
:param project_id: The Google Cloud project id within which MLEngine
job will be launched.
:type project_id: str
:param job: MLEng... | 0.001182 |
def get_next_scheduled_time(cron_string):
"""Calculate the next scheduled time by creating a crontab object
with a cron string"""
itr = croniter.croniter(cron_string, datetime.utcnow())
return itr.get_next(datetime) | 0.004329 |
def process_sparser_output(output_fname, output_fmt='json'):
"""Return a processor with Statements extracted from Sparser XML or JSON
Parameters
----------
output_fname : str
The path to the Sparser output file to be processed. The file can
either be JSON or XML output from Sparser, wit... | 0.000923 |
def regex(self, protocols, localhost=True):
"""
URL Validation regex
Based on regular expression by Diego Perini (@dperini) and provided
under MIT License: https://gist.github.com/dperini/729294
:return:
"""
p = r"^"
# protocol
p += r"(?:(?:(?:{})... | 0.002088 |
def expand_folder(notebook_or_folder, recursive=False):
"""
If notebook_or_folder is a folder, returns a list containing all notebooks
in the folder. Otherwise, returns a list containing the notebook name.
If recursive is True, recurses into subdirectories.
"""
is_file = os.path.isfile(notebook... | 0.000974 |
def process_mav(self, mlog, flightmode_selections):
'''process one file'''
self.vars = {}
idx = 0
all_false = True
for s in flightmode_selections:
if s:
all_false = False
# pre-calc right/left axes
self.num_fields = len(self.fields)
... | 0.003043 |
def idle_task(self):
'''called on idle'''
if self.module('console') is not None and not self.menu_added_console:
self.menu_added_console = True
self.module('console').add_menu(self.menu) | 0.00885 |
def subscribe(ws):
"""WebSocket endpoint, used for liveupdates"""
while ws is not None:
gevent.sleep(0.1)
try:
message = ws.receive() # expect function name to subscribe to
if message:
stream.register(ws, message)
except WebSocketError:
... | 0.003021 |
def _initial_run():
""" Check things during the initial setting of sprinter's global config """
if not system.is_officially_supported():
logger.warn(warning_template
+ "===========================================================\n"
+ "Sprinter is not officially su... | 0.006876 |
def initdb(self):
'''initdb will check for writability of the data folder, meaning
that it is bound to the local machine. If the folder isn't bound,
expfactory runs in demo mode (not saving data)
'''
self.database = EXPFACTORY_DATABASE
bot.info("DATABASE: %s" %self... | 0.00651 |
def rmatrixquaternion(q):
"""Create a rotation matrix from q quaternion rotation.
Quaternions are typed as Numeric Python numpy.arrays of length 4.
"""
assert np.allclose(math.sqrt(np.dot(q,q)), 1.0)
x, y, z, w = q
xx = x*x
xy = x*y
xz = x*z
xw = x*w
yy = y*y
yz = y*z
y... | 0.011084 |
def gplot(self, analytes=None, win=25, figsize=[10, 4],
ranges=False, focus_stage=None, ax=None, recalc=True):
"""
Plot analytes gradients as a function of Time.
Parameters
----------
analytes : array_like
list of strings containing names of analytes to... | 0.001584 |
def get(self, direction=NOMINAL, names=ALL, diff=False, factor=False):
""" get(direction=NOMINAL, names=ALL, diff=False, factor=False)
Returns different representations of the contained value(s). *direction* should be any of
*NOMINAL*, *UP* or *DOWN*. When not *NOMINAL*, *names* decides which un... | 0.004425 |
def print_dictionary(self, d, h, n, nl=False):
"""Print complex using the specified indent (n) and newline (nl)."""
if d in h:
return "{}..."
h.append(d)
s = []
if nl:
s.append("\n")
s.append(self.indent(n))
s.append("{")
for it... | 0.003812 |
def stop():
"""Stop the server, invalidating any viewer URLs.
This allows any previously-referenced data arrays to be garbage collected if there are no other
references to them.
"""
global global_server
if global_server is not None:
ioloop = global_server.ioloop
def stop_ioloop(... | 0.006536 |
def receive_message(self):
"""Read the next message from the connection.
@rtype: OmapiMessage
@raises OmapiError:
@raises socket.error:
"""
while not self.recv_message_queue:
self.transport.fill_inbuffer()
message = self.recv_message_queue.pop(0)
assert message is not None
if not message.verify(sel... | 0.034803 |
def create_ec2_role(self, role, bound_ami_id=None, bound_account_id=None, bound_iam_role_arn=None,
bound_iam_instance_profile_arn=None, bound_ec2_instance_id=None, bound_region=None,
bound_vpc_id=None, bound_subnet_id=None, role_tag=None, ttl=None, max_ttl=None, period=N... | 0.003475 |
def f_load(self, recursive=True, load_data=pypetconstants.LOAD_DATA,
max_depth=None):
"""Loads a group from disk.
:param recursive:
Default is ``True``.
Whether recursively all nodes below the current node should be loaded, too.
Note that links are ne... | 0.005613 |
def serialize_operations(self, operations):
"""Serialize a list of operations into JSON."""
serialized_ops = []
for operation in operations:
serializer = self.get_serializer_class(operation.__class__)
serialized_ops.append(serializer(operation).data)
return seria... | 0.006079 |
def transpose(attrs, inputs, proto_obj):
"""Transpose the input array."""
new_attrs = translation_utils._fix_attribute_names(attrs,
{'perm' : 'axes'})
return 'transpose', new_attrs, inputs | 0.007843 |
def p_stringValueList(p):
"""stringValueList : stringValue
| stringValueList stringValue
"""
if len(p) == 2:
p[0] = _fixStringValue(p[1], p)
else:
p[0] = p[1] + _fixStringValue(p[2], p) | 0.003861 |
def next_frame_basic_stochastic_discrete():
"""Basic 2-frame conv model with stochastic discrete latent."""
hparams = basic_deterministic_params.next_frame_sampling()
hparams.batch_size = 4
hparams.video_num_target_frames = 6
hparams.scheduled_sampling_mode = "prob_inverse_lin"
hparams.scheduled_sampling_de... | 0.021858 |
def propertyContainer(self, ulBuffer):
"""retrieves the property container of an buffer."""
fn = self.function_table.propertyContainer
result = fn(ulBuffer)
return result | 0.009852 |
def subnet_delete(auth=None, **kwargs):
'''
Delete a subnet
name
Name or ID of the subnet to update
CLI Example:
.. code-block:: bash
salt '*' neutronng.subnet_delete name=subnet1
salt '*' neutronng.subnet_delete \
name=1dcac318a83b4610b7a7f7ba01465548
'''
... | 0.002304 |
def read_json(self):
"""Calls the overridden method.
:returns: The read metadata.
:rtype: dict
"""
with reading_ancillary_files(self):
metadata = super(GenericLayerMetadata, self).read_json()
return metadata | 0.007435 |
def triangle(times: np.ndarray, amp: complex, period: float, phase: float = 0) -> np.ndarray:
"""Continuous triangle wave.
Args:
times: Times to output wave for.
amp: Pulse amplitude. Wave range is [-amp, amp].
period: Pulse period, units of dt.
phase: Pulse phase.
"""
r... | 0.007282 |
def get_kwargs(self, **kwargs):
"""
Creates a full URL to request based on arguments.
:Parametes:
- `kwargs`: All keyword arguments to build a kubernetes API endpoint
"""
version = kwargs.pop("version", "v1")
if version == "v1":
base = kwargs.pop("... | 0.002349 |
def get_items(self, names):
"""
Subclass get items
to get support for all methods in an given object
"""
env = self.state.document.settings.env
prefixes = get_import_prefixes_from_env(env)
methodNames = []
for name in names:
methodNames.append(... | 0.005199 |
def _detach_children(self):
"""Remove all children and give them independent parent copies."""
children = [val[0] for val in self._children.values()]
for child in children:
child()._parent = list(self)
self._children.clear() | 0.007463 |
def set_load_from(self, load_from):
"""Update load_from in Cache and backend."""
assert load_from is None or isinstance(load_from, Cache), \
"load_from needs to be None or a Cache object."
assert load_from is None or load_from.cl_size <= self.cl_size, \
"cl_size may only ... | 0.004587 |
def _default_request_kwargs(self):
"""The default request keyword arguments to be passed to the requests library."""
defaults = copy.deepcopy(super(Acls, self)._default_request_kwargs)
defaults.setdefault('headers', {}).update({
'X-Auth-Token': self._client.auth._token
})
... | 0.008824 |
def delete_binding(self, vhost, exchange, queue, rt_key):
"""
Deletes a binding between an exchange and a queue on a given vhost.
:param string vhost: vhost housing the exchange/queue to bind
:param string exchange: the target exchange of the binding
:param string queue: the que... | 0.002198 |
def insert(cls, index, interceptor):
"""
Add interceptor to the given index in the internal list.
Note: Raises ``ValueError`` if interceptor
does not extend ``OpenTracingInterceptor``
"""
cls._check(interceptor)
cls._interceptors.insert(index, interceptor) | 0.00627 |
def delete_firewall_rule(self, server_name, name):
'''
Deletes an Azure SQL Database server firewall rule.
server_name:
Name of the server with the firewall rule you want to delete.
name:
Name of the firewall rule you want to delete.
'''
_validate... | 0.004024 |
def stream(self, limit=None, page_size=None):
"""
Streams KeyInstance records from the API as a generator stream.
This operation lazily loads records as efficiently as possible until the limit
is reached.
The results are returned as a generator, so this operation is memory effici... | 0.009083 |
def DeregisterFormatter(cls, formatter_class):
"""Deregisters a formatter class.
The formatter classes are identified based on their lower case data type.
Args:
formatter_class (type): class of the formatter.
Raises:
KeyError: if formatter class is not set for the corresponding data type.... | 0.00318 |
def mapper_from_prior_arguments(self, arguments):
"""
Creates a new model mapper from a dictionary mapping_matrix existing priors to new priors.
Parameters
----------
arguments: {Prior: Prior}
A dictionary mapping_matrix priors to priors
Returns
----... | 0.005806 |
def interact(self, client, location, interaction_required_err):
'''Implement Interactor.interact by obtaining obtaining
a macaroon from the discharger, discharging it with the
local private key using the discharged macaroon as
a discharge token'''
p = interaction_required_err.int... | 0.001271 |
def _level_coords(self):
"""Return a mapping of all MultiIndex levels and their corresponding
coordinate name.
"""
level_coords = OrderedDict()
for name, index in self.indexes.items():
if isinstance(index, pd.MultiIndex):
level_names = index.names
... | 0.004264 |
def get_unspents(self):
"""Fetches all available unspent transaction outputs.
:rtype: ``list`` of :class:`~bitcash.network.meta.Unspent`
"""
self.unspents[:] = NetworkAPI.get_unspent(self.address)
self.balance = sum(unspent.amount for unspent in self.unspents)
return sel... | 0.006061 |
def solve_filter(expr, vars):
"""Filter values on the LHS by evaluating RHS with each value.
Returns any LHS values for which RHS evaluates to a true value.
"""
lhs_values, _ = __solve_for_repeated(expr.lhs, vars)
def lazy_filter():
for lhs_value in repeated.getvalues(lhs_values):
... | 0.002114 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.