text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def write_output(self):
"""Write all stored output data to storage."""
for data in self.output_data.values():
self.create_output(data.get('key'), data.get('value'), data.get('type')) | 0.014286 |
def add_user_action_sets(self, _type, name, description, version='v1.0'):
"""
创建数据源
https://wximg.qq.com/wxp/pdftool/get.html?id=rkalQXDBM&pa=39
:param _type: 用户行为源类型
:param name: 用户行为源名称 必填
:param description: 用户行为源描述,字段长度最小 1 字节,长度最大 128 字节
:param version: 版本号 ... | 0.002778 |
def check_config_mode(self, check_string=">config", pattern=""):
"""
Checks if the device is in configuration mode or not.
Rad config starts with baseprompt>config.
"""
return super(RadETXBase, self).check_config_mode(
check_string=check_string, pattern=pattern
... | 0.006173 |
def add_resource(self, resource):
"""Add a resource to the minimum needs table.
:param resource: The resource to be added
:type resource: dict
"""
updated_sentence = NeedsProfile.format_sentence(
resource['Readable sentence'], resource)
if self.edit_item:
... | 0.003425 |
def add(self, **kwargs):
"""Just a shortcut to change the current url, equivalent to Url(self, **kwargs)"""
if "path" in kwargs:
path = kwargs["path"]
if isinstance(path, bytes):
path = String(path)
if not path[0].startswith("/"):
paths... | 0.005803 |
def reconstruct_from_shape(self, shape, optimize=False):
"""
Shape is a tuple that may contain integers, shape symbols (tf, keras, theano) and UnknownSize (keras, mxnet)
known axes can be integers or symbols, but not Nones
"""
axes_lengths = list(self.elementary_axes_lengths)
... | 0.004591 |
def from_string(self, html_string):
"""Parses an html string and returns a list of Tempy trees."""
self._html_parser._reset().feed(html_string)
return self._html_parser.result | 0.01005 |
def find_volume_groups(self):
"""Finds all volume groups that are mounted through a loopback originating from :attr:`orig_re_pattern`.
Generator yields tuples of vgname, pvname
"""
os.environ['LVM_SUPPRESS_FD_WARNINGS'] = '1'
# find volume groups
try:
resul... | 0.004181 |
def _print_summary_map(strm, result_map, ftype):
"""Print summary of certain result map."""
if len(result_map) == 0:
return 0
npass = len([x for k, x in result_map.iteritems() if len(x) == 0])
strm.write('=====%d/%d %s files passed check=====\n' % (npass, len(result_map), fty... | 0.004959 |
def audit_log_show(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/audit_logs#getting-audit-logs"
api_path = "/api/v2/audit_logs/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, **kwargs) | 0.011321 |
def get_catalogue(args):
"""Returns a `tacl.Catalogue`."""
catalogue = tacl.Catalogue()
catalogue.load(args.catalogue)
return catalogue | 0.006623 |
def name(self):
"""
Algo name.
"""
if self._name is None:
self._name = self.__class__.__name__
return self._name | 0.012195 |
def model_temporal_evolotion(self, time_index, cycle_files):
"""
- The function prepares the model for this time cycle
- Any time-dependant forcing should be handled here. This includes temporal stresses, boundary conditions, and
initial conditions.
- Two options are availabl... | 0.007051 |
def dynamic_content_item_variant_update(self, item_id, id, data, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/dynamic_content#update-variant"
api_path = "/api/v2/dynamic_content/items/{item_id}/variants/{id}.json"
api_path = api_path.format(item_id=item_id, id=id)
return ... | 0.008021 |
def _resource_deletion(resource):
""" Recalculate consumption details and save resource details """
if resource.__class__ not in CostTrackingRegister.registered_resources:
return
new_configuration = {}
price_estimate = models.PriceEstimate.update_resource_estimate(resource, new_configuration)
... | 0.005698 |
def _verify_cert(self, sock: ssl.SSLSocket):
'''Check if certificate matches hostname.'''
# Based on tornado.iostream.SSLIOStream
# Needed for older OpenSSL (<0.9.8f) versions
verify_mode = self._ssl_context.verify_mode
assert verify_mode in (ssl.CERT_NONE, ssl.CERT_REQUIRED,
... | 0.002273 |
def _setLogicalOperator(self, lop):
"""Sets the way the find fields should be combined together."""
if not lop.lower() in ['and', 'or']:
raise FMError, 'Unsupported logical operator (not one of "and" or "or").'
self._lop = lop.lower() | 0.028571 |
def handle_line(self, line):
"""Read one line."""
if line.kind == ConfigLine.KIND_HEADER:
self.enter_block(line.header)
else:
self.insert_line(line) | 0.010204 |
def queryset(self):
"""This function sets the queryset according to the keyword arguments.
For the crosstype, the input value is the the display value of CROSS_TYPE.
This is done because the spaces in HET vs HET are not recognized.
Therefore the queryset must be matched exactly (ie by ... | 0.012712 |
def _get_object(self):
"""
:return:
The object our ref currently refers to. Refs can be cached, they will
always point to the actual object as it gets re-created on each query"""
# have to be dynamic here as we may be a tag which can point to anything
# Our path w... | 0.014344 |
def _parse_response(self, response):
"""Turn the PayPal response into a dict"""
q = QueryDict(response, encoding='UTF-8').dict()
return {k.lower(): v for k, v in q.items()} | 0.010204 |
def tag_array(events):
"""
Return a numpy array mapping events to tags
- Rows corresponds to events
- Columns correspond to tags
"""
all_tags = sorted(set(tag for event in events for tag in event.tags))
array = np.zeros((len(events), len(all_tags)))
for row, event in enumerate(events):
... | 0.00241 |
def _GetDateTime(self, filetime):
"""Retrieves the date and time from a FILETIME timestamp.
Args:
filetime (int): FILETIME timestamp.
Returns:
dfdatetime.DateTimeValues: date and time.
"""
if filetime == 0:
return dfdatetime_semantic_time.SemanticTime('Not set')
return dfdat... | 0.00551 |
def set_ecdh_curve(self, curve_name=None):
u''' Select a curve to use for ECDH(E) key exchange or set it to auto mode
Used for server only!
s.a. openssl.exe ecparam -list_curves
:param None | str curve_name: None = Auto-mode, "secp256k1", "secp384r1", ...
:return: 1 for succes... | 0.006878 |
def _map_center(self, coord, val):
''' Identitify the center of the Image correspond to one coordinate. '''
if self.ppd in [4, 8, 16, 32, 64]:
res = {'lat': 0, 'long': 360}
return res[coord] / 2.0
elif self.ppd in [128]:
res = {'lat': 90, 'long': 90}
... | 0.005607 |
def satellites_used(feed):
"""Counts number of satellites used in calculation from total visible satellites
Arguments:
feed feed=data_stream.TPV['satellites']
Returns:
total_satellites(int):
used_satellites (int):
"""
total_satellites = 0
used_satellites = 0
if not i... | 0.003717 |
def soup_maker(fh):
""" Takes a file handler returns BeautifulSoup"""
try:
from bs4 import BeautifulSoup
soup = BeautifulSoup(fh, "lxml")
for tag in soup.find_all():
tag.name = tag.name.lower()
except ImportError:
from BeautifulSoup import BeautifulStoneSoup
... | 0.002717 |
def _jdn(self):
"""Return the Julian date number for the given date."""
if self._last_updated == "gdate":
return conv.gdate_to_jdn(self.gdate)
return conv.hdate_to_jdn(self.hdate) | 0.009302 |
def setUser(self, user_or_username):
"""Link the user to the Contact
:returns: True if OK, False if the User could not be linked
:rtype: bool
"""
user = None
userid = None
# Handle User IDs (strings)
if isinstance(user_or_username, types.StringTypes):
... | 0.002793 |
def connect(dbapi_connection, connection_record):
"""
Called once by SQLAlchemy for each new SQLite DB-API connection.
Here is where we issue some PRAGMA statements to configure how we're
going to access the SQLite database.
@param dbapi_connection:
A newly connecte... | 0.002331 |
def getAllChannelsAsPolygons(self, maptype=None):
"""Return slew the telescope and return the corners of the modules
as Polygon objects.
If a projection is supplied, the ras and
decs are mapped onto x, y using that projection
"""
polyList = []
for ch in self.orig... | 0.004505 |
def git_iter(sep, *args, git=maybeloggit, **kwargs):
'Generator of chunks of stdout from given git command, delineated by sep character'
bufsize = 512
err = io.StringIO()
chunks = []
try:
for data in git('--no-pager', *args, _decode_errors='replace', _out_bufsize=bufsize, _iter=True, _err=err... | 0.004376 |
def _LhD(self):
"""
Implements Lₕ and D.
Returns
-------
Lh : ndarray
Uₕᵀ S₁⁻½ U₁ᵀ.
D : ndarray
(Sₕ ⊗ Sₓ + Iₕₓ)⁻¹.
"""
from numpy_sugar.linalg import ddot
self._init_svd()
if self._cache["LhD"] is not None:
... | 0.002946 |
def create(self, vals, check=True):
"""
Overrides orm create method.
@param self: The object pointer
@param vals: dictionary of fields value.
@return: new record set for hotel folio.
"""
if not 'service_lines' and 'folio_id' in vals:
tmp_room_lines = v... | 0.001144 |
def _mask_space(self, data):
"""Mask space pixels"""
geomask = get_geostationary_mask(area=self.area)
return data.where(geomask) | 0.013158 |
def create_user_id(self, user_id, app_id, cidr_block=None, mount_point='app-id', **kwargs):
"""POST /auth/<mount point>/map/user-id/<user_id>
:param user_id:
:type user_id:
:param app_id:
:type app_id:
:param cidr_block:
:type cidr_block:
:param mount_poi... | 0.006103 |
def is_the_session_still_active(self):
"""
Is the GGR session still active? Associated to a browser and the sessionId
Example of GGR status:
{"browsers":{"MicrosoftEdge":{"latest":{}},"android":{"8.1":{}},"chrome":{"70.0":{},"latest":{"test_tef":{"count":1,"sessions":[{"caps":{"browserNa... | 0.004137 |
def uuid(dataset_uri):
"""Return the UUID of the dataset."""
dataset = dtoolcore.DataSet.from_uri(dataset_uri)
click.secho(dataset.uuid) | 0.006757 |
def get_qpimage(self, idx):
"""Return background-corrected QPImage of data at index `idx`"""
if self._bgdata:
# The user has explicitly chosen different background data
# using `get_qpimage_raw`.
qpi = super(SeriesHdf5Qpimage, self).get_qpimage(idx)
else:
... | 0.002813 |
def _buildExecutor(self):
"""
Creates and returns an ExecutorInfo-shaped object representing our executor implementation.
"""
# The executor program is installed as a setuptools entry point by setup.py
info = addict.Dict()
info.name = "toil"
info.command.value = r... | 0.008114 |
def adjust_gamma(img, gamma, gain=1):
r"""Perform gamma correction on an image.
Also known as Power Law Transform. Intensities in RGB mode are adjusted
based on the following equation:
.. math::
I_{\text{out}} = 255 \times \text{gain} \times \left(\frac{I_{\text{in}}}{255}\right)^{\gamma}
... | 0.003244 |
def is_entry_safe(self, entry):
"""
Return ``True`` if ``entry`` can be safely extracted,
that is, if it does start with ``/`` or ``../``
after path normalization, ``False`` otherwise.
:rtype: bool
"""
normalized = os.path.normpath(entry)
if normalized.st... | 0.005682 |
def heatmap(args):
"""
%prog heatmap input.npy genome.json
Plot heatmap based on .npy data file. The .npy stores a square matrix with
bins of genome, and cells inside the matrix represent number of links
between bin i and bin j. The `genome.json` contains the offsets of each
contig/chr so that ... | 0.000343 |
def query_rates(self, pairs=[]):
''' Perform a request against truefx data '''
# If no pairs, TrueFx will use the ones given the last time
payload = {'id': self._session}
if pairs:
payload['c'] = _clean_pairs(pairs)
response = requests.get(self._api_url, params=payloa... | 0.004049 |
def nvmlDeviceGetFanSpeed(handle):
r"""
/**
* Retrieves the intended operating speed of the device's fan.
*
* Note: The reported speed is the intended fan speed. If the fan is physically blocked and unable to spin, the
* output will not match the actual fan speed.
*
* For all disc... | 0.006114 |
def resubmit(self, stream=sys.stdout, fail_running=False, resubmit_failed=False):
"""Function to resubmit failed jobs and collect results
Parameters
-----------
stream : `file`
Stream that this function will print to,
Must have 'write' function.
fail_run... | 0.003992 |
def index_update(index, items):
"""
:param:index: index name
:param:items: list of (operation, full class name, primary key, data) tuples.
"""
index_name = index
index = service.app_state.indexes[index_name]
adapted = service.adapted
session = safe_session()
updated = set()
writ... | 0.003615 |
def thread_exception(self, raised_exception):
""" Callback for handling exception, that are raised inside :meth:`.WThreadTask.thread_started`
:param raised_exception: raised exception
:return: None
"""
print('Thread execution was stopped by the exception. Exception: %s' % str(raised_exception))
print('Trac... | 0.030556 |
def can_lookup_objective_prerequisites(self):
"""Tests if this user can perform Objective lookups.
A return of true does not guarantee successful authorization. A
return of false indicates that it is known all methods in this
session will result in a PermissionDenied. This is intended a... | 0.003722 |
def get_joint_sections(section,
include_instructor_not_on_time_schedule=True):
"""
Returns a list of uw_sws.models.Section objects,
representing joint sections for the passed section.
"""
joint_sections = []
for url in section.joint_section_urls:
section = get_sec... | 0.002083 |
def get_or_default(func=None, default=None):
"""
Wrapper around Django's ORM `get` functionality.
Wrap anything that raises ObjectDoesNotExist exception
and provide the default value if necessary.
`default` by default is None. `default` can be any callable,
if it is callable it will be called wh... | 0.001241 |
def validate(self):
"""Validate the suite."""
for context_name in self.context_names:
context = self.context(context_name)
try:
context.validate()
except ResolvedContextError as e:
raise SuiteError("Error in context %r: %s"
... | 0.005464 |
def _filter_db_instances_by_status(awsclient, db_instances, status_list):
"""helper to select dbinstances.
:param awsclient:
:param db_instances:
:param status_list:
:return: list of db_instances that match the filter
"""
client_rds = awsclient.get_client('rds')
db_instances_with_status... | 0.001531 |
def bbox_overlaps(boxes, query_boxes):
"""
determine overlaps between boxes and query_boxes
:param boxes: n * 4 bounding boxes
:param query_boxes: k * 4 bounding boxes
:return: overlaps: n * k overlaps
"""
n_ = boxes.shape[0]
k_ = query_boxes.shape[0]
overlaps = np.zeros((n_, k_), dt... | 0.005045 |
def _connectToAPI(self):
"""
:return: A tweepy.API object that performs the queries
"""
#authorize twitter, initialize tweepy
auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
auth.set_access_token(self.access_key, self.access_secret)
api = t... | 0.008475 |
def remove_from_tor(self, protocol):
'''
Returns a Deferred which fires with None
'''
r = yield protocol.queue_command('DEL_ONION %s' % self.hostname[:-6])
if r.strip() != 'OK':
raise RuntimeError('Failed to remove hidden service: "%s".' % r) | 0.006803 |
def acquire_try_once(self):
"""
Try to aquire the lock once.
"""
if self.is_locked_by_me():
return True
else:
try:
self.fd = os.open(self.lock_filename, os.O_CREAT | os.O_RDWR | os.O_EXCL)
except FileExistsError:
... | 0.007692 |
def parse_color(color):
""" Parses color into a vtk friendly rgb list """
if color is None:
color = rcParams['color']
if isinstance(color, str):
return vtki.string_to_rgb(color)
elif len(color) == 3:
return color
else:
raise Exception("""
Invalid color input
M... | 0.002123 |
def create_from_xmlfile(cls, xmlfile, extdir=None):
"""Create a Source object from an XML file.
Parameters
----------
xmlfile : str
Path to XML file.
extdir : str
Path to the extended source archive.
"""
root = ElementTree.ElementTree(fil... | 0.003899 |
def get_user_brief():
"""Retrieve brief for current user (if any)."""
client = get_user_api()
with catch_raise_api_exception():
data, _, headers = client.user_self_with_http_info()
ratelimits.maybe_rate_limit(client, headers)
return data.authenticated, data.slug, data.email, data.name | 0.003175 |
def _Bern_to_JMS_I(C, qq):
"""From Bern to JMS basis for $\Delta F=2$ operators.
`qq` should be 'sb', 'db', 'ds' or 'cu'"""
if qq in ['sb', 'db', 'ds']:
dd = 'dd'
ij = '{}{}'.format(dflav[qq[0]] + 1, dflav[qq[1]] + 1)
elif qq == 'cu':
dd = 'uu'
ij = '{}{}'.format(uflav[qq... | 0.003925 |
def download(self, target_relpath, download_in_toto_metadata=True):
'''
Returns:
If download over TUF and in-toto is successful, this function will
return the complete filepath to the desired target.
'''
return self.__get_target(target_relpath, download_in_toto_me... | 0.008499 |
def cli(env, origin_volume_id, origin_snapshot_id, duplicate_size,
duplicate_iops, duplicate_tier, duplicate_snapshot_size, billing):
"""Order a duplicate file storage volume."""
file_manager = SoftLayer.FileStorageManager(env.client)
hourly_billing_flag = False
if billing.lower() == "hourly":
... | 0.000777 |
def isSameStatementList(stmListA: List[HdlStatement],
stmListB: List[HdlStatement]) -> bool:
"""
:return: True if two lists of HdlStatement instances are same
"""
if stmListA is stmListB:
return True
if stmListA is None or stmListB is None:
return False
f... | 0.002353 |
def start(self):
"""Execution happening on jhubctl."""
# Get specified resource.
resource_list = getattr(self, f'{self.resource_type}_list')
resource_action = getattr(resource_list, self.resource_action)
resource_action(self.resource_name) | 0.007168 |
def ambil_teks_dalam_label(sup):
"""Mengambil semua teks dalam sup label HTML (tanpa anak-anaknya).
:param sup: BeautifulSoup dari suatu label HTML
:type sup: BeautifulSoup
:returns: String semua teks dalam sup label HTML
:rtype: str
"""
return ''.join(i.strip() for i in sup.find_all(text=T... | 0.002924 |
def main_color(self):
"""
What is the most commonly occurring color.
Returns
------------
color: (4,) uint8, most common color
"""
if self.kind is None:
return DEFAULT_COLOR
elif self.kind == 'face':
colors = self.face_colors
... | 0.002594 |
def percolate_declares(program: Program) -> Program:
"""
Move all the DECLARE statements to the top of the program. Return a fresh obejct.
:param program: Perhaps jumbled program.
:return: Program with DECLAREs all at the top and otherwise the same sorted contents.
"""
declare_program = Program... | 0.004934 |
def is_int_dtype(dtype):
"""Return ``True`` if ``dtype`` is an integer type."""
dtype = np.dtype(dtype)
return np.issubsctype(getattr(dtype, 'base', None), np.integer) | 0.005587 |
def run(self, port): # pragma: no coverage
"""
Run on given port. Parse standard options and start the http server.
"""
tornado.options.parse_command_line()
http_server = tornado.httpserver.HTTPServer(self)
http_server.listen(port)
tornado.ioloop.IOLoop.instance()... | 0.009146 |
def unpack(cls, val):
'''
Convert from json/msgpack-friendly
'''
reqdictf, incunitf, incval = val
reqdict = {TimeUnit[k.upper()]: v for (k, v) in reqdictf.items()}
incunit = None if incunitf is None else TimeUnit[incunitf.upper()]
return cls(reqdict, incunit, incv... | 0.006192 |
def from_cstr_to_pystr(data, length):
"""Revert C pointer to Python str
Parameters
----------
data : ctypes pointer
pointer to data
length : ctypes pointer
pointer to length of data
"""
if PY3:
res = []
for i in range(length.value):
try:
... | 0.001299 |
def gather(obj):
"""Retrieve objects that have been distributed, making them local again"""
if hasattr(obj, '__distob_gather__'):
return obj.__distob_gather__()
elif (isinstance(obj, collections.Sequence) and
not isinstance(obj, string_types)):
return [gather(subobj) for subobj ... | 0.005618 |
def select_candidates(config):
"""Select candidates to download.
Parameters
----------
config: NgdConfig
Runtime configuration object
Returns
-------
list of (<candidate entry>, <taxonomic group>)
"""
download_candidates = []
for group in config.group:
summary... | 0.003448 |
def resetFifo(self):
"""
Resets the FIFO by first disabling the FIFO then sending a FIFO_RESET and then re-enabling the FIFO.
:return:
"""
logger.debug("Resetting FIFO")
self.i2c_io.write(self.MPU6050_ADDRESS, self.MPU6050_RA_USER_CTRL, 0b00000000)
pass
se... | 0.011321 |
def computeMD5(filepath, relativepath = ""):
'''Computes an MD5 checksum.
Depending on the file size, we either run the computation in Python or spawn a subprocess.
The implementation is slower in Python than the tested OS but there is an overhead associated with the spawning.
On my one-machine test (CentOS rele... | 0.038925 |
def get_option(self, name):
"""
Returns the value for the specified generic configuration option.
:returns: configuration option value or `None`, if the option was not
set.
"""
self.__validate_option_name(name)
return self.__options.get(name, None) | 0.006515 |
def presence_handler(stream, type_, from_, cb):
"""
Context manager to temporarily register a callback to handle presence
stanzas on a :class:`StanzaStream`.
:param stream: Stanza stream to register the coroutine at
:type stream: :class:`StanzaStream`
:param type_: Presence type to listen for.
... | 0.001095 |
def meta(*bases, **kwargs):
"""
Allows unique syntax similar to Python 3 for working with metaclasses in
both Python 2 and Python 3.
Examples
--------
>>> class BadMeta(type): # An usual metaclass definition
... def __new__(mcls, name, bases, namespace):
... if "bad" not in namespace: # A bad con... | 0.006608 |
def make_predicate_object_combinator(function, p, o):
""" Combinator to hold predicate object pairs until a subject is supplied and then
call a function that accepts a subject, predicate, and object.
Create a combinator to defer production of a triple until the missing pieces are supplied.
... | 0.006826 |
def bna_config_cmd_output_status(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
bna_config_cmd = ET.Element("bna_config_cmd")
config = bna_config_cmd
output = ET.SubElement(bna_config_cmd, "output")
status = ET.SubElement(output, "status... | 0.004386 |
def handle(self, **options):
"""Call "startapp" to generate app with custom user model."""
template = os.path.dirname(os.path.abspath(__file__)) + "/app_template"
name = options.pop("name")
call_command("startapp", name, template=template, **options) | 0.007092 |
def to_json(self):
"""
:return: str
"""
json_dict = self.to_json_basic()
json_dict['rain'] = self.rain
json_dict['light'] = self.light
json_dict['wind'] = self.wind
return json.dumps(json_dict) | 0.007782 |
def disconnect(self, client):
""" Remove client from pool. """
self.clients.remove(client)
del self.connect_args[client]
client.disconnect() | 0.011628 |
def guess_chunks(shape, typesize):
"""
Guess an appropriate chunk layout for a dataset, given its shape and
the size of each element in bytes. Will allocate chunks only as large
as MAX_SIZE. Chunks are generally close to some power-of-2 fraction of
each axis, slightly favoring bigger values for th... | 0.000618 |
def attributes_from_dict(document):
"""Convert a Json representation of a set of attribute instances into a
dictionary.
Parameters
----------
document : Json object
Json serialization of attribute instances
Returns
-------
dict(Attribute)
Dictionary of attribute instanc... | 0.001805 |
def set_uint_info(self, field, data):
"""Set uint type property into the DMatrix.
Parameters
----------
field: str
The field name of the information
data: numpy array
The array ofdata to be set
"""
_check_call(_LIB.XGDMatrixSetUIntInfo(se... | 0.003817 |
def weight_from_comm(self, v, comm):
""" The total number of edges (or sum of weights) to node ``v`` from
community ``comm``.
See Also
--------
:func:`~VertexPartition.MutableVertexPartition.weight_to_comm`
"""
return _c_louvain._MutableVertexPartition_weight_from_comm(self._partition, v, c... | 0.006173 |
def dns_get_str(s, pointer=0, pkt=None, _fullpacket=False):
"""This function decompresses a string s, starting
from the given pointer.
:param s: the string to decompress
:param pointer: first pointer on the string (default: 0)
:param pkt: (optional) an InheritOriginDNSStrPacket packet
:returns... | 0.000337 |
def __vCmdSetCamAperture(self, args):
'''ToDo: Validate CAM number and Valid Aperture Value'''
if len(args) == 1:
for cam in self.camera_list:
cam.boSetAperture(int(args[0]))
elif len(args) == 2:
cam = self.camera_list[int(args[1])]
cam.boSetAp... | 0.00905 |
def log_message(self):
"""Build a log message and reset the stats"""
time_delta = deepcopy(self.time_delta)
total_work_time = self.worker_count * time_delta
time_worked = sum(self.exec_times)
pct_busy = time_worked / total_work_time * 100.0
min_task_time = min(self.exec_... | 0.004386 |
def _beeswarm(ax, x, notch=0, sym='b+', vert=1, whis=1.5,
positions=None, widths=None, patch_artist=False,
bootstrap=None):
"""
Call signature::
beeswarm(x, notch=0, sym='+', vert=1, whis=1.5,
positions=None, widths=None, patch_artist=False)
Make a box and whisk... | 0.006046 |
def ssad(patch, cols, splits):
"""
Calculates an empirical intra-specific spatial abundance distribution
Parameters
----------
{0}
Returns
-------
{1} Result has one column giving the individuals of species in each
subplot.
Notes
-----
{2}
{3}
Examples
--... | 0.001027 |
def cells_rt_meta_pub(workbook, sheet, row, col, pub_qty):
"""
Publication section is special. It's possible there's more than one publication.
:param obj workbook:
:param str sheet:
:param int row:
:param int col:
:param int pub_qty: Number of distinct publication sections in this file
... | 0.002865 |
def on_renewing(self):
"""Action on renewing on RENEWING state.
Not recording lease, but restarting timers.
"""
self.client.lease.sanitize_net_values()
self.client.lease.set_times(self.time_sent_request)
self.set_timers() | 0.00738 |
def read(self):
"""Read coverage data from the coverage data file (if it exists)."""
if self.use_file:
self.lines, self.arcs = self._read_file(self.filename)
else:
self.lines, self.arcs = {}, {} | 0.008264 |
def has_more_pages(self):
"""
:return: ``True`` if there are more pages available on the server.
"""
# if has_next property exists, it represents whether more pages exist
if self.has_next is not None:
return self.has_next
# otherwise, try to compute whether ... | 0.003704 |
def remove_sqlvm_from_aglistener(instance, sqlvm_resource_id):
'''
Remove a SQL virtual machine from an availability group listener.
'''
if not is_valid_resource_id(sqlvm_resource_id):
raise CLIError("Invalid SQL virtual machine resource id.")
vm_list = instance.load_balancer_configurations... | 0.005803 |
def text(self, x, y, text):
"""Print a text on ASCII canvas.
Args:
x (int): x coordinate where the text should start.
y (int): y coordinate where the text should start.
text (str): string that should be printed.
"""
for i, char in enumerate(text):
... | 0.005634 |
def _set_loopback(self, v, load=False):
"""
Setter method for loopback, mapped from YANG variable /rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/neighbor_ips/neighbor_addr/update_source/loopback (loopback-interface)
If this variable is read-only (config: false) in the
source YANG file, the... | 0.005356 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.