text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def customer_source_webhook_handler(event):
"""Handle updates to customer payment-source objects.
Docs: https://stripe.com/docs/api#customer_object-sources.
"""
customer_data = event.data.get("object", {})
source_type = customer_data.get("object", {})
# TODO: handle other types of sources (https://stripe.com/do... | 0.021368 |
def _compute_sources_for_target(self, target):
"""Computes and returns the sources (relative to buildroot) for the given target."""
def resolve_target_sources(target_sources):
resolved_sources = []
for tgt in target_sources:
if tgt.has_sources():
resolved_sources.extend(tgt.sources... | 0.012517 |
def _delete_port_profile_from_ucsm(self, handle, port_profile, ucsm_ip):
"""Deletes Port Profile from UCS Manager."""
port_profile_dest = (const.PORT_PROFILESETDN + const.VNIC_PATH_PREFIX +
port_profile)
handle.StartTransaction()
# Find port profile on the U... | 0.003555 |
def get_all_article_properties(self, params=None):
"""
Get all article properties
This will iterate over all pages until it gets all elements.
So if the rate limit exceeded it will throw an Exception and you will get nothing
:param params: search params
:return: list
... | 0.0053 |
def diet(file, configuration, check):
"""Simple program that either print config customisations for your
environment or compresses file FILE."""
config = process.read_yaml_configuration(configuration)
process.diet(file, config) | 0.004115 |
def raise_for_status(self):
"""Raise WebDriverException if returned status is not zero."""
if not self.status:
return
error = find_exception_by_code(self.status)
message = None
screen = None
stacktrace = None
if isinstance(self.value, str):
... | 0.003215 |
def downloadFiles(self, prompt=True, extract=False):
"""Download files from the repository"""
#First, get the download urls
data = self.data
downloadUrls = self.getDownloadUrls()
#Then, confirm the user wants to do this
if prompt:
confirm = raw_input("Download files [Y/N]? ")
if confirm.lower() != ... | 0.039333 |
def _pluck_provider_state(raw_provider_state: Dict) -> ProviderState:
"""
>>> _pluck_provider_state({'name': 'there is an egg'})
ProviderState(descriptor='there is an egg', params=None)
>>> _pluck_provider_state({'name': 'there is an egg called', 'params': {'name': 'humpty'}})
ProviderState(descrip... | 0.005871 |
def once(func):
"""
Decorate func so it's only ever called the first time.
This decorator can ensure that an expensive or non-idempotent function
will not be expensive on subsequent calls and is idempotent.
>>> add_three = once(lambda a: a+3)
>>> add_three(3)
6
>>> add_three(9)
6
>>> add_three('12')
6
To... | 0.038788 |
def _convert_type(data_type): # @NoSelf
'''
Converts CDF data types into python types
'''
if data_type in (1, 41):
dt_string = 'b'
elif data_type == 2:
dt_string = 'h'
elif data_type == 4:
dt_string = 'i'
elif data_type in (8, ... | 0.002361 |
def logpdf(x, mean=None, cov=1, allow_singular=True):
"""
Computes the log of the probability density function of the normal
N(mean, cov) for the data x. The normal may be univariate or multivariate.
Wrapper for older versions of scipy.multivariate_normal.logpdf which
don't support support the allo... | 0.002372 |
def hash_array(vals, encoding='utf8', hash_key=None, categorize=True):
"""
Given a 1d array, return an array of deterministic integers.
.. versionadded:: 0.19.2
Parameters
----------
vals : ndarray, Categorical
encoding : string, default 'utf8'
encoding for data & key when strings
... | 0.000331 |
def connect(self, slot):
"""
Connects the signal to any callable object
"""
if not callable(slot):
raise ValueError("Connection to non-callable '%s' object failed" % slot.__class__.__name__)
if (isinstance(slot, partial) or '<' in slot.__name__):
# If it'... | 0.004708 |
def _json_to_evaluation(data):
"""
Only keep the data for online evaluations.
Two scenarios for multiple instructors:
1) all of the co-instructors may be evaluated online as a group,
sharing the eval URL.
2) each co-instructor may be evaluated individually,
with separate eval URLs.
... | 0.000671 |
def calc_2dsplinecoeffs_c(array2d):
"""
NAME:
calc_2dsplinecoeffs_c
PURPOSE:
Use C to calculate spline coefficients for a 2D array
INPUT:
array2d
OUTPUT:
new array with spline coeffs
HISTORY:
2013-01-24 - Written - Bovy (IAS)
"""
#Set up result arrays
... | 0.018931 |
def osm_net_download(lat_min=None, lng_min=None, lat_max=None, lng_max=None,
network_type='walk', timeout=180, memory=None,
max_query_area_size=50*1000*50*1000,
custom_osm_filter=None):
"""
Download OSM ways and nodes within a bounding box from the ... | 0.000174 |
def wake(self):
""" Wake the INA219 from power down mode """
configuration = self._read_configuration()
self._configuration_register(configuration | 0x0007)
# 40us delay to recover from powerdown (p14 of spec)
time.sleep(0.00004) | 0.007435 |
def put(self, *msgs):
"""Put one or more messages onto the queue. Example:
>>> queue.put("my message")
>>> queue.put("another message")
To put messages onto the queue in bulk, which can be significantly
faster if you have a large number of messages:
... | 0.009328 |
def createNetwork(self, name, scope_group_id=None, callback=None, errback=None, **kwargs):
"""
Create a new Network
For the list of keywords available, see :attr:`ns1.rest.ipam.Networks.INT_FIELDS` and :attr:`ns1.rest.ipam.Networks.PASSTHRU_FIELDS`
:param str name: Name of the Network t... | 0.007813 |
def bitperm(s, perm, pos):
"""Returns zero if there are no permissions for a bit of the perm. of a file. Otherwise it returns a positive value
:param os.stat_result s: os.stat(file) object
:param str perm: R (Read) or W (Write) or X (eXecute)
:param str pos: USR (USeR) or GRP (GRouP) or OTH (OTHer)
... | 0.00363 |
def blksize(self):
"""The test blksize."""
self._blksize = self.lib.iperf_get_test_blksize(self._test)
return self._blksize | 0.013605 |
def items(self):
"""Get query with correct ordering."""
if self.asc is not None:
if self._selected and self.asc:
return self.query.order_by(self._selected)
elif self._selected and not self.asc:
return self.query.order_by(desc(self._selected))
... | 0.005882 |
def weight_decay(decay_rate, var_list, skip_biases=True):
"""Apply weight decay to vars in var_list."""
if not decay_rate:
return 0.
tf.logging.info("Applying weight decay, decay_rate: %0.5f", decay_rate)
weight_decays = []
for v in var_list:
# Weight decay.
# This is a heuristic way to detect b... | 0.014658 |
def get_rates(self, mmin, mmax=np.inf):
"""
Returns the cumulative rates greater than Mmin
:param float mmin:
Minimum magnitude
"""
nsrcs = self.number_sources()
for iloc, source in enumerate(self.source_model):
print("Source Number %s of %s, Name... | 0.001741 |
def build_command(self, action, args=None):
"""Build a SOAP request.
Args:
action (str): the name of an action (a string as specified in the
service description XML file) to be sent.
args (list, optional): Relevant arguments as a list of (name,
va... | 0.000884 |
def _load_debugger_subcommands(self, name):
""" Create an instance of each of the debugger
subcommands. Commands are found by importing files in the
directory 'name' + 'sub'. Some files are excluded via an array set
in __init__. For each of the remaining files, we import them
an... | 0.00411 |
def get_map_location(target_device, fallback_device='cpu'):
"""Determine the location to map loaded data (e.g., weights)
for a given target device (e.g. 'cuda').
"""
map_location = torch.device(target_device)
# The user wants to use CUDA but there is no CUDA device
# available, thus fall back t... | 0.001441 |
def absent(
name,
region=None,
key=None,
keyid=None,
profile=None,
unsubscribe=False):
'''
Ensure the named sns topic is deleted.
name
Name of the SNS topic.
region
Region to connect to.
key
Secret key to be used.
keyid
... | 0.001568 |
def render_hidden(name, value):
""" render as hidden widget """
if isinstance(value, list):
return MultipleHiddenInput().render(name, value)
return HiddenInput().render(name, value) | 0.004975 |
def _get_quantiles(self, X, width, quantiles, modelmat=None, lp=None,
prediction=False, xform=True, term=-1):
"""
estimate prediction intervals for LinearGAM
Parameters
----------
X : array
input data of shape (n_samples, m_features)
wi... | 0.001978 |
def get_subjects_with_equal_or_higher_perm(self, perm_str):
"""
Args:
perm_str : str
Permission, ``read``, ``write`` or ``changePermission``.
Returns:
set of str : Subj that have perm equal or higher than ``perm_str``.
Since the lowest permission a subject can have is ``read`... | 0.005199 |
def _compensate_temperature(self, adc_t):
"""Compensate temperature.
Formula from datasheet Bosch BME280 Environmental sensor.
8.1 Compensation formulas in double precision floating point
Edition BST-BME280-DS001-10 | Revision 1.1 | May 2015
"""
var_1 = ((adc_t / 16384.0... | 0.002257 |
def absent(
name,
region=None,
key=None,
keyid=None,
profile=None):
'''
Ensure the IAM role is deleted.
name
Name of the IAM role.
region
Region to connect to.
key
Secret key to be used.
keyid
Access key to be used.
... | 0.000485 |
def view(action, dashboards, secrets):
"""View the output of the datafeeds and/or notifications used in your DASHBOARDS"""
if secrets is None:
secrets = os.path.join(os.path.expanduser("~"), "/.doodledashboard/secrets")
try:
loaded_secrets = try_read_secrets_file(secrets)
except Invali... | 0.004279 |
def list(ctx, remote):
"""List services."""
logger.debug("running command %s (%s)", ctx.command.name, ctx.params,
extra={"command": ctx.command.name, "params": ctx.params})
click.secho("[*] Installed services:")
home = ctx.obj["HOME"]
services_path = os.path.join(home, SERVICES)
... | 0.003339 |
def _infer_embedded_object(value):
"""
Infer CIMProperty/CIMParameter.embedded_object from the CIM value.
"""
if value is None:
# The default behavior is to assume that a value of None is not
# an embedded object. If the user wants that, they must specify
# the embedded_object p... | 0.001101 |
def make_skeleton(path, relations, item_rows, gzip=False):
"""
Instantiate a new profile skeleton (only the relations file and
item file) from an existing relations file and a list of rows
for the item table. For standard relations files, it is suggested
to have, as a minimum, the `i-id` and `i-inpu... | 0.000794 |
def leave_diff_mode(self):
"""Leave diff mode."""
assert self.diff_mode
self.diff_mode = False
self.diff_context_model = None
self.diff_from_source = False
self.setColumnCount(2)
self.refresh() | 0.008032 |
def run(self):
"""
start component
"""
loop = asyncio.get_event_loop()
if loop.is_closed():
asyncio.set_event_loop(asyncio.new_event_loop())
loop = asyncio.get_event_loop()
txaio.start_logging()
loop.run_until_complete(self.onConnect()) | 0.006309 |
def p_variable_decl(self, p):
""" variable_decl : variable t_colon style_list t_semicolon
"""
p[0] = Variable(list(p)[1:-1], p.lineno(4))
p[0].parse(self.scope) | 0.009852 |
def distinct(self, field=None):
"""
If field is None, then it means that it'll create:
select distinct *
and if field is not None, for example: 'name', it'll create:
select distinc(name),
"""
if field is None:
self.funcs.append(('distinct', ()... | 0.0075 |
def present(name,
base_dashboards_from_pillar=None,
base_panels_from_pillar=None,
base_rows_from_pillar=None,
dashboard=None,
profile='grafana'):
'''
Ensure the grafana dashboard exists and is managed.
name
Name of the grafana dashboard.
... | 0.000396 |
def get_course_final_price(self, mode, currency='$', enterprise_catalog_uuid=None):
"""
Get course mode's SKU discounted price after applying any entitlement available for this user.
Returns:
str: Discounted price of the course mode.
"""
try:
price_detai... | 0.005513 |
def _set_uda_offset1(self, v, load=False):
"""
Setter method for uda_offset1, mapped from YANG variable /uda_key/profile/uda_profile_offsets/uda_offset1 (union)
If this variable is read-only (config: false) in the
source YANG file, then _set_uda_offset1 is considered as a private
method. Backends lo... | 0.00491 |
def _stack_positions(positions, pos_in_dollars=True):
"""
Convert positions to percentages if necessary, and change them
to long format.
Parameters
----------
positions: pd.DataFrame
Daily holdings (in dollars or percentages), indexed by date.
Will be converted to percentages if... | 0.001066 |
def mul_coeffs(counts):
r'''Computes the liquid phase viscosity Joback coefficients
of an organic compound using the Joback method as a function of
chemical structure only.
.. math::
\mu_{liq} = \text{MW} \exp\left( \frac{ \sum_i \mu_a - 597.82}{T}
+... | 0.007088 |
def get_queryset(self):
"""
Optionally restricts the returned nodes
by filtering against a `search` query parameter in the URL.
"""
# retrieve all nodes which are published and accessible to current user
# and use joins to retrieve related fields
queryset = super(... | 0.002688 |
def add_make_function_rule(self, rule, opname, attr, customize):
"""Python 3.3 added a an addtional LOAD_CONST before MAKE_FUNCTION and
this has an effect on many rules.
"""
if self.version >= 3.3:
new_rule = rule % (('LOAD_CONST ') * 1)
else:
new_rule = r... | 0.004866 |
def lookup_effective_breakpoint(cls, file_name, line_number, frame):
""" Checks if there is an enabled breakpoint at given file_name and
line_number. Check breakpoint condition if any.
:return: found, enabled and condition verified breakpoint or None
:rtype: IKPdbBreakpoint or ... | 0.010417 |
def get_content_json(request):
"""Retrieve content as JSON using the ident-hash (uuid@version)."""
result = _get_content_json()
resp = request.response
resp.status = "200 OK"
resp.content_type = 'application/json'
resp.body = json.dumps(result)
return result, resp | 0.003413 |
def perform_exe_expansion(self):
"""
This function will look through the executables section of the
ConfigParser object and replace any values using macros with full paths.
For any values that look like
${which:lalapps_tmpltbank}
will be replaced with the equivalent of... | 0.004093 |
def get_all_entity_type_saved_searches(self, entitytype, **kwargs): # noqa: E501
"""Get all saved searches for a specific entity type for a user # noqa: E501
# noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async... | 0.001842 |
def list_processed_parameter_group_histogram(self, group=None, start=None, stop=None, merge_time=20):
"""
Reads index records related to processed parameter groups between the
specified start and stop time.
Each iteration returns a chunk of chronologically-sorted records.
:para... | 0.003581 |
def hmac(key, message, tag=None, alg=hashlib.sha256):
"""
Generates a hashed message authentication code (HMAC) by prepending the
specified @tag string to a @message, then hashing with to HMAC
using a cryptographic @key and hashing @alg -orithm.
"""
return HMAC.new(str(key), str(tag) + str(mess... | 0.005731 |
def refresh_all(self, *objects, **kwargs):
'''
This method is an alternate API for refreshing all entities tracked
by the session. You can call::
session.refresh_all()
session.refresh_all(force=True)
And all entities known by the session will be reloaded from Re... | 0.004115 |
def is_version(value):
"""Validate that value is a valid version string."""
try:
value = str(value)
if not parse_ver('1.4') <= parse_ver(value):
raise ValueError()
return value
except (AttributeError, TypeError, ValueError):
raise vol.Invalid(
'{} is n... | 0.002747 |
def combat(adata: AnnData, key: str = 'batch', covariates: Optional[Collection[str]] = None, inplace: bool = True):
"""ComBat function for batch effect correction [Johnson07]_ [Leek12]_ [Pedersen12]_.
Corrects for batch effects by fitting linear models, gains statistical power
via an EB framework where inf... | 0.004209 |
def add_cookie(self, key, value, **attrs):
'''
Finer control over cookies. Allow specifying an Morsel arguments.
'''
if attrs:
c = Morsel()
c.set(key, value, **attrs)
self.cookies[key] = c
else:
self.cookies[key] = value | 0.006472 |
def normalize(self):
"""
Adapt self.model so that amplitudes are positive and phases are in [0,360) as per convention
"""
for i, (_, amplitude, phase) in enumerate(self.model):
if amplitude < 0:
self.model['amplitude'][i] = -amplitude
self.model['phase'][i] = phase + 180.0
self.model['phase'][i] =... | 0.030726 |
def main():
"""
Main entry point for the `respect` command.
"""
args = parse_respect_args(sys.argv[1:])
if validate_username(args['<username>']):
print("processing...")
else:
print("@"+args['<username>'], "is not a valid username.")
print("Username may only contain alpha... | 0.001129 |
def _set_tunnel_map(self, v, load=False):
"""
Setter method for tunnel_map, mapped from YANG variable /interface/tunnel/tunnel_map (container)
If this variable is read-only (config: false) in the
source YANG file, then _set_tunnel_map is considered as a private
method. Backends looking to populate t... | 0.005459 |
def config_start(args):
'''Invoke a task (method configuration), on given entity in given space'''
# Try to use call caching (job avoidance)? Flexibly accept range of answers
cache = getattr(args, "cache", True)
cache = cache is True or (cache.lower() in ["y", "true", "yes", "t", "1"])
if not arg... | 0.005537 |
def get_gamma_value(self):
'''
getter
Gamma value.
'''
if isinstance(self.__gamma_value, float) is False:
raise TypeError("The type of __gamma_value must be float.")
return self.__gamma_value | 0.007968 |
def unmodified_isinstance(*bases):
"""When called in the form
MyOverrideClass(unmodified_isinstance(BuiltInClass))
it allows calls against passed in built in instances to pass even if there not a subclass
"""
class UnmodifiedIsInstance(type):
if sys.version_info[0] == 2 and sys.version_in... | 0.001997 |
def _update_property(tree_to_update, xpath_root, xpaths, values):
"""
Default update operation for a single parser property. If xpaths contains one xpath,
then one element per value will be inserted at that location in the tree_to_update;
otherwise, the number of values must match the number of xpaths.
... | 0.003532 |
def update(self, instance):
""" method finds unit_of_work record and change its status"""
assert isinstance(instance, UnitOfWork)
if instance.db_id:
query = {'_id': ObjectId(instance.db_id)}
else:
query = {unit_of_work.PROCESS_NAME: instance.process_name,
... | 0.003361 |
def get_supported_types():
"""
Return a dictionnary containing types lists supported by the
namespace browser.
Note:
If you update this list, don't forget to update variablexplorer.rst
in spyder-docs
"""
from datetime import date, timedelta
editable_types = [int, float, complex, lis... | 0.004306 |
def _compile_and_collapse(self):
"""Actually compile the requested regex"""
self._real_regex = self._real_re_compile(*self._regex_args,
**self._regex_kwargs)
for attr in self._regex_attributes_to_copy:
setattr(self, attr, getattr(self.... | 0.0059 |
def connect_head_namespaced_service_proxy(self, name, namespace, **kwargs): # noqa: E501
"""connect_head_namespaced_service_proxy # noqa: E501
connect HEAD requests to proxy of Service # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP ... | 0.001329 |
def get(self, **kwargs):
"""Returns the first object encountered that matches the specified
lookup parameters.
>>> site_list.get(id=1)
{'url': 'http://site1.tld/', 'published': False, 'id': 1}
>>> site_list.get(published=True, id__lt=3)
{'url': 'http://site1.tld/', 'publ... | 0.001519 |
def in_dir(
config_dir=os.path.expanduser('~/.tmuxp'), extensions=['.yml', '.yaml', '.json']
):
"""
Return a list of configs in ``config_dir``.
Parameters
----------
config_dir : str
directory to search
extensions : list
filetypes to check (e.g. ``['.yaml', '.json']``).
... | 0.005376 |
def set(self, document_id):
"""
Associate this document with a ProvStore document without making any calls to the API.
:param int document_id: ID of the document on ProvStore
:return: self
"""
if not self.abstract:
raise ImmutableDocumentException()
se... | 0.00831 |
def rmsd(self, other):
"""Compute the RMSD between two molecules.
Arguments:
| ``other`` -- Another molecule with the same atom numbers
Return values:
| ``transformation`` -- the transformation that brings 'self' into
overlap ... | 0.006079 |
def query_repos(gl_session, repos=None):
"""
Yields Gitlab project objects for all projects in Bitbucket
"""
if repos is None:
repos = []
for repo in repos:
yield gl_session.projects.get(repo)
if not repos:
for project in gl_session.projects.list(as_list=False):
... | 0.00295 |
def jstemplate(parser, token):
"""Templatetag to handle any of the Mustache-based templates.
Replaces ``[[[`` and ``]]]`` with ``{{{`` and ``}}}``,
``[[`` and ``]]`` with ``{{`` and ``}}`` and
``[%`` and ``%]`` with ``{%`` and ``%}`` to avoid conflicts
with Django's template engine when using any ... | 0.002037 |
def _Rforce(self,R,z,phi=0.,t=0.):
"""
NAME:
_Rforce
PURPOSE:
evaluate the radial force for this potential
INPUT:
R - Galactocentric cylindrical radius
z - vertical height
phi - azimuth
t - time
OUTPUT:
... | 0.016949 |
def add_defs(self, defs):
"Add svg definitions"
etree.SubElement(
defs,
'filter',
id='dropshadow',
width='1.2',
height='1.2',
)
etree.SubElement(
defs,
'feGaussianBlur',
stdDeviation='4',
result='blur',
) | 0.06639 |
def formfield_for_dbfield(self, db_field, **kwargs):
"""
Allow formfield_overrides to contain field names too.
"""
overrides = self.formfield_overrides.get(db_field.name)
if overrides:
kwargs.update(overrides)
field = super(AbstractEntryBaseAdmin, self).formf... | 0.006036 |
def initPin(self, pin):
"""
C_InitPIN
:param pin: new PIN
"""
new_pin1 = ckbytelist(pin)
rv = self.lib.C_InitPIN(self.session, new_pin1)
if rv != CKR_OK:
raise PyKCS11Error(rv) | 0.008163 |
def GeneratePassphrase(length=20):
"""Create a 20 char passphrase with easily typeable chars."""
valid_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
valid_chars += "0123456789 ,-_&$#"
return "".join(random.choice(valid_chars) for i in range(length)) | 0.018248 |
def p_member_expr_nobf(self, p):
"""member_expr_nobf : primary_expr_no_brace
| function_expr
| member_expr_nobf LBRACKET expr RBRACKET
| member_expr_nobf PERIOD identifier
| NEW member_expr arguments
... | 0.003401 |
def connect(self, port=None, baud_rate=115200):
'''
Parameters
----------
port : str or list-like, optional
Port (or list of ports) to try to connect to as a DMF Control
Board.
baud_rate : int, optional
Returns
-------
str
... | 0.00139 |
def _raveled_index_for_transformed(self, param):
"""
get the raveled index for a param for the transformed parameter array
(optimizer array).
that is an int array, containing the indexes for the flattened
param inside this parameterized logic.
!Warning! be sure to call ... | 0.004561 |
def scan(pattern, string, *args, **kwargs):
""" Returns True if pattern.search(Sentence(string)) may yield matches.
If is often faster to scan prior to creating a Sentence and searching it.
"""
return compile(pattern, *args, **kwargs).scan(string) | 0.007491 |
def _load_data():
"""Load the word and character mapping data into a dictionary.
In the data files, each line is formatted like this:
HANZI PINYIN_READING/PINYIN_READING
So, lines need to be split by '\t' and then the Pinyin readings need to be
split by '/'.
"""
data = {}
for na... | 0.001307 |
def group_keys_by_replica(session, keyspace, table, keys):
"""
Returns a :class:`dict` with the keys grouped per host. This can be
used to more accurately group by IN clause or to batch the keys per host.
If a valid replica is not found for a particular key it will be grouped under
:class:`~.NO_VAL... | 0.00263 |
def hybrid_forward(self, F, *states): # pylint: disable=arguments-differ
"""
Parameters
----------
states : list
the stack outputs from RNN, which consists of output from each time step (TNC).
Returns
--------
loss : NDArray
loss tensor wi... | 0.008021 |
def get_affected_domains(self):
""" Return a list of all affected domain and subdomains """
results = set()
dotted_domain = ("." + self.domain) if self.domain else None
for website in self.websites:
for subdomain in website['subdomains']:
if self.domain is Non... | 0.004658 |
def list_nodes(call=None):
'''
Return a list of the VMs that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The list_nodes function must be called with -f or --function.'
)
ret = {}
items = query(action='ve')
for item in items:
... | 0.001247 |
def add_note(self, note):
""" Wrapper method to add a note
The method can be passed the note as a dict with the `content`
property set, which is then directly send to the web service for
creation. Alternatively, only the body as string can also be passed. In
this case the parame... | 0.002323 |
def write_data(self, buf):
"""Send data to the device.
If the write fails for any reason, an :obj:`IOError` exception
is raised.
:param buf: the data to send.
:type buf: list(int)
:return: success status.
:rtype: bool
"""
if sys.version_info[... | 0.002491 |
def create(self,
institution_id,
initial_products,
_options=None,
webhook=None,
transactions__start_date=None,
transactions__end_date=None,
):
'''
Generate a public token for sandbox testing.
... | 0.007525 |
def prepare_for_authenticate(
self, entityid=None, relay_state="",
binding=saml2.BINDING_HTTP_REDIRECT, vorg="", nameid_format=None,
scoping=None, consent=None, extensions=None, sign=None,
response_binding=saml2.BINDING_HTTP_POST, **kwargs):
""" Makes all necessar... | 0.001747 |
def button_change_send(self, time_boot_ms, last_change_ms, state, force_mavlink1=False):
'''
Report button state change
time_boot_ms : Timestamp (milliseconds since system boot) (uint32_t)
last_change_ms : Time of last change of bu... | 0.010563 |
def add_key_val(keyname, keyval, keytype, filename, extnum):
"""Add/replace FITS key
Add/replace the key keyname with value keyval of type keytype in filename.
Parameters:
----------
keyname : str
FITS Keyword name.
keyval : str
FITS keyword value.
keytype: str
FITS... | 0.001096 |
def resize_state_port_meta(state_m, factor, gaphas_editor=True):
""" Resize data and logical ports relative positions """
# print("scale ports", factor, state_m, gaphas_editor)
if not gaphas_editor and isinstance(state_m, ContainerStateModel):
port_models = state_m.input_data_ports[:] + state_m.outp... | 0.006596 |
def execute_lines(self, lines):
"""Execute lines and give focus to shell"""
self.shell.execute_lines(to_text_string(lines))
self.shell.setFocus() | 0.011628 |
def _raise_unrecoverable_error_client(self, exception):
"""
Raises an exceptions.ClientError with a message telling that the error probably comes from the client
configuration.
:param exception: Exception that caused the ClientError
:type exception: Exception
:raise excep... | 0.007472 |
def unicode(self, *, invert_color: bool = False, borders: bool = False) -> str:
"""
Returns a string representation of the board with Unicode pieces.
Useful for pretty-printing to a terminal.
:param invert_color: Invert color of the Unicode pieces.
:param borders: Show borders a... | 0.002035 |
def delegate_to_method(mtd):
"""Create a simplification rule that delegates the instantiation to the
method `mtd` of the operand (if defined)"""
def _delegate_to_method(cls, ops, kwargs):
assert len(ops) == 1
op, = ops
if hasattr(op, mtd):
return getattr(op, mtd)()
... | 0.002558 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.