text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def heatmap(x, y, z, title="", cmap=plt.cm.YlOrRd, bins=20,
xlim=(-250, 250), ylim=(422.5, -47.5),
facecolor='lightgray', facecolor_alpha=0.4,
court_color="black", court_lw=0.5, outer_lines=False,
flip_court=False, ax=None, **kwargs):
"""
Returns an AxesImage obj... | 0.000668 |
def _get_parameter_signatures(self):
"""Get the signature of the parameters for the CL function declaration.
This should return the list of signatures of the parameters for use inside the function signature.
Returns:
list: the signatures of the parameters for the use in the CL code... | 0.005515 |
def make_json_formatted_for_single_chart(mutant_features,
inference_result_proto,
index_to_mutate):
"""Returns JSON formatted for a single mutant chart.
Args:
mutant_features: An iterable of `MutantFeatureValue`s representing the... | 0.009769 |
def _check_range_minions(self, expr, greedy):
'''
Return the minions found by looking via range expression
'''
if not HAS_RANGE:
raise CommandExecutionError(
'Range matcher unavailable (unable to import seco.range, '
'module most likely not ins... | 0.002926 |
def render(text,
options=None,
templatePaths=None,
default=None,
silent=False,
raiseErrors=False):
"""
Renders a template text to a resolved text value using the mako template
system.
Provides a much more robust template option to the projex.te... | 0.002675 |
def get_pub_order(self, undefined=""):
"""
Args:
undefined (optional): Argument, which will be returned if the
`pub_order` record is not found.
Returns:
str: Information about order in which was the book published or \
`undefined` i... | 0.003861 |
def message_to_item(cls, message):
'''Translate an unframed received message and return an
(item, request_id) pair.
The item can be a Request, Notification, Response or a list.
A JSON RPC error response is returned as an RPCError inside a
Response object.
If a Batch is... | 0.001411 |
def make_nfs_path(path):
"""Make a nfs version of a file path.
This just puts /nfs at the beginning instead of /gpfs"""
if os.path.isabs(path):
fullpath = path
else:
fullpath = os.path.abspath(path)
if len(fullpath) < 6:
return fullpath
if fullpath[0:6] == '/gpfs/':
... | 0.002571 |
def on_touch_up(self, touch):
"""Stop dragging if needed."""
if not self.dragging:
return
touch.ungrab(self)
self.dragging = False | 0.011494 |
def get_authzd_permissions(self, identifier, perm_domain):
"""
:type identifier: str
:type domain: str
:returns: a list of relevant json blobs, each a list of permission dicts
"""
related_perms = []
keys = ['*', perm_domain]
def query_permissions(self)... | 0.001446 |
def chimera(args):
"""
%prog chimera bamfile
Parse BAM file from `bwasw` and list multi-hit reads and breakpoints.
"""
import pysam
from jcvi.utils.natsort import natsorted
p = OptionParser(chimera.__doc__)
p.set_verbose()
opts, args = p.parse_args(args)
if len(args) != 1:
... | 0.004202 |
def cli_put_directory_structure(context, path):
"""
Performs PUTs rooted at the path using a directory structure
pointed to by context.input\_.
See :py:mod:`swiftly.cli.put` for context usage information.
See :py:class:`CLIPut` for more information.
"""
if not context.input_:
raise... | 0.000742 |
def sls_id(id_, mods, test=None, queue=False, **kwargs):
'''
Call a single ID from the named module(s) and handle all requisites
The state ID comes *before* the module ID(s) on the command line.
id
ID to call
mods
Comma-delimited list of modules to search for given id and its requ... | 0.000928 |
def convert(self, value, view):
"""Ensure that the value follows at least one template.
"""
is_mapping = isinstance(self.template, MappingTemplate)
for candidate in self.allowed:
try:
if is_mapping:
if isinstance(candidate, Filename) and \... | 0.001547 |
def config_(name: str, local: bool, package: str, section: str,
key: Optional[str]):
"""Extract or list values from config."""
cfg = config.read_configs(package, name, local=local)
if key:
with suppress(NoOptionError, NoSectionError):
echo(cfg.get(section, key))
else:
... | 0.002008 |
def get_dag_runs(dag_id, state=None):
"""
Returns a list of Dag Runs for a specific DAG ID.
:param dag_id: String identifier of a DAG
:param state: queued|running|success...
:return: List of DAG runs of a DAG with requested state,
or all runs if the state is not specified
"""
dagbag = Da... | 0.000898 |
def get_time():
"""
Gets current time in a form of a formated string. Used in logger function.
"""
import datetime
time=make_pathable_string('%s' % datetime.datetime.now())
return time.replace('-','_').replace(':','_').replace('.','_') | 0.019231 |
def report(self, req_handler):
"Send a response corresponding to this error to the client"
if self.exc:
req_handler.send_exception(self.code, self.exc, self.headers)
return
text = (self.text
or BaseHTTPRequestHandler.responses[self.code][1]
... | 0.006667 |
def _remove_grouping_groups(self, optree):
"""Grouping groups are implied by optrees, this function hoists grouping group expressions up
to their parent node.
"""
new_operands = []
for operand in optree.operands:
if isinstance(operand, OptreeNode):
new_operands.append(self._remove_grou... | 0.009311 |
def enforce_csrf(self, request):
"""
Enforce CSRF validation for session based authentication.
"""
reason = CSRFCheck().process_view(request, None, (), {})
if reason:
# CSRF failed, bail with explicit error message
raise exceptions.PermissionDenied('CSRF F... | 0.005882 |
def _display_sims(self, sims):
"""display computed similarities on stdout"""
nb_lignes_dupliquees = 0
for num, couples in sims:
print()
print(num, "similar lines in", len(couples), "files")
couples = sorted(couples)
for lineset, idx in couples:
... | 0.003356 |
def _load_data(self, band):
"""From Morrissey+ 2005, with the actual data coming from
http://www.astro.caltech.edu/~capak/filters/. According to the latter,
these are in QE units and thus need to be multiplied by the wavelength
when integrating per-energy.
"""
# `band` s... | 0.006012 |
def inc(self, key, key_length=0):
"""Add value to key-value
Params:
<str> key
<int> value
<int> key_length
Return:
<int> key_value
"""
if key_length < 1:
key_length = len(key)
val = self.add_method(self, key, key... | 0.00495 |
def process_tree_files(tree):
""" process_tree_files: Download files from nodes
Args:
tree (ChannelManager): manager to handle communication to Kolibri Studio
Returns: None
"""
# Fill in values necessary for next steps
config.LOGGER.info("Processing content...")
files_to_... | 0.005525 |
def assert_boolean_true(expr, msg_fmt="{msg}"):
"""Fail the test unless the expression is the constant True.
>>> assert_boolean_true(True)
>>> assert_boolean_true("Hello World!")
Traceback (most recent call last):
...
AssertionError: 'Hello World!' is not True
The following msg_fmt arg... | 0.001855 |
def bases_walker(cls):
"""
Loop through all bases of cls
>>> str = u'hai'
>>> for base in bases_walker(unicode):
... isinstance(str, base)
True
True
:param cls: The class in which we want to loop through the base classes.
"""
for base in cls.__bases__:
yield base
... | 0.002632 |
def bm_create_button(self, **kwargs):
"""Shortcut to the BMCreateButton method.
See the docs for details on arguments:
https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_BMCreateButton
The L_BUTTONVARn fields are especially important, so make su... | 0.003846 |
def _create(cls, name, node_type, nodeid=1,
loopback_ndi=None):
"""
Create the node/s for the engine. This isn't called directly,
instead it is used when engine.create() is called
:param str name: name of node
:param str node_type: based on engine type specified
... | 0.003708 |
def get_all_user_objects(self):
"""
Fetches all user objects from the AD, and returns MSADUser object
"""
logger.debug('Polling AD for all user objects')
ldap_filter = r'(objectClass=user)'
attributes = MSADUser.ATTRS
for entry in self.pagedsearch(ldap_filter, attributes):
# TODO: return ldapuser obje... | 0.028504 |
def invert(self):
"""
Invert the keys and values of an object.
The values must be serializable.
"""
keys = self._clean.keys()
inverted = {}
for key in keys:
inverted[self.obj[key]] = key
return self._wrap(inverted) | 0.006873 |
def read_magic_file(self, path, sort_by_this_name, sort_by_file_type=False):
"""
read a magic-formatted tab-delimited file.
return a dictionary of dictionaries, with this format:
{'Z35.5a': {'specimen_weight': '1.000e-03', 'er_citation_names': 'This study', 'specimen_volume': '', 'er_loc... | 0.001505 |
def lock_time(logfile):
'''work out gps lock times for a log file'''
print("Processing log %s" % filename)
mlog = mavutil.mavlink_connection(filename)
locked = False
start_time = 0.0
total_time = 0.0
t = None
m = mlog.recv_match(type=['GPS_RAW_INT','GPS_RAW'], condition=args.condition)
... | 0.005178 |
def beacon(config):
r'''
Monitor the disk usage of the minion
Specify thresholds for each disk and only emit a beacon if any of them are
exceeded.
.. code-block:: yaml
beacons:
diskusage:
- /: 63%
- /mnt/nfs: 50%
Windows drives must be quoted to avoi... | 0.00078 |
def send(self, tid, out_sid, company_code, session, sender_id=None, cancel_id=None, feature=None):
'''taobao.logistics.offline.send 自己联系物流(线下物流)发货
用户调用该接口可实现自己联系发货(线下物流),使用该接口发货,交易订单状态会直接变成卖家已发货。不支持货到付款、在线下单类型的订单。'''
request = TOPRequest('taobao.logistics.offline.send')
request[... | 0.019288 |
def from_dict(cls, d):
"""
Create an instance from a dictionary.
"""
instance = super(Simulation, cls).from_dict(d)
# The instance's input_files and cmd_line_args members still point to data structures in the original
# dictionary. Copy them to avoid surprises if they ... | 0.007952 |
def run_script_from_macro(self, args):
"""
Used internally by AutoKey for phrase macros
"""
self.__macroArgs = args["args"].split(',')
try:
self.run_script(args["name"])
except Exception as e:
self.set_return_value("{ERROR: %s}" % str(e)) | 0.009404 |
def parse_rpm_output(output, tags=None, separator=';'):
"""
Parse output of the rpm query.
:param output: list, decoded output (str) from the rpm subprocess
:param tags: list, str fields used for query output
:return: list, dicts describing each rpm package
"""
if tags is None:
tag... | 0.00062 |
def disassociate_health_monitor(self, pool, health_monitor):
"""Disassociate specified load balancer health monitor and pool."""
path = (self.disassociate_pool_health_monitors_path %
{'pool': pool, 'health_monitor': health_monitor})
return self.delete(path) | 0.006734 |
def publish(self):
"""Relay messages from client to redis."""
while not self.ws.closed:
# Sleep to prevent *constant* context-switches.
gevent.sleep(self.lag_tolerance_secs)
message = self.ws.receive()
if message is not None:
channel_name, ... | 0.004963 |
def command_builder(self, string, value=None, default=None, disable=None):
"""Builds a command with keywords
Notes:
Negating a command string by overriding 'value' with None or an
assigned value that evalutates to false has been deprecated.
Please use 'disabl... | 0.001509 |
def get_tables(self):
"""
Returns list of tuple of child variable and CPD in case of Bayesian
and list of tuple of scope of variables and values in case of Markov.
Returns
-------
list : list of tuples of child variable and values in Bayesian
list of tuples o... | 0.003738 |
def to_manager(sdf, columns, index):
""" create and return the block manager from a dataframe of series,
columns, index
"""
# from BlockManager perspective
axes = [ensure_index(columns), ensure_index(index)]
return create_block_manager_from_arrays(
[sdf[c] for c in columns], columns, a... | 0.003086 |
def _read_py(self, fin_py, get_goids_only, exclude_ungrouped):
"""Read Python sections file. Store: section2goids sections_seen. Return goids_fin."""
goids_sec = []
with open(fin_py) as istrm:
section_name = None
for line in istrm:
mgo = self.srch_py_goids... | 0.004773 |
def has_files(self):
"""stub"""
# I had to add the following check because file record types
# don't seem to be implemented
# correctly for raw edx Question objects
if 'fileIds' not in self.my_osid_object._my_map:
return False
return bool(self.my_osid_object._... | 0.005917 |
def uniq(pipe):
''' this works like bash's uniq command where the generator only iterates
if the next value is not the previous '''
pipe = iter(pipe)
previous = next(pipe)
yield previous
for i in pipe:
if i is not previous:
previous = i
yield i | 0.003289 |
def set(self, name, value, force=False):
"""Set a form element identified by ``name`` to a specified ``value``.
The type of element (input, textarea, select, ...) does not
need to be given; it is inferred by the following methods:
:func:`~Form.set_checkbox`,
:func:`~Form.set_radi... | 0.001318 |
def read_data(filename, data_format=None):
""" Read image data from file
This function reads input data from file. The format of the file
can be specified in ``data_format``. If not specified, the format is
guessed from the extension of the filename.
:param filename: filename to read data from
... | 0.001473 |
def get_profile_dir ():
"""Return path where all profiles of current user are stored."""
if os.name == 'nt':
if "LOCALAPPDATA" in os.environ:
basedir = unicode(os.environ["LOCALAPPDATA"], nt_filename_encoding)
else:
# read local appdata directory from registry
... | 0.003012 |
def _update_offsets(start_x, spacing, terminations, offsets, length):
'''Update the offsets
'''
return (start_x + spacing[0] * terminations / 2.,
offsets[1] + spacing[1] * 2. + length) | 0.004808 |
def resolve_import(self, item):
"""Simulate how Python resolves imports.
Returns the filename of the source file Python would load
when processing a statement like 'import name' in the module
we're currently under.
Args:
item: An instance of ImportItem
Retu... | 0.0009 |
def check_the_end_flag(self, state_arr):
'''
Check the end flag.
If this return value is `True`, the learning is end.
As a rule, the learning can not be stopped.
This method should be overrided for concreate usecases.
Args:
state_arr: `np.ndarray... | 0.007339 |
def query_by_group(cls, group_or_id, with_invitations=False, **kwargs):
"""Get a group's members."""
if isinstance(group_or_id, Group):
id_group = group_or_id.id
else:
id_group = group_or_id
if not with_invitations:
return cls._filter(
... | 0.002907 |
def fix_reference_url(url):
"""Used to parse an incorect url to try to fix it with the most common ocurrences for errors.
If the fixed url is still incorrect, it returns ``None``.
Returns:
String containing the fixed url or the original one if it could not be fixed.
"""
new_url = url
n... | 0.005128 |
def autocorrelation_plot(series, ax=None, **kwds):
"""
Autocorrelation plot for time series.
Parameters:
-----------
series: Time series
ax: Matplotlib axis object, optional
kwds : keywords
Options to pass to matplotlib plotting method
Returns:
-----------
class:`matplo... | 0.000825 |
async def _handle_stat(self, core, opts):
''' Prints details about a particular cron job. Not actually a different API call '''
prefix = opts.prefix
crons = await core.listCronJobs()
idens = [cron[0] for cron in crons]
matches = [iden for iden in idens if iden.startswith(prefix)]... | 0.00383 |
def validate(self, instance, value):
"""Checks if value is an open PNG file, valid filename, or png.Image
Returns an open bytestream of the image
"""
# Pass if already validated
if getattr(value, '__valid__', False):
return value
# Validate that value is PNG
... | 0.001918 |
def delete(identifier):
'''Delete a harvest source'''
log.info('Deleting source "%s"', identifier)
actions.delete_source(identifier)
log.info('Deleted source "%s"', identifier) | 0.005208 |
def _rt_parse_types(self, statement, element, mode, lineparser):
"""As part of parse_line(), checks for new type declarations in the statement."""
if mode == "insert":
#Since we got to this point, there is *no* code element that owns the current
#line which is being replaced; we ... | 0.01534 |
def _get_fwf_params(self):
"""Produce a dictionary with names, colspecs, and dtype for IGRA2 data.
Returns a dict with entries 'body' and 'header'.
"""
def _cdec(power=1):
"""Make a function to convert string 'value*10^power' to float."""
def _cdec_power(val):
... | 0.002194 |
def parse_proxy_line(line):
"""
Parse proxy details from the raw text line.
The text line could be in one of the following formats:
* host:port
* host:port:username:password
"""
line = line.strip()
match = RE_SIMPLE_PROXY.search(line)
if match:
return match.group(1), match.... | 0.001855 |
def _execute_query(
self,
sqlQuery):
"""* execute query and trim results*
**Key Arguments:**
- ``sqlQuery`` -- the sql database query to grab low-resolution results.
**Return:**
- ``databaseRows`` -- the database rows found on HTM trixles with re... | 0.003398 |
def run_fast(aligned, threads, cluster, node):
"""
run FastTree
"""
tree = '%s.fasttree.nwk' % (aligned.rsplit('.', 1)[0])
if check(tree) is False:
if 'FastTreeV' in os.environ:
ft = os.environ['FastTreeV']
os.environ['OMP_NUM_THREADS'] = str(threads)
else:
... | 0.006912 |
def is_default_argument(node: astroid.node_classes.NodeNG) -> bool:
"""return true if the given Name node is used in function or lambda
default argument's value
"""
parent = node.scope()
if isinstance(parent, (astroid.FunctionDef, astroid.Lambda)):
for default_node in parent.args.defaults:
... | 0.002028 |
def flatten_unique(l: Iterable) -> List:
""" Return a list of UNIQUE non-list items in l """
rval = OrderedDict()
for e in l:
if not isinstance(e, str) and isinstance(e, Iterable):
for ev in flatten_unique(e):
rval[ev] = None
else:
rval[e] = None
r... | 0.005831 |
def get_argument_parser():
"""Create the argument parser for the script.
Parameters
----------
Returns
-------
`argparse.ArgumentParser`
The arguemnt parser.
"""
desc = 'Generate a sample sheet based on a GEO series matrix.'
parser = cli.get_argument_parser(desc=desc)
... | 0.001078 |
def has_capabilities(self, *cap_names):
""" Check if class has all of the specified capabilities
:param cap_names: capabilities names to check
:return: bool
"""
for name in cap_names:
if name not in self.__class_capabilities__:
return False
return True | 0.03663 |
def run(self):
"""
Finds .DS_Store files into path
"""
filename = ".DS_Store"
command = "find {path} -type f -name \"{filename}\" ".format(path = self.path, filename = filename)
cmd = CommandHelper(command)
cmd.execute()
files = cmd.output.split("\n")
for f in files:
if not f.endswith(filename):
... | 0.042522 |
def find_plugins(self,
plugin_env, full_env=None, installer=None, fallback=True
):
"""Find all activatable distributions in `plugin_env`
Example usage::
distributions, errors = working_set.find_plugins(
Environment(plugin_dirlist)
)
map(w... | 0.001936 |
def _upgrade_snpeff_data(galaxy_dir, args, remotes):
"""Install or upgrade snpEff databases, localized to reference directory.
"""
snpeff_version = effects.snpeff_version(args)
if not snpeff_version:
return
for dbkey, ref_file in genome.get_builds(galaxy_dir):
resource_file = os.path... | 0.003682 |
def from_events(self, instance, ev_args, ctx):
"""
Collect the events and convert them to a single XML subtree, which then
gets appended to the list at `instance`. `ev_args` must be the
arguments of the ``"start"`` event of the new child.
This method is suspendable.
"""
... | 0.001083 |
def write_hdf5_array(array, h5g, path=None, attrs=None,
append=False, overwrite=False,
compression='gzip', **kwargs):
"""Write the ``array`` to an `h5py.Dataset`
Parameters
----------
array : `gwpy.types.Array`
the data object to write
h5g : `str`,... | 0.000469 |
def write_string(self, string):
""" Writes a string to the underlying output file as a buffer of chars with UTF-8 encoding. """
buf = bytes(string, 'UTF-8')
length = len(buf)
self.write_int(length)
self.write(buf) | 0.011858 |
def blocks(self, ignore_blank_lines=True):
"""
This generator generates the list of blocks directly under the fold
region. This list does not contain blocks from child regions.
:param ignore_blank_lines: True to ignore last blank lines.
"""
start, end = self.get_range(ig... | 0.003906 |
def from_mongo(cls, data, expired=False, **kw):
"""In the event a value that has technically already expired is loaded, swap it for None."""
value = super(Expires, cls).from_mongo(data, **kw)
if not expired and value.is_expired:
return None
return value | 0.051282 |
def expand(tmpl, *args, **kwargs):
"""Expand a path template with the given variables.
..code-block:: python
>>> expand('users/*/messages/*', 'me', '123')
users/me/messages/123
>>> expand('/v1/{name=shelves/*/books/*}', name='shelves/1/books/3')
/v1/shelves/1/books/3
Args:... | 0.001206 |
def write_pdb(outfile, title, atoms, box):
"""
Write a PDB file.
Parameters
----------
outfile
The stream to write in.
title
The title of the GRO file. Must be a single line.
atoms
An instance of Structure containing the atoms to write.
box
The periodic b... | 0.001395 |
def get_host_keys(hostname, sshdir):
"""get host key"""
hostkey = None
try:
host_keys = load_host_keys(os.path.join(sshdir, 'known_hosts'))
except IOError:
host_keys = {}
if hostname in host_keys:
hostkeytype = host_keys[hostname].keys()[0]
hostkey = host_keys[hostn... | 0.002801 |
def chain_frames(self):
"""Chains the frames. Requires ctypes or the speedups extension."""
prev_tb = None
for tb in self.frames:
if prev_tb is not None:
prev_tb.tb_next = tb
prev_tb = tb
prev_tb.tb_next = None | 0.007067 |
def help_completion_fields(self):
""" Return valid field names.
"""
for name, field in sorted(engine.FieldDefinition.FIELDS.items()):
if issubclass(field._matcher, matching.BoolFilter):
yield "%s=no" % (name,)
yield "%s=yes" % (name,)
c... | 0.002191 |
def _require_param(self, name, values):
"""
Method for finding the value for the given parameter name.
The value for the parameter could be extracted from two places:
* `values` dictionary
* `self._<name>` attribute
The use case for this method is that some resource... | 0.001769 |
def _set_log_callback(self):
"""Sets a callback that logs the events
"""
logger.debug("setting up event logger")
def log_callback(event):
logger.info("callback event: " + self.event_text(event))
self.set_events_callback(log_callback) | 0.006969 |
def _is_mutated(self):
"""
:return:
A boolean - if the sequence or any children (recursively) have been
mutated
"""
mutated = self._mutated
if self.children is not None:
for child in self.children:
if isinstance(child, Sequence... | 0.006818 |
def print_paths(self):
'''
Cycle for prepare information about paths
:return:
'''
for path_key, path_value in self.paths.items():
# Handler for request in path
self.current_path = path_key
for request_key, request_value in path_value.items():
... | 0.002766 |
def get_tesseract_version():
'''
Returns LooseVersion object of the Tesseract version
'''
try:
return LooseVersion(
subprocess.check_output(
[tesseract_cmd, '--version'], stderr=subprocess.STDOUT
).decode('utf-8').split()[1].lstrip(string.printable[10:])
... | 0.002584 |
def keys(self):
'''Return all valid keys'''
keys = []
for key, value in self.map.items():
if isinstance(value, Shovel):
keys.extend([key + '.' + k for k in value.keys()])
else:
keys.append(key)
return sorted(keys) | 0.006645 |
def handle_options():
'''Handle options.
'''
parser = OptionParser()
parser.set_defaults(add=False)
parser.set_defaults(rhofile=False)
parser.set_defaults(aniso=False)
parser.add_option("-m",
dest="m",
type="float",
help="Use... | 0.000448 |
def generate_user(self, subid=None):
'''generate a new user on the filesystem, still session based so we
create a new identifier. This function is called from the users new
entrypoint, and it assumes we want a user generated with a token.
since we don't have a database proper, we write the fol... | 0.005355 |
def build(self, plot):
"""
Build the guides
Parameters
----------
plot : ggplot
ggplot object being drawn
Returns
-------
box : matplotlib.offsetbox.Offsetbox | None
A box that contains all the guides for the plot.
If ... | 0.001116 |
def _validate_dt64_dtype(dtype):
"""
Check that a dtype, if passed, represents either a numpy datetime64[ns]
dtype or a pandas DatetimeTZDtype.
Parameters
----------
dtype : object
Returns
-------
dtype : None, numpy.dtype, or DatetimeTZDtype
Raises
------
ValueError :... | 0.00078 |
def set_properties(self, path, mode):
"""Set file's properties (name and mode).
This function is also in charge of swapping between textual and
binary streams.
"""
self.name = path
self.mode = mode
if 'b' in self.mode:
if not isinstance(self.read_dat... | 0.003717 |
def execute(self, ignore_cache=False):
"""
Execute the search and return an instance of ``Response`` wrapping all
the data.
:arg ignore_cache: if set to ``True``, consecutive calls will hit
ES, while cached result will be ignored. Defaults to `False`
"""
if i... | 0.002853 |
def set_pixel(self, x, y, value):
"""Set pixel at position x, y to the given value. X and Y should be values
of 0 to 8. Value should be OFF, GREEN, RED, or YELLOW.
"""
if x < 0 or x > 7 or y < 0 or y > 7:
# Ignore out of bounds pixels.
return
# Set green... | 0.00566 |
def toggle_all(self, checked):
"""Toggle all files mode"""
self.parent_widget.sig_option_changed.emit('show_all', checked)
self.show_all = checked
self.set_show_all(checked) | 0.009569 |
def merge_schemas(cls, schema, _schema):
"""Return second Schema, which is extended by first Schema
https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#composition-and-inheritance-polymorphism
"""
tmp = schema.properties[:] # copy
prop = {}
to_dict =... | 0.004342 |
def get_bit_width(self, resource):
"""Method to return the bit width for blosc based on the Resource"""
datatype = resource.datatype
if "uint" in datatype:
bit_width = int(datatype.split("uint")[1])
else:
raise ValueError("Unsupported datatype: {}".format(datatyp... | 0.005731 |
def get_KPPRA(self):
'''Determine the no. of k-points in the BZ (from the input) times the
no. of atoms (from the output)'''
# Find the no. of k-points
fp = open(self.inputf).readlines()
for l,ll in enumerate(fp):
if "K_POINTS" in ll:
# determine the t... | 0.004543 |
def absolute_magnitude_martin(self, richness=1, steps=1e4, n_trials=1000, mag_bright=None, mag_faint=23., alpha=0.32, seed=None):
"""
Calculate the absolute magnitude (Mv) of the isochrone using
the prescription of Martin et al. 2008.
ADW: Seems like the faint and bright limits ... | 0.011039 |
def has_zero_length_fragments(self, min_index=None, max_index=None):
"""
Return ``True`` if the list has at least one interval
with zero length withing ``min_index`` and ``max_index``.
If the latter are not specified, check all intervals.
:param int min_index: examine fragments ... | 0.006522 |
def _BuildIndex(self):
"""Recreate the key index."""
self._index = {}
for i, k in enumerate(self._keys):
self._index[k] = i | 0.012579 |
def set_output_format(self, file_type=None, rate=None, bits=None,
channels=None, encoding=None, comments=None,
append_comments=True):
'''Sets output file format arguments. These arguments will overwrite
any format related arguments supplied by other ef... | 0.000659 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.