text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def get_int(byte_array, signed=True):
"""
Gets the specified integer from its byte array.
This should be used by this module alone, as it works with big endian.
:param byte_array: the byte array representing th integer.
:param signed: whether the number is signed or not.
:return: the integer re... | 0.002326 |
def broadcast(self,
fromUserId,
objectName,
content,
pushContent=None,
pushData=None,
os=None):
"""
发送广播消息方法(发送消息给一个应用下的所有注册用户,如用户未在线会对满足条件(绑定手机终端)的用户发送 Push 信息,单条消息最大 128k,会话类型为 SYSTEM。每小时只能发送 1 ... | 0.010651 |
def build(client, destination_args):
""" Build a SetupHandler object for client from destination parameters.
"""
# Have defined a remote job directory, lets do the setup locally.
if client.job_directory:
handler = LocalSetupHandler(client, destination_args)
else:
handler = RemoteSetu... | 0.002817 |
def fit(self, fr):
"""
To perform the munging operations on a frame specified in steps on the frame fr.
:param fr: H2OFrame where munging operations are to be performed on.
:return: H2OFrame after munging operations are completed.
"""
assert_is_type(fr, H2OFrame)
... | 0.008306 |
def process_user(self, user: types.User):
"""
Generate user data
:param user:
:return:
"""
if not user:
return
yield 'user_id', user.id
if self.include_content:
yield 'user_full_name', user.full_name
if user.username:
... | 0.005348 |
def get_checksums(self, fileset):
"""
Downloads the MD5 digests associated with the files in the file-set.
These are saved with the downloaded files in the cache and used to
check if the files have been updated on the server
Parameters
----------
resource : xnat.... | 0.001438 |
def show_compatibility_message(self, message):
"""
Show compatibility message.
"""
messageBox = QMessageBox(self)
messageBox.setWindowModality(Qt.NonModal)
messageBox.setAttribute(Qt.WA_DeleteOnClose)
messageBox.setWindowTitle('Compatibility Check')
messag... | 0.004751 |
def flush(self, timeout=None):
"""
Invoking this method makes all buffered records immediately available
to send (even if linger_ms is greater than 0) and blocks on the
completion of the requests associated with these records. The
post-condition of :meth:`~kafka.KafkaProducer.flu... | 0.002336 |
def _assert_sframe_equal(sf1,
sf2,
check_column_names=True,
check_column_order=True,
check_row_order=True,
float_column_delta=None):
"""
Assert the two SFrames are equal.
The default... | 0.002901 |
def get_health_monitor(self, loadbalancer):
"""
Returns a dict representing the health monitor for the load
balancer. If no monitor has been configured, returns an
empty dict.
"""
uri = "/loadbalancers/%s/healthmonitor" % utils.get_id(loadbalancer)
resp, body = se... | 0.005168 |
def exception(maxTBlevel=None):
"""Retrieve useful information about an exception.
Returns a bunch (attribute-access dict) with the following information:
* name: exception class name
* cls: the exception class
* exception: the exception instance
* trace: the traceback instance
* formatted... | 0.000974 |
def apiDockerCall(job,
image,
parameters=None,
deferParam=None,
volumes=None,
working_dir=None,
containerName=None,
entrypoint=None,
detach=False,
log_config=... | 0.002153 |
def dlogpdf_df_dtheta(self, f, y, Y_metadata=None):
"""
TODO: Doc strings
"""
if self.size > 0:
if self.not_block_really:
raise NotImplementedError("Need to make a decorator for this!")
if isinstance(self.gp_link, link_functions.Identity):
... | 0.007759 |
def check_AP_deriv(abf,n=10):
"""X"""
timePoints=get_AP_timepoints(abf)[:10] #first 10
if len(timePoints)==0:
return
swhlab.plot.new(abf,True,title="AP velocity (n=%d)"%n,xlabel="ms",ylabel="V/S")
pylab.axhline(-50,color='r',lw=2,ls="--",alpha=.2)
pylab.axhline(-100,color='r',lw=2,ls="--... | 0.054636 |
def ticket_form_delete(self, id, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/ticket_forms#delete-ticket-form"
api_path = "/api/v2/ticket_forms/{id}.json"
api_path = api_path.format(id=id)
return self.call(api_path, method="DELETE", **kwargs) | 0.010345 |
def lock(self, block=True):
"""
Lock connection from being used else where
"""
self._locked = True
return self._lock.acquire(block) | 0.049645 |
def file(self, name, *args, **kwargs):
"""Open a file.
:param name: Filename appended to self.root
:param args: passed to open()
:param kwargs: passed to open()
:rtype: file
"""
return open(self(name), *args, **kwargs) | 0.007246 |
def add_comment(self, page_id, text):
"""
Add comment into page
:param page_id
:param text
"""
data = {'type': 'comment',
'container': {'id': page_id, 'type': 'page', 'status': 'current'},
'body': {'storage': {'value': text, 'representation... | 0.010204 |
def get_path(self):
"""
:returns: matplotlib.path.Path object for the z=0 projection of
this polygon.
"""
if self.path == None:
from matplotlib import path
return path.Path(self.points[:, :2]) # z=0 projection!
return self.path | 0.016026 |
def child(self, name):
"""Get a child with a specified name."""
return XMLElement(lib.lsl_child(self.e, str.encode(name))) | 0.014493 |
def _push_next(self):
"""Assign next batch workload to workers."""
r = next(self._iter, None)
if r is None:
return
self._key_queue.put((self._sent_idx, r))
self._sent_idx += 1 | 0.008811 |
def handle_log_data(self, m):
'''handling incoming log data'''
if self.download_file is None:
return
# lose some data
# import random
# if random.uniform(0,1) < 0.05:
# print('dropping ', str(m))
# return
if m.ofs != self.download_ofs:
... | 0.002694 |
def get_machine_stats(self):
'''
Gather spider based stats
'''
self.logger.debug("Gathering machine stats")
the_dict = {}
keys = self.redis_conn.keys('stats:crawler:*:*:*:*')
for key in keys:
# break down key
elements = key.split(":")
... | 0.00341 |
def set_offset(self, offset, mid=None):
"""This method will allow the menu to be placed anywhere in the open
window instead of just the upper left corner.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Inputs:
offset - This is the x,y tuple of the... | 0.002498 |
def enqueue_or_delay(self, queue_name=None, priority=None,
delayed_until=None, prepend=False, queue_model=None):
"""
Will enqueue or delay the job depending of the delayed_until.
"""
queue_name = self._get_queue_name(queue_name)
fields = {'queued': '1'}
... | 0.002817 |
def validate_url(cls, url: str) -> Optional[Match[str]]:
"""Check if the Extractor can handle the given url."""
match = re.match(cls._VALID_URL, url)
return match | 0.010753 |
def recv_exactly(self, n, timeout='default'):
"""
Recieve exactly n bytes
Aliases: read_exactly, readexactly, recvexactly
"""
self._print_recv_header(
'======== Receiving until exactly {0}B{timeout_text} ========', timeout, n)
return self._recv_predicate(la... | 0.00831 |
def summary_fig(
mapper_summary,
width=600,
height=500,
top=60,
left=20,
bottom=60,
right=20,
bgcolor="rgb(240,240,240)",
):
"""Define a dummy figure that displays info on the algorithms and
sklearn class instances or methods used
Returns a FigureWidget ob... | 0.000933 |
def tf_import_demo_experience(self, states, internals, actions, terminal, reward):
"""
Imports a single experience to memory.
"""
return self.demo_memory.store(
states=states,
internals=internals,
actions=actions,
terminal=terminal,
... | 0.008621 |
def up(ctx, instance_id):
"""Start EC2 instance"""
session = create_session(ctx.obj['AWS_PROFILE_NAME'])
ec2 = session.resource('ec2')
try:
instance = ec2.Instance(instance_id)
instance.start()
except botocore.exceptions.ClientError as e:
click.echo("Invalid instance ID {0} (... | 0.005277 |
def file_items(container, iterable):
"""
Files away objects into the appropriate attributes of the container.
"""
# container._value = copy(iterable)
container.nodes = set()
container.variables = set()
container.deterministics = set()
container.stochastics = set()
container.potenti... | 0.001359 |
def _add_item(self, cls, *args, **kwargs):
"""Add a plot item."""
box_index = kwargs.pop('box_index', self._default_box_index)
data = cls.validate(*args, **kwargs)
n = cls.vertex_count(**data)
if not isinstance(box_index, np.ndarray):
k = len(self._default_box_index... | 0.003697 |
def _acl_exists(name=None, id=None, token=None, consul_url=None):
'''
Check the acl exists by using the name or the ID,
name is ignored if ID is specified,
if only Name is used the ID associated with it is returned
'''
ret = {'result': False, 'id': None}
if id:
info = __sa... | 0.00246 |
def avail_images():
'''
Available images
'''
response = _query('grid', 'image/list')
ret = {}
for item in response['list']:
name = item['friendlyName']
ret[name] = item
return ret | 0.004444 |
def socket_parse(self, astr_destination):
'''
Examines <astr_destination> and if of form <str1>:<str2> assumes
that <str1> is a host to send datagram comms to over port <str2>.
Returns True or False.
'''
t_socketInfo = astr_destination.partition(':')
if ... | 0.012367 |
def getColumnByColumnAlias(self, name):
"""Returns a column from its name.
Input
-----
name : columnAlias of the column to retrieve
Return
------
A Column object or None when the name cannot be found.
"""
result = None
for ... | 0.00789 |
def sanitizer(name, replacements=[(':','_'), ('/','_'), ('\\','_')]):
"""
String sanitizer to avoid problematic characters in filenames.
"""
for old,new in replacements:
name = name.replace(old,new)
return name | 0.02521 |
def update_admin_object_resource(name, server=None, **kwargs):
'''
Update a JMS destination
'''
if 'jndiName' in kwargs:
del kwargs['jndiName']
return _update_element(name, 'resources/admin-object-resource', kwargs, server) | 0.007968 |
def get_stats(self, start=int(time()), stop=int(time())+10, step=10):
"""
Get stats of a monitored machine
:param start: Time formatted as integer, from when to fetch stats (default now)
:param stop: Time formatted as integer, until when to fetch stats (default +10 seconds)
:par... | 0.006676 |
def FetchSizeOfSignedBinary(binary_urn,
token = None
):
"""Returns the size of the given binary (in bytes).
Args:
binary_urn: RDFURN that uniquely identifies the binary.
token: ACL token to use with the legacy (non-relational) datastore.
Raises:
... | 0.01206 |
def autocov(x, **kwargs):
"""Returns the autocovariance of signal s at all lags.
Parameters
----------
x : ndarray
axis : time axis
all_lags : {True/False}
whether to return all nonzero lags, or to clip the length of r_xy
to be the length of x and y. If False, then the zero lag c... | 0.007752 |
def postChunked(host, selector, fields, files):
"""
Attempt to replace postMultipart() with nearly-identical interface.
(The files tuple no longer requires the filename, and we only return
the response body.)
Uses the urllib2_file.py originally from
http://fabien.seisen.org which was also draw... | 0.009592 |
def which(software, strip_newline=True):
'''get_install will return the path to where an executable is installed.
'''
if software is None:
software = "singularity"
cmd = ['which', software ]
try:
result = run_command(cmd)
if strip_newline is True:
result['message'... | 0.009346 |
def _scalar_field_to_json(field, row_value):
"""Maps a field and value to a JSON-safe value.
Args:
field ( \
:class:`~google.cloud.bigquery.schema.SchemaField`, \
):
The SchemaField to use for type conversion and field name.
row_value (any):
Value to ... | 0.001623 |
def _display_completions_like_readline(cli, completions):
"""
Display the list of completions in columns above the prompt.
This will ask for a confirmation if there are too many completions to fit
on a single page and provide a paginator to walk through them.
"""
from prompt_toolkit.shortcuts im... | 0.003222 |
def compare(self, other, components=[]):
"""
Compare two publishes
It expects that other publish is same or older than this one
Return tuple (diff, equal) of dict {'component': ['snapshot']}
"""
lg.debug("Comparing publish %s (%s) and %s (%s)" % (self.name, self.storage ... | 0.005848 |
def copy_view(self, request, object_id):
"""
Instantiates a class-based view that redirects to Wagtail's 'copy'
view for models that extend 'Page' (if the user has sufficient
permissions). We do this via our own view so that we can reliably
control redirection of the user back to... | 0.003155 |
def get_field_from_args_or_session(config, args, field_name):
"""
We try to get field_name from diffent sources:
The order of priorioty is following:
- command line argument (--<field_name>)
- current session configuration (default_<filed_name>)
"""
rez = getattr(args, field_name, None)
... | 0.012623 |
def _build_likelihood(self):
"""
This function computes the optimal density for v, q*(v), up to a constant
"""
# get the (marginals of) q(f): exactly predicting!
fmean, fvar = self._build_predict(self.X, full_cov=False)
return tf.reduce_sum(self.likelihood.variational_exp... | 0.011396 |
def fast_sync_inspect_snapshot( snapshot_path ):
"""
Inspect a snapshot
Return useful information
Return {'status': True, 'signatures': ..., 'payload_size': ..., 'sig_append_offset': ..., 'hash': ...} on success
Return {'error': ...} on error
"""
with open(snapshot_path, 'r') as f:
i... | 0.012894 |
def execute_fields_serially(
self,
parent_type: GraphQLObjectType,
source_value: Any,
path: Optional[ResponsePath],
fields: Dict[str, List[FieldNode]],
) -> AwaitableOrValue[Dict[str, Any]]:
"""Execute the given fields serially.
Implements the "Evaluating sel... | 0.002044 |
def preston_bin(data, max_num):
"""
Bins data on base 2 using Preston's method
Parameters
----------
data : array-like
Data to be binned
max_num : float
The maximum upper value of the data
Returns
-------
tuple
(binned_data, bin_edges)
Notes
-----
... | 0.000705 |
def _pad_arrays(t, arrays, indices, span, period):
"""Internal routine to pad arrays for periodic models."""
N = len(t)
if indices is None:
indices = np.arange(N)
pad_left = max(0, 0 - np.min(indices - span // 2))
pad_right = max(0, np.max(indices + span - span // 2) - (N - 1))
if pad_... | 0.000868 |
def xpath(self, *args, **kwargs):
""" Perform XPath on the passage XML
:param args: Ordered arguments for etree._Element().xpath()
:param kwargs: Named arguments
:return: Result list
:rtype: list(etree._Element)
"""
if "smart_strings" not in kwargs:
k... | 0.004975 |
def loadFromStream(self, stream, name=None):
"""Return a WSDL instance loaded from a stream object."""
document = DOM.loadDocument(stream)
wsdl = WSDL()
if name:
wsdl.location = name
elif hasattr(stream, 'name'):
wsdl.location = stream.name
wsdl.lo... | 0.005682 |
def result(self):
"""Formats the result."""
return {
"count": self._count,
"total": self._total,
"average": float(self._total) / self._count if self._count else 0
} | 0.005155 |
def datapath4file(filename, ext:str='.tgz', archive=True):
"Return data path to `filename`, checking locally first then in the config file."
local_path = URLs.LOCAL_PATH/'data'/filename
if local_path.exists() or local_path.with_suffix(ext).exists(): return local_path
elif archive: return Config.data_arc... | 0.023136 |
def get(self, didMethodName, required=True) -> DidMethod:
"""
:param didMethodName: name of DID Method
:param required: if not found and True, throws an exception, else None
:return: DID Method
"""
dm = self.d.get(didMethodName) if didMethodName else self.default
... | 0.005038 |
def run_evaluation(self, stream_name: str) -> None:
"""
Run the main loop with the given stream in the prediction mode.
:param stream_name: name of the stream to be evaluated
"""
def prediction():
logging.info('Running prediction')
self._run_zeroth_epoch(... | 0.004808 |
def meta_retrieve(self, meta_lookahead = None):
"""
Get metadata from the query itself. This is guaranteed to only
return a Python dictionary.
Note that if the query failed, the metadata might not be in JSON
format, in which case there may be additional, non-JSON data
wh... | 0.004678 |
def user_agent_detail(self, **kwargs):
"""Get the user agent detail.
Args:
**kwargs: Extra options to send to the server (e.g. sudo)
Raises:
GitlabAuthenticationError: If authentication is not correct
GitlabGetError: If the server cannot perform the request
... | 0.004264 |
def check_user(self, user_id):
"""
Check whether this user can read this dataset
"""
if self.hidden == 'N':
return True
for owner in self.owners:
if int(owner.user_id) == int(user_id):
if owner.view == 'Y':
return ... | 0.005797 |
def read_config(self):
"""Read a previous configuration file or create a new with default values."""
config_file = os.path.join(self.config_dir, 'pueue.ini')
self.config = configparser.ConfigParser()
# Try to get configuration file and return it
# If this doesn't work, a new defa... | 0.004464 |
def ctype_for_encoding(self, encoding):
"""Return ctypes type for an encoded Objective-C type."""
if encoding in self.typecodes:
return self.typecodes[encoding]
elif encoding[0:1] == b'^' and encoding[1:] in self.typecodes:
return POINTER(self.typecodes[encoding[1:]])
... | 0.002317 |
def symmetric_difference(self, other):
"""Constructs an unminimized DFA recognizing
the symmetric difference of the languages of two given DFAs.
Args:
other (DFA): The other DFA that will be used
for the symmetric difference operation
Returns:
... | 0.00655 |
def digicam_control_send(self, target_system, target_component, session, zoom_pos, zoom_step, focus_lock, shot, command_id, extra_param, extra_value, force_mavlink1=False):
'''
Control on-board Camera Control System to take shots.
target_system : System ID (u... | 0.007648 |
def load_shedding(network, **kwargs):
""" Implement load shedding in existing network to identify
feasibility problems
Parameters
----------
network : :class:`pypsa.Network
Overall container of PyPSA
marginal_cost : int
Marginal costs for load shedding
p_nom : int
... | 0.001745 |
def emit_dcp(self, event, **context):
"""Emit a event(with dcp) and gets the dynamic join point data(html code).
:param event: str,unicode: A unique identifier name for dcp.
:param context: dict: Keyword parameter, additional data passed to the template
:returns: html code with :class... | 0.006289 |
def check_indent_level(self, string, expected, line_num):
"""return the indent level of the string
"""
indent = self.config.indent_string
if indent == "\\t": # \t is not interpreted in the configuration file
indent = "\t"
level = 0
unit_size = len(indent)
... | 0.002508 |
def load_yaml_file(file):
"""
Load data from yaml file
:param file: Readable object or path to file
:type file: FileIO | str | unicode
:return: Yaml data
:rtype: None | int | float | str | unicode | list | dict
"""
if not hasattr(file, "read"):
with io.open(file, "r", encoding="... | 0.002347 |
def recv_framer(self, value):
"""
Set the framer in use for the receiving side of the
connection. The framer state will be reset next time the
framer is used.
"""
if not isinstance(value, framers.Framer):
raise ValueError("framer must be an instance of tendr... | 0.005464 |
def _lmder1_powell_singular():
"""Powell's singular function (lmder test #6). Don't run this as a
test, since it just zooms to zero parameters. The precise results
depend a lot on nitty-gritty rounding and tolerances and things."""
def func(params, vec):
vec[0] = params[0] + 10 * params[1]
... | 0.011375 |
def remove_which(ol,value,which,**kwargs):
'''
from elist.elist import *
ol = [1,'a',3,'a',5,'a']
id(ol)
new = remove_which(ol,'a',1)
ol
new
id(ol)
id(new)
####
ol = [1,'a',3,'a',5,'a']
id(ol)
rslt = remove_which(ol,'a',... | 0.010417 |
def iterate_subchain(self, chain):
"""
A coroutine used by __call__ to forward all requests to a
subchain.
"""
for mw in chain:
try:
yield mw
except Exception as err:
yield chain.throw(err) | 0.007018 |
def read(self, filename, binary_mode=False, size=None, offset=None):
"""Reads contents of a file to a string.
Args:
filename: string, a path
binary_mode: bool, read as binary if True, otherwise text
size: int, number of bytes or characters to read, otherwise
... | 0.001479 |
def _from_dict(cls, _dict):
"""Initialize a ListEnvironmentsResponse object from a json dictionary."""
args = {}
if 'environments' in _dict:
args['environments'] = [
Environment._from_dict(x) for x in (_dict.get('environments'))
]
return cls(**args... | 0.009346 |
def ASCII_encoding(self):
"""Returns the ASCII encoding of a string"""
w = unicodedata.normalize('NFKD', self.word).encode('ASCII',
'ignore') # Encode into ASCII, returns a bytestring
w = w.decode('utf-8') # Convert back to string
... | 0.008955 |
def _update_grammar(self):
"""
We create a new ``Grammar`` object from the one in ``AtisSqlTableContext``, that also
has the new entities that are extracted from the utterance. Stitching together the expressions
to form the grammar is a little tedious here, but it is worth it because we ... | 0.007901 |
def create_CAG_with_indicators(input, output, filename="CAG_with_indicators.pdf"):
""" Create a CAG with mapped indicators """
with open(input, "rb") as f:
G = pickle.load(f)
G.map_concepts_to_indicators(min_temporal_res="month")
G.set_indicator("UN/events/weather/precipitation", "Historical Ave... | 0.007592 |
def load_config(check_dir):
"""
Load configuration file from ``check_dir / ".cs50.yaml"``, applying
defaults to unspecified values.
:param check_dir: directory from which to load config file
:type check_dir: str / Path
:rtype: dict
"""
# Defaults for top-level keys
options = {
... | 0.00083 |
def _add_to_filemenu():
"""Helper function for the above :func:add_to_filemenu()
This function is serialised into a string and passed on
to evalDeferred above.
"""
import os
import pyblish
from maya import cmds
# This must be duplicated here, due to this function
# not being avai... | 0.000794 |
def install_catalogs(self):
"""
Call to catalog install command:
http://stackoverflow.com/a/24353921/4075339
"""
cmd_obj = self.distribution.get_command_obj('catalogs')
cmd_obj.force = self.force
if self.ugali_dir: cmd_obj.ugali_dir = self.ugali_dir
self.r... | 0.008772 |
def _GetCacheFileMetadataHeaderOffset(self, file_object):
"""Determines the offset of the cache file metadata header.
This method is inspired by the work of James Habben:
https://github.com/JamesHabben/FirefoxCache2
Args:
file_object (dfvfs.FileIO): a file-like object.
Returns:
int:... | 0.003745 |
def delete_tracking_beacon(self, tracking_beacons_id, **data):
"""
DELETE /tracking_beacons/:tracking_beacons_id/
Delete the :format:`tracking_beacons` with the specified :tracking_beacons_id.
"""
return self.delete("/tracking_beacons/{0}/".format(tracking_beacons_id), d... | 0.015198 |
def get_humidity(self):
"""
Returns the percentage of relative humidity
"""
self._init_humidity() # Ensure humidity sensor is initialised
humidity = 0
data = self._humidity.humidityRead()
if (data[0]): # Humidity valid
humidity = data[1]
ret... | 0.006024 |
def _check(self, sock_info):
"""This side-effecty function checks if this socket has been idle for
for longer than the max idle time, or if the socket has been closed by
some external network error, and if so, attempts to create a new
socket. If this connection attempt fails we raise the... | 0.001448 |
def DeleteClusterTags(r, tags, dry_run=False):
"""
Deletes tags from the cluster.
@type tags: list of str
@param tags: tags to delete
@type dry_run: bool
@param dry_run: whether to perform a dry run
"""
query = {
"dry-run": dry_run,
"tag": tags,
}
return r.requ... | 0.002801 |
def _add_hgnc_symbols(self, variant_obj):
"""Add hgnc symbols to the variant
If there are transcripts use the symbols found here,
otherwise use phizz to get the gene ids.
"""
hgnc_symbols = set()
if variant_obj.transcripts:
for transcript in v... | 0.006897 |
def debug_reduce(self, rule, tokens, parent, last_token_pos):
"""Customized format and print for our kind of tokens
which gets called in debugging grammar reduce rules
"""
def fix(c):
s = str(c)
last_token_pos = s.find('_')
if last_token_pos == -1:
... | 0.002778 |
def _Kw(rho, T):
"""Equation for the ionization constant of ordinary water
Parameters
----------
rho : float
Density, [kg/m³]
T : float
Temperature, [K]
Returns
-------
pKw : float
Ionization constant in -log10(kw), [-]
Notes
------
Raise :class:`No... | 0.000825 |
def fetch(backend_class, backend_args, category, filter_classified=False,
manager=None):
"""Fetch items using the given backend.
Generator to get items using the given backend class. When
an archive manager is given, this function will store
the fetched items in an `Archive`. If an exception ... | 0.000578 |
def _root_amplitude_brentq(counts, bkg, model, root_fn=_f_cash_root):
"""Fit amplitude by finding roots using Brent algorithm.
See Appendix A Stewart (2009).
Parameters
----------
counts : `~numpy.ndarray`
Slice of count map.
bkg : `~numpy.ndarray`
Slice of background map.
... | 0.000796 |
def show_firmware_version_output_show_firmware_version_build_time(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("config")
show_firmware_version = ET.Element("show_firmware_version")
config = show_firmware_version
output = ET.SubElement(show_firmware_vers... | 0.004785 |
def input_fields(self, preamble, *args):
"""Get a set of fields from the user. Optionally a preamble may be
shown to the user secribing the fields to return. The fields are
specified as the remaining arguments with each field being a a
list with the following entries:
- a pr... | 0.005413 |
def validate_broker_ids_subset(broker_ids, subset_ids):
"""Validate that user specified broker ids to restart exist in the broker ids retrieved
from cluster config.
:param broker_ids: all broker IDs in a cluster
:type broker_ids: list of integers
:param subset_ids: broker IDs specified by user
... | 0.004518 |
def validate(args):
"""
cldf validate <DATASET>
Validate a dataset against the CLDF specification, i.e. check
- whether required tables and columns are present
- whether values for required columns are present
- the referential integrity of the dataset
"""
ds = _get_dataset(args)
ds... | 0.002915 |
def document_scale(cls):
"""
Create a documentation for a scale
Import the superclass parameters
It replaces `{superclass_parameters}` with the documentation
of the parameters from the superclass.
Parameters
----------
cls : type
A scale class
Returns
-------
cls ... | 0.000575 |
def createKeyboardTab(self):
''' KEYBOARD '''
_keyboardList = [
'KEYCODE_1', 'KEYCODE_2', 'KEYCODE_3', 'KEYCODE_4', 'KEYCODE_5', 'KEYCODE_6', 'KEYCODE_7', 'KEYCODE_8',
'KEYCODE_9', 'KEYCODE_0',
'KEYCODE_Q', 'KEYCODE_W', 'KEYCODE_E', 'KEYCODE_R', 'KEYCODE_T', 'KEYCODE_... | 0.007212 |
def _respond(self, channel, text):
"""Respond to a message on the current socket.
Args:
channel (:py:class:`str`): The channel to send to.
text (:py:class:`str`): The message text to send.
"""
result = self._format_message(channel, text)
if result is not Non... | 0.004141 |
def boundary(ax, scale, axes_colors=None, **kwargs):
"""
Plots the boundary of the simplex. Creates and returns matplotlib axis if
none given.
Parameters
----------
ax: Matplotlib AxesSubplot, None
The subplot to draw on.
scale: float
Simplex scale size.
kwargs:
... | 0.001052 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.