text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def create_index(self, fields, no_term_offsets=False,
no_field_flags=False, stopwords = None):
"""
Create the search index. The index must not already exist.
### Parameters:
- **fields**: a list of TextField or NumericField objects
- **no_term_offsets**: If... | 0.007806 |
def extract_from_system(cert_callback=None, callback_only_on_failure=False):
"""
Extracts trusted CA certs from the system CA cert bundle
:param cert_callback:
A callback that is called once for each certificate in the trust store.
It should accept two parameters: an asn1crypto.x509.Certifi... | 0.000381 |
def get_tag_value(self, i):
"""Get the resource's tag value specifying its schedule."""
# Look for the tag, Normalize tag key and tag value
found = False
for t in i.get('Tags', ()):
if t['Key'].lower() == self.tag_key:
found = t['Value']
break
... | 0.003003 |
def critical_path(graph):
"""
Compute and return the critical path in an acyclic directed weighted graph.
@attention: This function is only meaningful for directed weighted acyclic graphs
@type graph: digraph
@param graph: Digraph
@rtype: List
@return: List containing all the... | 0.022897 |
def set_tlsext_use_srtp(self, profiles):
"""
Enable support for negotiating SRTP keying material.
:param bytes profiles: A colon delimited list of protection profile
names, like ``b'SRTP_AES128_CM_SHA1_80:SRTP_AES128_CM_SHA1_32'``.
:return: None
"""
if not is... | 0.003846 |
def update_volumes(self):
"""Update list of EBS Volumes for the account / region
Returns:
`None`
"""
self.log.debug('Updating EBSVolumes for {}/{}'.format(self.account.account_name, self.region))
ec2 = self.session.resource('ec2', region_name=self.region)
tr... | 0.002162 |
def init(changelog_name):
"""Setup your project."""
changelog_path = find_chglog_file()
create_changelog_flag = True
mark = style("?", fg="blue", bold=True)
if not changelog_name:
if changelog_path:
filename = style(changelog_path.name, fg="blue", bold=True)
message... | 0.002252 |
def determine_context(device_ids: List[int],
use_cpu: bool,
disable_device_locking: bool,
lock_dir: str,
exit_stack: ExitStack) -> List[mx.Context]:
"""
Determine the MXNet context to run on (CPU or GPU).
:param device_... | 0.002564 |
def unnest_child_dict(parent, key, parent_name=''):
"""
If ``parent`` dictionary has a ``key`` whose ``val`` is a dict,
unnest ``val``'s fields into ``parent`` and remove ``key``.
>>> parent = {'province': 'Québec', 'capital': {'name': 'Québec City', 'pop': 491140}}
>>> unnest_child_dict(parent, 'c... | 0.003155 |
def advance(self):
"""Follow the next rule if available.
If we've run out of rules, reset the rules iterator.
"""
try:
return next(self._rules_iter)
except InnerStopIteration:
self._rules_iter = self._follow_rules()
return StopIteration()
... | 0.004673 |
def conversations(self):
"""
Get the conversation topics for an input targeting criteria
"""
body = {
"conversation_type": self.conversation_type,
"audience_definition": self.audience_definition,
"targeting_inputs": self.targeting_inputs
}
... | 0.007212 |
def docstring_with_summary(docstring, pairs, key_header, summary_type):
""" Return a string joining the docstring with the pairs summary table. """
return "\n".join(
[docstring, "Summary of {}:".format(summary_type), ""] +
summary_table(pairs, key_header) + [""]
) | 0.010791 |
def change_directory(self, path, *args, **kwargs):
""" :meth:`.WNetworkClientProto.change_directory` method implementation
"""
client = self.dav_client()
previous_path = self.session_path()
try:
if client.is_dir(self.session_path(path)) is False:
raise ValueError('Unable to change current working direc... | 0.031401 |
def deactivate_workflow_transitions(cr, model, transitions=None):
"""
Disable workflow transitions for workflows on a given model.
This can be necessary for automatic workflow transitions when writing
to an object via the ORM in the post migration step.
Returns a dictionary to be used on reactivate_... | 0.000592 |
def update_binary_annotations(self, extra_annotations):
"""Updates the binary annotations for the current span."""
if not self.logging_context:
# This is not the root span, so binary annotations will be added
# to the log handler when this span context exits.
self.bin... | 0.003396 |
def connected_edges(G, nodes):
"""
Given graph G and list of nodes, return the list of edges that
are connected to nodes
"""
nodes_in_G = collections.deque()
for node in nodes:
if not G.has_node(node):
continue
nodes_in_G.extend(nx.node_connected_component(G, node))
... | 0.002639 |
def ancestor_of(self, name, ancestor, visited=None):
"""
Check whether a node has another node as an ancestor.
name: The name of the node being checked.
ancestor: The name of the (possible) ancestor node.
visited: (optional, None) If given, a set of nodes that have
a... | 0.001883 |
def human_xor_11(X, y, model_generator, method_name):
""" XOR (true/true)
This tests how well a feature attribution method agrees with human intuition
for an eXclusive OR operation combined with linear effects. This metric deals
specifically with the question of credit allocation for the following func... | 0.006944 |
def _to_narrow(self, terms, data, mask, dates, symbols):
"""
Convert raw computed pipeline results into a DataFrame for public APIs.
Parameters
----------
terms : dict[str -> Term]
Dict mapping column names to terms.
data : dict[str -> ndarray[ndim=2]]
... | 0.000715 |
def chars2gloss(chars):
"""
Get the TLS basic gloss for a characters.
"""
out = []
chars = gbk2big5(chars)
for char in chars:
tmp = []
if char in _cd.TLS:
for entry in _cd.TLS[char]:
baxter = _cd.TLS[char][entry]['UNIHAN_GLOSS']
if baxt... | 0.002427 |
def save_migration(connection, basename):
""" Save a migration in `migrations_applied` table """
# Prepare query
sql = "INSERT INTO migrations_applied (name, date) VALUES (%s, NOW())"
# Run
with connection.cursor() as cursor:
cursor.execute(sql, (basename,))
connection.commit()
... | 0.003003 |
def date_struct(year, month, day, tz = "UTC"):
"""
Given year, month and day numeric values and a timezone
convert to structured date object
"""
ymdtz = (year, month, day, tz)
if None in ymdtz:
#logger.debug("a year, month, day or tz value was empty: %s" % str(ymdtz))
return None... | 0.012774 |
def company_vat(self):
"""
Returns 10 character tax identification number,
Polish: Numer identyfikacji podatkowej.
https://pl.wikipedia.org/wiki/NIP
"""
vat_digits = []
for _ in range(3):
vat_digits.append(self.random_digit_not_null())
for _... | 0.002809 |
def get_number_of_rows(dbcon, tablename, uuid=None):
"""
Return the number of rows in a table
:param dbcon: database connection
:param tablename: table name
:return: Boolean
"""
dbcur = dbcon.cursor()
if check_table_exists(dbcon, tablename):
if uuid:
dbcur.execute("SE... | 0.003901 |
def is_file_managed_by_git(self, path):
'''
:param path: Path to check
:returns: True if path is managed by git
'''
status, _stdout, _stderr = self.git.execute(
['git', 'ls-files', path, '--error-unmatch'],
with_extended_output=True,
with_excep... | 0.005571 |
def msg(self, msg):
""" used to write to a debugger that is connected to this
server; `str' written will have a newline added to it
"""
if hasattr(self.output, 'writeline'):
self.output.writeline(msg)
elif hasattr(self.output, 'writelines'):
self.output.wr... | 0.005376 |
def pack_chunk(source_data: bytes) -> str:
"""
Packs the specified binary source data by compressing it with the Zlib
library and then converting the bytes to a base64 encoded string for
non-binary transmission.
:param source_data:
The data to be converted to a compressed, base64 string
... | 0.002075 |
def alias_field(model, field):
"""
Return the prefix name of a field
"""
for part in field.split(LOOKUP_SEP)[:-1]:
model = associate_model(model,part)
return model.__name__ + "-" + field.split(LOOKUP_SEP)[-1] | 0.008475 |
def opt_grid_parallel(params, func, limits, ftol=0.01, disp=0, compute_errors=True):
"""
parallelized version of :func:`opt_grid`
"""
import multiprocessing
def spawn(f):
def fun(q_in,q_out):
while True:
i,x = q_in.get()
if i == None:
break
q_out.put((i,f(x)))
return fun
... | 0.053065 |
def save(self, basepath):
"""Save comic URL to filename on disk."""
out.info(u"Get image URL %s" % self.url, level=1)
self.connect()
filename = "%s%s" % (self.filename, self.ext)
comicDir = os.path.join(basepath, self.dirname)
if not os.path.isdir(comicDir):
o... | 0.001637 |
def alocar(
self,
nome,
id_tipo_rede,
id_ambiente,
descricao,
id_ambiente_vip=None,
vrf=None):
"""Inserts a new VLAN.
:param nome: Name of Vlan. String with a maximum of 50 characters.
:param id_tipo_rede: Ident... | 0.003638 |
def PrepareMergeTaskStorage(self, task):
"""Prepares a task storage for merging.
Moves the task storage file from the processed directory to the merge
directory.
Args:
task (Task): task.
Raises:
IOError: if the storage type is not supported or
if the storage file cannot be r... | 0.003846 |
def to_json(self, *, include_keys=None, exclude_keys=None, use_default_excludes=True,
pretty=False):
"""Converts the response from to_dict to a JSON string. If pretty is True then newlines,
indentation and key sorting are used.
"""
return to_json(
self.to_dict(
include_keys=i... | 0.009091 |
def _make_read_func(file_obj):
"""Return a CFFI callback that reads from a file-like object."""
@ffi.callback("cairo_read_func_t", error=constants.STATUS_READ_ERROR)
def read_func(_closure, data, length):
string = file_obj.read(length)
if len(string) < length: # EOF too early
re... | 0.002132 |
def sct_report_string(report):
"""Return a human-readable string representation of the error report
returned by lxml's schematron validator.
"""
ret = []
namespaces = {"svrl": "http://purl.oclc.org/dsdl/svrl"}
for index, failed_assert_el in enumerate(
report.findall("svrl:failed-assert",... | 0.002714 |
def _within_box(points, boxes):
"""Validate which keypoints are contained inside a given box.
points: NxKx2
boxes: Nx4
output: NxK
"""
x_within = (points[..., 0] >= boxes[:, 0, None]) & (
points[..., 0] <= boxes[:, 2, None]
)
y_within = (points[..., 1] >= boxes[:, 1, None]) & (
... | 0.002506 |
def construct_graph(self, fixed, feedable, x_val, hash_key):
"""
Construct the graph required to run the attack through generate_np.
:param fixed: Structural elements that require defining a new graph.
:param feedable: Arguments that can be fed to the same graph when
they take diff... | 0.005633 |
def gen(self, month=0, week=0, day=0, weekday=0, hour=0, minute=0):
'''generate config dictionary to pass to add() or remove()
Args:
month (int): month in a year, from 1 to 12
week (int): week in a month, from 1 to 4
day (int): day in a month, from 1 to 31
... | 0.003394 |
def update(self):
"""Gets the latest version of your metadata from the infrastructure and updates your local copy
Returns `True` if successful, `False` otherwise - OR -
Raises [IOTException](./Exceptions.m.html#IoticAgent.IOT.Exceptions.IOTException)
containing the error if the infrast... | 0.008915 |
def swap(self, fn, *args, **kwargs):
'''
Given a mutator `fn`, calls `fn` with the atom's current state, `args`,
and `kwargs`. The return value of this invocation becomes the new value
of the atom. Returns the new value.
:param fn: A function which will be passed the current sta... | 0.005656 |
def _get_scaled_score(
simple_score: float,
categorical_score: float,
category_weight: Optional[float] = .5) -> float:
"""
Scaled score is the weighted average of the simple score and
categorical score
"""
return np.average(
[simple... | 0.005181 |
def zforce(self,R,z,phi=0.,t=0.):
"""
NAME:
zforce
PURPOSE:
evaluate the vertical force F_z (R,z,t)
INPUT:
R - Cylindrical Galactocentric radius (can be Quantity)
z - vertical height (can be Quantity)
phi - azimuth (optional;... | 0.015929 |
def __sync(self):
"""Skip reader to the block boundary."""
pad_length = _BLOCK_SIZE - self.__reader.tell() % _BLOCK_SIZE
if pad_length and pad_length != _BLOCK_SIZE:
data = self.__reader.read(pad_length)
if len(data) != pad_length:
raise EOFError('Read %d bytes instead of %d' %
... | 0.00838 |
def getRemoteObject(self, busName, objectPath, interfaces=None,
replaceKnownInterfaces=False):
"""
Creates a L{RemoteDBusObject} instance to represent the
specified DBus object. If explicit interfaces are not
supplied, DBus object introspection will be used to ob... | 0.00092 |
def get_objects(self, uri, _oid=None, _start=None, _end=None,
load_kwargs=None, **kwargs):
'''
Load and transform csv data into a list of dictionaries.
Each row in the csv will result in one dictionary in the list.
:param uri: uri (file://, http(s)://) of csv file t... | 0.002123 |
def _get_example_length(example):
"""Returns the maximum length between the example inputs and targets."""
length = tf.maximum(tf.shape(example[0])[0], tf.shape(example[1])[0])
return length | 0.020408 |
def _write_ieeg_json(output_file):
"""Use only required fields
"""
dataset_info = {
"TaskName": "unknown",
"Manufacturer": "n/a",
"PowerLineFrequency": 50,
"iEEGReference": "n/a",
}
with output_file.open('w') as f:
dump(dataset_info, f, indent=' ') | 0.003195 |
def darken_color(color, amount):
"""Darken a hex color."""
color = [int(col * (1 - amount)) for col in hex_to_rgb(color)]
return rgb_to_hex(color) | 0.006329 |
def performAction(self, action):
""" Execute one action.
"""
# print "ACTION:", action
self.t += 1
Task.performAction(self, action)
# self.addReward()
self.samples += 1 | 0.009009 |
async def post(self, path, data={}, send_raw=False, **params):
'''sends post request
Parameters
----------
path : str
same as get_url
query : kargs dict
additional info to pass to get_url
See Also
--------
get_url :
Returns
-------
requests.models.Response
... | 0.009474 |
def adafactor_optimizer_from_hparams(hparams, lr):
"""Create an Adafactor optimizer based on model hparams.
Args:
hparams: model hyperparameters
lr: learning rate scalar.
Returns:
an AdafactorOptimizer
Raises:
ValueError: on illegal values
"""
if hparams.optimizer_adafactor_decay_type == "A... | 0.006036 |
def validate_ec2_browser_config(self):
"""Validate that the ec2 config is conform
"""
if self.config.get('launch', True):
required_keys = [
'browserName',
'platform',
'ssh_key_path',
'username',
'amiid',... | 0.001355 |
def extract(uid=None, base_url=None, use_default_email_domain=False,
default_email_domain=None, user=None, password=None):
'''
FIXME: DOCS...
'''
assert base_url and isinstance(base_url, (unicode, str))
export_url = os.path.join(base_url, 'export_csv')
# ded is shortform for "defaul... | 0.000888 |
def init(self):
"""
To be overridden to initialize the datasets needed by the calculation
"""
oq = self.oqparam
if not oq.risk_imtls:
if self.datastore.parent:
oq.risk_imtls = (
self.datastore.parent['oqparam'].risk_imtls)
i... | 0.001606 |
def _pause_all_nodes(self, max_thread_pool_size=0):
"""Pause all cluster nodes - ensure that we store data so that in
the future the nodes can be restarted.
:return: int - number of failures.
"""
failed = 0
def _pause_specific_node(node):
if not node.instanc... | 0.002357 |
def from_str(string):
"""Generate a `AddEvent` object from a string
"""
match = re.match(r'^ADD (\w+)$', string)
if match:
return AddEvent(match.group(1))
else:
raise EventParseError | 0.00813 |
def descendants(self, include_clip=True):
"""
Return a generator to iterate over all descendant layers.
Example::
# Iterate over all layers
for layer in psd.descendants():
print(layer)
# Iterate over all layers in reverse order
f... | 0.002522 |
def encrypt(key_id, plaintext, encryption_context=None, grant_tokens=None,
region=None, key=None, keyid=None, profile=None):
'''
Encrypt plaintext into cipher text using specified key.
CLI example::
salt myminion boto_kms.encrypt 'alias/mykey' 'myplaindata' '{"aws:username":"myuser"}'
... | 0.002604 |
def fold(self, predicate):
"""Takes a predicate and applies it to each node starting from the
leaves and making the return value propagate."""
childs = {x:y.fold(predicate) for (x,y) in self._attributes.items()
if isinstance(y, SerializableTypedAttributesHolder)}
return... | 0.011628 |
def _get_request(self, request_url, request_method, **params):
"""
Return a Request object that has the GET parameters
attached to the url or the POST data attached to the object.
"""
if request_method == 'GET':
if params:
request_url += '&%s' % urlenc... | 0.003945 |
def render_form(form, **kwargs):
"""
Render a form to a Bootstrap layout
"""
renderer_cls = get_form_renderer(**kwargs)
return renderer_cls(form, **kwargs).render() | 0.005435 |
def update(self, attributes):
"""Update the current instance based on attribute->value items in
*attributes*.
:param dict attributes: Dictionary of attributes to be updated
:rtype: :class:`sandman2.model.Model`
"""
for attribute in attributes:
setattr(self, a... | 0.005376 |
def decompile_func(func):
'''
Decompile a function into ast.FunctionDef node.
:param func: python function (can not be a built-in)
:return: ast.FunctionDef instance.
'''
code = func.__code__
# For python 3
# defaults = func.func_defaults if sys.version_info.major < 3 else func.... | 0.00731 |
def create(cls, name, billing_group=None, description=None, tags=None,
settings=None, api=None):
"""
Create a project.
:param name: Project name.
:param billing_group: Project billing group.
:param description: Project description.
:param tags: Project ta... | 0.002588 |
def update_router(router,
name=None,
admin_state_up=None,
profile=None,
**kwargs):
'''
Updates a router
CLI Example:
.. code-block:: bash
salt '*' neutron.update_router router_id name=new-router-name
admin... | 0.001214 |
def _run_serial_ops(state):
'''
Run all ops for all servers, one server at a time.
'''
for host in list(state.inventory):
host_operations = product([host], state.get_op_order())
with progress_spinner(host_operations) as progress:
try:
_run_server_ops(
... | 0.002101 |
def send(
self,
message=None,
From=None,
To=None,
Cc=None,
Bcc=None,
Subject=None,
Tag=None,
HtmlBody=None,
TextBody=None,
Metadata=None,
ReplyTo=None,
Headers=None,
TrackOpens=None,
TrackLinks="None"... | 0.003675 |
def replace_headers(request, replacements):
"""
Replace headers in request according to replacements. The replacements
should be a list of (key, value) pairs where the value can be any of:
1. A simple replacement string value.
2. None to remove the given header.
3. A callable which accepts... | 0.001353 |
async def close(self, *args, _conn=None, **kwargs):
"""
Perform any resource clean up necessary to exit the program safely.
After closing, cmd execution is still possible but you will have to
close again before exiting.
:raises: :class:`asyncio.TimeoutError` if it lasts more tha... | 0.005725 |
def get_app_from_path(path):
'''
:param path: A string to attempt to resolve to an app object
:type path: string
:returns: The describe hash of the app object if found, or None otherwise
:rtype: dict or None
This method parses a string that is expected to perhaps refer to
an app object. If... | 0.001282 |
def _custom_response_edit(self, method, url, headers, body, response):
"""
This method allows a service to edit a response.
If you want to do this, you probably really want to use
_edit_mock_response - this method will operate on Live resources.
"""
if self.get_implement... | 0.003976 |
def create(self, input=None, live_stream=False, outputs=None, options=None):
""" Creates a transcoding job. Here are some examples::
job.create('s3://zencodertesting/test.mov')
job.create(live_stream=True)
job.create(input='http://example.com/input.mov',
... | 0.002759 |
def export_chat_invite_link(
self,
chat_id: Union[int, str]
) -> str:
"""Use this method to generate a new invite link for a chat; any previously generated link is revoked.
You must be an administrator in the chat for this to work and have the appropriate admin rights.
Args... | 0.006029 |
def perform_matched_selection(self, event):
"""
Performs matched selection.
:param event: QMouseEvent
"""
selected = TextHelper(self.editor).match_select()
if selected and event:
event.accept() | 0.007905 |
def fit_doublegauss_samples(samples,**kwargs):
"""Fits a two-sided Gaussian to a set of samples.
Calculates 0.16, 0.5, and 0.84 quantiles and passes these to
`fit_doublegauss` for fitting.
Parameters
----------
samples : array-like
Samples to which to fit the Gaussian.
kwargs
... | 0.009615 |
def plugin_valid(self, filename):
"""
Checks if the given filename is a valid plugin for this Strategy
"""
filename = os.path.basename(filename)
for regex in self.regex_expressions:
if regex.match(filename):
return True
return False | 0.006494 |
def _classify_directory_contents(filesystem, root):
"""Classify contents of a directory as files/directories.
Args:
filesystem: The fake filesystem used for implementation
root: (str) Directory to examine.
Returns:
(tuple) A tuple consisting of three values: the directory examined,... | 0.001111 |
def patterson_f3(acc, aca, acb):
"""Unbiased estimator for F3(C; A, B), the three-population test for
admixture in population C.
Parameters
----------
acc : array_like, int, shape (n_variants, 2)
Allele counts for the test population (C).
aca : array_like, int, shape (n_variants, 2)
... | 0.000553 |
def _get_functions(expr, ldelim="(", rdelim=")"):
"""Parse function calls."""
tpars = _pair_delims(expr, ldelim=ldelim, rdelim=rdelim)
alphas = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
fchars = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789" "_"
tfuncs = []
... | 0.005803 |
def _kcpassword(password):
'''
Internal function for obfuscating the password used for AutoLogin
This is later written as the contents of the ``/etc/kcpassword`` file
.. versionadded:: 2017.7.3
Adapted from:
https://github.com/timsutton/osx-vm-templates/blob/master/scripts/support/set_kcpasswo... | 0.001756 |
def _with_meta(gen_node):
"""Wraps the node generated by gen_node in a :with-meta AST node if the
original form has meta.
:with-meta AST nodes are used for non-quoted collection literals and for
function expressions."""
@wraps(gen_node)
def with_meta(
ctx: ParserContext,
form: ... | 0.003617 |
def findFile(self, fname, numtype):
"""
Function that finds the associated file for fname when Fname is
time or NDump.
Parameters
----------
fname : string
The name of the file we are looking for.
numType : string
Designates how this funct... | 0.00559 |
def parse_qs(s, rx, parsef=None, length=2, quote=False):
'''helper for parsing a string that can both rx or parsef
which is obstensibly the parsef for rx.
Use parse colors for color tuples. This won't work with
those.
'''
if type(rx) != str:
rx = rx.pattern;
if re.match(" *... | 0.017058 |
def parse(cls, querydict):
""" Parse querydict data.
There are expected agruments:
distinct, fields, filter, include, page, sort
Parameters
----------
querydict : django.http.request.QueryDict
MultiValueDict with query arguments.
Returns
... | 0.001656 |
def is_free(self):
""" returns True if any of the spectral model parameters is set to free, else False
"""
return bool(np.array([int(value.get("free", False)) for key, value in self.spectral_pars.items()]).sum()) | 0.016949 |
def add_choice(self, text, inline_region, name='', identifier=None):
"""stub"""
choice_display_text = self._choice_text_metadata['default_string_values'][0]
choice_display_text['text'] = text
if identifier is None:
identifier = str(ObjectId())
choice = {
'... | 0.006061 |
def set_master(service,
conn_type,
private='y',
unpriv='y',
chroot='y',
wakeup='n',
maxproc='100',
command='',
write_conf=True,
path=MASTER_CF):
'''
Set a single config value in... | 0.00043 |
def check_method_allowed(cls, request):
""" Ensure the request HTTP method is permitted for this resource.
Raising a ResourceException if it is not.
"""
if not request.method in cls._meta.allowed_methods:
raise HttpError(
'Method \'%s\' not allowed on this r... | 0.007389 |
def _generate_image_and_label_batch(image, label, min_queue_examples,
batch_size, shuffle):
"""Construct a queued batch of images and labels.
Args:
image: 3-D Tensor of [height, width, 3] of type.float32.
label: 1-D Tensor of type.int32
min_queue_examples: int32, min... | 0.007052 |
def nvmlDeviceSetAutoBoostedClocksEnabled(handle, enabled):
r"""
/**
* Try to set the current state of Auto Boosted clocks on a device.
*
* For Kepler &tm; or newer fully supported devices.
*
* Auto Boosted clocks are enabled by default on some hardware, allowing the GPU to run at highe... | 0.006554 |
def load(fname):
"""Loads an array from file.
See more details in ``save``.
Parameters
----------
fname : str
The filename.
Returns
-------
list of NDArray, RowSparseNDArray or CSRNDArray, or \
dict of str to NDArray, RowSparseNDArray or CSRNDArray
Loaded data.
... | 0.001702 |
def make_canonical_path(
image_identifier, image_width, image_height,
region, size, rotation, quality, format_str
):
"""
Return the canonical URL path for an image for the given region/size/
rotation/quality/format API tranformation settings.
See http://iiif.io/api/image/2.1/#canonical-... | 0.000535 |
def fit_mcmc(self,nwalkers=300,nburn=200,niter=100,
p0=None,initial_burn=None,
ninitial=50, loglike_kwargs=None,
**kwargs):
"""Fits stellar model using MCMC.
:param nwalkers: (optional)
Number of walkers to pass to :class:`emcee.EnsembleSam... | 0.00769 |
def my_notes(self, start_index=0, limit=100, get_all=False, sort_by='loanId', sort_dir='asc'):
"""
Return all the loan notes you've already invested in. By default it'll return 100 results at a time.
Parameters
----------
start_index : int, optional
The result index ... | 0.003316 |
def kill(self):
"""Kill instantiated process
:raises: `AttributeError` if instantiated process doesn't seem to satisfy `constraints <relshell.daemon_shelloperator.DaemonShellOperator>`_
"""
BaseShellOperator._close_process_input_stdin(self._batcmd.batch_to_file_s)
BaseShellOpera... | 0.011765 |
def _internal_build(self):
""" This function assumes the self.__tree object has been setup,
though it doesn't care how. It will then setup all python
side data structures to be used for querying this object.
"""
self.nodes = self.__tree.Nodes()
self.edges = self._... | 0.001805 |
def set_index(self, indexes=None, append=False, inplace=None,
**indexes_kwargs):
"""Set DataArray (multi-)indexes using one or more existing
coordinates.
Parameters
----------
indexes : {dim: index, ...}
Mapping from names matching dimensions and va... | 0.002101 |
def plugins_all(self):
"""
All resulting versions of all plugins in the group filtered by ``blacklist``
Returns:
dict: Nested dictionary of plugins accessible through dot-notation.
Similar to :py:attr:`plugins`, but lowest level is a regular dictionary of
all unfilt... | 0.006234 |
def redo(self, channel, image):
"""This method is called when an image is set in a channel."""
self.logger.debug("image set")
chname = channel.name
# get old highlighted thumbs for this channel -- will be
# an empty set or one thumbkey
old_highlight = channel.extdata.thu... | 0.001472 |
def PXOR(cpu, dest, src):
"""
Logical exclusive OR.
Performs a bitwise logical exclusive-OR (XOR) operation on the quadword
source (second) and destination (first) operands and stores the result
in the destination operand location. The source operand can be an MMX(TM)
te... | 0.007308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.