text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def email(value,
allow_empty = False,
**kwargs):
"""Validate that ``value`` is a valid email address.
.. note::
Email address validation is...complicated. The methodology that we have
adopted here is *generally* compliant with
`RFC 5322 <https://tools.ietf.org/html/rfc532... | 0.003203 |
def is_fnmatch_regex(string):
"""
Returns True if the given string is considered a fnmatch
regular expression, False otherwise.
It will look for
:param string: str
"""
is_regex = False
regex_chars = ['!', '*', '$']
for c in regex_chars:
if string.find(c) > -1:
r... | 0.002857 |
def EU27as(self, to='name_short'):
"""
Return EU27 countries in the specified classification
Parameters
----------
to : str, optional
Output classification (valid str for an index of
country_data file), default: name_short
Returns
-------... | 0.004329 |
def params(self_, parameter_name=None):
"""
Return the Parameters of this class as the
dictionary {name: parameter_object}
Includes Parameters from this class and its
superclasses.
"""
if self_.self is not None and self_.self._instance__params:
self_.... | 0.001704 |
def get_clean_url(self):
"""Retrieve the clean, full URL - including username/password."""
if self.needs_auth:
self.prompt_auth()
url = RepositoryURL(self.url.full_url)
url.username = self.username
url.password = self.password
return url | 0.006734 |
def _handle_results(self):
"""
Call back function to be implemented by the CLI.
"""
# Only process if we get HTTP result of 200
if self._api_result.status_code == requests.codes.ok:
self._relays = json.loads(self._api_result.text)
self._filter()
... | 0.005882 |
def Create(self, project_id, start_options=None, deadline=10):
"""Creates an emulator instance.
This method will wait for up to 'deadline' seconds for the emulator to
start.
Args:
project_id: project ID
start_options: a list of additional command-line options to pass to the
emula... | 0.001464 |
def _catalog_validation_to_list(response):
"""Formatea la validación de un catálogo a dos listas de errores.
Una lista de errores para "catalog" y otra para "dataset".
"""
# crea una lista de dicts para volcarse en una tabla (catalog)
rows_catalog = []
validation_result = {
"catalog_t... | 0.000481 |
def _validate_error(error):
"""Validate and return the given error object.
Based on the given error object, return either None or a dict with a
"message" key whose value is a string (the dict may also have any other
keys that it wants).
The given "error" object can be:
- None, in which case N... | 0.000802 |
def get_dict_key(data, key):
''' will serach a mulitdemensional dictionary for a key name and return a
value list of matching results '''
if isinstance(data, Mapping):
if key in data:
yield data[key]
for key_data in data.values():
for found in get_dict_key(key_da... | 0.002801 |
def getRandomWithMods(inputSpace, maxChanges):
""" Returns a random selection from the inputSpace with randomly modified
up to maxChanges number of bits.
"""
size = len(inputSpace)
ind = np.random.random_integers(0, size-1, 1)[0]
value = copy.deepcopy(inputSpace[ind])
if maxChanges == 0:
return valu... | 0.019391 |
def native(self):
"""
The native Python datatype representation of this value
:return:
An integer or None
"""
if self.contents is None:
return None
if self._native is None:
extra_bits = int_from_bytes(self.contents[0:1])
... | 0.004184 |
def vq_nearest_neighbor(x, means,
soft_em=False, num_samples=10, temperature=None):
"""Find the nearest element in means to elements in x."""
bottleneck_size = common_layers.shape_list(means)[0]
x_norm_sq = tf.reduce_sum(tf.square(x), axis=-1, keepdims=True)
means_norm_sq = tf.reduce_sum... | 0.01311 |
def message(self, executor_id, slave_id, message):
"""Sends a message from the framework to one of its executors.
These messages are best effort; do not expect a framework message to be
retransmitted in any reliable fashion.
"""
logging.info('Sends message `{}` to executor `{}` ... | 0.005102 |
def isin(self, values, level=None):
"""
Return a boolean array where the index values are in `values`.
Compute boolean array of whether each index value is found in the
passed set of values. The length of the returned boolean array matches
the length of the index.
Param... | 0.000701 |
def sh_e(cls, cmd, **kwargs):
"""Run the command. It behaves like "sh -e".
It raises InstallError if the command failed.
"""
Log.debug('CMD: {0}'.format(cmd))
cmd_kwargs = {
'shell': True,
}
cmd_kwargs.update(kwargs)
env = os.environ.copy()
... | 0.00117 |
def image_click_yshift(axes = "gca"):
"""
Takes a starting and ending point, then shifts the image y by this amount
"""
if axes == "gca": axes = _pylab.gca()
try:
p1 = _pylab.ginput()
p2 = _pylab.ginput()
yshift = p2[0][1]-p1[0][1]
e = axes.images[0].get_extent()
... | 0.010549 |
async def loop(self):
"""Pulse every timeout seconds until stopped."""
while not self.stopped:
self.timeout_handle = self.pyvlx.connection.loop.call_later(
self.timeout_in_seconds, self.loop_timeout)
await self.loop_event.wait()
if not self.stopped:
... | 0.004348 |
def channels_close(chan0: Channel, chan1: Channel,
tolerance: float = TOLERANCE) -> bool:
"""Returns: True if channels are almost identical.
Closeness is measured with the channel angle.
"""
return vectors_close(chan0.vec, chan1.vec, tolerance) | 0.003571 |
def remember_encrypted_identity(self, subject, encrypted):
"""
Base64-encodes the specified serialized byte array and sets that
base64-encoded String as the cookie value.
The ``subject`` instance is expected to be a ``WebSubject`` instance
with a web_registry handle so that an H... | 0.002445 |
def strategy(data, params):
"""
Dodge overlapping interval
Assumes that each set has the same horizontal position.
"""
width = params['width']
with suppress(TypeError):
iter(width)
width = np.asarray(width)
width = width[data.index]
... | 0.001536 |
async def _async_get_data(self, resource, id=None):
"""Get the data from the resource."""
if id:
url = urljoin(self._api_url, "spc/{}/{}".format(resource, id))
else:
url = urljoin(self._api_url, "spc/{}".format(resource))
data = await async_request(self._session.g... | 0.00277 |
def pystdlib():
"""Return a set of all module-names in the Python standard library.
"""
curver = '.'.join(str(x) for x in sys.version_info[:2])
return (set(stdlib_list.stdlib_list(curver)) | {
'_LWPCookieJar', '_MozillaCookieJar', '_abcoll', 'email._parseaddr',
'email.base64mime', ... | 0.00088 |
def htmlFormat(output, pathParts = (), statDict = None, query = None):
"""Formats as HTML, writing to the given object."""
statDict = statDict or scales.getStats()
if query:
statDict = runQuery(statDict, query)
_htmlRenderDict(pathParts, statDict, output) | 0.041199 |
def _check_pattern_list(patterns, key, default=None):
"""Validates file search patterns from user configuration.
Acceptable input is a string (which will be converted to a singleton list),
a list of strings, or anything falsy (such as None or an empty dictionary).
Empty or unset input will be converted... | 0.000905 |
def _post_call(atdepth, package, fqdn, result, entry, bound, ekey, argl, argd):
"""Finishes constructing the log and records it to the database.
"""
from time import time
if not atdepth and entry is not None:
ek = ekey
if result is not None:
retid = _tracker_str(result)
... | 0.00203 |
def get_headers(environ):
"""
Returns only proper HTTP headers.
"""
for key, value in environ.iteritems():
key = str(key)
if key.startswith('HTTP_') and key not in \
('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
yield key[5:].replace('_', '-').title(), value
... | 0.002358 |
def get_xy_from_linecol(self, line, col, offsets, factors):
"""Get the intermediate coordinates from line & col.
Intermediate coordinates are actually the instruments scanning angles.
"""
loff, coff = offsets
lfac, cfac = factors
x__ = (col - coff) / cfac * 2**16
... | 0.005263 |
def transform(self, transform, desc=None):
"""
Create a copy of this query, transformed by `transform`.
Args:
transform (callable): Callable that takes an iterable of values and
returns an iterable of transformed values.
Keyword Args:
desc (str):... | 0.002717 |
def err(txt):
"""Print, emphasized 'error', the given 'txt' message"""
print("%s# %s%s%s" % (PR_ERR_CC, get_time_stamp(), txt, PR_NC))
sys.stdout.flush() | 0.006024 |
def visit_Num(self, node: AST, dfltChaining: bool = True) -> str:
"""Return `node`s number as string."""
return str(node.n) | 0.014388 |
def close(self):
"""Called by the main gui to close the containers. Called also when the container widget is closed
Closed by clicking the window: goes through self.close_slot
Closed programmatically: use this method directly
"""
if (self.closed):
r... | 0.010249 |
def __find_args_separator(self, decl_string, start_pos):
"""implementation details"""
bracket_depth = 0
for index, ch in enumerate(decl_string[start_pos:]):
if ch not in (self.__begin, self.__end, self.__separator):
continue # I am interested only in < and >
... | 0.003053 |
def get_decorated_names(path,decorator_module, decorator_name):
'''
Get the name of fumctions or methods decorated with the specified decorator.
If a method, the name will be as class_name.method_name.
Args :
path : The path to the module.
decorator_mod... | 0.032389 |
def file_size(self):
"""
Return size of the file.
"""
stream = self.get_file_stream()
stream.seek(0, os.SEEK_END)
return stream.tell() | 0.010989 |
def add_tip_labels_to_axes(self):
"""
Add text offset from tips of tree with correction for orientation,
and fixed_order which is usually used in multitree plotting.
"""
# get tip-coords and replace if using fixed_order
if self.style.orient in ("up", "down"):
... | 0.003199 |
def cancelRequest(self, requestId, reason=None, _=None):
"""Cancel a request: remove it from requests, & errback the deferred.
NOTE: Attempts to cancel a request which is no longer tracked
(expectResponse == False and already sent, or response already
received) will raise KeyError
... | 0.004255 |
def folderitem(self, obj, item, index):
"""Prepare a data item for the listing.
:param obj: The catalog brain or content object
:param item: Listing item (dictionary)
:param index: Index of the listing item
:returns: Augmented listing data item
"""
obj = obj.get... | 0.000976 |
def step(self, vector_action=None, memory=None, text_action=None, value=None, custom_action=None) -> AllBrainInfo:
"""
Provides the environment with an action, moves the environment dynamics forward accordingly,
and returns observation, state, and reward information to the agent.
:param ... | 0.004159 |
def wheel_delta_discrete(self):
"""The delta for the wheel in discrete steps (e.g. wheel clicks) and
whether it has changed in this event.
Returns:
(int, bool): The delta of the wheel, in discrete steps, compared to
the last event and whether it has changed.
"""
delta = self._libinput. \
libinput_... | 0.028571 |
def create(self, path, data=None):
"""Send a POST CRUD API request to the given path using the given data which will be converted
to json"""
return self.handleresult(self.r.post(urljoin(self.url + CRUD_PATH,
path),
... | 0.008333 |
def handle_forever(self):
""" Main loop of the pool: handle clients forever, until the event loop is stopped. """
# container for all the client connection coros
connection_list = []
for client in self.clients:
args, kwargs = self.connect_args[client]
connection_l... | 0.004261 |
def select_between_exonic_splice_site_and_alternate_effect(effect):
"""
If the given effect is an ExonicSpliceSite then it might contain
an alternate effect of higher priority. In that case, return the
alternate effect. Otherwise, this acts as an identity function.
"""
if effect.__class__ is not... | 0.001538 |
def colormode(self, mode=None, crange=None):
'''Sets the current colormode (can be RGB or HSB) and eventually
the color range.
If called without arguments, it returns the current colormode.
'''
if mode is not None:
if mode == "rgb":
self.color_mode = ... | 0.006667 |
def show_link(name):
'''
Display master link for the alternative
.. versionadded:: 2015.8.13,2016.3.4,2016.11.0
CLI Example:
.. code-block:: bash
salt '*' alternatives.show_link editor
'''
if __grains__['os_family'] == 'RedHat':
path = '/var/lib/'
elif __grains__['os... | 0.001076 |
def issue_add(lancet, assign, add_to_sprint, summary):
"""
Create a new issue on the issue tracker.
"""
summary = " ".join(summary)
issue = create_issue(
lancet,
summary,
# project_id=project_id,
add_to_active_sprint=add_to_sprint,
)
if assign:
if assi... | 0.001996 |
def __set_formulas(self, formulas):
"""
Sets formulas in this cell range from an iterable of iterables.
Any cell values can be set using this method. Actual formulas must
start with an equal sign.
"""
# Tuple of tuples is required
array = tuple(tuple(self._clean_... | 0.00716 |
def _unpack_oxm_field(self):
"""Unpack oxm_field from oxm_field_and_mask.
Returns:
:class:`OxmOfbMatchField`, int: oxm_field from oxm_field_and_mask.
Raises:
ValueError: If oxm_class is OFPXMC_OPENFLOW_BASIC but
:class:`OxmOfbMatchField` has no such inte... | 0.003344 |
def _run_check(self, check_method, ds, max_level):
"""
Runs a check and appends a result to the values list.
@param bound method check_method: a given check method
@param netCDF4 dataset ds
@param int max_level: check level
@return list: list of Result objects
"""... | 0.001925 |
def print_update(self):
"""
print some status information in between.
"""
print("\r\n")
now = datetime.datetime.now()
print("Update info: (from: %s)" % now.strftime("%c"))
current_total_size = self.total_stined_bytes + self.total_new_bytes
if self.total_... | 0.001606 |
def emulate_wheel(self, data, direction, timeval):
"""Emulate rel values for the mouse wheel.
In evdev, a single click forwards of the mouse wheel is 1 and
a click back is -1. Windows uses 120 and -120. We floor divide
the Windows number by 120. This is fine for the digital scroll
... | 0.001724 |
def conf_merger(user_dict, variable):
"""
Merge global configuration with user's personal configuration.
Global configuration has always higher priority.
"""
if variable not in globals().keys():
raise NameError("Unknown variable '%s'." % variable)
if variable not in user_dict:
... | 0.002488 |
def _env(self, line):
'''env will parse a line that beings with ENV, indicative of one or
more environment variables.
Parameters
==========
line: the line from the recipe file to parse for ADD
'''
line = self._setup('ENV', line)
# Extrac... | 0.007207 |
def get_list(self, section, option):
"""
This allows for loading of Pyramid list style configuration
options:
[foo]
bar =
baz
qux
zap
``get_list('foo', 'bar')`` returns ``['baz', 'qux', 'zap']``
:param str section:
... | 0.003509 |
def process_op(self, rc, nbytes, overlap):
"""
Handles the possible completion or re-queueing if conditions haven't
been met (the `complete` callable returns false) of a overlapped request.
"""
act = overlap.object
overlap.object = None
if act in self.token... | 0.004665 |
def get_menu(course, current, renderer, plugin_manager, user_manager):
""" Returns the HTML of the menu used in the administration. ```current``` is the current page of section """
default_entries = []
if user_manager.has_admin_rights_on_course(course):
default_entries += [("settings", "<i class='fa... | 0.008556 |
def _run_select(self):
"""
Run the query as a "select" statement against the connection.
:return: The result
:rtype: list
"""
return self._connection.select(
self.to_sql(), self.get_bindings(), not self._use_write_connection
) | 0.00678 |
def stats(self, node_id=None, params=None):
"""
The Cluster Stats API allows to retrieve statistics from a cluster wide
perspective. The API returns basic index metrics and information about
the current nodes that form the cluster.
`<http://www.elastic.co/guide/en/elasticsearch/r... | 0.002134 |
def get_elapsed_timestamp(self) -> str:
"""
A human-readable version of the elapsed time for the last execution
of the step. The value is derived from the `ProjectStep.elapsed_time`
property.
"""
t = self.elapsed_time
minutes = int(t / 60)
seconds = int(t ... | 0.004425 |
def subtype(self, value=noValue, **kwargs):
"""Create a specialization of |ASN.1| schema or value object.
The subtype relationship between ASN.1 types has no correlation with
subtype relationship between Python types. ASN.1 type is mainly identified
by its tag(s) (:py:class:`~pyasn1.typ... | 0.002235 |
def dns(self, domain_name, recursive=False, **kwargs):
"""Resolves DNS links to the referenced object.
Multihashes are hard to remember, but domain names are usually easy to
remember. To create memorable aliases for multihashes, DNS TXT records
can point to other DNS links, IPFS objects... | 0.001564 |
def cio_tell(cio):
"""Get position in byte stream."""
OPENJPEG.cio_tell.argtypes = [ctypes.POINTER(CioType)]
OPENJPEG.cio_tell.restype = ctypes.c_int
pos = OPENJPEG.cio_tell(cio)
return pos | 0.004785 |
def _split_indices(self, concat_inds):
"""Take indices in 'concatenated space' and return as pairs
of (traj_i, frame_i)
"""
clengths = np.append([0], np.cumsum(self.__lengths))
mapping = np.zeros((clengths[-1], 2), dtype=int)
for traj_i, (start, end) in enumerate(zip(clen... | 0.006198 |
def get_log(self, project, logstore, from_time, to_time, topic=None,
query=None, reverse=False, offset=0, size=100):
""" Get logs from log service. will retry when incomplete.
Unsuccessful opertaion will cause an LogException.
Note: for larger volume of data (e.g. > 1 million... | 0.003552 |
def _genotype_in_background(rec, base_name, back_samples):
"""Check if the genotype in the record of interest is present in the background records.
"""
def passes(rec):
return not rec.FILTER or len(rec.FILTER) == 0
return (passes(rec) and
any(rec.genotype(base_name).gt_alleles == rec... | 0.007519 |
def sendFuture(self, future):
"""Send a Future to be executed remotely."""
future = copy.copy(future)
future.greenlet = None
future.children = {}
try:
if shared.getConst(hash(future.callable), timeout=0):
# Enforce name reference passing if already sh... | 0.002735 |
def stream_download(self, data, callback):
# type: (Union[requests.Response, ClientResponse], Callable) -> Iterator[bytes]
"""Generator for streaming request body data.
:param data: A response object to be streamed.
:param callback: Custom callback for monitoring progress.
"""
... | 0.005525 |
def create_organization_course(organization, course_key):
"""
Inserts a new organization-course relationship into app/local state
No response currently defined for this operation
"""
organization_obj = serializers.deserialize_organization(organization)
try:
relationship = internal.Organi... | 0.002278 |
def as_boxes(self, solid=False):
"""
A rough Trimesh representation of the voxels with a box
for each filled voxel.
Parameters
-----------
solid: bool, if True return boxes for sparse_solid
Returns
---------
mesh: Trimesh object made up of one bo... | 0.002714 |
def geckoboard_funnel(request, frequency=settings.STATISTIC_FREQUENCY_DAILY):
"""
Returns a funnel chart for the metrics specified in the GET variables.
"""
# get all the parameters for this function
params = get_gecko_params(request, cumulative=True)
metrics = Metric.objects.filter(uid__in=par... | 0.010279 |
def add_plugins(self, page, placeholder):
"""
Add a "TextPlugin" in all languages.
"""
for language_code, lang_name in iter_languages(self.languages):
for no in range(1, self.dummy_text_count + 1):
add_plugin_kwargs = self.get_add_plugin_kwargs(
... | 0.002427 |
def upload(resume, message):
"""
Upload files in the current dir to FloydHub.
"""
data_config = DataConfigManager.get_config()
if not upload_is_resumable(data_config) or not opt_to_resume(resume):
abort_previous_upload(data_config)
access_token = AuthConfigManager.get_access_token()... | 0.002381 |
def calc_2d_ellipse_properties(cov,nstd=2):
"""Calculate the properties for 2d ellipse given the covariance matrix."""
def eigsorted(cov):
vals, vecs = np.linalg.eigh(cov)
order = vals.argsort()[::-1]
return vals[order], vecs[:,order]
vals, vecs = eigsorted(cov)
width, height = ... | 0.022636 |
def read(self, size=None):
"""Read `size` bytes or if size is not provided everything is read.
:param size: the number of bytes read.
"""
if self._pos >= self.limit:
return self.on_exhausted()
if size is None or size == -1: # -1 is for consistence with file
... | 0.003035 |
def _synchronize_node(configfile, node):
"""Performs the Synchronize step of a Chef run:
Uploads all cookbooks, all roles and all databags to a node and add the
patch for data bags
Returns the node object of the node which is about to be configured,
or None if this node object cannot be found.
... | 0.001428 |
def virt_conf_from_stream(
self,
conf_fd,
template_repo=None,
template_store=None,
do_bootstrap=True,
do_build=True,
):
"""
Initializes all the virt infrastructure of the prefix, creating the
domains disks, doing any network leases and creating... | 0.003024 |
def configure(self):
"""
Executes the ansible playbooks that configure the servers in the stack.
Assumes that the root playbook directory is ``./playbooks/`` relative
to the stack configuration file. Also sets the ansible *module_path*
to be ``./common_modules/`` relative to th... | 0.000489 |
def popup(self):
""" Show the notification from code. This will initialize and activate
if needed.
Notes
------
This does NOT block. Callbacks should be used to handle click events
or the `show` state should be observed to know when it is closed.
... | 0.008214 |
def initPort(self):
""" Required initialization call, wraps pyserial constructor. """
try:
self.m_ser = serial.Serial(port=self.m_ttyport,
baudrate=self.m_baudrate,
timeout=0,
... | 0.003497 |
def _get_authorization_headers(sapisid_cookie):
"""Return authorization headers for API request."""
# It doesn't seem to matter what the url and time are as long as they are
# consistent.
time_msec = int(time.time() * 1000)
auth_string = '{} {} {}'.format(time_msec, sapisid_cookie, ORIGIN_URL)
a... | 0.00177 |
def uri_to_iri(value):
"""
Converts an ASCII URI byte string into a unicode IRI
:param value:
An ASCII-encoded byte string of the URI
:return:
A unicode string of the IRI
"""
if not isinstance(value, byte_cls):
raise TypeError(unwrap(
'''
value ... | 0.000729 |
def keypair(self, i, keypair_class):
""" Return the keypair that corresponds to the provided sequence number
and keypair class (BitcoinKeypair, etc.).
"""
# Make sure keypair_class is a valid cryptocurrency keypair
if not is_cryptocurrency_keypair_class(keypair_class):
... | 0.003448 |
def update_path(self):
"""
Tries to update the $PATH automatically.
"""
if WINDOWS:
return self.add_to_windows_path()
# Updating any profile we can on UNIX systems
export_string = self.get_export_string()
addition = "\n{}\n".format(export_string)
... | 0.002663 |
def scale_WCS(self,pixel_scale,retain=True):
''' Scale the WCS to a new pixel_scale. The 'retain' parameter
[default value: True] controls whether or not to retain the original
distortion solution in the CD matrix.
'''
_ratio = pixel_scale / self.pscale
# Correct the siz... | 0.003763 |
def load_data_with_word2vec(word2vec_list):
"""Loads and preprocessed data for the MR dataset.
Returns input vectors, labels, vocabulary, and inverse vocabulary.
"""
# Load and preprocess data
sentences, labels = load_data_and_labels()
sentences_padded = pad_sentences(sentences)
# vocabulary... | 0.004435 |
def getMiniHTML(self):
'''
getMiniHTML - Gets the HTML representation of this document without any pretty formatting
and disregarding original whitespace beyond the functional.
@return <str> - HTML with only functional whitespace present
'''
from .For... | 0.007576 |
def _validate(self):
'''Validate the mappings.'''
self._validate_fasta_vs_seqres()
self._validate_mapping_signature()
self._validate_id_types()
self._validate_residue_types() | 0.009302 |
def Rconverter(Robj, dataframe=False):
"""
Convert an object in R's namespace to one suitable
for ipython's namespace.
For a data.frame, it tries to return a structured array.
It first checks for colnames, then names.
If all are NULL, it returns np.asarray(Robj), else
it tries to construct ... | 0.005682 |
async def get_default_storage_layout(cls) -> StorageLayout:
"""Default storage layout.
Storage layout that is applied to a node when it is deployed.
"""
data = await cls.get_config("default_storage_layout")
return cls.StorageLayout.lookup(data) | 0.007018 |
def has_option(section, name):
"""
Wrapper around ConfigParser's ``has_option`` method.
"""
cfg = ConfigParser.SafeConfigParser({"working_dir": "/tmp", "debug": "0"})
cfg.read(CONFIG_LOCATIONS)
return cfg.has_option(section, name) | 0.003937 |
def merge(self, others, merge_conditions, common_ancestor=None): # pylint: disable=unused-argument
"""
Merge this SimMemory with the other SimMemory
"""
changed_bytes = self._changes_to_merge(others)
l.info("Merging %d bytes", len(changed_bytes))
l.info("... %s has chan... | 0.007843 |
def main():
"""
NAME
irmaq_magic.py
DESCRIPTION
plots IRM acquisition curves from measurements file
SYNTAX
irmaq_magic [command line options]
INPUT
takes magic formatted magic_measurements.txt files
OPTIONS
-h prints help message and quits
-f FIL... | 0.001694 |
def log_proto(self, message, **kw):
"""Add a protobuf entry to be logged during :meth:`commit`.
:type message: protobuf message
:param message: the protobuf entry
:type kw: dict
:param kw: (optional) additional keyword arguments for the entry.
See :class:`~go... | 0.004598 |
def check_obfuscated_ip (self):
"""Warn if host of this URL is obfuscated IP address."""
# check if self.host can be an IP address
# check for obfuscated IP address
if iputil.is_obfuscated_ip(self.host):
ips = iputil.resolve_host(self.host)
if ips:
... | 0.008977 |
def quote(key, value):
"""Certain options support string values. We want clients to be able to pass Python strings in
but we need them to be quoted in the output. Unfortunately some of those options also allow
numbers so we type check the value before wrapping it in quotes.
"""
if key in quoted_opt... | 0.011472 |
def update(self):
"""Update the AMP list."""
# Init new stats
stats = self.get_init_value()
if self.input_method == 'local':
for k, v in iteritems(self.glances_amps.update()):
stats.append({'key': k,
'name': v.NAME,
... | 0.002519 |
def calculate_journal_volume(pub_date, year):
"""
volume value is based on the pub date year
pub_date is a python time object
"""
try:
volume = str(pub_date.tm_year - year + 1)
except TypeError:
volume = None
except AttributeError:
volume = None
return volume | 0.003175 |
def SendMessage(handle: int, msg: int, wParam: int, lParam: int) -> int:
"""
SendMessage from Win32.
Return int, the return value specifies the result of the message processing;
it depends on the message sent.
"""
return ctypes.windll.user32.SendMessageW(ctypes.c_void_p(handle), msg,... | 0.008929 |
def get_environments():
"""
:return: all knows environments
"""
LOGGER.debug("EnvironmentService.get_environments")
args = {'http_operation': 'GET', 'operation_path': ''}
response = EnvironmentService.requester.call(args)
ret = None
if response.rc == 0:
... | 0.004813 |
def _get_ex_data(self):
"""Return hierarchical function name."""
func_id, func_name = self._get_callable_path()
if self._full_cname:
func_name = self.encode_call(func_name)
return func_id, func_name | 0.008264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.