text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def avail_sizes(call=None):
'''
Return a list of the image sizes that are on the provider
'''
if call == 'action':
raise SaltCloudSystemExit(
'The avail_sizes function must be called with '
'-f or --function, or with the --list-sizes option'
)
params = {'Acti... | 0.001629 |
def split_channels(image):
"""
Split channels of a multi-channel ANTsImage into a collection
of scalar ANTsImage types
Arguments
---------
image : ANTsImage
multi-channel image to split
Returns
-------
list of ANTsImage types
Example
-------
>>> import ants... | 0.004634 |
def indent_text(*strs, **kwargs):
""" indents text according to an operater string and a global indentation
level. returns a tuple of all passed args, indented according to the
operator string
indent: [defaults to +0]
The operator string, of the form
++n : increment... | 0.002798 |
def get_metrics(self, metric_identifiers, from_date, limit=10, group_by="week", **kwargs):
"""
Retrieves a multiple metrics as efficiently as possible.
:param metric_identifiers: a list of tuples of the form `(unique_identifier, metric_name`) identifying which metrics to retrieve.
For e... | 0.007729 |
def write_flows_to_gssha_time_series_ihg(self,
path_to_output_file,
connection_list_file,
date_search_start=None,
date_search_end=None,
... | 0.001442 |
def validate(self, corpus, catalogue):
"""Returns True if all of the files labelled in `catalogue`
are up-to-date in the database.
:param corpus: corpus of works
:type corpus: `Corpus`
:param catalogue: catalogue matching filenames to labels
:type catalogue: `Catalogue`
... | 0.001255 |
def by_identifier_secret(self, request):
"""
Authenticates a client by its identifier and secret (aka password).
:param request: The incoming request
:type request: oauth2.web.Request
:return: The identified client
:rtype: oauth2.datatype.Client
:raises OAuthIn... | 0.001451 |
def to_package(self, repo_url):
"""Return the package representation of this repo."""
return Package(name=self.name, url=repo_url + self.name) | 0.012658 |
def wrap(cls, app):
"""
Adds test live server capability to a Flask app module.
:param app:
A :class:`flask.Flask` app instance.
"""
host, port = cls.parse_args()
ssl = cls._argument_parser.parse_args().ssl
ssl_context = None
if host... | 0.002665 |
def get_collections(kwdb, libtype="*"):
"""Get list of collections from kwdb, then add urls necessary for hyperlinks"""
collections = kwdb.get_collections(libtype=libtype)
for result in collections:
url = flask.url_for(".doc_for_library", collection_id=result["collection_id"])
result["url"] ... | 0.008596 |
def run_analysis(self, argv):
""" Build the manifest for all the models
"""
args = self._parser.parse_args(argv)
components = Component.build_from_yamlfile(args.comp)
NAME_FACTORY.update_base_dict(args.data)
model_dict = make_library(**args.__dict__)
model_manager... | 0.003797 |
def sku_update(self, product_id, properties, session, **kwargs):
'''taobao.fenxiao.product.sku.update 产品sku编辑接口
产品SKU信息更新'''
request = TOPRequest('taobao.fenxiao.product.sku.update')
request['product_id'] = product_id
request['properties'] = properties
for k, v i... | 0.015898 |
def simxSetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode):
'''
Please have a look at the function description/documentation in the V-REP user manual
'''
return c_SetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode) | 0.014388 |
def _get_range(self, endpoint_name):
""" Returns a Range based on the endpoint name """
url = self.build_url(self._endpoints.get(endpoint_name))
response = self.session.get(url)
if not response:
return None
data = response.json()
return self.range_constructor... | 0.008219 |
def get_template(self):
"""
读取一个Excel模板,将此Excel的所有行读出来,并且识别特殊的标记进行记录
:return: 返回读取后的模板,结果类似:
[
{'cols': #各列,与subs不会同时生效
'subs':[ #子模板
{'cols':#各列,
'subs': #子模板
'field': #对应数据中字段名称
... | 0.006121 |
def get_pickle_protocol():
"""
Allow configuration of the pickle protocol on a per-machine basis.
This way, if you use multiple platforms with different versions of
pickle, you can configure each of them to use the highest protocol
supported by all of the machines that you want to be able to
com... | 0.001348 |
def build(self):
"""Builds the barcode pattern from `self.ean`.
:returns: The pattern as string
:rtype: String
"""
code = _ean.EDGE[:]
pattern = _ean.LEFT_PATTERN[int(self.ean[0])]
for i, number in enumerate(self.ean[1:7]):
code += _ean.CODES[pattern[... | 0.004024 |
def is_gesture(self):
"""Macro to check if this event is
a :class:`~libinput.event.GestureEvent`.
"""
if self in {type(self).GESTURE_SWIPE_BEGIN, type(self).GESTURE_SWIPE_END,
type(self).GESTURE_SWIPE_UPDATE, type(self).GESTURE_PINCH_BEGIN,
type(self).GESTURE_PINCH_UPDATE, type(self).GESTURE_PINCH_END}:
... | 0.03352 |
def kendall(x, axis=0):
"""Kendall' tau (Rank) Correlation Matrix (for ordinal data)
Parameters
----------
x : ndarray
data set
axis : int, optional
Variables as columns is the default (axis=0). If variables are
in the rows use axis=1
Returns
-------
r : ndarra... | 0.000996 |
def ensure_vbounds(self, use_margins=None):
"""Ensure the cursor is within vertical screen bounds.
:param bool use_margins: when ``True`` or when
:data:`~pyte.modes.DECOM` is set,
cursor is bounded by top and and bottom
... | 0.003195 |
def execute(self, command):
"""Execute a DDE command."""
pData = c_char_p(command)
cbData = DWORD(len(command) + 1)
hDdeData = DDE.ClientTransaction(pData, cbData, self._hConv, HSZ(), CF_TEXT, XTYP_EXECUTE, TIMEOUT_ASYNC, LPDWORD())
if not hDdeData:
raise DDEError("Un... | 0.007634 |
def _write_openjpeg(self, img_array, verbose=False):
"""
Write JPEG 2000 file using OpenJPEG 1.5 interface.
"""
if img_array.ndim == 2:
# Force the image to be 3D. Just makes things easier later on.
img_array = img_array.reshape(img_array.shape[0],
... | 0.000717 |
def medianscore(inlist):
"""
Returns the 'middle' score of the passed list. If there is an even
number of scores, the mean of the 2 middle scores is returned.
Usage: lmedianscore(inlist)
"""
newlist = copy.deepcopy(inlist)
newlist.sort()
if len(newlist) % 2 == 0: # if even number of scores, avera... | 0.003344 |
def do_decode(cls, obj, obj_type):
# type: (Any, ConjureTypeType) -> Any
"""Decodes json into the specified type
Args:
obj: the json object to decode
element_type: a class object which is the type we're decoding into.
"""
if inspect.isclass(obj_type) and ... | 0.00239 |
def cancel(self):
"""
Cancel itself and following NOTs as far as possible.
Returns the simplified expression.
"""
expr = self
while True:
arg = expr.args[0]
if not isinstance(arg, self.__class__):
return expr
expr = arg.... | 0.004902 |
def register_dependency(self, data_src, data_sink):
""" registers a dependency of data_src -> data_sink
by placing appropriate entries in provides_for and depends_on
"""
pdebug("registering dependency %s -> %s" % (data_src, data_sink))
if (data_src not in self._gettask(data... | 0.003704 |
def get_notice(self) -> dict:
"""
取得公布欄訊息列表
"""
try:
# 取得資料
response = self.__session.get(
self.__url + '/MessageBoard', timeout=0.5, verify=False)
soup = BeautifulSoup(response.text, 'html.parser')
# 整理公布欄訊息列表
n... | 0.004027 |
def snake(s):
"""Convert from title or camelCase to snake_case."""
if len(s) < 2:
return s.lower()
out = s[0].lower()
for c in s[1:]:
if c.isupper():
out += "_"
c = c.lower()
out += c
return out | 0.003817 |
def _load_keras_model(model_network_path, model_weight_path, custom_objects=None):
"""Load a keras model from disk
Parameters
----------
model_network_path: str
Path where the model network path is (json file)
model_weight_path: str
Path where the model network weights are (hd5 fil... | 0.003191 |
def _commit(self):
"""
:return: (dict) Response object content
"""
assert self.uri is not None, Exception("BadArgument: uri property cannot be None")
url = '{}/{}'.format(self.uri, self.__class__.__name__)
serialized_json = jsonpickle.encode(self, unpicklable=False, )
... | 0.005714 |
def normalize_rrs(rrsets):
"""Lexically sort the order of every ResourceRecord in a ResourceRecords
element so we don't generate spurious changes: ordering of e.g. NS records
is irrelevant to the DNS line protocol, but XML sees it differently.
Also rewrite any wildcard records to use the ascii hex code: somewh... | 0.007206 |
def _set_property(self, val, *args):
"""Private method that sets the value currently of the property"""
val = UserClassAdapter._set_property(self, val, *args)
if val:
Adapter._set_property(self, val, *args)
return val | 0.007663 |
def _add_dispatcher(self, path_regex, dispatch_function):
"""Add a request path and dispatch handler.
Args:
path_regex: A string regex, the path to match against incoming requests.
dispatch_function: The function to call for these requests. The function
should take (request, start_response... | 0.002128 |
def get_unique_schema_id(schema):
# type: (GraphQLSchema) -> str
"""Get a unique id given a GraphQLSchema"""
assert isinstance(schema, GraphQLSchema), (
"Must receive a GraphQLSchema as schema. Received {}"
).format(repr(schema))
if schema not in _cached_schemas:
_cached_schemas[sch... | 0.002457 |
def generate_cmd_string(self, cmd, *args, **kwargs):
"""
for any generate_cmd_string doesn't written as public method of terraform
examples:
1. call import command,
ref to https://www.terraform.io/docs/commands/import.html
--> generate_cmd_string call:
te... | 0.002478 |
def add_line(self, start, end, color=(0.5, 0.5, 0.5), width=1):
"""
Adds a line.
Args:
start: Starting coordinates for line.
end: Ending coordinates for line.
color: Color for text as RGB. Defaults to grey.
width: Width of line. Defaults to 1.
... | 0.001978 |
def combine(self, pattern, variable):
"""Combine a pattern and variable parts to be a line string again."""
inter_zip = izip_longest(variable, pattern, fillvalue='')
interleaved = [elt for pair in inter_zip for elt in pair]
return ''.join(interleaved) | 0.007067 |
def shut_down():
"""Closes connection and restores terminal"""
curses.nocbreak()
curses.echo()
curses.endwin()
gpsd_socket.close()
print('Keyboard interrupt received\nTerminated by user\nGood Bye.\n')
sys.exit(1) | 0.004167 |
def factorize(self, niter=10, compute_w=True, compute_h=True,
compute_err=True, show_progress=False):
""" Factorize s.t. WH = data
Parameters
----------
niter : int
number of iterations.
show_progress : bool
... | 0.005113 |
def find_and_replace(self, node):
"""Parses URIs containing .md and replaces them with their HTML page.
Args:
node(node): docutils node.
Returns:
node: docutils node.
"""
if isinstance(node, nodes.reference) and 'refuri' in node:
reference_uri = node['refuri']
if referenc... | 0.008734 |
def text_dict_write(fpath, dict_):
"""
Very naive, but readable way of storing a dictionary on disk
FIXME: This broke on RoseMary's big dataset. Not sure why. It gave bad
syntax. And the SyntaxError did not seem to be excepted.
"""
#dict_ = text_dict_read(fpath)
#dict_[key] = val
dict_te... | 0.006494 |
def get_plugin_modules(folders, package='plugins',
parentpackage='linkcheck.dummy'):
"""Get plugin modules for given folders."""
for folder in folders:
for module in loader.get_folder_modules(folder, parentpackage):
yield module
for module in loader.get_package_mod... | 0.002817 |
def show_instance(name, call=None):
'''
List the a single node, return dict of grains.
'''
local = salt.client.LocalClient()
ret = local.cmd(name, 'grains.items')
ret.update(_build_required_items(ret))
return ret | 0.004167 |
def limit_disk_io(self, uuid, media, totalbytessecset=False, totalbytessec=0, readbytessecset=False, readbytessec=0, writebytessecset=False,
writebytessec=0, totaliopssecset=False, totaliopssec=0, readiopssecset=False, readiopssec=0, writeiopssecset=False, writeiopssec=0,
tot... | 0.004458 |
def get_error(response):
"""Gets Error by HTTP Status Code"""
errors = {
400: BadRequestError,
401: UnauthorizedError,
403: AccessDeniedError,
404: NotFoundError,
429: RateLimitExceededError,
500: ServerError,
502: BadGatewayError,
503: ServiceUna... | 0.002033 |
def get_all_permissionschemes(self, expand=None):
"""
Returns a list of all permission schemes.
By default only shortened beans are returned.
If you want to include permissions of all the schemes,
then specify the permissions expand parameter.
Permissions will be included... | 0.004518 |
def update(old_template=None, old_version=None, new_template=None, new_version=None,
enter_parameters=False):
"""Updates the temple project to the latest template
Proceeeds in the following steps:
1. Ensure we are inside the project repository
2. Obtain the latest version of the package tem... | 0.00325 |
def convert(self, *args, **kwargs):
""" attempt to coerce any object types to better types return a copy of
the block (if copy = True) by definition we ARE an ObjectBlock!!!!!
can return multiple blocks!
"""
if args:
raise NotImplementedError
by_item = kwarg... | 0.001284 |
def after_epoch(self, **_) -> None:
"""
Reset progress counters. Save ``total_batch_count`` after the 1st epoch.
"""
if not self._total_batch_count_saved:
self._total_batch_count = self._current_batch_count.copy()
self._total_batch_count_saved = True
self.... | 0.006637 |
def _catch_exceptions(self, exctype, value, tb):
"""Catches all exceptions and logs them."""
# Now we log it.
self.error('Uncaught exception', exc_info=(exctype, value, tb))
# First, we print to stdout with some colouring.
print_exception_formatted(exctype, value, tb) | 0.006452 |
def assert_not_in(obj, seq, message=None, extra=None):
"""Raises an AssertionError if obj is in iter."""
# for very long strings, provide a truncated error
if isinstance(seq, six.string_types) and obj in seq and len(seq) > 200:
index = seq.find(obj)
start_index = index - 50
if start_... | 0.003876 |
def d(self, xi):
"""Convenience function to compute first derivative of basis functions. 'Memoized' for speed."""
return self.__basis(xi, self.p, compute_derivatives=True) | 0.016043 |
def set_property(self, name, value):
"""
Helper to set a property value by name, translating to correct
dbus type
See also :py:meth:`get_property`
:param str name: The property name in the object's dictionary
whose value shall be set.
:param value: Propertie... | 0.002618 |
def sample(self, sample_size=20):
"""
This method retrieve an iterable object that implements the method
__iter__. The arguments given will compose the parameters in the
request url.
kwargs: sample_size (Integer) between 0 and 100.
return: iterable object of Works metad... | 0.004079 |
def watch_thread(self):
'''watch for menu events from child'''
from mp_settings import MPSetting
try:
while True:
msg = self.parent_pipe_recv.recv()
if self.menu_callback is not None:
self.menu_callback(msg)
time.sle... | 0.00542 |
def outlay(self, q):
"""
Determines the complete cash outlay (including commission) necessary
given a quantity q.
Second returning parameter is a commission itself.
Args:
* q (float): quantity
"""
fee = self.commission(q, self._price * self.multiplie... | 0.004831 |
def create(cls, name, certificate):
"""
Create a TLS CA. The certificate must be compatible with OpenSSL
and be in PEM format. The certificate can be either a file with
the Root CA, or a raw string starting with BEGIN CERTIFICATE, etc.
When creating a TLS CA, you must also import... | 0.005644 |
def get_targets(self, config):
""" Given an Entry object, return all of the outgoing links. """
return {urllib.parse.urljoin(self.url, attrs['href'])
for attrs in self._targets
if self._check_rel(attrs, config.rel_whitelist, config.rel_blacklist)
and self... | 0.008523 |
def trace2array(self, sl):
"""Return an array with the trace of all stochastics, sliced by sl."""
chain = []
for stochastic in self.stochastics:
tr = stochastic.trace.gettrace(slicing=sl)
if tr is None:
raise AttributeError
chain.append(tr)
... | 0.005747 |
def hailstone(n):
"""Return the 'hailstone sequence' from n to 1
n: The starting point of the hailstone sequence
"""
sequence = [n]
while n > 1:
if n%2 != 0:
n = 3*n + 1
else:
n = int(n/2)
sequence.append(n)
return sequence | 0.034091 |
def sigmask(self, sigsetsize=None):
"""
Gets the current sigmask. If it's blank, a new one is created (of sigsetsize).
:param sigsetsize: the size (in *bytes* of the sigmask set)
:return: the sigmask
"""
if self._sigmask is None:
if sigsetsize is not None:
... | 0.006605 |
def find_type(self, txt):
"""
top level function used to simply return the
ONE ACTUAL string used for data types
"""
searchString = txt.upper()
match = 'Unknown'
for i in self.lst_type:
if searchString in i:
match = i
return ma... | 0.009288 |
def get_requested_aosp_permissions(self):
"""
Returns requested permissions declared within AOSP project.
This includes several other permissions as well, which are in the platform apps.
:rtype: list of str
"""
aosp_permissions = []
all_permissions = self.get_pe... | 0.005929 |
def isPrefixOf(self, other):
"""Indicate if this |ASN.1| object is a prefix of other |ASN.1| object.
Parameters
----------
other: |ASN.1| object
|ASN.1| object
Returns
-------
: :class:`bool`
:class:`True` if this |ASN.1| object is a pare... | 0.008913 |
def overlay_gateway_ip_interface_loopback_loopback_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
overlay_gateway = ET.SubElement(config, "overlay-gateway", xmlns="urn:brocade.com:mgmt:brocade-tunnels")
name_key = ET.SubElement(overlay_gateway, "name... | 0.004127 |
def process_ssh(self, data, name):
"""
Processes SSH keys
:param data:
:param name:
:return:
"""
if data is None or len(data) == 0:
return
ret = []
try:
lines = [x.strip() for x in data.split(b'\n')]
for idx, li... | 0.005128 |
def score_small_straight_yahztee(dice: List[int]) -> int:
"""
Small straight scoring according to regular yahtzee rules
"""
global CONSTANT_SCORES_YAHTZEE
dice_set = set(dice)
if _are_two_sets_equal({1, 2, 3, 4}, dice_set) or \
_are_two_sets_equal({2, 3, 4, 5}, dice_set) or \
... | 0.002242 |
def _get_remote_settle_modes(pn_link):
"""Return a map containing the settle modes as provided by the remote.
Skip any default value.
"""
modes = {}
snd = pn_link.remote_snd_settle_mode
if snd == proton.Link.SND_UNSETTLED:
modes['snd-settle-mode'] = 'unsettled'
elif snd == proton.Lin... | 0.00198 |
def split_id_otp(from_key):
"""
Separate public id from OTP given a YubiKey OTP as input.
@param from_key: The OTP from a YubiKey (in modhex)
@type from_key: string
@returns: public_id and OTP
@rtype: tuple of string
"""
if len(from_key) > 32:
public_id, otp = from_key[:-32], f... | 0.005076 |
def padded_cross_entropy_factored(factored_logits,
labels,
label_smoothing,
weights_fn=weights_nonzero,
reduce_sum=True):
"""Memory-efficient computation of smoothing cross-entropy.
... | 0.004759 |
def __flush_buffer(self):
"""Flush the buffer contents out to a chunk.
"""
def ok(_):
self._buffer.close()
self._buffer = StringIO()
return self.__flush_data(self._buffer.getvalue()).addCallback(ok) | 0.007874 |
def _process_skip_checks(cls, skip_checks):
"""
Processes an iterable of skip_checks with strings and returns a dict
with <check_name>: <max_skip_level> pairs
"""
check_dict = defaultdict(lambda: None)
# A is for "all", "M" is for medium, "L" is for low
check_loo... | 0.004367 |
def _reset_internal(self):
"""Resets the pose of the arm and grippers."""
super()._reset_internal()
self.sim.data.qpos[self._ref_joint_pos_indexes] = self.mujoco_robot.init_qpos
if self.has_gripper_right:
self.sim.data.qpos[
self._ref_joint_gripper_right_actu... | 0.005455 |
def search_text(self, text_cursor, search_txt, search_flags):
"""
Searches a text in a text document.
:param text_cursor: Current text cursor
:param search_txt: Text to search
:param search_flags: QTextDocument.FindFlags
:returns: the list of occurrences, the current occ... | 0.001397 |
def _NotifyLegacy(username, notification_type, message, object_reference):
"""Schedules a legacy AFF4 user notification."""
try:
with aff4.FACTORY.Open(
aff4.ROOT_URN.Add("users").Add(username),
aff4_type=aff4_users.GRRUser,
mode="rw") as fd:
args = _MapLegacyArgs(notification_ty... | 0.015355 |
def debug(method):
"""Decorator to debug the given method"""
def new_method(*args, **kwargs):
import pdb
try:
import pudb
except ImportError:
pudb = pdb
try:
pudb.runcall(method, *args, **kwargs)
except pdb.bdb.BdbQuit:
sys.... | 0.002123 |
def mdot_t(self,ifig=None,lims=[7.4,2.6,-8.5,-4.5],label=None,colour=None,s2ms=False,
dashes=None):
"""
Plot mass loss history as a function of log-time-left
Parameters
----------
ifig : integer or string
Figure label, if None the current figure is use... | 0.022866 |
def get_settings(all,key):
"""View Hitman internal settings. Use 'all' for all keys"""
with Database("settings") as s:
if all:
for k, v in zip(list(s.keys()), list(s.values())):
print("{} = {}".format(k, v))
elif key:
print("{} = {}".format(key, s[key]))
... | 0.005141 |
def stack_decoders(self, *layers):
"""
Stack decoding layers.
"""
self.stack(*layers)
self.decoding_layers.extend(layers) | 0.012422 |
def remove_run_script(self, script, target_name=None):
"""
Removes the given script string from the given target
:param script: The script string to be removed from the target
:param target_name: Target name or list of target names to remove the run script from or None for every target
... | 0.003793 |
def filter(coro, iterable, assert_fn=None, limit=0, loop=None):
"""
Returns a list of all the values in coll which pass an asynchronous truth
test coroutine.
Operations are executed concurrently by default, but results
will be in order.
You can configure the concurrency via `limit` param.
... | 0.0004 |
def MI_enumInstances(self,
env,
ns,
propertyList,
requestedCimClass,
cimClass):
# pylint: disable=invalid-name
"""Return instances of a given CIM class
Implements the WBE... | 0.004053 |
def remove_file_from_s3(awsclient, bucket, key):
"""Remove a file from an AWS S3 bucket.
:param awsclient:
:param bucket:
:param key:
:return:
"""
client_s3 = awsclient.get_client('s3')
response = client_s3.delete_object(Bucket=bucket, Key=key) | 0.00361 |
def get_last_activities(self, n):
"""Get all activity data for the last activity
Keyword arguments:
"""
filenames = self.get_activity_list().iloc[-n:].filename.tolist()
last_activities = [self.get_activity(f) for f in filenames]
return last_activities | 0.006667 |
def create_virtualenv(self):
"""
Populate venv from preloaded image
"""
return task.create_virtualenv(self.target, self.datadir,
self._preload_image(), self._get_container_name) | 0.013575 |
def get_ssl(self, host_and_port=None):
"""
Get SSL params for the given host.
:param (str,int) host_and_port: the host/port pair we want SSL params for, default current_host_and_port
"""
if not host_and_port:
host_and_port = self.current_host_and_port
return... | 0.008403 |
def flush(self, save_index=False, save_model=False, clear_buffer=False):
"""Commit all changes, clear all caches."""
if save_index:
if self.fresh_index is not None:
self.fresh_index.save(self.location('index_fresh'))
if self.opt_index is not None:
... | 0.00783 |
def post_unvote(self, post_id):
"""Action lets you unvote for a post (Requires login).
Parameters:
post_id (int):
"""
return self._get('posts/{0}/unvote.json'.format(post_id),
method='PUT', auth=True) | 0.007407 |
def get_positions(elinfo, center=True):
'''Computes the positions of the elctrodes based on the elinfo
Parameters
----------
elinfo: dict
Contains electrode information from yaml file (dim, pitch, sortlist, plane, pos)
Returns
-------
positions: np.array
3d points with the ... | 0.001796 |
def findModuleOfName(self, dotted_name, level, filename, extrapath=None):
"""Given a fully qualified name, find what module contains it."""
if dotted_name.endswith('.*'):
return dotted_name[:-2]
name = dotted_name
# extrapath is None only in a couple of test cases; in real l... | 0.003668 |
def _set_lsp_cspf_computation_mode(self, v, load=False):
"""
Setter method for lsp_cspf_computation_mode, mapped from YANG variable /mpls_config/router/mpls/mpls_cmds_holder/lsp/secondary_path/lsp_cspf_computation_mode (cspf-computation-mode)
If this variable is read-only (config: false) in the
source Y... | 0.004547 |
def save_data(self,session, exp_id, content):
'''save data will obtain the current subid from the session, and save it
depending on the database type. Currently we just support flat files'''
from expfactory.database.models import (
Participant,
Result
)
subid = session.get('subid'... | 0.009908 |
def set_models_keyspace(self, keyspace):
"""Set keyspace for all connection models"""
for models in self.connection.introspection.cql_models.values():
for model in models:
model.__keyspace__ = keyspace | 0.00813 |
def merge_arrays(merge_list, names=None, flatten=True, outtype=None):
"""Merges the given arrays into a single array. The arrays must all have
the same shape. If one or more of the given arrays has multiple fields,
all of the fields will be included as separate fields in the new array.
Parameters
-... | 0.002263 |
def raw(func, **func_args):
"""Decorator for eager functions checking input array
and stripping away the weld_type.
Stripping the weld_type is required to keep the same code in Series.apply and because
Numpy functions don't (all) have kwargs. Passing weld_type to NumPy functions is unexpected
and r... | 0.002317 |
def _get_replaced_code(self, names):
""" Return code, with new name, expressions, and replacements applied.
"""
code = self._code
# Modify name
fname = names[self]
code = code.replace(" " + self.name + "(", " " + fname + "(")
# Apply string replacements ... | 0.005372 |
def _extract(self):
"""Extract email addresses from results.
Text content from all crawled pages are ran through a simple email
extractor. Data is cleaned prior to running pattern expressions.
"""
self.log.debug("Extracting emails from text content")
for item in self.dat... | 0.003839 |
def _wres(parallel, progs, fresources=None, ensure_mem=None):
"""Add resource information to the parallel environment on required programs and files.
Enables spinning up required machines and operating in non-shared filesystem
environments.
progs -- Third party tools used in processing
fresources ... | 0.006203 |
def run(self):
"""Called by Sphinx.
:returns: ImgurEmbedNode and ImgurJavaScriptNode instances with config values passed as arguments.
:rtype: list
"""
# Get Imgur ID.
imgur_id = self.arguments[0]
if not RE_IMGUR_ID.match(imgur_id):
raise ImgurError('... | 0.008824 |
def filter_by(self, **kwargs):
"""
Apply the given filtering criterion to a copy of this Query, using
keyword expressions.
"""
query = self._copy()
for field, value in kwargs.items():
query.domain.append(
(field, '=', value)
)
... | 0.00597 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.