text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def _take_values(self, item: Node) -> DictBasicType:
"""Takes snapshot of the object and replaces _parent property value on None to avoid
infitinite recursion in GPflow tree traversing.
:param item: GPflow node object.
:return: dictionary snapshot of the node object."""
values ... | 0.007444 |
def alpha_div(alphas, Ks, dim, num_q, rhos, nus):
r'''
Estimate the alpha divergence between distributions:
\int p^\alpha q^(1-\alpha)
based on kNN distances.
Used in Renyi, Hellinger, Bhattacharyya, Tsallis divergences.
Enforces that estimates are >= 0.
Returns divergence estimates w... | 0.002381 |
def fetchMyCgi(self):
"""Fetches statistics from my_cgi.cgi"""
try:
response = urlopen(Request('http://{}/my_cgi.cgi'.format(self.ip), b'request=create_chklst'));
except (HTTPError, URLError):
_LOGGER.warning("Failed to open url to {}".format(self.ip))
self._e... | 0.009843 |
def _cache_from_source(path: str) -> str:
"""Return the path to the cached file for the given path. The original path
does not have to exist."""
cache_path, cache_file = os.path.split(importlib.util.cache_from_source(path))
filename, _ = os.path.splitext(cache_file)
return os.path.join(cache_path, f... | 0.005917 |
def load(self, path, name):
"""Imports the specified ``fgic`` file from the hard disk.
:param path: filedirectory to which the ``fgic`` file is written.
:param name: filename, without file extension
"""
filename = name + '.fgic'
filepath = aux.joinpath(path, filename)
... | 0.003666 |
def validate_line(self, line):
"""Validate Unicode IPA string relative to panphon.
line -- String of IPA characters. Can contain whitespace and limited
punctuation.
"""
line0 = line
pos = 0
while line:
seg_m = self.ft.seg_regex.match(line)
... | 0.003405 |
def create_shell(console, manage_dict=None, extra_vars=None, exit_hooks=None):
"""Creates the shell"""
manage_dict = manage_dict or MANAGE_DICT
_vars = globals()
_vars.update(locals())
auto_imported = import_objects(manage_dict)
if extra_vars:
auto_imported.update(extra_vars)
_vars.u... | 0.00035 |
def _main_ctxmgr(func):
'''
A decorator wrapper for :class:`ServerMainContextManager`
Usage example:
.. code:: python
@aiotools.main
def mymain():
server_args = do_init()
stop_sig = yield server_args
if stop_sig == signal.SIGINT:
do_gracef... | 0.001689 |
def update_role(self, service_name, deployment_name, role_name,
os_virtual_hard_disk=None, network_config=None,
availability_set_name=None, data_virtual_hard_disks=None,
role_size=None, role_type='PersistentVMRole',
resource_extension_refer... | 0.002112 |
def commands(self):
"""
Returns a list of commands supported by the motor
controller.
"""
self._commands, value = self.get_attr_set(self._commands, 'commands')
return value | 0.009091 |
def insertPhenotypeAssociationSet(self, phenotypeAssociationSet):
"""
Inserts the specified phenotype annotation set into this repository.
"""
datasetId = phenotypeAssociationSet.getParentContainer().getId()
attributes = json.dumps(phenotypeAssociationSet.getAttributes())
... | 0.002597 |
def set(self, value):
"""
Sets the value of the DNS name
:param value:
A unicode string
"""
if not isinstance(value, str_cls):
raise TypeError(unwrap(
'''
%s value must be a unicode string, not %s
''',
... | 0.002732 |
def read(self, fileobj):
"""Return if all data could be read and the atom payload"""
fileobj.seek(self._dataoffset, 0)
data = fileobj.read(self.datalength)
return len(data) == self.datalength, data | 0.008696 |
def check_params(num_rows, num_cols, padding):
"""Validation and typcasting"""
num_rows = check_int(num_rows, 'num_rows', min_value=1)
num_cols = check_int(num_cols, 'num_cols', min_value=1)
padding = check_int(padding, 'padding', min_value=0)
return num_rows, num_cols, padding | 0.003333 |
def _on_call_service_msg(self, msg):
"""
Stub service handler. Start a thread to import the mitogen.service
implementation from, and deliver the message to the newly constructed
pool. This must be done as CALL_SERVICE for e.g. PushFileService may
race with a CALL_FUNCTION blockin... | 0.003795 |
def pHYs(self):
"""
pHYs chunk in PNG image, or |None| if not present
"""
match = lambda chunk: chunk.type_name == PNG_CHUNK_TYPE.pHYs # noqa
return self._find_first(match) | 0.014085 |
def create_similar(self, content, width, height):
"""Create a new surface that is as compatible as possible
for uploading to and the use in conjunction with this surface.
For example the new surface will have the same fallback resolution
and :class:`FontOptions`.
Generally, the n... | 0.001627 |
def RGB_to_CMY(cobj, *args, **kwargs):
"""
RGB to CMY conversion.
NOTE: CMYK and CMY values range from 0.0 to 1.0
"""
cmy_c = 1.0 - cobj.rgb_r
cmy_m = 1.0 - cobj.rgb_g
cmy_y = 1.0 - cobj.rgb_b
return CMYColor(cmy_c, cmy_m, cmy_y) | 0.003802 |
def auto_convert_numeric_string_cell(flagable, cell_str, position, worksheet, flags, units):
'''
Handles the string containing numeric case of cell and attempts
auto-conversion for auto_convert_cell.
'''
def numerify_str(cell_str, flag_level='minor', flag_text=""):
'''
Differentiates... | 0.003154 |
def grab_hidden_properties(self):
# type: () -> dict
"""
A one-shot access to hidden properties (the field is then destroyed)
:return: A copy of the hidden properties dictionary on the first call
:raise AttributeError: On any call after the first one
"""
# Copy p... | 0.005917 |
def jsonp(*args, **kw):
"""
Returns a JSON response with a callback wrapper, if asked for.
Consider using CORS instead, as JSONP makes the client app insecure.
See the :func:`~coaster.views.decorators.cors` decorator.
"""
data = json.dumps(dict(*args, **kw), indent=2)
callback = request.args... | 0.001629 |
def to_reminders(self, ical, label=None, priority=None, tags=None,
tail=None, sep=" ", postdate=None, posttime=None):
"""Return Remind commands for all events of a iCalendar"""
if not hasattr(ical, 'vevent_list'):
return ''
reminders = [self.to_remind(vevent, la... | 0.006073 |
def _resample_samplerate(samples, sr, newsr):
# type: (np.ndarray, int, int, str) -> np.ndarray
"""
Uses https://github.com/tuxu/python-samplerate
"""
try:
from samplerate import resample
except ImportError:
return None
ratio = newsr/sr
return _applyMultichan(samples,
... | 0.002584 |
def get_ref(self):
"""
Return the ID of the resource to which this not is attached
"""
if self.ref_key == 'NETWORK':
return self.network
elif self.ref_key == 'NODE':
return self.node
elif self.ref_key == 'LINK':
return self.link
... | 0.003774 |
def get_web_server(self, listen_addr, debug=False, **ssl_args):
"""Setup WebSocketServer on listen_addr (host, port)."""
return geventwebsocket.WebSocketServer(
listen_addr,
self.resource,
debug=debug,
**{key: val for key, val in ssl_args.items() if val is... | 0.005882 |
def Parse(self):
"""Iterator returning dict for each entry in history."""
for timestamp, url, title in self.Query(self.VISITS_QUERY):
if not isinstance(timestamp, (long, int)):
timestamp = 0
yield [timestamp, "FIREFOX3_VISIT", url, title] | 0.011236 |
def asset_class(self) -> str:
""" Returns the full asset class path for this stock """
result = self.parent.name if self.parent else ""
# Iterate to the top asset class and add names.
cursor = self.parent
while cursor:
result = cursor.name + ":" + result
c... | 0.00551 |
def remove_control_from_group(self, process_id, wit_ref_name, group_id, control_id):
"""RemoveControlFromGroup.
[Preview API] Removes a control from the work item form.
:param str process_id: The ID of the process.
:param str wit_ref_name: The reference name of the work item type.
... | 0.005942 |
def missingDataValue(self):
""" Returns the value to indicate missing data.
"""
value = getMissingDataValue(self._array)
fieldNames = self._array.dtype.names
# If the missing value attibute is a list with the same length as the number of fields,
# return the missing val... | 0.00722 |
def hex_to_name(hex_value, spec=u'css3'):
"""
Convert a hexadecimal color value to its corresponding normalized
color name, if any such name exists.
The optional keyword argument ``spec`` determines which
specification's list of color names will be used; valid values are
``html4``, ``css2``, ``... | 0.001017 |
def get_config():
"""Retrieve the config as a dictionary of key-value pairs."""
self = H2OConfigReader._get_instance()
if not self._config_loaded:
self._read_config()
return self._config | 0.008696 |
def inline_graphics(soup):
"""
inline-graphic tags
"""
inline_graphics = []
inline_graphic_tags = raw_parser.inline_graphic(soup)
position = 1
for tag in inline_graphic_tags:
item = {}
copy_attribute(tag.attrs, 'xlink:href', item, 'xlink_href')
# Get the tag type... | 0.001414 |
def xception(c, k=8, n_middle=8):
"Preview version of Xception network. Not tested yet - use at own risk. No pretrained model yet."
layers = [
conv(3, k*4, 3, 2),
conv(k*4, k*8, 3),
ConvSkip(k*8, k*16, act=False),
ConvSkip(k*16, k*32),
ConvSkip(k*32, k*91),
]
for ... | 0.012698 |
def _on_prop_changed(self, instance, meth_name, res, args, kwargs):
"""Called by the observation code, we are interested in
__setitem__"""
if not self._itsme and meth_name == "__setitem__": self.update_widget(args[0])
return | 0.019455 |
def formatmonthname(self, theyear, themonth, withyear=True):
"""
Change colspan to "5", add "today" button, and return a month
name as a table row.
"""
display_month = month_name[themonth]
if isinstance(display_month, six.binary_type) and self.encoding:
displ... | 0.003012 |
def pci_lookup_name1(
access: (IN, ctypes.POINTER(pci_access)),
buf: (IN, ctypes.c_char_p),
size: (IN, ctypes.c_int),
flags: (IN, ctypes.c_int),
arg1: (IN, ctypes.c_int),
) -> ctypes.c_char_p:
"""
Conversion of PCI ID's to names (according to the pci.ids file).
char *pci_lookup_name(
... | 0.001773 |
def _flush(self, buffer):
"""
Flush the write buffers of the stream if applicable.
Args:
buffer (memoryview): Buffer content.
"""
with _handle_client_error():
self._client.put_object(
Body=buffer.tobytes(), **self._client_kwargs) | 0.006452 |
def log10norm(x, mu, sigma=1.0):
""" Scale scipy lognorm from natural log to base 10
x : input parameter
mu : mean of the underlying log10 gaussian
sigma : variance of underlying log10 gaussian
"""
return stats.lognorm(sigma * np.log(10), scale=mu).pdf(x) | 0.003497 |
def blueprint_name_to_url(name):
""" remove the last . in the string it it ends with a .
for the url structure must follow the flask routing format
it should be /model/method instead of /model/method/
"""
if name[-1:] == ".":
name = name[:-1]
name = st... | 0.005479 |
def buy(self, price, volume, symbol, order_type=ft.OrderType.NORMAL, adjust_limit=0, acc_id=0):
"""买入"""
ret, data = self._trade_ctx.place_order(price=price, qty=volume, code=symbol, trd_side=ft.TrdSide.BUY,
order_type=order_type, adjust_limit=adjust_limit... | 0.009967 |
def columns(self):
"""
:return: the list of column in this table
"""
c = self._connection.cursor()
c.execute("describe `%s`.`%s`" % (self._db, self._name))
self._cols = []
for col in c.fetchall():
self._cols.append(Column.build(col, table=self, con=sel... | 0.00831 |
def get_resource_type_from_included_serializer(self):
"""
Check to see it this resource has a different resource_name when
included and return that name, or None
"""
field_name = self.field_name or self.parent.field_name
parent = self.get_parent_serializer()
if p... | 0.002538 |
def _range2cols(areas):
"""
Convert comma separated list of column names and ranges to indices.
Parameters
----------
areas : str
A string containing a sequence of column ranges (or areas).
Returns
-------
cols : list
A list of 0-based column indices.
Examples
... | 0.001449 |
def logs_update(self):
"""
Function updates logs.
"""
Gdk.threads_enter()
if not self.debugging:
self.debugging = True
self.debug_btn.set_label('Info logs')
else:
self.debugging = False
self.debug_btn.set_label('Debug logs')... | 0.003846 |
def _compute_filename(self, request: BaseRequest):
'''Get the appropriate filename from the request.'''
path = self._path_namer.get_filename(request.url_info)
if os.path.isdir(path):
path += '.f'
else:
dir_name, name = os.path.split(path)
path = os.pa... | 0.005168 |
def get(self,id):
'''Return all the semantic tag related to the given tag id
:returns: a semantic tag or None
:rtype: list of ckan.model.semantictag.SemanticTag object
'''
query = meta.Session.query(TagSemanticTag).filter(TagSemanticTag.id==id)
return query.first() | 0.035842 |
def _init_decoder(self):
"""
Set-up the _decoder attribute if necessary.
"""
# Note: content-encoding value should be case-insensitive, per RFC 7230
# Section 3.2
content_encoding = self.headers.get('content-encoding', '').lower()
if self._decoder is None and cont... | 0.004796 |
def find(self, dtype):
"""
Parameters
----------
dtype : PandasExtensionDtype or string
Returns
-------
return the first matching dtype, otherwise return None
"""
if not isinstance(dtype, str):
dtype_type = dtype
if not isi... | 0.002928 |
def line_statuses(self, filename):
"""
Return a list of tuples `(lineno, status)` of all the lines found in
the Cobertura report for the given file `filename` where `lineno` is
the line number and `status` is coverage status of the line which can
be either `True` (line hit) or `F... | 0.003053 |
def close(self):
"""Close the TarFile. In write-mode, two finishing zero blocks are
appended to the archive.
"""
if self.closed:
return
if self.mode in "aw":
self.fileobj.write(NUL * (BLOCKSIZE * 2))
self.offset += (BLOCKSIZE * 2)
... | 0.00304 |
def validate_maintenance_window(window):
"""Validate PreferredMaintenanceWindow for DBInstance"""
days = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
day_re = r'[A-Z]{1}[a-z]{2}'
hour = r'[01]?[0-9]|2[0-3]'
minute = r'[0-5][0-9]'
r = ("(?P<start_day>%s):(?P<start_hour>%s):(?P<start_minute>... | 0.000601 |
def set_user_methods(self, user_methods, forced=False):
r'''Method used to select certain property methods as having a higher
priority than were set by default. If `forced` is true, then methods
which were not specified are excluded from consideration.
As a side effect, `method` is remo... | 0.002769 |
def phonenumber_validation(data):
""" Validates phonenumber
Similar to phonenumber_field.validators.validate_international_phonenumber() but uses a different message if the
country prefix is absent.
"""
from phonenumber_field.phonenumber import to_python
phone_number = to_python(data)
if no... | 0.006116 |
def check_timeseries_id(self, dataset):
'''
Checks that if a variable exists for the time series id it has the appropriate attributes
:param netCDF4.Dataset dataset: An open netCDF dataset
'''
results = []
required_ctx = TestCtx(BaseCheck.HIGH, 'Required variable for tim... | 0.005664 |
def unbind_handler(self, svc_ref):
"""
Called if a command service is gone.
Unregisters its commands.
:param svc_ref: A reference to the unbound service
:return: True if the commands have been unregistered
"""
if svc_ref not in self._bound_references:
... | 0.002736 |
def after_return(self, status, retval, task_id, args, kwargs, einfo):
"""
After a task has run (both succesfully or with a failure) clear the
lock if "unlock_before_run" is False.
"""
# Only clear the lock after the task's execution if the
# "unlock_before_run" option is ... | 0.004376 |
def stop_trial(self, trial, error=False, error_msg=None, stop_logger=True):
"""Only returns resources if resources allocated."""
prior_status = trial.status
self._stop_trial(
trial, error=error, error_msg=error_msg, stop_logger=stop_logger)
if prior_status == Trial.RUNNING:
... | 0.003454 |
def delete_object_in_seconds(self, cont, obj, seconds, extra_info=None):
"""
Sets the object in the specified container to be deleted after the
specified number of seconds.
The 'extra_info' parameter is included for backwards compatibility. It
is no longer used at all, and will ... | 0.004065 |
def ec2_route_table_main_route_table_id(self, lookup, default=None):
"""
Args:
lookup: the friendly name of the VPC whose main route table we are looking up
default: the optional value to return if lookup failed; returns None if not set
Returns:
the ID of the main route table of the named ... | 0.008986 |
def get_conn(self):
"""Return a AzureDLFileSystem object."""
conn = self.get_connection(self.conn_id)
service_options = conn.extra_dejson
self.account_name = service_options.get('account_name')
adlCreds = lib.auth(tenant_id=service_options.get('tenant'),
... | 0.0048 |
def get_text(node, strategy):
"""
Get the most confident text results, either those with @index = 1 or the first text results or empty string.
"""
textEquivs = node.get_TextEquiv()
if not textEquivs:
log.debug("No text results on %s %s", node, node.id)
return ''
# elif strategy ... | 0.003546 |
def get_token_credentials(cls, username, request):
""" Get api token for user with username of :username:
Used by Token-based auth as `credentials_callback` kwarg.
"""
try:
user = cls.get_item(username=username)
except Exception as ex:
log.error(str(ex))
... | 0.004717 |
def clean_up_inverse(self, current):
"""
Clean up current.
Python doesn't have variable lookbehinds, so we have to do negative lookaheads.
!(...) when converted to regular expression is atomic, so once it matches, that's it.
So we use the pattern `(?:(?!(?:stuff|to|exclude)<x>))... | 0.007752 |
def rebuild(self, recreate=True, force=False, **kwargs):
"Recreate (if needed) the wx_obj and apply new properties"
# detect if this involves a spec that needs to recreate the wx_obj:
needs_rebuild = any([isinstance(spec, (StyleSpec, InitSpec))
for spec_name, sp... | 0.007134 |
def attributesToBinary(cls, attributes):
"""
:rtype: (str|None,int)
:return: the binary data and the number of chunks it was composed from
"""
chunks = [(int(k), v) for k, v in iteritems(attributes) if cls._isValidChunkName(k)]
chunks.sort()
numChunks = int(attrib... | 0.004825 |
def multi_bulk(self, args):
'''Multi bulk encoding for list/tuple ``args``
'''
return null_array if args is None else b''.join(self._pack(args)) | 0.011905 |
def initialize(self, init_value, context=None, force=False):
"""
Initialize the configuration manager
:param force: force initialization even if it's already initialized
:return:
"""
if not force and self._instance is not None:
raise ConfigurationAlreadyInit... | 0.004098 |
def map_abi_data(normalizers, types, data):
"""
This function will apply normalizers to your data, in the
context of the relevant types. Each normalizer is in the format:
def normalizer(datatype, data):
# Conditionally modify data
return (datatype, data)
Where datatype is a valid A... | 0.001101 |
def align(self, other):
"""
Align two time series so that len(self) == len(other) and self.timstamps == other.timestamps.
:return: :tuple:(`TimeSeries` object(the aligned self), `TimeSeries` object(the aligned other))
"""
if isinstance(other, TimeSeries):
aligned, ot... | 0.002188 |
def module(self):
"""The module in which the Class is defined.
Python equivalent of the CLIPS defglobal-module command.
"""
modname = ffi.string(lib.EnvDefclassModule(self._env, self._cls))
defmodule = lib.EnvFindDefmodule(self._env, modname)
return Module(self._env, d... | 0.006079 |
def convert_examples_to_features(examples, tokenizer, max_seq_length,
doc_stride, max_query_length, is_training):
"""Loads a data file into a list of `InputBatch`s."""
unique_id = 1000000000
features = []
for (example_index, example) in enumerate(examples):
que... | 0.00177 |
def MI_enumInstanceNames(self,
env,
objPath):
# pylint: disable=invalid-name
"""Return instance names of a given CIM class
Implements the WBEM operation EnumerateInstanceNames in terms
of the enum_instances method. A derived cla... | 0.004878 |
def _mk_connectivity_pits(self, i12, flats, elev, mag, dX, dY):
"""
Helper function for _mk_adjacency_matrix. This is a more general
version of _mk_adjacency_flats which drains pits and flats to nearby
but non-adjacent pixels. The slope magnitude (and flats mask) is
updated for t... | 0.00304 |
def _unify_call_signature(i, dist_fn):
"""Creates `dist_fn_wrapped` which calls `dist_fn` with all prev nodes.
Args:
i: Python `int` corresponding to position in topologically sorted DAG.
dist_fn: Python `callable` which takes a subset of previously constructed
distributions (in reverse order) and pr... | 0.007634 |
def move_group(self, group, parent, index=None):
"""
Move group to be a child of new parent.
:param group: The group to move.
:type group: :class:`keepassdb.model.Group`
:param parent: The new parent for the group.
:type parent: :class:`keepassdb.model.Group`
... | 0.008629 |
def execute_task(self, task, workflow_id, data=None):
""" Celery task that runs a single task on a worker.
Args:
self (Task): Reference to itself, the celery task object.
task (BaseTask): Reference to the task object that performs the work
in its run() method.
w... | 0.001688 |
def _build_collapse_to_gene_dict(graph) -> Dict[BaseEntity, Set[BaseEntity]]:
"""Build a collapse dictionary.
:param pybel.BELGraph graph: A BEL graph
:return: A dictionary of {node: set of PyBEL node tuples}
"""
collapse_dict = defaultdict(set)
r2g = {}
for gene_node, rna_node, d in graph... | 0.002481 |
def add_keywords_from_dict(self, keyword_dict):
"""To add keywords from a dictionary
Args:
keyword_dict (dict): A dictionary with `str` key and (list `str`) as value
Examples:
>>> keyword_dict = {
"java": ["java_2e", "java programing"],
... | 0.00464 |
def contamination_detection(self):
"""
Calculate the levels of contamination in the reads
"""
self.qualityobject = quality.Quality(self)
self.qualityobject.contamination_finder(input_path=self.sequencepath,
report_path=self.reportpa... | 0.006192 |
def outlineColor(self, value):
""" sets the outline color """
if isinstance(value, (list, Color)):
if value is list:
self._outlineColor = value
else:
self._outlineColor = value.asList | 0.007843 |
def close(self):
"""Close by closing the :attr:`transport`
Return the ``connection_lost`` event which can be used to wait
for complete transport closure.
"""
if not self._closed:
closed = False
event = self.event('connection_lost')
if self.tra... | 0.001873 |
async def streamstorm(self, text, opts=None, user=None):
'''
Evaluate a storm query and yield result messages.
Yields:
((str,dict)): Storm messages.
'''
if opts is None:
opts = {}
MSG_QUEUE_SIZE = 1000
chan = asyncio.Queue(MSG_QUEUE_SIZE, ... | 0.003502 |
def _process_json(data):
"""
return a list of GradCommittee objects.
"""
requests = []
for item in data:
committee = GradCommittee()
committee.status = item.get('status')
committee.committee_type = item.get('committeeType')
committee.dept = item.get('dept')
co... | 0.000656 |
def map_metabolite2kegg(metabolite):
"""
Return a KEGG compound identifier for the metabolite if it exists.
First see if there is an unambiguous mapping to a single KEGG compound ID
provided with the model. If not, check if there is any KEGG compound ID in
a list of mappings. KEGG IDs may map to co... | 0.000413 |
def publish_collated_document(cursor, model, parent_model):
"""Publish a given `module`'s collated content in the context of
the `parent_model`. Note, the model's content is expected to already
have the collated content. This will just persist that content to
the archive.
"""
html = bytes(cnxep... | 0.000725 |
def start_timer(self, reprate):
"""Start the digital output task that serves as the acquistion trigger"""
print 'starting digital output at rate {} Hz'.format(reprate)
self.trigger_task = DigitalOutTask(self.trigger_src, reprate)
self.trigger_task.start() | 0.010453 |
def package(self, value):
"""
Setter for **self.__package** attribute.
:param value: Attribute value.
:type value: unicode
"""
if value is not None:
assert type(value) is unicode, "'{0}' attribute: '{1}' type is not 'unicode'!".format(
"packa... | 0.008287 |
def get_load(jid):
'''
Included for API consistency
'''
options = _get_options(ret=None)
_response = _request("GET", options['url'] + options['db'] + '/' + jid)
if 'error' in _response:
log.error('Unable to get JID "%s" : "%s"', jid, _response)
return {}
return {_response['id... | 0.002994 |
def parse_contexts(contexts):
"""
Convert a contexts JSON to an Elasticsearch-compatible list of key-value pairs
For example, the JSON
{
"data": [
{
"data": {
"unique": true
},
"schema": "iglu:com.acme/unduplicated/jsonschema/1-0-0"
},
... | 0.001467 |
async def open_wallet_search(wallet_handle: int,
type_: str,
query_json: str,
options_json: str) -> int:
"""
Search for wallet records
:param wallet_handle: wallet handler (created by open_wallet).
:param type_: allo... | 0.002158 |
def friction_plate_Martin_1999(Re, plate_enlargement_factor):
r'''Calculates Darcy friction factor for single-phase flow in a
Chevron-style plate heat exchanger according to [1]_.
.. math::
\frac{1}{\sqrt{f_f}} = \frac{\cos \phi}{\sqrt{0.045\tan\phi
+ 0.09\sin\phi + f_0/\cos(\phi)}} +... | 0.007913 |
def read_byte(self):
"""Read one byte of cooked data
"""
buf = b''
if len(self.cookedq) > 0:
buf = bytes([self.cookedq[0]])
self.cookedq = self.cookedq[1:]
else:
yield from self.process_rawq()
if not self.eof:
yield ... | 0.003846 |
def revoke_admin_privileges(name, **client_args):
'''
Revoke cluster administration privileges from a user.
name
Name of the user from whom admin privileges will be revoked.
CLI Example:
.. code-block:: bash
salt '*' influxdb.revoke_admin_privileges <name>
'''
client = _c... | 0.002513 |
def doAffiliate(self):
"""Direct the user sign up with an affiliate OpenID provider."""
sreg_req = sreg.SRegRequest(['nickname'], ['fullname', 'email'])
href = sreg_req.toMessage().toURL(OPENID_PROVIDER_URL)
message = """Get an OpenID at <a href=%s>%s</a>""" % (
quoteattr(hr... | 0.005333 |
def Handle_Note(self, msg):
""" Handle a new note.
:param msg: the received note
:type msg: dict
:returns: The message to reply with
:rtype: str
"""
note_text = msg['object']['note']
note_tags = msg['object']['tags']
if 'ID' in msg['object']:
... | 0.002039 |
def run_conditional_decorators(self, context):
"""Evaluate the step decorators to decide whether to run step or not.
Use pypyr.dsl.Step.run_step if you intend on executing the step the
same way pypyr does.
Args:
context: (pypyr.context.Context) The pypyr context. This arg w... | 0.001101 |
def check_perms(perms, user, slug, raise_exception=False):
"""a helper user to check if a user has the permissions
for a given slug"""
if isinstance(perms, string_types):
perms = {perms}
else:
perms = set(perms)
allowed_users = ACLRule.get_users_for(perms, slug)
if allowed_user... | 0.00227 |
def click_download(self, event):
"""
event for download button
"""
args ['parallel'] = self.p.get()
args ['file_type'] = self.optionmenu.get()
args ['no_redirects'] = self.t.get()
args ['query'] = self.entry_query.get()
args ['min_file_size'] = int( self.entry_min.get())
args ['max_file_size'] = int( ... | 0.061111 |
def map_statements(self):
"""Run the ontology mapping on the statements."""
for stmt in self.statements:
for agent in stmt.agent_list():
if agent is None:
continue
all_mappings = []
for db_name, db_id in agent.db_refs.items(... | 0.001984 |
def send_notification(self, title, message, typ=1, url=None, sender=None):
"""
sends a message to user of this role's private mq exchange
"""
self.user.send_notification(title=title, message=message, typ=typ, url=url,
sender=sender) | 0.009967 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.