text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def smooth(self):
"""
Read/write boolean specifying whether to use curve smoothing to
form the line connecting the data points in this series into
a continuous curve. If |False|, a series of straight line segments
are used to connect the points.
"""
smooth = self.... | 0.004854 |
def equalizeImage(img, save_path=None, name_additive='_eqHist'):
'''
Equalize the histogram (contrast) of an image
works with RGB/multi-channel images
and flat-arrays
@param img - image_path or np.array
@param save_path if given output images will be saved there
@param name_additiv... | 0.002239 |
def propagate_cols(self, col_names, target_df_name, source_df_name,
down=True):
"""
Put the data for "col_name" from source_df into target_df
Used to get "azimuth" from sample table into measurements table
(for example).
Note: if getting data from the sampl... | 0.001965 |
def main():
"""
NAME
chi_magic.py
DESCRIPTION
plots magnetic susceptibility as a function of frequency and temperature and AC field
SYNTAX
chi_magic.py [command line options]
OPTIONS
-h prints help message and quits
-i allows interactive setting of FILE and... | 0.00169 |
def searchadmin(self, searchstring=None):
""" search user page """
self._check_auth(must_admin=True)
is_admin = self._check_admin()
if searchstring is not None:
res = self._search(searchstring)
else:
res = None
attrs_list = self.attributes.get_sear... | 0.00339 |
def get_display(self):
"""
returns information about the display, including
brightness, screensaver etc.
"""
log.debug("getting display information...")
cmd, url = DEVICE_URLS["get_display"]
return self._exec(cmd, url) | 0.007299 |
def delete_user(self, username, params=None):
"""
`<https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html>`_
:arg username: username
:arg refresh: If `true` (the default) then refresh the affected shards
to make this operation visible ... | 0.004944 |
def crypto_scalarmult_ed25519_base(n):
"""
Computes and returns the scalar product of a standard group element and an
integer ``n`` on the edwards25519 curve.
:param n: a :py:data:`.crypto_scalarmult_ed25519_SCALARBYTES` long bytes
sequence representing a scalar
:type n: bytes
:re... | 0.000999 |
def get_rt_ticker(self, code, num=500):
"""
获取指定股票的实时逐笔。取最近num个逐笔
:param code: 股票代码
:param num: 最近ticker个数(有最大个数限制,最近1000个)
:return: (ret, data)
ret == RET_OK 返回pd dataframe数据,数据列格式如下
ret != RET_OK 返回错误字符串
===================== ... | 0.002686 |
def _is_whitelisted(self, email):
"""Check if an email is in the whitelist. If there's no whitelist,
it's assumed it's not whitelisted."""
return hasattr(settings, "SAFE_EMAIL_WHITELIST") and \
any(re.match(m, email) for m in settings.SAFE_EMAIL_WHITELIST) | 0.006826 |
def sg_int(tensor, opt):
r"""Casts a tensor to intx.
See `tf.cast()` in tensorflow.
Args:
tensor: A `Tensor` or `SparseTensor` (automatically given by chain).
opt:
name: If provided, it replaces current tensor's name.
Returns:
A `Tensor` or `SparseTensor` with same shape... | 0.005063 |
def update(verbose=False):
"""
Update local dictionnaries by downloading the latest version from the
server, if there's one.
"""
local = local_list()
remote = dict(remote_list())
updated = False
for name, date in local:
if name in remote and remote[name] > date:
upd... | 0.002 |
def iter(self, offset=0, count=None, pagesize=None, **kwargs):
"""Iterates over the collection.
This method is equivalent to the :meth:`list` method, but
it returns an iterator and can load a certain number of entities at a
time from the server.
:param offset: The index of the ... | 0.001966 |
def create_or_update_lun_id(self, volume_id, lun_id):
"""Set the LUN ID on a volume.
:param integer volume_id: The id of the volume
:param integer lun_id: LUN ID to set on the volume
:return: a SoftLayer_Network_Storage_Property object
"""
return self.client.call('Networ... | 0.004902 |
def show_plain_text(self, text):
"""Show text in plain mode"""
self.switch_to_plugin()
self.switch_to_plain_text()
self.set_plain_text(text, is_code=False) | 0.010471 |
def stop(self):
"""
Stop this server so that the calling process can exit
"""
# unsetup_fuse()
self.fuse_process.teardown()
for uuid in self.processes:
self.processes[uuid].terminate() | 0.008197 |
async def list(self) -> List[str]:
"""
Return list of pool names configured, empty list for none.
:return: list of pool names.
"""
LOGGER.debug('NodePoolManager.list >>>')
rv = [p['pool'] for p in await pool.list_pools()]
LOGGER.debug('NodePoolManager.list <<<... | 0.005764 |
def compose(funcs:List[Callable])->Callable:
"Compose `funcs`"
def compose_(funcs, x, *args, **kwargs):
for f in listify(funcs): x = f(x, *args, **kwargs)
return x
return partial(compose_, funcs) | 0.017937 |
def get_snippet_content(snippet_name, **format_kwargs):
""" Load the content from a snippet file which exists in SNIPPETS_ROOT """
filename = snippet_name + '.snippet'
snippet_file = os.path.join(SNIPPETS_ROOT, filename)
if not os.path.isfile(snippet_file):
raise ValueError('could not find snipp... | 0.00211 |
def _multiple_replace(text, search_replace_dict):
"""
Replace multiple things at once in a text.
Parameters
----------
text : str
search_replace_dict : dict
Returns
-------
replaced_text : str
Examples
--------
>>> d = {'a': 'b', 'b': 'c', 'c': 'd', 'd': 'e'}
>>> _... | 0.001475 |
def main():
"""Return 0 on success."""
args = parse_args()
if not args.files:
return 0
with enable_sphinx_if_possible():
status = 0
pool = multiprocessing.Pool(multiprocessing.cpu_count())
try:
if len(args.files) > 1:
results = pool.map(
... | 0.000822 |
def handle_message(self, msg):
"""manage message of different types, and colorize output
using ansi escape codes
"""
if msg.module not in self._modules:
color, style = self._get_decoration("S")
if msg.module:
modsep = colorize_ansi(
... | 0.003492 |
def get_list_transformer(namespaces):
"""this function returns a transformer to
find all list elements and recompute their xml:id.
Because if we duplicate lists we create invalid XML.
Each list must have its own xml:id
This is important if you want to be able to reopen the produced
document w... | 0.001502 |
def launch_server(message_handler, options):
"""
Launch a message server
:param handler_function: The handler function to execute for each message
:param options: Application options for TCP, etc.
"""
logger = logging.getLogger(__name__)
# if (options.debug):
# logger.setLevel(logging.... | 0.004418 |
def write_constraints(self, table):
"""Write DDL of `table` constraints to the output file
:Parameters:
- `table`: an instance of a :py:class:`mysql2pgsql.lib.mysql_reader.MysqlReader.Table` object that represents the table to read/write.
Returns None
"""
self.f.write... | 0.010283 |
def run(self):
"""Periodically sends buffered operations and/or commit.
"""
if not self._should_auto_commit and not self._should_auto_send:
return
last_send, last_commit = 0, 0
while not self._stopped:
if self._should_auto_commit:
if last_c... | 0.002123 |
def nanfill(a, f_a, *args, **kwargs):
"""Fill masked areas with np.nan
Wrapper for functions that can't handle ma (e.g. scipy.ndimage)
This will force filters to ignore nan, but causes adjacent pixels to be set to nan as well: http://projects.scipy.org/scipy/ticket/1155
"""
a = checkma(a)
... | 0.011364 |
def create_request(self):
"""Set download requests
Create a list of DownloadRequests for all Sentinel-2 acquisitions within request's time interval and
acceptable cloud coverage.
"""
fis_service = FisService(instance_id=self.instance_id)
self.download_list = fis_service.... | 0.008902 |
def hiddenColumns( self ):
"""
Returns a list of the hidden columns for this tree.
:return [<str>, ..]
"""
output = []
columns = self.columns()
for c, column in enumerate(columns):
if ( not self.isColumnHidden(c) ):
... | 0.020513 |
def _sample_points(X, centers, oversampling_factor, random_state):
r"""
Sample points independently with probability
.. math::
p_x = \frac{\ell \cdot d^2(x, \mathcal{C})}{\phi_X(\mathcal{C})}
"""
# re-implement evaluate_cost here, to avoid redundant computation
distances = pairwise_di... | 0.001761 |
def calculate_fitness(self):
"""Calculcate your fitness."""
if self.fitness is not None:
raise Exception("You are calculating the fitness of agent {}, "
.format(self.id) +
"but they already have a fitness")
infos = self.infos()
... | 0.001936 |
def set_figure_params(
self,
scanpy=True,
dpi=80,
dpi_save=150,
frameon=True,
vector_friendly=True,
fontsize=14,
color_map=None,
format="pdf",
transparent=False,
ipython_format="png2x",
):
"""Set resolution/size, styling... | 0.00384 |
def volume(self, vol, clim=None, method='mip', threshold=None,
cmap='grays'):
"""Show a 3D volume
Parameters
----------
vol : ndarray
Volume to render.
clim : tuple of two floats | None
The contrast limits. The values in the volume are mapp... | 0.002604 |
def tplot_rename(old_name, new_name):
"""
This function will rename tplot variables that are already stored in memory.
Parameters:
old_name : str
Old name of the Tplot Variable
new_name : str
New name of the Tplot Variable
Returns:
None
... | 0.012467 |
def author_names(self):
"""
Returns a dictionary like this:
{
"urn:cts:greekLit:tlg0012$$n1" : "Homer"
, "urn:cts:greekLit:tlg0012$$n2" : "Omero"
, ...
}
"""
return {"%s$$n%i" % (author.get_urn(), i): name[1]
for author... | 0.004425 |
def get_rendered_fields(self, ctx=None):
'''
:param ctx: rendering context in which the method was called
:return: ordered list of the fields that will be rendered
'''
if ctx is None:
ctx = RenderContext()
ctx.push(self)
current = self._fields[self._fi... | 0.004854 |
def set_file(path, saltenv='base', **kwargs):
'''
Set answers to debconf questions from a file.
CLI Example:
.. code-block:: bash
salt '*' debconf.set_file salt://pathto/pkg.selections
'''
if '__env__' in kwargs:
# "env" is not supported; Use "saltenv".
kwargs.pop('__e... | 0.002203 |
def configure_graph(self, info):
""" Handles display of the graph dot traits.
"""
if info.initialized:
self.model.edit_traits(parent=info.ui.control,
kind="live", view=attr_view) | 0.013043 |
def push(self, filename, data):
"""Push a chunk of a file to the streaming endpoint.
Args:
filename: Name of file that this is a chunk of.
chunk_id: TODO: change to 'offset'
chunk: File data.
"""
self._queue.put(Chunk(filename, data)) | 0.006601 |
def byte_str(nBytes, unit='bytes', precision=2):
"""
representing the number of bytes with the chosen unit
Returns:
str
"""
#return (nBytes * ureg.byte).to(unit.upper())
if unit.lower().startswith('b'):
nUnit = nBytes
elif unit.lower().startswith('k'):
nUnit = nByte... | 0.005618 |
def find_for_player_id(player_id, connection=None, page_size=100,
page_number=0, sort_by=DEFAULT_SORT_BY, sort_order=DEFAULT_SORT_ORDER):
"""
List playlists for a for given player id.
"""
return pybrightcove.connection.ItemResultSet(
"find_playlists_for_player_id", Pl... | 0.007194 |
def check_consistent_parameter_grouping(self):
"""
Ensures this object does not have conflicting groups of parameters.
:raises ValueError: For conflicting or absent parameters.
"""
parameter_groups = {}
if self.indices_per_axis is not None:
parameter_groups["... | 0.003051 |
def authorize(login, password, scopes, note='', note_url='', client_id='',
client_secret='', two_factor_callback=None):
"""Obtain an authorization token for the GitHub API.
:param str login: (required)
:param str password: (required)
:param list scopes: (required), areas you want this tok... | 0.00091 |
def transform(self, X, y=None, scan_onsets=None):
""" Use the model to estimate the time course of response to
each condition (ts), and the time course unrelated to task
(ts0) which is spread across the brain.
This is equivalent to "decoding" the design matrix and
... | 0.000656 |
def from_options(cls, options):
"""Given an `Options` object, produce a `ChangedRequest`."""
return cls(options.changes_since,
options.diffspec,
options.include_dependees,
options.fast) | 0.004202 |
def step_through(self, msg='', shutit_pexpect_child=None, level=1, print_input=True, value=True):
"""Implements a step-through function, using pause_point.
"""
shutit_global.shutit_global_object.yield_to_draw()
shutit_pexpect_child = shutit_pexpect_child or self.get_current_shutit_pexpect_session().pexpect_chil... | 0.024161 |
def init(options=None, ini_paths=None, argv=None,
strict=False, **parser_kwargs):
"""Initialize singleton config and read/parse configuration.
:keyword bool strict: when true, will error out on invalid arguments
(default behavior is to ignore them)
:returns: the loaded configuration.
"... | 0.001898 |
def find_all_paths(G, start, end, path=[]):
"""
Find all paths between vertices start and end in graph.
"""
path = path + [start]
if start == end:
return [path]
if start not in G.vertices:
raise GraphInsertError("Vertex %s doesn't exist." % (start,))
if end not in G.... | 0.001563 |
def _is_healthiest_node(self, members, check_replication_lag=True):
"""This method tries to determine whether I am healthy enough to became a new leader candidate or not."""
_, my_wal_position = self.state_handler.timeline_wal_position()
if check_replication_lag and self.is_lagging(my_wal_posit... | 0.005122 |
def repertoire(self, direction, mechanism, purview):
"""Return the cause or effect repertoire function based on a direction.
Args:
direction (str): The temporal direction, specifiying the cause or
effect repertoire.
"""
system = self.system[direction]
... | 0.002339 |
def send_security_email(data):
"""Celery task to send security email.
:param data: Contains the email data.
"""
msg = Message()
msg.__dict__.update(data)
current_app.extensions['mail'].send(msg) | 0.004566 |
def path_alias_regex(self, regex):
""" A decorator that adds a path-alias regular expression; calls
add_path_regex """
def decorator(func):
""" Adds the function to the regular expression alias list """
self.add_path_regex(regex, func)
return decorator | 0.006494 |
def _split_line(self, line):
"""Split line into field values."""
line = line.rstrip('\r\n')
flds = re.split('\t', line)
assert len(flds) == self.exp_numcol, "EXPECTED({E}) COLUMNS, ACTUAL({A}): {L}".format(
E=self.exp_numcol, A=len(flds), L=line)
return flds | 0.009677 |
def evaluate_detections(self, detections):
"""
top level evaluations
Parameters:
----------
detections: list
result list, each entry is a matrix of detections
Returns:
----------
None
"""
# make all these folders for results... | 0.004556 |
def intersects(self, other):
"""Returns true if this envelope intersects another.
Arguments:
other -- Envelope or tuple of (minX, minY, maxX, maxY)
"""
try:
return (self.min_x <= other.max_x and
self.max_x >= other.min_x and
se... | 0.004193 |
def execute(self, command, consume=True):
"""
Sends the given data to the remote host (with a newline appended)
and waits for a prompt in the response. The prompt attempts to use
a sane default that works with many devices running Unix, IOS,
IOS-XR, or Junos and others. If that f... | 0.001953 |
def handler(event, context): # pylint: disable=W0613
"""
Historical vpc event collector.
This collector is responsible for processing Cloudwatch events and polling events.
"""
records = deserialize_records(event['Records'])
# Split records into two groups, update and delete.
# We don't wan... | 0.005181 |
def demote(self):
"""Demote the bootstrap code to the end of the `sys.path` so it is found last.
:return: The list of un-imported bootstrap modules.
:rtype: list of :class:`types.ModuleType`
"""
import sys # Grab a hold of `sys` early since we'll be un-importing our module in this process.
un... | 0.00744 |
def list_abundance_expansion(graph: BELGraph) -> None:
"""Flatten list abundances."""
mapping = {
node: flatten_list_abundance(node)
for node in graph
if isinstance(node, ListAbundance)
}
relabel_nodes(graph, mapping, copy=False) | 0.003717 |
def remove_router_interface(self, context, router_id, interface_info):
"""Remove a subnet of a network from an existing router."""
router_to_del = (
super(AristaL3ServicePlugin, self).remove_router_interface(
context,
router_id,
interface_info... | 0.00144 |
def convert_zero_consonant(pinyin):
"""零声母转换,还原原始的韵母
i行的韵母,前面没有声母的时候,写成yi(衣),ya(呀),ye(耶),yao(腰),
you(忧),yan(烟),yin(因),yang(央),ying(英),yong(雍)。
u行的韵母,前面没有声母的时候,写成wu(乌),wa(蛙),wo(窝),wai(歪),
wei(威),wan(弯),wen(温),wang(汪),weng(翁)。
ü行的韵母,前面没有声母的时候,写成yu(迂),yue(约),yuan(冤),
yun(晕);ü上两点省略。
"""
... | 0.000845 |
async def set_name_endpoint(request: web.Request) -> web.Response:
""" Set the name of the robot.
Request with POST /server/name {"name": new_name}
Responds with 200 OK {"hostname": new_name, "prettyname": pretty_name}
or 400 Bad Request
In general, the new pretty name will be the specified name. ... | 0.000951 |
def videos(self, days=None):
"""
Return all <ArloVideo> objects from camera given days range
:param days: number of days to retrieve
"""
if days is None:
days = self._min_days_vdo_cache
library = ArloMediaLibrary(self._session, preload=False)
try:
... | 0.002829 |
def run_pyspark_yarn_cluster(env_dir, env_name, env_archive, args):
"""
Initializes the requires spark command line options on order to start a python job with the given python environment.
Parameters
----------
env_dir : str
env_name : str
env_archive : str
args : list
Returns
... | 0.00241 |
def build_strings(strings, prefix):
"""Construct string definitions according to
the previously maintained table.
"""
strings = [
(
make_c_str(prefix + str(number), value),
reloc_ptr(
prefix + str(number), 'reloc_delta', 'ch... | 0.004228 |
def node_sub(self, node_self, node_other):
'''node_sub
Low-level api: Compute the delta of two configs. This method is
recursive. Assume two configs are different.
Parameters
----------
node_self : `Element`
A config node in a config tree that is being proc... | 0.001661 |
def _set_cmap_seq(self, v, load=False):
"""
Setter method for cmap_seq, mapped from YANG variable /overlay_class_map/cmap_seq (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_cmap_seq is considered as a private
method. Backends looking to populate this variable... | 0.003366 |
def get_dattype_regionmode(regions, scen7=False):
"""
Get the THISFILE_DATTYPE and THISFILE_REGIONMODE flags for a given region set.
In all MAGICC input files, there are two flags: THISFILE_DATTYPE and
THISFILE_REGIONMODE. These tell MAGICC how to read in a given input file. This
function maps the ... | 0.005542 |
async def create_room(self, alias: Optional[str] = None, is_public: bool = False,
name: Optional[str] = None, topic: Optional[str] = None,
is_direct: bool = False, invitees: Optional[List[str]] = None,
initial_state: Optional[List[dict]] = No... | 0.007578 |
def invoke_obfuscation(scriptString):
# Add letters a-z with random case to $RandomDelimiters.
alphabet = ''.join(choice([i.upper(), i]) for i in ascii_lowercase)
# Create list of random dxelimiters called randomDelimiters.
# Avoid using . * ' " [ ] ( ) etc. as delimiters as these will cause problems ... | 0.007336 |
def _identity(self, *args, **kwargs):
'''
Local users and groups.
accounts
Can be either 'local', 'remote' or 'all' (equal to "local,remote").
Remote accounts cannot be resolved on all systems, but only
those, which supports 'passwd -S -a'.
disabled
... | 0.002766 |
def on_equalarea_specimen_select(self, event):
"""
Get mouse position on double click find the nearest interpretation
to the mouse
position then select that interpretation
Parameters
----------
event : the wx Mouseevent for that click
Alters
----... | 0.002336 |
def appndd(item, cell):
"""
Append an item to a double precision cell.
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/appndd_c.html
:param item: The item to append.
:type item: Union[float,Iterable[float]]
:param cell: The cell to append to.
:type cell: spiceypy.utils.support_type... | 0.001715 |
def require_paragraph(self):
"""Create a new paragraph unless the currently-active container
is already a paragraph."""
if self._containers and _is_paragraph(self._containers[-1]):
return False
else:
self.start_paragraph()
return True | 0.006623 |
def getshapestring(self, startrow=1, nrow=-1, rowincr=1):
"""Get the shapes of all cells in the column in string format.
(see :func:`table.getcolshapestring`)"""
return self._table.getcolshapestring(self._column,
startrow, nrow, rowincr) | 0.006536 |
def output_all_points(self):
"""Return all points in the bank.
Return all points in the bank as lists of m1, m2, spin1z, spin2z.
Returns
-------
mass1 : list
List of mass1 values.
mass2 : list
List of mass2 values.
spin1z : list
... | 0.002055 |
def delete_vector(self, data, v=None):
"""
Deletes vector v and his id (data) in all matching buckets in the storage.
The data argument must be JSON-serializable.
"""
# Delete data id in each hashes
for lshash in self.lshashes:
if v is None:
k... | 0.005906 |
def randints(s, e, n=1):
"""
returns n uniform random numbers from [s, e]
"""
assert e >= s, "Wrong range: [{}, {})".format(s, e)
n = max(1, n)
arr = [s + a % (e - s) for a in struct.unpack('<%dL' % n, os.urandom(4 * n))]
return arr | 0.010417 |
def Ctrl(cls, key):
""" 在指定元素上执行ctrl组合键事件
@note: key event -> control + key
@param key: 如'X'
"""
element = cls._element()
element.send_keys(Keys.CONTROL, key) | 0.013393 |
def load_file(self, filename):
"""Load mask image.
Results are appended to previously loaded masks.
This can be used to load mask per color.
"""
if not os.path.isfile(filename):
return
self.logger.info('Loading mask image from {0}'.format(filename))
... | 0.001571 |
def action_bootstrap(verbose=False):
"""Bootstrap the local REPO with a few cool ontologies"""
printDebug("The following ontologies will be imported:")
printDebug("--------------")
count = 0
for s in BOOTSTRAP_ONTOLOGIES:
count += 1
print(count, "<%s>" % s)
printDebug("... | 0.002004 |
def FlushCache(self):
"""Empties the cache that holds cached decompressed data."""
self._cache = b''
self._cache_start_offset = None
self._cache_end_offset = None
self._ResetDecompressorState() | 0.004695 |
async def start_component_in_thread(executor, workload: CoroutineFunction[T], *args: Any, loop=None, **kwargs: Any) -> Component[T]:
"""\
Starts the passed `workload` with additional `commands` and `events` pipes.
The workload will be executed on an event loop in a new thread; the thread is provided by `exe... | 0.003185 |
def append(self, *values):
"""Append values at the end of the list
Allow chaining.
Args:
values: values to be appened at the end.
Example:
>>> from ww import l
>>> lst = l([])
>>> lst.append(1)
[1]
>>> lst
... | 0.003643 |
def new_scope(self, new_scope={}):
"""Add a new innermost scope for the duration of the with block.
Args:
new_scope (dict-like): The scope to add.
"""
old_scopes, self.scopes = self.scopes, self.scopes.new_child(new_scope)
yield
self.scopes = old_scopes | 0.006369 |
def create_case_task(self, case_id, case_task):
"""
:param case_id: Case identifier
:param case_task: TheHive task
:type case_task: CaseTask defined in models.py
:return: TheHive task
:rtype: json
"""
req = self.url + "/api/case/{}/task".format(case_id)... | 0.004587 |
def rebuild( self ):
"""
Rebuilds the information for this scene.
"""
self._buildData.clear()
self._dateGrid.clear()
self._dateTimeGrid.clear()
curr_min = self._minimumDate
curr_max = self._maximumDate
self._maximumDate... | 0.015754 |
def split_datetime(self, column_name_prefix = "X", limit=None, timezone=False):
"""
Splits an SArray of datetime type to multiple columns, return a
new SFrame that contains expanded columns. A SArray of datetime will be
split by default into an SFrame of 6 columns, one for each
y... | 0.003779 |
def page_load_time(self):
"""
The average total load time for all runs (not weighted).
"""
load_times = self.get_load_times('page')
return round(mean(load_times), self.decimal_precision) | 0.00885 |
def yuv_to_rgb(y, u=None, v=None):
"""Convert the color from YUV coordinates to RGB.
Parameters:
:y:
The Y component value [0...1]
:u:
The U component value [-0.436...0.436]
:v:
The V component value [-0.615...0.615]
Returns:
The color as an (r, g, b) tuple in the range:
r[... | 0.013072 |
def to_binary(value, encoding='utf-8'):
"""Convert value to binary string, default encoding is utf-8
:param value: Value to be converted
:param encoding: Desired encoding
"""
if not value:
return b''
if isinstance(value, six.binary_type):
return value
if isinstance(value, si... | 0.002415 |
async def do_connect(self, args):
"""Connect to the PLM device.
Usage:
connect [device [workdir]]
Arguments:
device: PLM device (default /dev/ttyUSB0)
workdir: Working directory to save and load device information
"""
params = args.split()
... | 0.002457 |
def do_function(self, prov, func, kwargs):
'''
Perform a function against a cloud provider
'''
matches = self.lookup_providers(prov)
if len(matches) > 1:
raise SaltCloudSystemExit(
'More than one results matched \'{0}\'. Please specify '
... | 0.001907 |
def voxel_seg(self, segfile, MRSfile):
"""
add voxel segmentation info
Parameters
----------
segfile : str
Path to nifti file with segmentation info (e.g. XXXX_aseg.nii.gz)
MRSfile : str
Path to MRS nifti file
""... | 0.012367 |
def AnularLiquidacion(self, coe):
"Anular liquidación activa"
ret = self.client.liquidacionAnular(
auth={
'token': self.Token, 'sign': self.Sign,
'cuit': self.Cuit, },
coe=coe,
... | 0.004329 |
def _get_ssl_sock(self):
"""Get raw SSL socket."""
assert self.scheme == u"https", self
raw_connection = self.url_connection.raw._connection
if raw_connection.sock is None:
# sometimes the socket is not yet connected
# see https://github.com/kennethreitz/requests/... | 0.004963 |
def enhance(self):
"""Load metadata from a data service to improve naming.
:raises tvrenamer.exceptions.ShowNotFound:
when unable to find show/series name based on parsed name
:raises tvrenamer.exceptions.EpisodeNotFound:
when unable to find episode name(s) based on pars... | 0.002148 |
def repeat(coro, times=1, step=1, limit=1, loop=None):
"""
Executes the coroutine function ``x`` number of times,
and accumulates results in order as you would use with ``map``.
Execution concurrency is configurable using ``limit`` param.
This function is a coroutine.
Arguments:
coro... | 0.000838 |
def deserialize(cls, assoc_s):
"""
Parse an association as stored by serialize().
inverse of serialize
@param assoc_s: Association as serialized by serialize()
@type assoc_s: str
@return: instance of this class
"""
pairs = kvform.kvToSeq(assoc_s, str... | 0.002268 |
def done(p_queue, host=None):
if host is not None:
return _path(_c.FSQ_DONE, root=_path(host, root=hosts(p_queue)))
'''Construct a path to the done dir for a queue'''
return _path(p_queue, _c.FSQ_DONE) | 0.004525 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.