text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def norm(self, x):
"""Return the norm of ``x``.
Parameters
----------
x : `LinearSpaceElement`
Element whose norm to compute.
Returns
-------
norm : float
Norm of ``x``.
"""
if x not in self:
raise LinearSpaceT... | 0.004348 |
def _insert_error(self, path, node):
""" Adds an error or sub-tree to :attr:tree.
:param path: Path to the error.
:type path: Tuple of strings and integers.
:param node: An error message or a sub-tree.
:type node: String or dictionary.
"""
field = path[0]
... | 0.002193 |
def parse(self, limit=None, or_limit=1):
"""
Parse mydrug files
:param limit: int limit json docs processed
:param or_limit: int odds ratio limit
:return: None
"""
dir_path = Path(self.rawdir)
aeolus_file = dir_path / self.files['aeolus']['file']
a... | 0.002336 |
def encode(data, checksum=True):
"""Convert binary to base58 using BASE58_ALPHABET."""
if checksum:
data = data + utils.hash256(data)[:4]
v, prefix = to_long(256, lambda x: x, iter(data))
data = from_long(v, prefix, BASE58_BASE, lambda v: BASE58_ALPHABET[v])
return data.decode("utf8") | 0.003185 |
def get_params():
"""Get params to execute the micro-mordred"""
parser = get_params_parser()
args = parser.parse_args()
if not args.raw and not args.enrich and not args.identities and not args.panels:
print("No tasks enabled")
sys.exit(1)
return args | 0.00692 |
def dragMoveEvent(self, event):
"""Reimplement Qt method"""
index = self.indexAt(event.pos())
if index:
dst = self.get_filename(index)
if osp.isdir(dst):
event.acceptProposedAction()
else:
event.ignore()
else:
... | 0.00578 |
def nonuniq(iterable):
"""
Yield the non-unique items of an iterable, preserving order. If an
item occurs N > 0 times in the input sequence, it will occur N-1
times in the output sequence.
Example:
>>> x = nonuniq([0, 0, 2, 6, 2, 0, 5])
>>> list(x)
[0, 2, 0]
"""
temp_dict = {}
for e in iterable:
if e in... | 0.040431 |
def indicator(self, indicator_type, summary, **kwargs):
"""Add Indicator data to Batch object.
Args:
indicator_type (str): The ThreatConnect define Indicator type.
summary (str): The value for this Indicator.
confidence (str, kwargs): The threat confidence for this I... | 0.004802 |
def _get_title(self):
"""According to http://support.microsoft.com/kb/124103 the buffer
size is 1024
Does not support unicode, only ANSI"""
#TODO: unicode support
strbuffer = self.ctypes.create_string_buffer(1024)
size = self.ctypes.c_short(1024)
#unicode... | 0.010965 |
def get_active_stats(self):
"""
Returns all of the active statistics for the gadgets currently registered.
"""
stats = []
for gadget in self._registry.values():
for s in gadget.stats:
if s not in stats:
stats.append(s)
retur... | 0.009174 |
def _get_interp_method(interp, sizes=()):
"""Get the interpolation method for resize functions.
The major purpose of this function is to wrap a random interp method selection
and a auto-estimation method.
Parameters
----------
interp : int
interpolation method for all resizing operation... | 0.002431 |
def set_field(self, name, value, parse=False):
""" Set the value of a field
"""
# explicit getitem needed for ValueField
try:
item = dict.__getitem__(self, name)
item.set( item.parse(value) if parse else value )
except ValidationError as err:
... | 0.013477 |
def make_dep_graph(depender):
"""Returns a digraph string fragment based on the passed-in module
"""
shutit_global.shutit_global_object.yield_to_draw()
digraph = ''
for dependee_id in depender.depends_on:
digraph = (digraph + '"' + depender.module_id + '"->"' + dependee_id + '";\n')
return digraph | 0.029412 |
def getJsonPath(name, moduleFile):
"""
获取JSON配置文件的路径:
1. 优先从当前工作目录查找JSON文件
2. 若无法找到则前往模块所在目录查找
"""
currentFolder = os.getcwd()
currentJsonPath = os.path.join(currentFolder, name)
if os.path.isfile(currentJsonPath):
return currentJsonPath
else:
moduleFolder = os.path.a... | 0.002232 |
def generateCertificate(cls):
"""
Create and return an X.509 certificate and corresponding private key.
:rtype: RTCCertificate
"""
key = generate_key()
cert = generate_certificate(key)
return cls(key=key, cert=cert) | 0.007353 |
def on_step_end(self, step, logs={}):
""" Called at end of each step for each callback in callbackList"""
for callback in self.callbacks:
# Check if callback supports the more appropriate `on_step_end` callback.
# If not, fall back to `on_batch_end` to be compatible with built-in... | 0.007561 |
def format(self, number, **kwargs):
"""Format a given number.
Format a number, with comma-separated thousands and
custom precision/decimal places
Localise by overriding the precision and thousand / decimal separators
2nd parameter `precision` can be an object matching `settings... | 0.00241 |
def _get_replica_set_members(self, selector):
"""Return set of replica set member addresses."""
# Implemented here in Topology instead of MongoClient, so it can lock.
with self._lock:
topology_type = self._description.topology_type
if topology_type not in (TOPOLOGY_TYPE.R... | 0.003824 |
def get_build_configuration_by_name(name):
"""
Returns the build configuration matching the name
:param name: name of build configuration
:return: The matching build configuration, or None if no match found
"""
response = utils.checked_api_call(pnc_api.build_configs, 'get_all', q='name==' + name... | 0.005089 |
def _planck(self, lam, Teff):
"""
Computes monochromatic blackbody intensity in W/m^3 using the
Planck function.
@lam: wavelength in m
@Teff: effective temperature in K
Returns: monochromatic blackbody intensity
"""
return 2*self.h*self.c*self.c/lam**5 ... | 0.008197 |
def set_enable(self, channel, value):
'''Enable/Disable output of power channel
'''
try:
bit = self._ch_map[channel]['GPIOEN']['bit']
except KeyError:
raise ValueError('set_enable() not supported for channel %s' % channel)
self._set_power_gpio_value(bit=bi... | 0.008955 |
def _finalize_axis(self, key, **kwargs):
"""
Extends the ElementPlot _finalize_axis method to set appropriate
labels, and axes options for 3D Plots.
"""
axis = self.handles['axis']
self.handles['fig'].set_frameon(False)
axis.grid(self.show_grid)
axis.view_... | 0.001967 |
def pnl_cancel(self, asset_manager_id, pnl_type,
business_date, book_id,
next_hash_key=None, next_range_key=None,
page_size=None):
"""
Cancel the PNL records matching the request
Args:
asset_manager_id (int): id of asset manag... | 0.00426 |
def publish_repo(self, repo, env):
"""
`repo` - Repo name.
`env` - Environment.
Publish a repository. This action regenerates metadata.
"""
_r = self.connectors[env].post('/repositories/%s-%s/actions/publish/' % (repo, env), {'id': 'yum_distributor'})
if _r.statu... | 0.006186 |
def autodetect(self):
"""
Try to guess the device_type using SNMP GET based on the SNMP_MAPPER dict. The type which
is returned is directly matching the name in *netmiko.ssh_dispatcher.CLASS_MAPPER_BASE*
dict.
Thus you can use this name to retrieve automatically the right Connec... | 0.003595 |
def _iterate_subsequences(self, tokens):
"""
Using regex invokes this function, which significantly impacts performance of adapt. it is an N! operation.
Args:
tokens(list): list of tokens for Yield results.
Yields:
str: ?
"""
for start_idx in xra... | 0.006342 |
def resample_zeroinflation_variables(self):
"""
There's no way around the fact that we have to look at every
data point, even the zeros here.
"""
# TODO: move this to cython?
T, N, C, D, b = self.T, self.D_emission, self.C, self.D, self.emission_distn.b
indptr = [... | 0.003104 |
def unregister(self, model_or_iterable):
"""
Unregisters the given model(s).
If a model isn't registered, this will raise NotRegistered. If one of
its subclasses is registered, DescendantRegistered will be raised.
"""
if isinstance(model_or_iterable, ModelBase):
... | 0.002362 |
def make_environment_relocatable(home_dir):
"""
Makes the already-existing environment use relative paths, and takes out
the #!-based environment selection in scripts.
"""
home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
activate_this = os.path.join(bin_dir, 'activate_this.py')
... | 0.003328 |
def finish(self, blueprint, documents):
"""Finish a list of pre-assembled documents"""
# Reset the blueprint
blueprint.reset()
# Finish the documents
finished = []
for document in documents:
finished.append(blueprint.finish(document))
return finishe... | 0.006231 |
def train(epochs, ctx):
"""Training function."""
if isinstance(ctx, mx.Context):
ctx = [ctx]
net.initialize(mx.init.Xavier(magnitude=2), ctx=ctx)
opt_options = {'learning_rate': opt.lr, 'wd': opt.wd}
if opt.optimizer == 'sgd':
opt_options['momentum'] = 0.9
if opt.optimizer == 'a... | 0.002917 |
def nvmlDeviceGetClockInfo(handle, type):
r"""
/**
* Retrieves the current clock speeds for the device.
*
* For Fermi &tm; or newer fully supported devices.
*
* See \ref nvmlClockType_t for details on available clock information.
*
* @param device ... | 0.00567 |
def generate_recurrence_models(
self, collapse=False, bin_width=0.1,
config=None, rendered_msr=None):
'''
Iterates over the lists of values defining epistemic uncertainty
in the parameters and calculates the corresponding recurrence model
At present epistemic unce... | 0.000485 |
def add_directory(self, directory: PathLike) -> None:
"""
Adds *.gtb.cp4* tables from a directory. The relevant files are lazily
opened when the tablebase is actually probed.
"""
directory = os.path.abspath(directory)
if not os.path.isdir(directory):
raise IOE... | 0.005357 |
def make_parent_bands(self, band, child_bands):
"""
this will determine the grouping bands that it belongs to, recursively
13q21.31 ==> 13, 13q, 13q2, 13q21, 13q21.3, 13q21.31
:param band:
:param child_bands:
:return:
"""
m = re.match(r'([pq][A-H\d]+(?:... | 0.002976 |
def connect(self, successor):
"""Connect this node to its successor node by
setting its outgoing and the successors ingoing."""
if isinstance(self, ConnectToExitNode) and not isinstance(successor, EntryOrExitNode):
return
self.outgoing.append(successor)
successor.ing... | 0.008902 |
def is_enabled(self):
"""Returns `True` when rule enabled.
:rtype: bool
"""
if self.name in settings.exclude_rules:
return False
elif self.name in settings.rules:
return True
elif self.enabled_by_default and ALL_ENABLED in settings.rules:
... | 0.005333 |
def rotate_and_traslate(cur, alpha, v0):
r"""Rotate and translate a curve."""
if len(cur) > 2 or (type(cur[0][0]) in [list, tuple]):
cur_list = cur[:]
for i in range(len(cur_list)):
curi = cur_list[i]
curi = rotate_and_traslate(curi, alpha, v0)
cur_list... | 0.004231 |
def n_lfom_rows(FLOW,HL_LFOM):
"""This equation states that the open area corresponding to one row can be
set equal to two orifices of diameter=row height. If there are more than
two orifices per row at the top of the LFOM then there are more orifices
than are convenient to drill and more than necessary... | 0.004468 |
def on_toml_dumps(self, toml, config, dictionary, **kwargs):
""" The `toml <https://pypi.org/project/toml/>`_ dumps method.
:param module toml: The ``toml`` module
:param class config: The instance's config class
:param dict dictionary: The dictionary to serialize
:param list in... | 0.002847 |
def replace_key(self, key, new_key):
"""
Replace the key of an existing heap node in place. Raises ``KeyError``
if the key to replace does not exist or if the new key is already in
the pqdict.
"""
heap = self._heap
position = self._position
if new_key in ... | 0.00381 |
def _clear_ignore(endpoint_props):
'''
Both _clear_dict and _ignore_keys in a single iteration.
'''
return dict(
(prop_name, prop_val)
for prop_name, prop_val in six.iteritems(endpoint_props)
if prop_name not in _DO_NOT_COMPARE_FIELDS and prop_val is not None
) | 0.003279 |
def calculate_bin_edges(centers):
"""Calculate the edges of wavelength bins given the centers.
The algorithm calculates bin edges as the midpoints between bin centers
and treats the first and last bins as symmetric about their centers.
Parameters
----------
centers : array-like or `~astropy.un... | 0.000737 |
def from_event(cls, ion_event):
"""Constructs the given native extension from the properties of an event.
Args:
ion_event (IonEvent): The event to construct the native value from.
"""
if ion_event.value is not None:
args, kwargs = cls._to_constructor_args(ion_eve... | 0.005525 |
def index_delete(self, index):
'''
Delets the specified index
> search = ElasticSearch()
> search.index_delete('twitter')
{"ok" : True, "acknowledged" : True }
'''
request = self.session
url = 'http://%s:%s/%s' % (self.host, self.port, index)
res... | 0.005391 |
def startLoop(self):
'''
Starts a blocking run loop in which driver callbacks are properly
invoked.
@precondition: There was no previous successful call to L{startLoop}
without an intervening call to L{stopLoop}.
'''
first = True
self._looping = True
... | 0.004246 |
def warp(self, target_bbox, target_size=None):
"""Returns a copy of this image warped to a target size and bounding box"""
# Determine target size based on pixels per unit of the source image and the target bounding box reprojected
# to the source projection.
if not target_size:
... | 0.004982 |
async def revoke(self):
"""Removes all access rights for this user from the controller.
"""
await self.controller.revoke(self.username)
self._user_info.access = '' | 0.010256 |
def scale_down_dynos(self):
"""Turn off web and worker dynos, plus clock process if
there is one and it's active.
"""
processes = ["web", "worker"]
if self.clock_is_on:
processes.append("clock")
for process in processes:
self.scale_down_dyno(proces... | 0.006211 |
def parse_redis_url(url):
"""Parses a redis URL."""
# create config with some sane defaults
redis_config = {
"DB": 0,
"PASSWORD": None,
"HOST": "localhost",
"PORT": 6379,
"SSL": False
}
if not url:
return redis_config
url = urlparse.urlparse(url... | 0.001255 |
def _size_columns(self, container):
"""Calculate the table's column sizes constrained by:
- requested (absolute, relative and automatic) column widths
- container width (= available width)
- cell contents
"""
def calculate_column_widths(max_cell_width):
"""C... | 0.00033 |
def log(self, format_str, *format_args, **log_options):
"""
wrapper around the module's logger
format_str -- string -- the message to log
*format_args -- list -- if format_str is a string containing {}, then format_str.format(*format_args) is ran
**log_options --
le... | 0.005155 |
def create_invoice_from_albaran(pk, list_lines):
MODEL_SOURCE = SalesAlbaran
MODEL_FINAL = SalesInvoice
url_reverse = 'CDNX_invoicing_invoicesaless_list'
# type_doc
msg_error_relation = _("Hay lineas asignadas a facturas")
msg_error_not_found = _('Sales albaran not found'... | 0.003734 |
def instance_attr_ancestors(self, name, context=None):
"""Iterate over the parents that define the given name as an attribute.
:param name: The name to find definitions for.
:type name: str
:returns: The parents that define the given name as
an instance attribute.
:... | 0.004098 |
def container_name(self):
"""
The container_name is the concatenation of ``image_name`` and a uuid1 string
We also remove the url portion of the ``image_name`` before using it.
"""
if getattr(self, "_container_name", NotSpecified) is NotSpecified:
self.container_name... | 0.008734 |
def sds(self):
"""
Returns a `list` of all the `ScaleIO_SDS` known to the cluster. Updates every time - no caching.
:return: a `list` of all the `ScaleIO_SDS` known to the cluster.
:rtype: list
"""
self.connection._check_login()
response = self.connection._do_get... | 0.009174 |
def add_nodes_from(self, nodes, **attr):
"""Add multiple nodes.
Parameters
----------
nodes : iterable container
A container of nodes (list, dict, set, etc.).
OR
A container of (node, attribute dict) tuples.
Node attributes are updated usi... | 0.000771 |
def user_fields(self, user):
"""
Retrieve the user fields for this user.
:param user: User object or id
"""
return self._query_zendesk(self.endpoint.user_fields, 'user_field', id=user) | 0.013333 |
def alias_name():
"""
Returns list of alias name by query paramaters
---
tags:
- Query functions
parameters:
- name: alias_name
in: query
type: string
required: false
description: 'Other names used to refer to a gene'
default: 'peptidase nexin-... | 0.000763 |
def float_to_int(data, digits=None, dtype=np.int32):
"""
Given a numpy array of float/bool/int, return as integers.
Parameters
-------------
data : (n, d) float, int, or bool
Input data
digits : float or int
Precision for float conversion
dtype : numpy.dtype
What datatype... | 0.000636 |
def _apply_post_fixes( self, sentence, NPlabels, cutPhrases, cutMaxThreshold ):
''' Fraasituvastaja j2relparandused:
*) Tekstis6renduste eemaldamine (s6rendatud tekst ei pruugi olla
fraas, v6ib olla nt terve lause);
*) Problemaatiliste kesks6nade eemaldamine fraasia... | 0.011023 |
def unix_time(dt=None, as_int=False):
"""Generate a unix style timestamp (in seconds)"""
if dt is None:
dt = datetime.datetime.utcnow()
if type(dt) is datetime.date:
dt = date_to_datetime(dt)
epoch = datetime.datetime.utcfromtimestamp(0)
delta = dt - epoch
if as_int:
... | 0.005128 |
def build(self, builder):
"""Build XML by appending to builder"""
params = {}
if self.edit_point is not None:
params["EditPoint"] = self.edit_point
if self.used_imputation_method is not None:
params['UsedImputationMethod'] = bool_to_yes_no(self.used_imputation_m... | 0.003247 |
def _sort_r(sorted, processed, key, deps, dependency_tree):
"""Recursive topological sort implementation."""
if key in processed:
return
processed.add(key)
for dep_key in deps:
dep_deps = dependency_tree.get(dep_key)
if dep_deps is None:
log.debug('"%s" not found, ski... | 0.002155 |
def visit_Assign(self, node):
"""Visit assignment statement."""
if len(node.targets) != 1:
raise ValueError('no support for chained assignment')
# Before the node gets modified, get a source code representation
# to add as a comment later on
if anno.hasanno(node, 'pre_anf'):
orig_src = ... | 0.005205 |
def host_trigger_pull(trg_queue, ignore_listener=False):
'''Write a non-blocking byte to a host trigger fifo, to cause a triggered
scan'''
trigger_pull(trg_queue, ignore_listener=ignore_listener,
trigger=_c.FSQ_HOSTS_TRIGGER) | 0.003891 |
def system_methodSignature(self, method_name: str)->str:
"""获取函数的签名.
system.methodSignature('add') => [double, int, int]
Parameters:
method_name (str): - 要查看的函数名
Returns:
(str): - 签名文本
"""
method = None
if method_name in self.funcs:
... | 0.003906 |
def select(self, *features):
"""
selects the features given as string
e.g
passing 'hello' and 'world' will result in imports of
'hello' and 'world'. Then, if possible 'hello.feature'
and 'world.feature' are imported and select is called
in each feature module.
... | 0.000975 |
def is_duplicate_content_url(url1, url2):
"""Check if both URLs are allowed to point to the same content."""
if url1 == url2:
return True
if url2 in url1:
url1 = shorten_duplicate_content_url(url1)
if not url2.endswith('/') and url1.endswith('/'):
url2 += '/'
retu... | 0.001873 |
def _resample(self, arrays, ji_windows):
"""Resample all arrays with potentially different resolutions to a common resolution."""
# get a destination array template
win_dst = ji_windows[self.dst_res]
aff_dst = self._layer_meta[self._res_indices[self.dst_res][0]]["transform"]
arra... | 0.004598 |
def select(cls, verb):
"""
Return selected columns for the select verb
Parameters
----------
verb : object
verb with the column selection attributes:
- names
- startswith
- endswith
- contains
... | 0.000954 |
def truncate_attr_at_path( obj, path ):
"""
Traverses a set of nested attributes and truncates the value on an object
:param mixed obj: The object to set the attribute on
:param tuple path: The path to the attribute on the object
:rtype None:
"""
target = obj
last_attr = path[-1]
m... | 0.037394 |
def get_end_trigger(options):
"""
When to end the optimization based on input option.
"""
if options.endTriggerType.lower() == "epoch":
return MaxEpoch(options.endTriggerNum)
else:
return MaxIteration(options.endTriggerNum) | 0.003861 |
def submit(self, executor, task, tag=None):
"""Submits a task to a provided executor
:type executor: s3transfer.futures.BoundedExecutor
:param executor: The executor to submit the callable to
:type task: s3transfer.tasks.Task
:param task: The task to submit to the executor
... | 0.001934 |
def multiclass_logloss(actual, predicted, eps=1e-15):
"""Multi class version of Logarithmic Loss metric.
:param actual: Array containing the actual target classes
:param predicted: Matrix with class predictions, one probability per class
"""
# Convert 'actual' to a binary array if it's not already:... | 0.001515 |
def init_group(store, overwrite=False, path=None, chunk_store=None):
"""Initialize a group store. Note that this is a low-level function and there should be no
need to call this directly from user code.
Parameters
----------
store : MutableMapping
A mapping that supports string keys and byt... | 0.001908 |
def collected(self, group, filename=None, host=None, location=None, move=True, all=True):
'''
Sync archives to a central place.
:param name:
:param group:
:param filename:
:param host:
:param location:
:param move:
:param all:
:return:
... | 0.006494 |
def _addupdate_hdxobject(self, hdxobjects, id_field, new_hdxobject):
# type: (List[HDXObjectUpperBound], str, HDXObjectUpperBound) -> HDXObjectUpperBound
"""Helper function to add a new HDX object to a supplied list of HDX objects or update existing metadata if the object
already exists in the l... | 0.006986 |
def vocab_token_counts(text_filepattern, max_lines):
"""Read a vocab file and return a dictionary of token counts.
Reads a two-column CSV file of tokens and their frequency in a dataset. The
tokens are presumed to be generated by encode() or the equivalent.
Args:
text_filepattern: A pattern matching one o... | 0.010526 |
def get_extended(self, config):
"""
Generates a configuration that includes all inherited values.
:param config: Container configuration.
:type config: ContainerConfiguration
:return: A merged (shallow) copy of all inherited configurations merged with the container configuration... | 0.003513 |
def label_from_attrs(da, extra=''):
''' Makes informative labels if variable metadata (attrs) follows
CF conventions. '''
if da.attrs.get('long_name'):
name = da.attrs['long_name']
elif da.attrs.get('standard_name'):
name = da.attrs['standard_name']
elif da.name is not None:
... | 0.001852 |
def retry_timeout(api, retries=3):
"""Retry API call when a timeout occurs."""
@wraps(api)
def retry_api(*args, **kwargs):
"""Retrying API."""
for i in range(1, retries + 1):
try:
return api(*args, **kwargs)
except RequestTimeout:
if i ... | 0.002639 |
def delete_load_balancer_listeners(self, name, ports):
"""
Deletes a load balancer listener (or group of listeners)
:type name: string
:param name: The name of the load balancer to create the listeners for
:type ports: List int
:param ports: Each int represents the port... | 0.004747 |
def options(self, context, module_options):
'''
LISTENER Listener name to generate the launcher for
'''
if not 'LISTENER' in module_options:
context.log.error('LISTENER option is required!')
sys.exit(1)
self.empire_launcher = None
headers... | 0.007584 |
def get_all_names(chebi_ids):
'''Returns all names'''
all_names = [get_names(chebi_id) for chebi_id in chebi_ids]
return [x for sublist in all_names for x in sublist] | 0.005618 |
def _read_frame(self):
"""Read one frame"""
# Read the first line, ignore the title and try to get the time. The
# time field is optional.
line = self._get_line()
pos = line.rfind("t=")
if pos >= 0:
time = float(line[pos+2:])*picosecond
else:
... | 0.001713 |
def find_projects(name=None, name_mode='exact', properties=None, tags=None,
level=None, describe=False, explicit_perms=None, region=None,
public=None, created_after=None, created_before=None, billed_to=None,
limit=None, return_handler=False, first_page_size=100, con... | 0.0032 |
def make_fortran_patterns():
"Strongly inspired from idlelib.ColorDelegator.make_pat"
kwstr = 'access action advance allocatable allocate apostrophe assign assignment associate asynchronous backspace bind blank blockdata call case character class close common complex contains continue cycle data deallocate de... | 0.000872 |
def getcellvalue(self, window_name, object_name, row_index, column=0):
"""
Get cell value
@param window_name: Window name to type in, either full name,
LDTP's name convention, or a Unix glob.
@type window_name: string
@param object_name: Object name to type in, either fu... | 0.002899 |
def save_data(self, trigger_id, **data):
"""
let's save the data
:param trigger_id: trigger ID from which to save data
:param data: the data to check to be used and save
:type trigger_id: int
:type data: dict
:return: the status of the sa... | 0.002245 |
def uninstall_all_visa_handlers(self, session):
"""Uninstalls all previously installed handlers for a particular session.
:param session: Unique logical identifier to a session. If None, operates on all sessions.
"""
if session is not None:
self.__uninstall_all_handlers_hel... | 0.008772 |
def get_config( config_path=CONFIG_PATH ):
"""
Get the config
"""
parser = SafeConfigParser()
parser.read( config_path )
config_dir = os.path.dirname(config_path)
immutable_key = False
key_id = None
blockchain_id = None
hostname = socket.gethostname()
wallet = None
... | 0.006508 |
def ref_string_matches_ref_sequence(self, ref_sequence):
'''Returns true iff the REF string in the record agrees with
the given ref_sequence'''
# you never know what you're gonna get...
if self.POS < 0:
return False
end_pos = self.ref_end_pos()
if end_pos >= ... | 0.004695 |
def URL(base, path, segments=None, defaults=None):
"""
URL segment handler capable of getting and setting segments by name. The
URL is constructed by joining base, path and segments.
For each segment a property capable of getting and setting that segment is
created dynamically.
"""
# Make a... | 0.001199 |
def setup_command(self, encoding, options, personal_dict, file_name=None):
"""Setup command."""
cmd = [
self.binary,
'-l'
]
if encoding:
cmd.extend(['-i', encoding])
if personal_dict:
cmd.extend(['-p', personal_dict])
al... | 0.001918 |
def check_if_exists(self, use_user_site):
# type: (bool) -> bool
"""Find an installed distribution that satisfies or conflicts
with this requirement, and set self.satisfied_by or
self.conflicts_with appropriately.
"""
if self.req is None:
return False
... | 0.001593 |
def get_status(options):
"""
Get programs statuses.
:param options: parsed commandline arguments.
:type options: optparse.Values.
:return: supervisord XML-RPC call result.
:rtype: dict.
"""
payload = { # server connection URI formatted string payload
"username": options.userna... | 0.004596 |
def require(method):
"""
Decorator for managing chained dependencies of different class
properties. The @require decorator allows developers to specify
that a function call must be operated on before another property
or function call is accessed, so that data and processing for an
entire class c... | 0.001235 |
def _format_field_value(self, field_name) -> str:
"""Formats a field's value for usage in SQL.
Arguments:
field_name:
The name of the field to format
the value of.
Returns:
The field's value formatted for usage
in SQL.
... | 0.003161 |
def close(self):
""" Deletes all static mask objects. """
for key in self.masklist.keys():
self.masklist[key] = None
self.masklist = {} | 0.011628 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.