text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def list_supported_categories():
"""
Prints a list of supported external account category names.
For example, "AWS" is a supported external account category name.
"""
categories = get_supported_categories(api)
category_names = [category.name for category in categories]
print ("Supported account categories... | 0.015152 |
def feature_assert(*feas):
"""
Takes some feature patterns (like in `feature_needs`).
Raises a fuse.FuseError if your underlying FUSE lib fails
to have some of the matching features.
(Note: use a ``has_foo`` type feature assertion only if lib support
for method ``foo`` is *necessary* for your f... | 0.003774 |
def remove_file(self, filepath):
"""
Removes the DataFrameModel from being registered.
:param filepath: (str)
The filepath to delete from the DataFrameModelManager.
:return: None
"""
self._models.pop(filepath)
self._updates.pop(filepath, default=None)
... | 0.005435 |
def run_step(context):
"""Get, set, unset $ENVs.
Context is a dictionary or dictionary-like. context is mandatory.
Input context is:
env:
get: {dict}
set: {dict}
unset: [list]
At least one of env's sub-keys (get, set or unset) must exist.
This step wil... | 0.000953 |
def n1qlQueryAll(self, *args, **kwargs):
"""
Execute a N1QL query, retrieving all rows.
This method returns a :class:`Deferred` object which is executed
with a :class:`~.N1QLRequest` object. The object may be iterated
over to yield the rows in the result set.
This metho... | 0.00274 |
def set_sensor_thresholds(self, sensor_number, lun=0,
unr=None, ucr=None, unc=None,
lnc=None, lcr=None, lnr=None):
"""Set the sensor thresholds that are not 'None'
`sensor_number`
`unr` for upper non-recoverable
`ucr` for upper... | 0.004167 |
def _decrypt(self, hexified_value):
"""The exact opposite of _encrypt
"""
encrypted_value = binascii.unhexlify(hexified_value)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
jsonified_value = self.cipher.decrypt(
encrypted_value).d... | 0.005013 |
def grant_role(self, role_name, principal_name, principal_type, grantor, grantorType, grant_option):
"""
Parameters:
- role_name
- principal_name
- principal_type
- grantor
- grantorType
- grant_option
"""
self.send_grant_role(role_name, principal_name, principal_type, gran... | 0.007792 |
def ext_pillar(minion_id,
pillar, # pylint: disable=W0613
collection='pillar',
id_field='_id',
re_pattern=None,
re_replace='',
fields=None):
'''
Connect to a mongo database and read per-node pillar information.
Param... | 0.000315 |
def owner(self):
"""
Username of document creator
"""
if self._owner:
return self._owner
elif not self.abstract:
return self.read_meta()._owner
raise EmptyDocumentException() | 0.008097 |
def _init_tmatrix(self):
"""Initialize the T-matrix.
"""
if self.radius_type == Scatterer.RADIUS_MAXIMUM:
# Maximum radius is not directly supported in the original
# so we convert it to equal volume radius
radius_type = Scatterer.RADIUS_EQUAL_VOLUME
... | 0.006369 |
def keep_folder(raw_path):
"""
Keep only folders that don't contain patterns in `DIR_EXCLUDE_PATTERNS`.
"""
keep = True
for pattern in DIR_EXCLUDE_PATTERNS:
if pattern in raw_path:
LOGGER.debug('rejecting', raw_path)
keep = False
return keep | 0.003367 |
def execute(self, method, args, ref):
""" Execute the method with args """
response = {'result': None, 'error': None, 'ref': ref}
fun = self.methods.get(method)
if not fun:
response['error'] = 'Method `{}` not found'.format(method)
else:
try:
... | 0.003802 |
def get_selection(cls, strings, title="Select an option", subtitle=None, exit_option=True, _menu=None):
"""
Single-method way of getting a selection out of a list of strings.
Args:
strings (:obj:`list` of :obj:`str`): The list of strings this menu should be built from.
... | 0.006205 |
def get_asset_repository_assignment_session(self):
"""Gets the session for assigning asset to repository mappings.
return: (osid.repository.AssetRepositoryAssignmentSession) - an
``AssetRepositoryAsignmentSession``
raise: OperationFailed - unable to complete request
rai... | 0.002581 |
def difference(self, other):
"""difference(x, y) = x(t) - y(t)."""
return self.operation(other, lambda x, y: x - y) | 0.015267 |
def edges(self, nodes=None):
"""
Returns a ``tuple`` of all edges in the ``DictGraph`` an edge is a pair
of **node objects**.
Arguments:
- nodes(iterable) [default: ``None``] iterable of **node objects** if
specified the edges will be limited to t... | 0.009044 |
def read_geo(self, key, info):
"""Read angles.
"""
pairs = {('satellite_azimuth_angle', 'satellite_zenith_angle'):
("SatelliteAzimuthAngle", "SatelliteZenithAngle"),
('solar_azimuth_angle', 'solar_zenith_angle'):
("SolarAzimuthAngle", "SolarZeni... | 0.001009 |
def niceStringify( self ):
" Returns a string representation with new lines and shifts "
out = ""
if self.docstring is not None:
out += str( self.docstring )
if not self.encoding is None:
if out != "":
out += '\n'
out += str( self.enco... | 0.020071 |
def namedb_select_where_unexpired_names(current_block, only_registered=True):
"""
Generate part of a WHERE clause that selects from name records joined with namespaces
(or projections of them) that are not expired.
Also limit to names that are registered at this block, if only_registered=True.
If o... | 0.008447 |
def as_dict(self, **kwargs):
"""Return an error dict for self.args and kwargs."""
error, reason, details, err_kwargs = self.args
result = {
key: val
for key, val in {
'error': error, 'reason': reason, 'details': details,
}.items()
i... | 0.004619 |
def archive_query_interval(self, _from, to):
'''
:param _from: Start of interval (int) (inclusive)
:param to: End of interval (int) (exclusive)
:raises: IOError
'''
with self.session as session:
table = self.tables.archive
try:
res... | 0.004261 |
def result_summary(self, result):
"""
Return a summary of the results.
"""
return "{} examples, {} errors, {} failures\n".format(
result.testsRun, len(result.errors), len(result.failures),
) | 0.008197 |
def matches_prefix(ip, prefix):
"""
Returns True if the given IP address is part of the given
network, returns False otherwise.
:type ip: string
:param ip: An IP address.
:type prefix: string
:param prefix: An IP prefix.
:rtype: bool
:return: True if the IP is in the prefix, Fals... | 0.00565 |
def _str2array(d):
""" Reconstructs a numpy array from a plain-text string """
if type(d) == list:
return np.asarray([_str2array(s) for s in d])
ins = StringIO(d)
return np.loadtxt(ins) | 0.004785 |
def update_payload(self, fields=None):
"""Wrap submitted data within an extra dict."""
payload = super(ConfigTemplate, self).update_payload(fields)
if 'template_combinations' in payload:
payload['template_combinations_attributes'] = payload.pop(
'template_combinations... | 0.00545 |
def find_video_by_id(self, video_id):
"""doc: http://open.youku.com/docs/doc?id=44
"""
url = 'https://openapi.youku.com/v2/videos/show_basic.json'
params = {
'client_id': self.client_id,
'video_id': video_id
}
r = requests.get(url, params=params)
... | 0.005479 |
def add(self, event_state, event_type, event_value,
proc_list=None, proc_desc="", peak_time=6):
"""Add a new item to the logs list.
If 'event' is a 'new one', add it at the beginning of the list.
If 'event' is not a 'new one', update the list .
If event < peak_time then the ... | 0.004334 |
def p_pkg_file_name(self, p):
"""pkg_file_name : PKG_FILE_NAME LINE"""
try:
if six.PY2:
value = p[2].decode(encoding='utf-8')
else:
value = p[2]
self.builder.set_pkg_file_name(self.document, value)
except OrderError:
... | 0.004115 |
def replace(iterable, pred, substitutes, count=None, window_size=1):
"""Yield the items from *iterable*, replacing the items for which *pred*
returns ``True`` with the items from the iterable *substitutes*.
>>> iterable = [1, 1, 0, 1, 1, 0, 1, 1]
>>> pred = lambda x: x == 0
>>> substitu... | 0.000412 |
def get_manifest(self, repo_name, tag):
'''return the image manifest via the aws client, saved in self.manifest
'''
image = None
repo = self.aws.describe_images(repositoryName=repo_name)
if 'imageDetails' in repo:
for contender in repo.get('imageDetails'):
if tag in contender['i... | 0.003421 |
def validate_arrangement_version(self):
"""Validate if the arrangement_version is supported
This is for autorebuilds to fail early otherwise they may failed
on workers because of osbs-client validation checks.
Method should be called after self.adjust_build_kwargs
Shows a warn... | 0.003802 |
def get_p_value(transcript, rates, iterations, consequence, de_novos):
""" find the probability of getting de novos with a mean conservation
The probability is the number of simulations where the mean conservation
between simulated de novos is less than the observed conservation.
Args:
... | 0.008279 |
def export_plotter_vtkjs(plotter, filename, compress_arrays=False):
"""Export a plotter's rendering window to the VTKjs format.
"""
sceneName = os.path.split(filename)[1]
doCompressArrays = compress_arrays
# Generate timestamp and use it to make subdirectory within the top level output dir
time... | 0.002765 |
def save_object(self, obj):
"""
Save object to disk as JSON.
Generally shouldn't be called directly.
"""
obj.pre_save(self.jurisdiction.jurisdiction_id)
filename = '{0}_{1}.json'.format(obj._type, obj._id).replace('/', '-')
self.info('save %s %s as %s',... | 0.00276 |
def get_instance_aws_context(ec2_client):
"""
Returns: a dictionary of aws context
dictionary will contain these entries:
region, instance_id, account, role, env, env_short, service
Raises: IOError if couldn't read metadata or lookup attempt failed
"""
result = {}
try:
result["region"] = http_ge... | 0.014383 |
def render(self, doc, context=None, math_option=False, img_path='',
css_path=CSS_PATH):
"""Start thread to render a given documentation"""
# If the thread is already running wait for it to finish before
# starting it again.
if self.wait():
self.doc = doc
... | 0.005396 |
def sms_login(self, client_id, phone_number, code, scope='openid'):
"""Login using phone number/verification code.
"""
return self.post(
'https://{}/oauth/ro'.format(self.domain),
data={
'client_id': client_id,
'connection': 'sms',
... | 0.003676 |
def _remove(self, xer, primary):
"""
Private method for removing a descriptor from the event loop.
It does the inverse job of _add, and also add a check in case of the fd
has gone away.
"""
if xer in primary:
notifier = primary.pop(xer)
notifier.s... | 0.006079 |
def _raw_records(self, identifier=None, rtype=None, name=None, content=None):
"""Return list of record dicts in the netcup API convention."""
record_fields = {
'id': identifier,
'type': rtype,
'hostname': name and self._relative_name(name),
'destination': ... | 0.002433 |
def makeUserLoginMethod(username, password, locale=None):
'''Return a function that will call the vim.SessionManager.Login() method
with the given parameters. The result of this function can be passed as
the "loginMethod" to a SessionOrientedStub constructor.'''
def _doLogin(soapStub):
... | 0.014706 |
def deactivate_users(server_context, target_ids, container_path=None):
"""
Deactivate but do not delete user accounts
:param server_context: A LabKey server context. See utils.create_server_context.
:param target_ids:
:param container_path:
:return:
"""
# This action responds with HTML s... | 0.004196 |
def connecting_vars(self):
"""
Returns a dictionary with the variables that must be added to the
input file in order to connect this :class:`Node` to its dependencies.
"""
vars = {}
for prod in self.products:
vars.update(prod.connecting_vars())
return... | 0.006154 |
def getChargeTimeElapsed(self):
"""Returns the charge time elapsed (in seconds), or 0 if is not currently charging"""
command = '$GS'
status = self.sendCommand(command)
if int(status[1]) == 3:
return int(status[2])
else:
return 0 | 0.015326 |
def shutdown(self, how):
"""
Shut down one or both halves of the connection. If ``how`` is 0,
further receives are disallowed. If ``how`` is 1, further sends
are disallowed. If ``how`` is 2, further sends and receives are
disallowed. This closes the stream in one or both dire... | 0.002401 |
def _configure_manager(self):
"""
Create the manager to handle the instances, and also another
to handle flavors.
"""
self._manager = CloudBlockStorageManager(self,
resource_class=CloudBlockStorageVolume, response_key="volume",
uri_base="volumes")
... | 0.01173 |
def update(self, agent=None, metadata=None):
"""
Only the agent_id and metadata are able to be updated via the API.
"""
self.manager.update_entity(self, agent=agent, metadata=metadata) | 0.009259 |
def remove_zero_points(self):
"""Remove all elements where the norms and points are zero.
Note
----
This returns nothing and updates the NormalCloud in-place.
"""
points_of_interest = np.where((np.linalg.norm(self.point_cloud.data, axis=0) != 0.0) &
... | 0.010972 |
def load_figure(d, new_fig=True):
"""Create a figure from what is returned by :meth:`inspect_figure`"""
import matplotlib.pyplot as plt
subplotpars = d.pop('subplotpars', None)
if subplotpars is not None:
subplotpars.pop('validate', None)
subplotpars = mfig.Subplo... | 0.00315 |
def compare(expr, value, regex_expr=False):
"""
Compares an string or regular expression againast a given value.
Arguments:
expr (str|regex): string or regular expression value to compare.
value (str): value to compare against to.
regex_expr (bool, optional): enables string based re... | 0.001071 |
def queue_pop(self, key, **kwargs):
"""
Remove and return the first item queue.
:param key: The document ID
:param kwargs: Arguments passed to :meth:`mutate_in`
:return: A :class:`ValueResult`
:raise: :cb_exc:`QueueEmpty` if there are no items in the queue.
:rais... | 0.002525 |
def _AnalyzeEvents(self, storage_writer, analysis_plugins, event_filter=None):
"""Analyzes events in a plaso storage.
Args:
storage_writer (StorageWriter): storage writer.
analysis_plugins (dict[str, AnalysisPlugin]): analysis plugins that
should be run and their names.
event_filter... | 0.008032 |
def _cache(self, key, val):
"""
Request that a key/value pair be considered for caching.
"""
cache_size = (1 if util.dimensionless_contents(self.streams, self.kdims)
else self.cache_size)
if len(self) >= cache_size:
first_key = next(k for k in se... | 0.007712 |
def configure_replicator_database(host, port, username=None, password=None):
"""
Connects to dabatase, checks the version and creates the
design document used by feat (if it doesn't exist).
@returns: IDatabaseConnection bound to _replicator database
"""
database = driver.Database(host, port, '_... | 0.000897 |
def _handle_fetch_response(self, responses):
"""The callback handling the successful response from the fetch request
Delivers the message list to the processor, handles per-message errors
(ConsumerFetchSizeTooSmall), triggers another fetch request
If the processor is still processing t... | 0.00044 |
def hira2kata(text, ignore=''):
"""Convert Hiragana to Full-width (Zenkaku) Katakana.
Parameters
----------
text : str
Hiragana string.
ignore : str
Characters to be ignored in converting.
Return
------
str
Katakana string.
Examples
--------
>>> pri... | 0.001715 |
def get(method, hmc, uri, uri_parms, logon_required):
"""Operation: Get CPC Energy Management Data (any CPC mode)."""
cpc_oid = uri_parms[0]
try:
cpc = hmc.cpcs.lookup_by_oid(cpc_oid)
except KeyError:
raise InvalidResourceError(method, uri)
energy_props =... | 0.00058 |
def unindex_template(self, tpl):
"""
Unindex a template from the `templates` container.
:param tpl: The template to un-index
:type tpl: alignak.objects.item.Item
:return: None
"""
name = getattr(tpl, 'name', '')
try:
del self.name_to_template[... | 0.004926 |
def exec_run(self, cmd, stdout=True, stderr=True, stdin=False, tty=False,
privileged=False, user='', detach=False, stream=False,
socket=False, environment=None, workdir=None, demux=False):
"""
Run a command inside this container. Similar to
``docker exec``.
... | 0.001494 |
def reassembly(self, info):
"""Reassembly procedure.
Positional arguments:
* info -- Info, info dict of packets to be reassembled
"""
BUFID = info.bufid # Buffer Identifier
FO = info.fo # Fragment Offset
IHL = info.ihl # Internet Header Length
... | 0.000971 |
async def get_friendly_name(self) -> Text:
"""
Let's use the first name of the user as friendly name. In some cases
the user object is incomplete, and in those cases the full user is
fetched.
"""
if 'first_name' not in self._user:
user = await self._get_full_... | 0.00489 |
def get_requires(self, requires_types):
"""Extracts requires of given types from metadata file, filter windows
specific requires.
"""
if not isinstance(requires_types, list):
requires_types = list(requires_types)
extracted_requires = []
for requires_name in re... | 0.003378 |
def _make_grid_of_axes(self,
bounding_rect=cfg.bounding_rect_default,
num_rows=cfg.num_rows_per_view_default,
num_cols=cfg.num_cols_grid_default,
axis_pad=cfg.axis_pad_default,
commn_an... | 0.008411 |
def delay(self, seconds=0, minutes=0, msg=None):
""" Delay protocol execution for a specific amount of time.
:param float seconds: A time to delay in seconds
:param float minutes: A time to delay in minutes
If both `seconds` and `minutes` are specified, they will be added.
"""
... | 0.004819 |
def connect(self, dialect=None, timeout=60):
"""
Will connect to the target server and negotiate the capabilities
with the client. Once setup, the client MUST call the disconnect()
function to close the listener thread. This function will populate
various connection properties th... | 0.000559 |
def register(name, fn=None):
"""
Decorator to register a function as a hook
Register hook for ``hook_name``. Can be used as a decorator::
@register('hook_name')
def my_hook(...):
pass
or as a function call::
def my_hook(...):
pass
register('hook_... | 0.000981 |
def change_object_link_card(obj, perms):
"""
If the user has permission to change `obj`, show a link to its Admin page.
obj -- An object like Movie, Play, ClassicalWork, Publication, etc.
perms -- The `perms` object that it's the template.
"""
# eg: 'movie' or 'classicalwork':
name = obj.__c... | 0.001538 |
def get(self, sid):
"""
Constructs a FunctionContext
:param sid: The sid
:returns: twilio.rest.serverless.v1.service.function.FunctionContext
:rtype: twilio.rest.serverless.v1.service.function.FunctionContext
"""
return FunctionContext(self._version, service_sid... | 0.008287 |
def parse_endnotes(document, xmlcontent):
"""Parse endnotes document.
Endnotes are defined in file 'endnotes.xml'
"""
endnotes = etree.fromstring(xmlcontent)
document.endnotes = {}
for note in endnotes.xpath('.//w:endnote', namespaces=NAMESPACES):
paragraphs = [parse_paragraph(documen... | 0.004367 |
def _ssl_wrap_socket(self, sock):
"""Wrap SSLSocket around the Socket.
:param socket.socket sock:
:rtype: SSLSocket
"""
context = self._parameters['ssl_options'].get('context')
if context is not None:
hostname = self._parameters['ssl_options'].get('server_hos... | 0.002494 |
def _validate_min(self, min_value, field, value):
""" {'nullable': False } """
try:
if value < min_value:
self._error(field, errors.MIN_VALUE)
except TypeError:
pass | 0.008734 |
def journal_event(events):
"""Group multiple events into a single one."""
reasons = set(chain.from_iterable(e.reasons for e in events))
attributes = set(chain.from_iterable(e.file_attributes for e in events))
return JrnlEvent(events[0].file_reference_number,
events[0].parent_file_r... | 0.00211 |
def cost_zerg_corrected(self) -> "Cost":
""" This returns 25 for extractor and 200 for spawning pool instead of 75 and 250 respectively """
if self.race == Race.Zerg and Attribute.Structure.value in self.attributes:
# a = self._game_data.units(UnitTypeId.ZERGLING)
# print(a)
... | 0.00722 |
def QA_indicator_BBI(DataFrame, N1=3, N2=6, N3=12, N4=24):
'多空指标'
C = DataFrame['close']
bbi = (MA(C, N1) + MA(C, N2) + MA(C, N3) + MA(C, N4)) / 4
DICT = {'BBI': bbi}
return pd.DataFrame(DICT) | 0.004695 |
def queue(self, new_job_id = None, new_job_name = None, queue_name = None):
"""Sets the status of this job to 'queued' or 'waiting'."""
# update the job id (i.e., when the job is executed in the grid)
if new_job_id is not None:
self.id = new_job_id
if new_job_name is not None:
self.name = n... | 0.012739 |
def setModelData(self, editor, model, index):
"""Updates the model after changing data in the editor.
Args:
editor (QtGui.QComboBox): The current editor for the item. Should be
a `QtGui.QComboBox` as defined in `createEditor`.
model (ColumnDtypeModel): The model ... | 0.007737 |
def get_sources(src_dir='src', ending='.cpp'):
"""Function to get a list of files ending with `ending` in `src_dir`."""
return [os.path.join(src_dir, fnm) for fnm in os.listdir(src_dir) if fnm.endswith(ending)] | 0.009174 |
def compute(self, runner_results, setup=False, poll=False, ignore_errors=False):
''' walk through all results and increment stats '''
for (host, value) in runner_results.get('contacted', {}).iteritems():
if not ignore_errors and (('failed' in value and bool(value['failed'])) or
... | 0.007049 |
def _remove_overlapped_date_str(self, results: List[List[dict]]) -> List[Extraction]:
"""
some string may be matched by multiple date templates,
deduplicate the results and return a single list
"""
res = []
all_results = []
for x in results:
all_resul... | 0.003106 |
def setup_logging(name):
"""Setup logging according to environment variables."""
logger = logging.getLogger(__name__)
if 'NVIM_PYTHON_LOG_FILE' in os.environ:
prefix = os.environ['NVIM_PYTHON_LOG_FILE'].strip()
major_version = sys.version_info[0]
logfile = '{}_py{}_{}'.format(prefix,... | 0.001079 |
def add(self, pattern_txt):
"""Add a pattern to the list.
Args:
pattern_txt (str list): the pattern, as a list of lines.
"""
self.patterns[len(pattern_txt)] = pattern_txt
low = 0
high = len(pattern_txt) - 1
while not pattern_txt[low]:
lo... | 0.004057 |
def get_mac_address_table_output_mac_address_table_mac_state(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
get_mac_address_table = ET.Element("get_mac_address_table")
config = get_mac_address_table
output = ET.SubElement(get_mac_address_table, ... | 0.002358 |
def _energy_distance_imp(x, y, exponent=1):
"""
Real implementation of :func:`energy_distance`.
This function is used to make parameter ``exponent`` keyword-only in
Python 2.
"""
x = _transform_to_2d(x)
y = _transform_to_2d(y)
_check_valid_energy_exponent(exponent)
distance_xx = ... | 0.001351 |
def _add_job_from_spec(self, job_json, use_job_id=True):
""" Add a single job to the Dagobah from a spec. """
job_id = (job_json['job_id']
if use_job_id
else self.backend.get_new_job_id())
self.add_job(str(job_json['name']), job_id)
job = self.get_job... | 0.001733 |
def command(self, *args, **kwargs):
"""A shortcut decorator for declaring and attaching a command to
the group. This takes the same arguments as :func:`command` but
immediately registers the created command with this instance by
calling into :meth:`add_command`.
"""
def ... | 0.004338 |
def _configure_port_binding(self, is_provider_vlan, duplicate_type,
is_native,
switch_ip, vlan_id,
intf_type, nexus_port, vni):
"""Conditionally calls vlan and port Nexus drivers."""
# This implies VLAN, VNI... | 0.003759 |
def dir_name_changed(self, widget, data=None):
"""
Function is used for controlling
label Full Directory project name
and storing current project directory
in configuration manager
"""
config_manager.set_config_value("da.project_dir", self.dir_name.get_text())
... | 0.008596 |
async def save(self, fp, *, seek_begin=True, use_cached=False):
"""|coro|
Saves this attachment into a file-like object.
Parameters
-----------
fp: Union[BinaryIO, :class:`os.PathLike`]
The file-like object to save this attachment to or the filename
to u... | 0.004159 |
def _user(self, user, real_name):
"""
Sends the USER message.
Required arguments:
* user - Username to send.
* real_name - Real name to send.
"""
with self.lock:
self.send('USER %s 0 * :%s' % (user, real_name))
if self.readable():
... | 0.005391 |
def add_ignore_patterns(self, *patterns):
"""
Adds an ignore pattern to the list for ignore patterns.
Ignore patterns are used to filter out unwanted files or directories
from the file system model.
A pattern is a Unix shell-style wildcards. See :mod:`fnmatch` for a
dee... | 0.003317 |
def write_registers(self, registeraddress, values):
"""Write integers to 16-bit registers in the slave.
The slave register can hold integer values in the range 0 to 65535 ("Unsigned INT16").
Uses Modbus function code 16.
The number of registers that will be written is defined by the l... | 0.006711 |
def record_modify_controlfield(rec, tag, controlfield_value,
field_position_global=None,
field_position_local=None):
"""Modify controlfield at position specified by tag and field number."""
field = record_get_field(
rec, tag,
field_po... | 0.00155 |
def camel_to_snake(name):
"""Converts CamelCase to snake_case.
Args:
name (string): The name to convert from CamelCase to snake_case.
Returns:
string: Converted string.
"""
s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", name)
return re.sub("([a-z0-9])([A-Z])", r"\1_\2", s1).lower() | 0.003135 |
def _proxy(self):
"""
Generate an instance context for the instance, the context is capable of
performing various actions. All instance actions are proxied to the context
:returns: ServiceContext for this ServiceInstance
:rtype: twilio.rest.preview.acc_security.service.ServiceC... | 0.010246 |
def loads_msgpack(buf):
"""
Args:
buf: the output of `dumps`.
"""
# Since 0.6, the default max size was set to 1MB.
# We change it to approximately 1G.
return msgpack.loads(buf, raw=False,
max_bin_len=MAX_MSGPACK_LEN,
max_array_len=MAX_MS... | 0.002283 |
def is_mixed_script(string, allowed_aliases=['COMMON']):
"""Checks if ``string`` contains mixed-scripts content, excluding script
blocks aliases in ``allowed_aliases``.
E.g. ``B. C`` is not considered mixed-scripts by default: it contains characters
from **Latin** and **Common**, but **Common** is excl... | 0.002066 |
def compute_metric(self, components):
"""Compute recall from `components`"""
numerator = components[RECALL_RELEVANT_RETRIEVED]
denominator = components[RECALL_RELEVANT]
if denominator == 0.:
if numerator == 0:
return 1.
else:
raise ... | 0.005141 |
def _resolve_jars_info(self, targets, classpath_products):
"""Consults ivy_jar_products to export the external libraries.
:return: mapping of jar_id -> { 'default' : <jar_file>,
'sources' : <jar_file>,
'javadoc' : <jar_file>,
... | 0.005155 |
def get_3d_markers_residual(
self, component_info=None, data=None, component_position=None
):
"""Get 3D markers with residual."""
return self._get_3d_markers(
RT3DMarkerPositionResidual, component_info, data, component_position
) | 0.01444 |
def convert_documentation(nb_path):
"""Run only the document conversion portion of the notebook conversion
The final document will not be completel
"""
with open(nb_path) as f:
nb = nbformat.reads(f.read(), as_version=4)
doc = ExtractInlineMetatabDoc(package_url="metapack+file:" + dirna... | 0.00375 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.