text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def create_conversation(
self, parameters, custom_headers=None, raw=False, **operation_config):
"""CreateConversation.
Create a new Conversation.
POST to this method with a
* Bot being the bot creating the conversation
* IsGroup set to true if this is not a direct me... | 0.002446 |
def delay(fn, opts, task, *args, **kwargs):
""" delay(t=5, stddev=0., pdf="gauss")
Wraps a bound method of a task and delays its execution by *t* seconds.
"""
if opts["stddev"] <= 0:
t = opts["t"]
elif opts["pdf"] == "gauss":
t = random.gauss(opts["t"], opts["stddev"])
elif opts[... | 0.00369 |
def do_resource(self,args):
"""Go to the specified resource. resource -h for detailed help"""
parser = CommandArgumentParser("resource")
parser.add_argument('-i','--logical-id',dest='logical-id',help='logical id of the child resource');
args = vars(parser.parse_args(args))
stack... | 0.020089 |
def set_public_domain(self, public_domain=None):
"""Sets the public domain flag.
:param public_domain: the public domain status
:type public_domain: ``boolean``
:raise: ``NoAccess`` -- ``Metadata.isReadOnly()`` is ``true``
*compliance: mandatory -- This method must be implement... | 0.002805 |
def bell(self, percent = 0, onerror = None):
"""Ring the bell at the volume percent which is relative the base
volume. See XBell(3X11)."""
request.Bell(display = self.display,
onerror = onerror,
percent = percent) | 0.043011 |
def check_required(obj, required_parameters):
"""
Check if a parameter is available on an object
:param obj: Object
:param required_parameters: list of parameters
:return:
"""
for parameter in required_parameters:
if not hasattr(obj, parameter) or getattr(obj, parameter) is None:
... | 0.004728 |
def onchange_partner_id(self):
'''
When you change partner_id it will update the partner_invoice_id,
partner_shipping_id and pricelist_id of the hotel reservation as well
---------------------------------------------------------------------
@param self: object pointer
'''... | 0.002304 |
def transform(self, X):
"""Embeds data points in the learned linear embedding space.
Transforms samples in ``X`` into ``X_embedded``, samples inside a new
embedding space such that: ``X_embedded = X.dot(L.T)``, where ``L`` is
the learned linear transformation (See :class:`MahalanobisMixin`).
Param... | 0.003827 |
def prefetch(self, file_size=None):
"""
Pre-fetch the remaining contents of this file in anticipation of future
`.read` calls. If reading the entire file, pre-fetching can
dramatically improve the download speed by avoiding roundtrip latency.
The file's contents are incrementall... | 0.001143 |
def club(self, sort='desc', ctype='player', defId='', start=0, count=None, page_size=itemsPerPage['club'],
level=None, category=None, assetId=None, league=None, club=None,
position=None, zone=None, nationality=None, rare=False, playStyle=None):
"""Return items in your club, excluding c... | 0.003342 |
def get_zooms(src_dst, ensure_global_max_zoom=False, tilesize=256):
"""
Calculate raster min/max mercator zoom level.
Parameters
----------
src_dst: rasterio.io.DatasetReader
Rasterio io.DatasetReader object
ensure_global_max_zoom: bool, optional
Apply latitude correction factor... | 0.001336 |
def update_identity_pool(IdentityPoolId,
IdentityPoolName=None,
AllowUnauthenticatedIdentities=False,
SupportedLoginProviders=None,
DeveloperProviderName=None,
OpenIdConnectProviderARNs=None,
... | 0.004442 |
def set_taskfileinfo(self, tfi):
"""Set the :class:`jukeboxcore.filesys.TaskFileInfo` that the refobject represents.
:param tfi: the taskfileinfo for the refobject or None if nothing is loaded.
:type tfi: :class:`jukeboxcore.filesys.TaskFileInfo` | None
:returns: None
:rtype: No... | 0.00885 |
def uninstall(cls):
"""Remove the package manager from the system."""
if os.path.exists(cls.home):
shutil.rmtree(cls.home) | 0.013333 |
def encode_simple(d):
"""Encode strings in basic python objects."""
if isinstance(d, unicode):
return d.encode()
if isinstance(d, list):
return list(map(encode_simple, d))
if isinstance(d, dict):
return dict([(encode_simple(k), encode_simple(v)) for k, v in d.items()])
return... | 0.006211 |
def convert_time_string(date_str):
""" Change a date string from the format 2018-08-15T23:55:17 into a datetime object """
dt, _, _ = date_str.partition(".")
dt = datetime.strptime(dt, "%Y-%m-%dT%H:%M:%S")
return dt | 0.008658 |
def clean_undefined(obj):
"""
Convert Undefined array entries to None (null)
"""
if isinstance(obj, list):
return [
None if isinstance(item, Undefined) else item
for item in obj
]
if isinstance(obj, dict):
for key in obj:
obj[key] = clean_u... | 0.002833 |
def _get_parent_remote_paths(self):
"""
Get list of remote folders based on the list of all file urls
:return: set([str]): set of remote folders (that contain files)
"""
parent_paths = set([item.get_remote_parent_path() for item in self.file_urls])
if '' in parent_paths:
... | 0.007833 |
def add_key_value(self, key, value):
"""Add custom field to Indicator object.
.. note:: The key must be the exact name required by the batch schema.
Example::
file_hash = tcex.batch.file('File', '1d878cdc391461e392678ba3fc9f6f32')
file_hash.add_key_value('size', '1024'... | 0.003155 |
def rebuild(self, image, root_pass=None, authorized_keys=None, **kwargs):
"""
Rebuilding an Instance deletes all existing Disks and Configs and deploys
a new :any:`Image` to it. This can be used to reset an existing
Instance or to install an Image on an empty Instance.
:param i... | 0.00368 |
async def discover_master(self, service, timeout):
"""Perform Master discovery for specified service."""
# TODO: get lock
idle_timeout = timeout
# FIXME: single timeout used 4 times;
# meaning discovery can take up to:
# 3 * timeout * (sentinels count)
#
... | 0.000934 |
def make_energies_hdu(self, extname="ENERGIES"):
""" Builds and returns a FITs HDU with the energy bin boundries
extname : The HDU extension name
"""
if self._evals is None:
return None
cols = [fits.Column("ENERGY", "1E", unit='MeV',
... | 0.006466 |
def _parse_ppm_segment(self, fptr):
"""Parse the PPM segment.
Parameters
----------
fptr : file
Open file object.
Returns
-------
PPMSegment
The current PPM segment.
"""
offset = fptr.tell() - 2
read_buffer = fptr... | 0.003846 |
def min_filter(data, size=7, res_g=None, sub_blocks=(1, 1, 1)):
"""
minimum filter of given size
Parameters
----------
data: 2 or 3 dimensional ndarray or OCLArray of type float32
input data
size: scalar, tuple
the size of the patch to consider
res_g: OCLArray
st... | 0.003279 |
def current(self, value):
"""set current cursor position"""
current = min(max(self._min, value), self._max)
self._current = current
if current > self._stop :
self._stop = current
self._start = current-self._width
elif current < self._start :
... | 0.015 |
def show(self, start=0, geometry=None, output=None):
"""pretty-print data to the console
(similar to q.show, but uses python stdout by default)
>>> x = q('([k:`x`y`z]a:1 2 3;b:10 20 30)')
>>> x.show() # doctest: +NORMALIZE_WHITESPACE
k| a b
-| ----
x| 1 10
... | 0.001385 |
def GetExpirationTime(self):
"""Computes the timestamp at which this breakpoint will expire."""
# TODO(emrekultursay): Move this to a common method.
if '.' not in self.definition['createTime']:
fmt = '%Y-%m-%dT%H:%M:%S%Z'
else:
fmt = '%Y-%m-%dT%H:%M:%S.%f%Z'
create_datetime = datetime.s... | 0.006757 |
def init_comm(self):
"""
Initializes comm and attaches streams.
"""
if self.comm:
return self.comm
comm = None
if self.dynamic or self.renderer.widget_mode == 'live':
comm = self.renderer.comm_manager.get_server_comm()
return comm | 0.006452 |
async def add(gc: GroupControl, slaves):
"""Add speakers to group."""
click.echo("Adding to existing group: %s" % slaves)
click.echo(await gc.add(slaves)) | 0.006024 |
def check_datasource_perms(self, datasource_type=None, datasource_id=None):
"""
Check if user can access a cached response from explore_json.
This function takes `self` since it must have the same signature as the
the decorated method.
"""
form_data = get_form_data()[0]
datasource_id, data... | 0.001582 |
def calc_DUP_parameter(self, modeln, label, fig=10, color='r', marker_type='*',
h_core_mass=False):
"""
Method to calculate the DUP parameter evolution for different
TPs specified specified by their model number.
Parameters
----------
fig : int... | 0.023172 |
def sample(self, n=None, frac=None, replace=False, weights=None,
random_state=None, axis=None):
"""
Return a random sample of items from an axis of object.
You can use `random_state` for reproducibility.
Parameters
----------
n : int, optional
... | 0.000448 |
def ssh_sa_ssh_server_shutdown(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
ssh_sa = ET.SubElement(config, "ssh-sa", xmlns="urn:brocade.com:mgmt:brocade-sec-services")
ssh = ET.SubElement(ssh_sa, "ssh")
server = ET.SubElement(ssh, "server")
... | 0.006508 |
def get_bin_indices(self, values):
"""Returns index tuple in histogram of bin which contains value"""
return tuple([self.get_axis_bin_index(values[ax_i], ax_i)
for ax_i in range(self.dimensions)]) | 0.008547 |
def get_value_generator(self_,name): # pylint: disable-msg=E0213
"""
Return the value or value-generating object of the named
attribute.
For most parameters, this is simply the parameter's value
(i.e. the same as getattr()), but Dynamic parameters have
their value-genera... | 0.00921 |
def to_fp(self, file_pointer, comments=None):
"""
The method can be used to save a WCNF formula into a file pointer.
The file pointer is expected as an argument. Additionally,
supplementary comment lines can be specified in the ``comments``
parameter.
... | 0.004391 |
def choose_parent_view(self, request):
"""
Instantiates a class-based view to provide a view that allows a parent
page to be chosen for a new object, where the assigned model extends
Wagtail's Page model, and there is more than one potential parent for
new instances. The view cla... | 0.003559 |
def get_fields_with_environment_context(self, db_name, table_name, environment_context):
"""
Parameters:
- db_name
- table_name
- environment_context
"""
self.send_get_fields_with_environment_context(db_name, table_name, environment_context)
return self.recv_get_fields_with_environmen... | 0.009063 |
async def selfplay(state, flagfile='selfplay'):
"""Run selfplay and write a training chunk to the fsdb golden_chunk_dir.
Args:
state: the RL loop State instance.
flagfile: the name of the flagfile to use for selfplay, either 'selfplay'
(the default) or 'boostrap'.
"""
output_dir = os.path.join... | 0.013591 |
def learnObjects(self, objectPlacements):
"""
Learn each provided object in egocentric space. Touch every location on each
object.
This method doesn't try move the sensor along a path. Instead it just leaps
the sensor to each object location, resetting the location layer with each
leap.
Th... | 0.006549 |
def autoconfig_url_from_preferences():
"""
Get the PAC ``AutoConfigURL`` value from the macOS System Preferences.
This setting is visible as the "URL" field in
System Preferences > Network > Advanced... > Proxies > Automatic Proxy Configuration.
:return: The value from the registry, or None i... | 0.003813 |
def contains_remove(self, item):
# type (Any, Any) -> Any
'''Takes a collection and an item and returns a new collection
of the same type with that item removed. The notion of "contains"
is defined by the object itself; the following must be ``True``:
.. code-block:: python
item not in con... | 0.001163 |
def key_usage(self):
"""The :py:class:`~django_ca.extensions.KeyUsage` extension, or ``None`` if it doesn't exist."""
try:
ext = self.x509.extensions.get_extension_for_oid(ExtensionOID.KEY_USAGE)
except x509.ExtensionNotFound:
return None
return KeyUsage(ext) | 0.012698 |
def _get_admin_change_url(self, model, context):
"""
Returns the admin change url.
"""
app_label = model._meta.app_label
return reverse('%s:%s_%s_changelist' % (get_admin_site_name(context),
app_label,
... | 0.005525 |
def _make_exception(self, response):
"""
In case of exception, construct the exception
object that holds all important values returned by
the response.
:return: The exception instance
:rtype: PocketException
"""
headers = response.headers
limit_he... | 0.001953 |
def netconf_state_sessions_session_source_host(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
netconf_state = ET.SubElement(config, "netconf-state", xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring")
sessions = ET.SubElement(netconf_state, "se... | 0.004274 |
def xmlSetup(self, logType, logList):
"""Create xml file with fields from logbook form."""
from xml.etree.ElementTree import Element, SubElement, ElementTree
from datetime import datetime
curr_time = datetime.now()
if logType == "MCC":
# Set up xml t... | 0.008681 |
def do_or_fake_filter( value, formatter ):
"""
call a faker if value is None
uses:
{{ myint|or_fake:'randomInt' }}
"""
if not value:
value = Faker.getGenerator().format( formatter )
return value | 0.021186 |
def update_import_request(self, import_request_to_update, project, repository_id, import_request_id):
"""UpdateImportRequest.
[Preview API] Retry or abandon a failed import request.
:param :class:`<GitImportRequest> <azure.devops.v5_0.git.models.GitImportRequest>` import_request_to_update: The u... | 0.00672 |
def agents_email_show(self, email_id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/chat/agents#get-agent-by-email-id"
api_path = "/api/v2/agents/email/{email_id}"
api_path = api_path.format(email_id=email_id)
return self.call(api_path, **kwargs) | 0.010417 |
def stochastic_event_set(sources, source_site_filter=nofilter):
"""
Generates a 'Stochastic Event Set' (that is a collection of earthquake
ruptures) representing a possible *realization* of the seismicity as
described by a source model.
The calculator loops over sources. For each source, it loops o... | 0.000574 |
def is_identity_matrix(mat,
ignore_phase=False,
rtol=RTOL_DEFAULT,
atol=ATOL_DEFAULT):
"""Test if an array is an identity matrix."""
if atol is None:
atol = ATOL_DEFAULT
if rtol is None:
rtol = RTOL_DEFAULT
mat = np.arr... | 0.001292 |
def downloadFile(url,outfile=None):
''' Copied from http://stackoverflow.com/questions/16694907/how-to-download-large-file-in-python-with-requests-py '''
if not outfile:
outfile = url.split('/')[-1]
r = requests.get(url, stream=True)
with open(outfile, 'wb') as f:
for chunk in r.iter_c... | 0.014354 |
def execute(self, operation, parameters=()):
"""
Wraps execute method to record the query, execution duration and
stackframe.
"""
__traceback_hide__ = True # NOQ
# Time the exection of the query
start = time.time()
try:
return self.cursor.ex... | 0.003221 |
def set_redraw_lag(self, lag_sec):
"""Set lag time for redrawing the canvas.
Parameters
----------
lag_sec : float
Number of seconds to wait.
"""
self.defer_redraw = (lag_sec > 0.0)
if self.defer_redraw:
self.defer_lagtime = lag_sec | 0.006369 |
def makefractalCIJ(mx_lvl, E, sz_cl, seed=None):
'''
This function generates a directed network with a hierarchical modular
organization. All modules are fully connected and connection density
decays as 1/(E^n), with n = index of hierarchical level.
Parameters
----------
mx_lvl : int
... | 0.001724 |
def _detsat_one(filename, ext, sigma=2.0, low_thresh=0.1, h_thresh=0.5,
small_edge=60, line_len=200, line_gap=75,
percentile=(4.5, 93.0), buf=200, plot=False, verbose=False):
"""Called by :func:`detsat`."""
if verbose:
t_beg = time.time()
fname = '{0}[{1}]'.format(fi... | 0.000109 |
def __locate_driver_named(name):
"""Searchs __modules for a driver named @arg name.
@returns the package for driver @arg name or None if one can't be found.
"""
global __modules
if type(__modules) is not list:
__modules = list(__modules)
ms = [d for d in __modules if d.ahioDriverInfo.... | 0.002597 |
def create_context(self, message_queue, task_id):
"""
Create values to be used by upload_folder_run function.
:param message_queue: Queue: queue background process can send messages to us on
:param task_id: int: id of this command's task so message will be routed correctly
"""
... | 0.010482 |
def fetch(self):
"""
Fetch a SampleInstance
:returns: Fetched SampleInstance
:rtype: twilio.rest.autopilot.v1.assistant.task.sample.SampleInstance
"""
params = values.of({})
payload = self._version.fetch(
'GET',
self._uri,
par... | 0.00346 |
def convex_comb_dis(model,a,b):
"""convex_comb_dis -- add piecewise relation with convex combination formulation
Parameters:
- model: a model where to include the piecewise linear relation
- a[k]: x-coordinate of the k-th point in the piecewise linear relation
- b[k]: y-coordinate of the... | 0.010261 |
def pack_tuple(self, values):
"""
Pack tuple of values
<tuple> ::= <cardinality><field>+
:param value: tuple to be packed
:type value: tuple of scalar values (bytes, str or int)
:return: packed tuple
:rtype: bytes
"""
assert isinstance(values, (t... | 0.003914 |
def is_dot(ip):
"""Return true if the IP address is in dotted decimal notation."""
octets = str(ip).split('.')
if len(octets) != 4:
return False
for i in octets:
try:
val = int(i)
except ValueError:
return False
if val > 255 or val < 0:
... | 0.002865 |
def __parse_blacklist(self, json):
"""Parse blacklist entries using Sorting Hat format.
The Sorting Hat blacklist format is a JSON stream that
stores a list of blacklisted entries.
Next, there is an example of a valid stream:
{
"blacklist": [
"John ... | 0.002502 |
def fft_convolve(data, h, res_g = None,
plan = None, inplace = False,
kernel_is_fft = False,
kernel_is_fftshifted = False):
""" convolves data with kernel h via FFTs
data should be either a numpy array or a OCLArray (see doc for fft)
both data an... | 0.029185 |
def search_media(self, series, query_string):
"""Search for media from a series starting with query_string, case-sensitive
@param crunchyroll.models.Series series the series to search in
@param str query_string the search query, same restrictions
... | 0.007587 |
def _calc_waves(self, angular_freqs, profile):
"""Compute the wave numbers and amplitudes (up- and down-going).
Parameters
----------
angular_freqs: :class:`numpy.ndarray`
Angular frequency at which the waves are computed.
profile: :class:`~.base.site.Profile`
... | 0.000913 |
def has_offline_historical_manager_or_raise(self):
"""Raises an exception if model uses a history manager and
historical model history_id is not a UUIDField.
Note: expected to use edc_model.HistoricalRecords instead of
simple_history.HistoricalRecords.
"""
try:
... | 0.004704 |
def ignore( self, other ):
"""
Define expression to be ignored (e.g., comments) while doing pattern
matching; may be called repeatedly, to define multiple comment or other
ignorable patterns.
Example::
patt = OneOrMore(Word(alphas))
patt.parseString('abl... | 0.013665 |
def element(self, inp=None, data_ptr=None, order=None):
"""Create a new element.
Parameters
----------
inp : `array-like`, optional
Input used to initialize the new element.
If ``inp`` is `None`, an empty element is created with no
guarantee of its s... | 0.000408 |
def main(pub_port=None, sub_port=None):
'''main of forwarder
:param sub_port: port for subscribers
:param pub_port: port for publishers
'''
try:
if sub_port is None:
sub_port = get_sub_port()
if pub_port is None:
pub_port = get_pub_port()
context = zm... | 0.001272 |
def _get_val(val, full=False):
"""
Get the value(s) of a dataset as a single value or as 1-d list of
values. In the special case of timeseries, when a check is for time-based
criteria, you can return the entire timeseries.
"""
try:
val = val.strip()
except:
pass
... | 0.003958 |
def learn(
network,
env,
seed=None,
nsteps=5,
total_timesteps=int(80e6),
vf_coef=0.5,
ent_coef=0.01,
max_grad_norm=0.5,
lr=7e-4,
lrschedule='linear',
epsilon=1e-5,
alpha=0.99,
gamma=0.99,
log_interval=100,
load_path=None,
**network_kwargs):
'''
Ma... | 0.005838 |
def function_name(self):
"""
Returns name of the function to invoke. If no function identifier is provided, this method will return name of
the only function from the template
:return string: Name of the function
:raises InvokeContextException: If function identifier is not prov... | 0.006861 |
def setCache(self, val = 1):
""" Sets cache on (or updates), or turns off """
# first clear the old cached values
self.cacheConnections = []
self.cacheLayers = []
if val:
for layer in self.layers:
if layer.active and not layer.frozen:
... | 0.015094 |
def lock(self):
"""Lock the Sesame. Return True on success, else False."""
endpoint = API_SESAME_CONTROL_ENDPOINT.format(self.device_id)
payload = {'type': 'lock'}
response = self.account.request('POST', endpoint, payload=payload)
if response is None:
return False
... | 0.00463 |
def tab(self):
"""Move to the next tab space, or the end of the screen if there
aren't anymore left.
"""
for stop in sorted(self.tabstops):
if self.cursor.x < stop:
column = stop
break
else:
column = self.columns - 1
... | 0.005814 |
def HSV_to_RGB(cobj, target_rgb, *args, **kwargs):
"""
HSV to RGB conversion.
H values are in degrees and are 0 to 360.
S values are a percentage, 0.0 to 1.0.
V values are a percentage, 0.0 to 1.0.
"""
H = cobj.hsv_h
S = cobj.hsv_s
V = cobj.hsv_v
h_floored = int(math.floor(H))
... | 0.000694 |
def get_user_id_from_email(self, email):
""" Uses the get-all-user-accounts Portals API to retrieve the
user-id by supplying an email. """
accts = self.get_all_user_accounts()
for acct in accts:
if acct['email'] == email:
return acct['id']
return None | 0.00625 |
def _analyze_read_write(self):
""" Compute variables read/written/...
"""
write_var = [x.variables_written_as_expression for x in self.nodes]
write_var = [x for x in write_var if x]
write_var = [item for sublist in write_var for item in sublist]
write_var = list(set(writ... | 0.006126 |
def prompt_4_yes_no(question):
"""
Ask a question and prompt for yes or no
:param question: Question to ask; answer is yes/no
:return: :boolean
"""
while True:
sys.stdout.write(question + ' (y/n)? ')
try:
choice = raw_inp... | 0.004724 |
def select_server(self,
selector,
server_selection_timeout=None,
address=None):
"""Like select_servers, but choose a random server if several match."""
return random.choice(self.select_servers(selector,
... | 0.011962 |
def set_credentials(self, client_id=None, client_secret=None):
"""
set given credentials and reset the session
"""
self._client_id = client_id
self._client_secret = client_secret
# make sure to reset session due to credential change
self._session = None | 0.006452 |
def get_parent_gradebooks(self, gradebook_id):
"""Gets the parents of the given gradebook.
arg: gradebook_id (osid.id.Id): the ``Id`` of a gradebook
return: (osid.grading.GradebookList) - the parents of the
gradebook
raise: NotFound - ``gradebook_id`` is not found
... | 0.003033 |
def Barati_high(Re):
r'''Calculates drag coefficient of a smooth sphere using the method in
[1]_.
.. math::
C_D = 8\times 10^{-6}\left[(Re/6530)^2 + \tanh(Re) - 8\ln(Re)/\ln(10)\right]
- 0.4119\exp(-2.08\times10^{43}/[Re + Re^2]^4)
-2.1344\exp(-\{[\ln(Re^2 + 10.7563)/\ln(10)]^2 + 9.... | 0.003413 |
def unregister_signal_handlers():
""" set signal handlers to default """
signal.signal(SIGNAL_STACKTRACE, signal.SIG_IGN)
signal.signal(SIGNAL_PDB, signal.SIG_IGN) | 0.005714 |
def save_plain_image_as_file(self, filepath, format='png', quality=90):
"""Used for generating thumbnails. Does not include overlaid
graphics.
"""
img_w = self.get_plain_image_as_widget()
# assumes that the image widget has some method for saving to
# a file
img_... | 0.005435 |
def get_failed_requests(self, results):
"""Return the requests that failed.
:param results: the results of a membership request check
:type results: :class:`list`
:return: the failed requests
:rtype: generator
"""
data = {member['guid']: member for member in resu... | 0.004587 |
def create(self):
"""
Create the link on the nodes
"""
node1 = self._nodes[0]["node"]
adapter_number1 = self._nodes[0]["adapter_number"]
port_number1 = self._nodes[0]["port_number"]
node2 = self._nodes[1]["node"]
adapter_number2 = self._nodes[1]["adapter_... | 0.003284 |
def load(*files):
"""
Loads configuration from one or more files by merging right to left.
:Parameters:
*files : `file-like`
A YAML file to read.
:Returns:
`dict` : the configuration document
"""
if len(files) == 0:
raise errors.ConfigError("No config files ... | 0.002387 |
def process_response(self, request, response):
""" Sets the cache and deals with caching headers if needed
"""
if not self.should_cache(request, response):
# We don't need to update the cache, just return
return response
response = self.patch_headers(response)
... | 0.007792 |
def pos(self, x=None, y=None):
u'''Move or query the window cursor.'''
if x is not None:
System.Console.CursorLeft=x
else:
x = System.Console.CursorLeft
if y is not None:
System.Console.CursorTop=y
else:
y = System.Console.... | 0.011429 |
def all_state_variables_read(self):
""" recursive version of variables_read
"""
if self._all_state_variables_read is None:
self._all_state_variables_read = self._explore_functions(
lambda x: x.state_variables_read)
return self._all_state_variables_read | 0.00641 |
def rewrite(self, source, token=None, client=None):
"""Rewrite source blob into this one.
If :attr:`user_project` is set on the bucket, bills the API request
to that project.
:type source: :class:`Blob`
:param source: blob whose contents will be rewritten into this blob.
... | 0.001175 |
def get_re_experiment(case, minor=1):
""" Returns an experiment that uses the Roth-Erev learning method.
"""
locAdj = "ac"
experimentation = 0.55
recency = 0.3
tau = 100.0
decay = 0.999
nStates = 3 # stateless RE?
Pd0 = get_pd_max(case, profile)
Pd_min = get_pd_min(case, profile... | 0.003531 |
def make_bindings_type(filenames,color_input,colorkey,file_dictionary,sidebar,bounds):
# instantiating string the main string block for the javascript block of html code
string = ''
'''
# logic for instantiating variable colorkey input
if not colorkeyfields == False:
colorkey = 'selectedText'
'''
# iteratin... | 0.049836 |
def objects_patch(self, bucket, key, info):
"""Updates the metadata associated with an object.
Args:
bucket: the name of the bucket containing the object.
key: the key of the object being updated.
info: the metadata to update.
Returns:
A parsed object information dictionary.
Rai... | 0.001597 |
def set(self):
"""Set event flag to true and resolve future(s) returned by until_set()
Notes
-----
A call to set() may result in control being transferred to
done_callbacks attached to the future returned by until_set().
"""
self._flag = True
old_future ... | 0.005042 |
def _make_minimal(dictionary):
"""
This function removes all the keys whose value is either None or an empty
dictionary.
"""
new_dict = {}
for key, value in dictionary.items():
if value is not None:
if isinstance(value, dict):
new_value = _make_minimal(value)
... | 0.002123 |
def _get_cgroup_from_proc(self, cgroup, pid, filename):
"""Find a specific cgroup file, containing metrics to extract."""
params = {
"file": filename,
}
return DockerUtil.find_cgroup_from_proc(self._mountpoints, pid, cgroup, self.docker_util._docker_root) % (params) | 0.009677 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.