text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _default_key_normalizer(key_class, request_context):
"""
Create a pool key out of a request context dictionary.
According to RFC 3986, both the scheme and host are case-insensitive.
Therefore, this function normalizes both before constructing the pool
key for an HTTPS request. If you wish to ch... | 0.000522 |
def _set_hierarchy_view(self, session):
"""Sets the underlying hierarchy view to match current view"""
if self._hierarchy_view == FEDERATED:
try:
session.use_federated_hierarchy_view()
except AttributeError:
pass
else:
try:
... | 0.004706 |
def Sens_t(poly, dist, **kws):
"""
Variance-based decomposition
AKA Sobol' indices
Total effect sensitivity index
Args:
poly (Poly):
Polynomial to find first order Sobol indices on.
dist (Dist):
The distributions of the input used in ``poly``.
Returns:
... | 0.001627 |
def poly2lsf(a):
"""Prediction polynomial to line spectral frequencies.
converts the prediction polynomial specified by A,
into the corresponding line spectral frequencies, LSF.
normalizes the prediction polynomial by A(1).
.. doctest::
>>> from spectrum import poly2lsf
>>> a = [1... | 0.010165 |
def batch_eval(self, exprs, n, extra_constraints=(), solver=None, model_callback=None):
"""
Evaluate one or multiple expressions.
:param exprs: A list of expressions to evaluate.
:param n: Number of different solutions to return.
:param extra_cons... | 0.0097 |
def _indexMib(self):
"""Rebuild a tree from MIB objects found at currently loaded modules.
If currently existing tree is out of date, walk over all Managed Objects
and Instances to structure Management Instrumentation objects into a tree
of the following layout:
MibTree
... | 0.000926 |
def compact(self):
"""Remove all invalid config entries."""
saved_length = 0
to_remove = []
for i, entry in enumerate(self.entries):
if not entry.valid:
to_remove.append(i)
saved_length += entry.data_space()
for i in reversed(to_remov... | 0.005051 |
def fill_with_defaults(process_input, input_schema):
"""Fill empty optional fields in input with default values."""
for field_schema, fields, path in iterate_schema(process_input, input_schema):
if 'default' in field_schema and field_schema['name'] not in fields:
dict_dot(process_input, path... | 0.00578 |
def content(self):
"""
:return: string (unicode) with Dockerfile content
"""
if self.cache_content and self.cached_content:
return self.cached_content
try:
with self._open_dockerfile('rb') as dockerfile:
content = b2u(dockerfile.read())
... | 0.003497 |
def evaluateplanarR2derivs(Pot,R,phi=None,t=0.):
"""
NAME:
evaluateplanarR2derivs
PURPOSE:
evaluate the second radial derivative of a (list of) planarPotential instance(s)
INPUT:
Pot - (list of) planarPotential instance(s)
R - Cylindrical radius (can be Quantity)
... | 0.020251 |
def assemble_buffer(self, buf_header, buf_payload):
''' Add a buffer header and payload that we read from the socket.
This differs from add_buffer() because we're validating vs.
the header's num_buffers, instead of filling in the header.
Args:
buf_header (``JSON``) : a buff... | 0.004213 |
def action_sequence_to_logical_form(self, action_sequence: List[str]) -> str:
"""
Takes an action sequence as produced by :func:`logical_form_to_action_sequence`, which is a
linearization of an abstract syntax tree, and reconstructs the logical form defined by that
abstract syntax tree.
... | 0.006935 |
def _get_args(op, name):
"""Hack to get relevant arguments for lineage computation.
We need a better way to determine the relevant arguments of an expression.
"""
# Could use multipledispatch here to avoid the pasta
if isinstance(op, ops.Selection):
assert name is not None, 'name is None'
... | 0.001263 |
def __get_query_agg_max(cls, field, agg_id=None):
"""
Create an es_dsl aggregation object for getting the max value of a field.
:param field: field from which the get the max value
:return: a tuple with the aggregation id and es_dsl aggregation object. Ex:
{
... | 0.007313 |
def json_get(json: JsonValue, path: str, expected_type: Any = ANY) -> Any:
"""Get a JSON value by path, optionally checking its type.
>>> j = {"foo": {"num": 3.4, "s": "Text"}, "arr": [10, 20, 30]}
>>> json_get(j, "/foo/num")
3.4
>>> json_get(j, "/arr[1]")
20
Raise ValueError if the path i... | 0.000373 |
def not_files(self):
"""Returns a list of all arguments that aren't files/globs."""
_args = []
for arg in self.all:
if not len(_expand_path(arg)):
if not os.path.exists(arg):
_args.append(arg)
return ArgsList(_args, no_argv=True) | 0.00641 |
def kernels_status_cli(self, kernel, kernel_opt=None):
""" client wrapper for kernel_status
Parameters
==========
kernel_opt: additional option from the client, if kernel not defined
"""
kernel = kernel or kernel_opt
response = self.kernels_status(ker... | 0.004918 |
def to_dict(self):
"""Render a MessageElement as python dict
:return: Python dict representation
:rtype: dict
"""
obj_dict = super(Cell, self).to_dict()
child_dict = {
'type': self.__class__.__name__,
'header_flag': self.header_flag,
'... | 0.004016 |
def copy_numbered_block(self):
'''
Copies the block as it was originally specified by start and end into a new table.
Additionally inserts the original table indices in the first row of the block.
Returns:
A copy of the block with no block transformations.
'''
... | 0.008197 |
def load(cls, environment_name=None, site_name='primary', data_only=False, allow_old=False):
"""
Return an Environment object based on an existing environnment+site.
:param environment_name: exising environment name, path or None to
look in current or parent directories for project
... | 0.004038 |
def scenarios(self, generate_seed=False):
"""
Generator function. Spits out scenarios for this experiment
"""
seed = prime_numbers(1000)
sweeps_all = self.experiment["sweeps"].keys()
if "combinations" in self.experiment:
if isinstance(self.experiment["combinat... | 0.004161 |
def cite(
self,
title,
author=False,
year=False,
url=False,
publisher=False,
mediaKind=False,
linkedText=False,
nocite=False):
"""*generate a MMD citation*
**Key Arguments:**
- ``titl... | 0.002221 |
def disconnect(self, driver):
"""Disconnect from the console."""
self.log("TELNETCONSOLE disconnect")
try:
while self.device.mode != 'global':
self.device.send('exit', timeout=10)
except OSError:
self.log("TELNETCONSOLE already disconnected")
... | 0.003617 |
def is_convex(self):
"""
Check if a mesh is convex or not.
Returns
----------
is_convex: bool
Is mesh convex or not
"""
if self.is_empty:
return False
is_convex = bool(convex.is_convex(self))
return is_convex | 0.006579 |
def decode(self, packet):
'''
Decode a CONNECT control packet.
'''
self.encoded = packet
# Strip the fixed header plus variable length field
lenLen = 1
while packet[lenLen] & 0x80:
lenLen += 1
packet_remaining = packet[lenLen+1:]
# Var... | 0.007629 |
def trajectories(self, M, N, start=None, stop=None):
"""
Generates M trajectories, each of length N, starting from state s
Parameters
----------
M : int
number of trajectories
N : int
trajectory length
start : int, optional, default = None... | 0.00554 |
def add_suffix(in_files, suffix):
"""
Wrap nipype's fname_presuffix to conveniently just add a prefix
>>> add_suffix([
... '/path/to/sub-045_ses-test_T1w.nii.gz',
... '/path/to/sub-045_ses-retest_T1w.nii.gz'], '_test')
'sub-045_ses-test_T1w_test.nii.gz'
"""
import os.path as op... | 0.001931 |
def guess_currency_from_address(address):
"""
Given a crypto address, find which currency it likely belongs to.
Raises an exception if it can't find a match. Raises exception if address
is invalid.
"""
if is_py2:
fixer = lambda x: int(x.encode('hex'), 16)
else:
fixer = lambda... | 0.006764 |
def get_dependencies(self):
"""Returns the set of data dependencies as producer infos corresponding to data requirements."""
producer_infos = set()
for product_type in self._dependencies:
producer_infos.update(self._get_producer_infos_by_product_type(product_type))
return producer_infos | 0.012945 |
def get_initializer(default_init_type: str, default_init_scale: float, default_init_xavier_rand_type: str,
default_init_xavier_factor_type: str, embed_init_type: str, embed_init_sigma: float,
rnn_init_type: str, extra_initializers: Optional[List[Tuple[str, mx.initializer.Initiali... | 0.004137 |
def service(self, name=None, pk=None, scope=None, **kwargs):
"""
Retrieve single KE-chain Service.
Uses the same interface as the :func:`services` method but returns only a single pykechain
:class:`models.Service` instance.
:param name: (optional) name to limit the search for
... | 0.004125 |
def calc_dmgrid(d, maxloss=0.05, dt=3000., mindm=0., maxdm=0.):
""" Function to calculate the DM values for a given maximum sensitivity loss.
maxloss is sensitivity loss tolerated by dm bin width. dt is assumed pulse width in microsec.
"""
# parameters
tsamp = d['inttime']*1e6 # in microsec
k ... | 0.008253 |
def camera_action(self, mouse_pos):
"""Return a `sc_pb.Action` with the camera movement filled."""
action = sc_pb.Action()
action_spatial = mouse_pos.action_spatial(action)
mouse_pos.obs_pos.assign_to(action_spatial.camera_move.center_minimap)
return action | 0.00361 |
def file_list(self, load):
'''
Return a list of files from the dominant environment
'''
if 'env' in load:
# "env" is not supported; Use "saltenv".
load.pop('env')
ret = set()
if 'saltenv' not in load:
return []
if not isinstanc... | 0.00237 |
def analyzeModelWeightDistribution(modelName,base):
"""Plot histogram of non-zero weight values."""
model = torch.load(modelName)
model.eval()
analyzeWeightDistribution(model.l1.weight.data, base) | 0.029412 |
def get_task_log(task_id, session, request_kwargs=None):
"""Static method for getting a task log, given a task_id.
This method exists so a task log can be retrieved without
retrieving the items task history first.
:type task_id: str or int
:param task_id: The task id for the ta... | 0.003086 |
def create_dialog(self):
"""Create the dialog."""
self.bbox = QDialogButtonBox(QDialogButtonBox.Ok |
QDialogButtonBox.Cancel)
self.idx_ok = self.bbox.button(QDialogButtonBox.Ok)
self.idx_cancel = self.bbox.button(QDialogButtonBox.Cancel)
filebutton = QPushButton... | 0.002781 |
def add_new_state(state_machine_m, state_type):
"""Triggered when shortcut keys for adding a new state are pressed, or Menu Bar "Edit, Add State" is clicked.
Adds a new state only if the parent state (selected state) is a container state, and if the graphical editor or
the state machine tree are in focus.
... | 0.005711 |
def approximate_size(size, a_kilobyte_is_1024_bytes=True):
'''
Humansize.py from Dive into Python3
Mark Pilgrim - http://www.diveintopython3.net/
Copyright (c) 2009, Mark Pilgrim, All rights reserved.
Convert a file size to human-readable form.
Keyword arguments:
size -- file size in bytes
... | 0.001252 |
def collect(self):
"""
Overrides the Collector.collect method
"""
content = self._load()
result = dict((self.STATE[num], 0) for num in self.STATE)
for line in content:
line_array = self._remove_empty(line.split(' '))
state = self.STATE[line_array... | 0.004619 |
def get_conns(cred, providers):
"""Collect node data asynchronously using gevent lib."""
cld_svc_map = {"aws": conn_aws,
"azure": conn_az,
"gcp": conn_gcp,
"alicloud": conn_ali}
sys.stdout.write("\rEstablishing Connections: ")
sys.stdout.flush()
... | 0.001199 |
def event(request, slug):
"""
:param request: Django request object.
:param event_id: The `id` associated with the event.
:param is_preview: Should the listing page be generated as a preview? This
will allow preview specific actions to be done in the
templat... | 0.001055 |
def get_fc2(supercell,
symmetry,
dataset,
atom_list=None,
decimals=None):
"""Force constants are computed.
Force constants, Phi, are calculated from sets for forces, F, and
atomic displacement, d:
Phi = -F / d
This is solved by matrix pseudo-inversi... | 0.000546 |
def _save_config(self, filename):
"""Save the current running config to the given file."""
self.device.show('checkpoint file {}'.format(filename), raw_text=True) | 0.011299 |
def openResultsInBrowser(res):
"""
Method that collects the URI from a list of entities and opens them
Args:
-----
res: A list containing several i3visio entities.
"""
print(emphasis("\n\tOpening URIs in the default web browser..."))
urisToBrowser(["https://github.com/i3visio/osrfr... | 0.003049 |
def _validate_bool(value):
"""
Validate a setting is a bool.
Returns:
bool: The value as a boolean.
Raises:
ValueError: If the value can't be parsed as a bool string or isn't already bool.
"""
if isinstance(value, six.text_type):
if value.strip().lower() == 'true':
... | 0.004673 |
def associar_assinatura(retorno):
"""Constrói uma :class:`RespostaSAT` para o retorno (unicode) da função
:meth:`~satcfe.base.FuncoesSAT.associar_assinatura`.
"""
resposta = analisar_retorno(forcar_unicode(retorno),
funcao='AssociarAssinatura')
if resposta.EEEEE n... | 0.007353 |
def _get_base_class_names(frame):
""" Get baseclass names from the code object """
co, lasti = frame.f_code, frame.f_lasti
code = co.co_code
extends = []
for (op, oparg) in op_stream(code, lasti):
if op in dis.hasconst:
if type(co.co_consts[oparg]) == str:
extend... | 0.001003 |
def get_selected_text(self):
"""
Return text selected by current text cursor, converted in unicode
Replace the unicode line separator character \u2029 by
the line separator characters returned by get_line_separator
"""
return to_text_string(self.textCursor().selec... | 0.009302 |
def connect(self, object, callback):
"""Subscribe to the signal."""
def signal_fired(sender, object, iface, signal, params):
callback(*params)
return object._bus.subscribe(sender=object._bus_name, object=object._path, iface=self._iface_name, signal=self.__name__, signal_fired=signal_fired) | 0.023411 |
def delete_pool_member(hostname, username, password, name, member):
'''
Delete an existing pool member.
hostname
The host/address of the bigip device
username
The iControl REST username
password
The iControl REST password
name
The name of the pool to be modified
... | 0.00396 |
def normalized_index_expression(indices, shape, int_to_slice=False):
"""Enable indexing with almost Numpy-like capabilities.
Implements the following features:
- Usage of general slices and sequences of slices
- Conversion of `Ellipsis` into an adequate number of ``slice(None)``
objects
- Fe... | 0.000239 |
def plot_knee(self, ):
"""
Plot the curve and the knee, if it exists
"""
import matplotlib.pyplot as plt
plt.figure(figsize=(8, 8))
plt.plot(self.x, self.y)
plt.vlines(self.knee, plt.ylim()[0], plt.ylim()[1]) | 0.010949 |
def save(self):
""" Easy save(insert or update) for db models """
try:
if self.exists() is False:
self.db.session.add(self)
# self.db.session.merge(self)
self.db.session.commit()
except (Exception, BaseException) as error:
i... | 0.00495 |
def _set_computation_mode(self, v, load=False):
"""
Setter method for computation_mode, mapped from YANG variable /mpls_state/lsp/frr/computation_mode (lsp-cspf-computation-mode)
If this variable is read-only (config: false) in the
source YANG file, then _set_computation_mode is considered as a private
... | 0.00363 |
def is_dst(zonename):
"""
Find out whether it's Daylight Saving Time in this timezone
"""
tz = pytz.timezone(zonename)
now = pytz.utc.localize(datetime.utcnow())
return now.astimezone(tz).dst() != timedelta(0) | 0.004292 |
def next(self):
"""Get next data batch from iterator.
Returns
-------
DataBatch
The data of next batch.
Raises
------
StopIteration
If the end of the data is reached.
"""
if self.iter_next():
return DataBatch(d... | 0.008475 |
def shell(self, term='xterm'):
""" Start an interactive shell session
This method invokes a shell on the remote SSH server and proxies
traffic to/from both peers.
You must connect to a SSH server using ssh_connect()
prior to starting the session.
"""
channel = s... | 0.004988 |
def get_return_from(self, notif):
"""Setter of exit_status and execution_time attributes
:param notif: notification to get data from
:type notif: alignak.notification.Notification
:return: None
"""
self.exit_status = notif.exit_status
self.execution_time = notif.... | 0.005988 |
def file_names(self) -> Iterable[str]:
"""Generates all file names that are used to generate file_handles.
"""
if self.is_sharded():
yield from ShardedFile(self.filename_spec).get_filenames()
elif self.filename_spec:
yield self.filename_spec | 0.006734 |
def get_task_df(self):
'''
Returns
-------
'''
term_time_df = self._get_term_time_df()
terms_to_include = (
term_time_df
.groupby('term')['top']
.sum()
.sort_values(ascending=False)
.iloc[:self.num_terms_to_include].index
)
task_df = (
term_time_df[term_time_df.term.isin(terms_to_... | 0.040757 |
def bulk_lookup_rdap(addresses=None, inc_raw=False, retry_count=3, depth=0,
excluded_entities=None, rate_limit_timeout=60,
socket_timeout=10, asn_timeout=240, proxy_openers=None):
"""
The function for bulk retrieving and parsing whois information for a list
of IP ad... | 0.000072 |
def shorthand(self):
"""Return the 6-tuple (a,b,c,d,e,f) that describes this matrix"""
return (self.a, self.b, self.c, self.d, self.e, self.f) | 0.012658 |
def redo(self):
"""Redo the last cluster assignment operation.
Returns
-------
up : UpdateInfo instance of the changes done by this operation.
"""
# Go forward in the stack, and retrieve the new assignment.
item = self._undo_stack.forward()
if item is N... | 0.002179 |
def _get_pretty_dimension_order(self, ds, name):
'''
Returns a comma seperated string of the dimensions for a specified
variable
:param netCDF4.Dataset ds: An open netCDF dataset
:param str name: A string with a valid NetCDF variable name for the
dataset... | 0.002899 |
def resolve_redirects(self, resp, req, stream=False, timeout=None,
verify=True, cert=None, proxies=None):
"""Receives a Response. Returns a generator of Responses."""
i = 0
hist = [] # keep track of history
while resp.is_redirect:
prepared_request ... | 0.001644 |
def headloss_kozeny(Length, Diam, Vel, Porosity, Nu):
"""Return the Carmen Kozeny Sand Bed head loss."""
#Checking input validity
ut.check_range([Length, ">0", "Length"], [Diam, ">0", "Diam"],
[Vel, ">0", "Velocity"], [Nu, ">0", "Nu"],
[Porosity, "0-1", "Porosity"])
... | 0.00432 |
def message(self, message, thread_id=None):
"""Message the user associated with this profile.
:param message: The message to send to this user.
:param thread_id: The id of the thread to respond to, if any.
"""
return_value = helpers.Messager(self._session).send(
self... | 0.004577 |
def quadrat_cut_geometry(geometry, quadrat_width, min_num=3, buffer_amount=1e-9):
"""
Split a Polygon or MultiPolygon up into sub-polygons of a specified size,
using quadrats.
Parameters
----------
geometry : shapely Polygon or MultiPolygon
the geometry to split up into smaller sub-poly... | 0.002212 |
def diagram(args):
"""
%prog diagram
Plot the predictive power of various evidences.
"""
p = OptionParser(diagram.__doc__)
opts, args, iopts = p.set_image_options(args, figsize="8x4", format="png")
if len(args) != 0:
sys.exit(not p.print_help())
fig = plt.figure(1, (iopts.w, i... | 0.002778 |
def request_add(self, req, x, y):
"""Add two numbers"""
r = x + y
self._add_result.set_value(r)
return ("ok", r) | 0.013889 |
def zoom(self, factor):
"""
Zoom the camera view by a factor.
"""
camera = self.ren.GetActiveCamera()
camera.Zoom(factor)
self.ren_win.Render() | 0.010471 |
def configure_firewall(self, FirewallRules):
"""
Helper function for automatically adding several FirewallRules in series.
"""
firewall_rule_bodies = [
FirewallRule.to_dict()
for FirewallRule in FirewallRules
]
return self.cloud_manager.configure_f... | 0.011268 |
def delete_organization(db, organization):
"""Remove an organization from the registry.
This function removes the given organization from the registry.
Related information such as domains or enrollments are also removed.
It checks first whether the organization is already on the registry.
When it i... | 0.001232 |
def reassign_label(self, label, new_label, relabel=False):
"""
Reassign a label number to a new number.
If ``new_label`` is already present in the segmentation image,
then it will be combined with the input ``label`` number.
Parameters
----------
labels : int
... | 0.000739 |
def add_resource(self, resource_id, attributes, parents=[],
issuer='default'):
"""
Will add the given resource with a given identifier and attribute
dictionary.
example/
add_resource('/asset/12', {'id': 12, 'manufacturer': 'GE'})
"""
# MA... | 0.003497 |
def refresh(self):
"""Refresh tabwidget."""
if self.tabwidget.count():
editor = self.tabwidget.currentWidget()
else:
editor = None
self.find_widget.set_editor(editor) | 0.009009 |
def _get_default_retry_params():
"""Get default RetryParams for current request and current thread.
Returns:
A new instance of the default RetryParams.
"""
default = getattr(_thread_local_settings, 'default_retry_params', None)
if default is None or not default.belong_to_current_request():
return Ret... | 0.013587 |
def resolve(self, value):
"""
Resolve contextual value.
:param value:
Contextual value.
:return:
If value is a function with a single parameter, which is a read-only
dictionary, the return value of the function called with context
properties as its parameter. If not, the value itself.
"... | 0.050388 |
def p_operation_definition3(self, p):
"""
operation_definition : operation_type name directives selection_set
"""
p[0] = self.operation_cls(p[1])(
selections=p[4],
name=p[2],
directives=p[3],
) | 0.007435 |
def read_end_of_message(self):
"""Read the b"\\r\\n" at the end of the message."""
read = self._file.read
last = read(1)
current = read(1)
while last != b'' and current != b'' and not \
(last == b'\r' and current == b'\n'):
last = current
c... | 0.005952 |
def _plot(self):
"""Draw all the serie slices"""
squares = self._squares()
sq_dimensions = self.add_squares(squares)
for index, serie in enumerate(self.series):
current_square = self._current_square(squares, index)
self.gaugify(serie, squares, sq_dimensions, curr... | 0.006042 |
def deprecated(deprecated_in=None, removed_in=None, current_version=None, details=""):
"""Decorate a function to signify its deprecation
This function wraps a method that will soon be removed and does two things:
* The docstring of the method will be modified to include a notice
about depreca... | 0.000534 |
def delete_dataset(self, dataset, delete_nonempty=True):
"""Deletes a dataset (and optionally any tables in it), if it exists.
:param dataset:
:type dataset: BQDataset
:param delete_nonempty: if true, will delete any tables before deleting the dataset
"""
if no... | 0.005111 |
def run_all():
'''
Run all the munin plugins
CLI Example:
.. code-block:: bash
salt '*' munin.run_all
'''
plugins = list_plugins()
ret = {}
for plugin in plugins:
ret.update(run(plugin))
return ret | 0.003968 |
def status(self, s=None):
"""
Set/Get the status of the button.
"""
if s is None:
return self.states[self._status]
if isinstance(s, str):
s = self.states.index(s)
self._status = s
self.textproperty.SetLineOffset(self.offset)
self.ac... | 0.002509 |
def knitting_pattern(self, specification=None):
"""loads a :class:`knitting pattern
<knittingpattern.KnittingPattern.KnittingPattern>` from the dumped
content
:param specification: a
:class:`~knittingpattern.ParsingSpecification.ParsingSpecification`
or :obj:`None` t... | 0.003106 |
def BenjaminiHochbergCorrection(pvals, fdr):
"""Benjamini-Hochberg procedure to control false discovery rate.
Calling arguments:
*pvals* : a list of tuples of *(label, p)* where *label* is some label assigned
to each data point, and *p* is the corresponding *P-value*.
*fdr* : the desired false ... | 0.00644 |
def make_err(self, errtype, message, original, loc, ln=None, reformat=True, *args, **kwargs):
"""Generate an error of the specified type."""
if ln is None:
ln = self.adjust(lineno(loc, original))
errstr, index = getline(loc, original), col(loc, original) - 1
if reformat:
... | 0.006818 |
def save(self, index=None, force=False):
"""Save file"""
editorstack = self.get_current_editorstack()
return editorstack.save(index=index, force=force) | 0.011236 |
def addBreakpoint( self, lineno = -1 ):
"""
Adds a breakpoint for the given line number to this edit.
:note The lineno is 0-based, while the editor displays lines as
a 1-based system. So, if you want to put a breakpoint at
visual line... | 0.021116 |
def normalize_query(query_string, terms=TERMS, norm_space=NORM_SPACE):
"""
Example:
>>> normalize_query(' some random words "with quotes " and spaces')
['some', 'random', 'words', 'with quotes', 'and', 'spaces']
"""
return [
norm_space(' ', (t[0] or t[1]).strip()) for t in terms(q... | 0.003003 |
async def info(self, ctx, *, member : discord.Member = None):
"""Shows info about a member.
This cannot be used in private messages. If you don't specify
a member then the info returned will be yours.
"""
channel = ctx.message.channel
if member is None:
membe... | 0.004167 |
def stellar_luminosity2(self, steps=10000):
"""
DEPRECATED: ADW 2017-09-20
Compute the stellar luminosity (L_Sol; average per star).
Uses "sample" to generate mass sample and pdf. The range of
integration only covers the input isochrone data (no
extrapolation used), but... | 0.007984 |
def create_view(self, name, expr, database=None):
"""
Create an MapD view from a table expression
Parameters
----------
name : string
expr : ibis TableExpr
database : string, default None
"""
ast = self._build_ast(expr, MapDDialect.make_context())... | 0.004415 |
def calc_sasa(dssp_df):
"""
Calculation of SASA utilizing the DSSP program.
DSSP must be installed for biopython to properly call it.
Install using apt-get on Ubuntu
or from: http://swift.cmbi.ru.nl/gv/dssp/
Input: PDB or CIF structure file
Output: SASA (integer) of structure
"""
... | 0.001988 |
def connect(
self,
host_or_hosts,
port_or_ports=7051,
rpc_timeout=None,
admin_timeout=None,
):
"""
Pass-through connection interface to the Kudu client
Parameters
----------
host_or_hosts : string or list of strings
If you ha... | 0.003311 |
def postParse(self, original, loc, tokens):
"""Create a ComputationNode for Combine."""
return ComputationNode(self._combine, original, loc, tokens, ignore_no_tokens=True, ignore_one_token=True) | 0.014286 |
def fetch(self):
"""
Fetch a InstalledAddOnExtensionInstance
:returns: Fetched InstalledAddOnExtensionInstance
:rtype: twilio.rest.preview.marketplace.installed_add_on.installed_add_on_extension.InstalledAddOnExtensionInstance
"""
params = values.of({})
payload ... | 0.004688 |
def send(self, sender: PytgbotApiBot):
"""
Send the message via pytgbot.
:param sender: The bot instance to send with.
:type sender: pytgbot.bot.Bot
:rtype: PytgbotApiMessage
"""
return sender.send_chat_action(
# receiver, self.media, disable_notifi... | 0.006726 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.