text stringlengths 78 104k | score float64 0 0.18 |
|---|---|
def audit_logs_list(self, filter_actor_id=None, filter_created_at=None, filter_ip_address=None, filter_source_type=None, **kwargs):
"https://developer.zendesk.com/rest_api/docs/core/audit_logs#listing-audit-logs"
api_path = "/api/v2/audit_logs.json"
api_query = {}
if "query" in kwargs.ke... | 0.004024 |
def json_output(cls, cs, score_dict, output_filename, ds_loc, limit,
output_type='json'):
'''
Generates JSON output for the ocmpliance score(s)
@param cs Compliance Checker Suite
@param score_groups List of results
@param output_filename The fi... | 0.002528 |
def _add_facl_rules(self):
"""
Apply ACL rules on the directory using setfacl program. Raises CommandDoesNotExistException
if the command is not present on the system.
:return: None
"""
setfacl_command_exists()
# we are not using pylibacl b/c it's only for python... | 0.005747 |
def inference(self, observed_arr):
'''
Draws samples from the `fake` distribution.
Args:
observed_arr: `np.ndarray` of observed data points.
Returns:
`np.ndarray` of inferenced.
'''
if observed_arr.ndim != 2:
ob... | 0.008493 |
def _parse_fmadm_config(output):
'''
Parsbb fmdump/fmadm output
'''
result = []
output = output.split("\n")
# extract header
header = [field for field in output[0].lower().split(" ") if field]
del output[0]
# parse entries
for entry in output:
entry = [item for item in ... | 0.001232 |
def get_contents(self):
"""Fetch the signature contents. This is the main reason this
class exists, so we can compute this once and cache it regardless
of how many target or source Nodes there are.
"""
try:
return self._memo['get_contents']
except KeyError:
... | 0.003436 |
def jarFlags(target, source, env, for_signature):
"""If we have a manifest, make sure that the 'm'
flag is specified."""
jarflags = env.subst('$JARFLAGS', target=target, source=source)
for src in source:
contents = src.get_text_contents()
if contents[:16] == "Manifest-Version":
... | 0.004739 |
def encode_offset_commit_request_kafka(cls, group, payloads):
"""
Encode an OffsetCommitRequest struct
Arguments:
group: string, the consumer group you are committing offsets for
payloads: list of OffsetCommitRequestPayload
"""
return kafka.protocol.commit... | 0.005214 |
def get_data_path(package, resource):
# type: (str, str) -> str
"""Return the full file path of a resource of a package."""
loader = pkgutil.get_loader(package)
if loader is None or not hasattr(loader, 'get_data'):
raise PackageResourceError("Failed to load package: '{0}'".format(
pa... | 0.001449 |
def IfContainer(cls, ifc: IfContainer, ctx: SerializerCtx):
"""
Srialize IfContainer instance
"""
childCtx = ctx.withIndent()
def asHdl(statements):
return [cls.asHdl(s, childCtx) for s in statements]
try:
cond = cls.condAsHdl(ifc.cond, True, ctx... | 0.001447 |
def _read_output(self, command):
""" Read CSV delimited input from Slurm. """
cmd = []
cmd.extend(self._prefix)
cmd.extend([self._path, "-iP"])
cmd.extend(command)
command = cmd
logger.debug("Cmd %s" % command)
null = open('/dev/null', 'w')
proces... | 0.001274 |
async def setFormName(self, oldn, newn):
'''
Rename a form within all the layers.
'''
logger.info(f'Migrating [{oldn}] to [{newn}]')
async with self.getTempSlab():
i = 0
async for buid, valu in self.getFormTodo(oldn):
await self.editNode... | 0.004167 |
def unpack(self, unpacker):
"""
unpacks an exception handler entry in an exception table. Updates
the internal structure of this instance
"""
(a, b, c, d) = unpacker.unpack_struct(_HHHH)
self.start_pc = a
self.end_pc = b
self.handler_pc = c
self.... | 0.005917 |
def _check_if_complete(self, url, json_response):
"""
Check if a request has been completed and return the redirect URL if it has
@type url: str
@type json_response: list or dict
@rtype: str or bool
"""
if '__done' in json_response and isinstance(j... | 0.003797 |
def run(self, path_dir=None, convergence=True, write_input=True,
clear_dir=False, max_lpfac=150, min_egrid=0.00005):
"""
Write inputs (optional), run BoltzTraP, and ensure
convergence (optional)
Args:
path_dir (str): directory in which to run BoltzTraP
... | 0.001367 |
def convert_args_to_laid_out_tensors(xs):
"""Convert list elements to laid-out-tensors when possible.
Args:
xs: a list
Returns:
a list
"""
ret = []
for x in xs:
if hasattr(x, "to_laid_out_tensor"):
ret.append(x.to_laid_out_tensor())
else:
ret.append(x)
return ret | 0.022876 |
def setup(self):
"""
Called by pytest to setup the collector cells in .
Here we start a kernel and setup the sanitize patterns.
"""
if self.parent.config.option.current_env:
kernel_name = CURRENT_ENV_KERNEL_NAME
else:
kernel_name = self.nb.metadat... | 0.004608 |
def path(self):
"""Returns the build root for the current workspace."""
if self._root_dir is None:
# This env variable is for testing purpose.
override_buildroot = os.environ.get('PANTS_BUILDROOT_OVERRIDE', None)
if override_buildroot:
self._root_dir = override_buildroot
else:
... | 0.012552 |
def set_top_sentences(self, value):
''' setter '''
if isinstance(value, int) is False:
raise TypeError("The type of __top_sentences must be int.")
self.__top_sentences = value | 0.009479 |
def get_parameter_limits(xval, loglike, cl_limit=0.95, cl_err=0.68269, tol=1E-2,
bounds=None):
"""Compute upper/lower limits, peak position, and 1-sigma errors
from a 1-D likelihood function. This function uses the
delta-loglikelihood method to evaluate parameter limits by
sear... | 0.001436 |
def _do_get(self, uri, **kwargs):
"""
Convinient method for GET requests
Returns http request status value from a POST request
"""
#TODO:
# Add error handling. Check for HTTP status here would be much more conveinent than in each calling method
scaleioapi_get_head... | 0.013857 |
def cell_ends_with_code(lines):
"""Is the last line of the cell a line with code?"""
if not lines:
return False
if not lines[-1].strip():
return False
if lines[-1].startswith('#'):
return False
return True | 0.004016 |
def validate_metadata(self, existing):
""" create / validate metadata """
self.metadata = [
c.name for c in self.values_axes if c.metadata is not None] | 0.011173 |
def temporal_split(X, y, test_size=0.25):
'''
Split time series or sequence data along the time axis.
Test data is drawn from the end of each series / sequence
Parameters
----------
X : array-like, shape [n_series, ...]
Time series data and (optionally) contextual data
y : array-like... | 0.001228 |
def _pos_nt(pr, pos, stranded=False):
"""
Given a pileup read and a position, return the base that is covered by the
read at the given position if the position is covered.
Parameters
----------
pr : pysam.calignmentfile.PileupRead
Region of type chrom:start-end, chrom:start-end:strand, ... | 0.002475 |
def fullpath(self):
"""
Full path to the Mackup configuration files.
The full path to the directory when Mackup is storing the configuration
files.
Returns:
str
"""
return str(os.path.join(self.path, self.directory)) | 0.006993 |
def _pre_index_check(handler, host=None, core_name=None):
'''
PRIVATE METHOD - MASTER CALL
Does a pre-check to make sure that all the options are set and that
we can talk to solr before trying to send a command to solr. This
Command should only be issued to masters.
handler : str
The im... | 0.000493 |
def show_metrics(metrics, all_branches=False, all_tags=False):
"""
Args:
metrics (list): Where each element is either a `list`
if an xpath was specified, otherwise a `str`
"""
for branch, val in metrics.items():
if all_branches or all_tags:
logger.info("{branch}:"... | 0.001346 |
def check_conflicts(self):
"""Checks for any conflicts between modules configured to be built.
"""
shutit_global.shutit_global_object.yield_to_draw()
cfg = self.cfg
# Now consider conflicts
self.log('PHASE: conflicts', level=logging.DEBUG)
errs = []
self.pause_point('\nNow checking for conflicts between... | 0.025818 |
async def clean_up_clients_async(self):
"""
Resets the pump swallows all exceptions.
"""
if self.partition_receiver:
if self.eh_client:
await self.eh_client.stop_async()
self.partition_receiver = None
self.partition_receive_hand... | 0.005435 |
def execute(self, commands, pretty_format=False):
"""
Parse and run a DQL string
Parameters
----------
commands : str
The DQL command string
pretty_format : bool
Pretty-format the return value. (e.g. 4 -> 'Updated 4 items')
"""
tr... | 0.002703 |
def stop(self, timeout=None, force=False):
"""Stop the worker thread and synchronously wait for it to finish.
Args:
timeout (float): The maximum time to wait for the thread to stop
before raising a TimeoutExpiredError. If force is True, TimeoutExpiredError
i... | 0.006693 |
def add_download_task(self, source_url, remote_path, selected_idx=(), **kwargs):
"""
:param source_url: 离线下载目标的URL
:param remote_path: 欲保存到百度网盘的目录, 注意以 / 打头
:param selected_idx: 在 BT 或者磁力链的下载类型中, 选择哪些idx下载, 不填写为全部
添加离线任务,支持所有百度网盘支持的类型
"""
if source_url.startswith(... | 0.005535 |
def not_right(self, num):
"""
WITH SLICES BEING FLAT, WE NEED A SIMPLE WAY TO SLICE FROM THE LEFT [:-num:]
"""
if num == None:
return FlatList([_get_list(self)[:-1:]])
if num <= 0:
return FlatList.EMPTY
return FlatList(_get_list(self)[:-num:]) | 0.012658 |
def get_asset_form_for_create(self, asset_record_types):
"""Gets the asset form for creating new assets.
A new form should be requested for each create transaction.
arg: asset_record_types (osid.type.Type[]): array of asset
record types
return: (osid.repository.Asset... | 0.001797 |
def jacobian(expr, symbols):
"""
Derive a symbolic expr w.r.t. each symbol in symbols. This returns a symbolic jacobian vector.
:param expr: A sympy Expr.
:param symbols: The symbols w.r.t. which to derive.
"""
jac = []
for symbol in symbols:
# Differentiate to every param
f... | 0.005208 |
def xyz(self):
"""
:returns: an array of shape (N, 3) with the cartesian coordinates
"""
return geo_utils.spherical_to_cartesian(
self.lons.flat, self.lats.flat, self.depths.flat) | 0.008969 |
def view_get(method_name):
"""
Creates a getter that will drop the current value,
and call the view's method with specified name
using the context's key as first argument.
@param method_name: the name of a method belonging to the view.
@type method_name: str
"""
def view_get(_value, con... | 0.002151 |
def price_diff(self):
'返回DataStruct.price的一阶差分'
res = self.price.groupby(level=1).apply(lambda x: x.diff(1))
res.name = 'price_diff'
return res | 0.011429 |
def sortByKey(self, ascending=True, numPartitions=None, keyfunc=lambda x: x):
"""
Sorts this RDD, which is assumed to consist of (key, value) pairs.
>>> tmp = [('a', 1), ('b', 2), ('1', 3), ('d', 4), ('2', 5)]
>>> sc.parallelize(tmp).sortByKey().first()
('1', 3)
>>> sc.p... | 0.00428 |
def iter_object_acl(root):
"""Child-first discovery of ACEs for an object.
Walks the ACL graph via ``__acl_bases__`` and yields the ACEs parsed from
``__acl__`` on each object.
"""
for obj in iter_object_graph(root):
for ace in parse_acl(getattr(obj, '__acl__', ())):
yield ace | 0.003125 |
def update_caption(self, mouse):
""" 添加坐标显示 """
caption = "{} x: {}, y: {}".format(self._title, mouse.x, mouse.y)
super().set_caption(caption) | 0.011976 |
def maximization_step(num_words, stanzas, schemes, probs):
"""
Update latent variables t_table, rprobs
"""
t_table = numpy.zeros((num_words, num_words + 1))
rprobs = numpy.ones(schemes.num_schemes)
for i, stanza in enumerate(stanzas):
scheme_indices = schemes.get_schemes_for_len(len(stan... | 0.000855 |
def temp(dev, target):
""" Gets or sets the target temperature."""
click.echo("Current target temp: %s" % dev.target_temperature)
if target:
click.echo("Setting target temp: %s" % target)
dev.target_temperature = target | 0.004049 |
def schedule(self):
"""Initiate distribution of the test collection.
Initiate scheduling of the items across the nodes. If this gets called
again later it behaves the same as calling ``._reschedule()`` on all
nodes so that newly added nodes will start to be used.
If ``.collect... | 0.001365 |
def uninstall(pkg):
'''
Uninstall the specified package.
Args:
pkg (str): The package name.
Returns:
dict: The ``result`` and ``output``.
CLI Example:
.. code-block:: bash
salt '*' flatpak.uninstall org.gimp.GIMP
'''
ret = {'result': None, 'output': ''}
... | 0.001637 |
def write_yaml_report(func):
"""Decorator used in campaign node post-processing
"""
@wraps(func)
def _wrapper(*args, **kwargs):
now = datetime.datetime.now()
with Timer() as timer:
data = func(*args, **kwargs)
if isinstance(data, (SEQUENCES, types.GeneratorType))... | 0.001174 |
def estimate_pos_and_err_parabolic(tsvals):
"""Solve for the position and uncertainty of source in one dimension
assuming that you are near the maximum and the errors are parabolic
Parameters
----------
tsvals : `~numpy.ndarray`
The TS values at the maximum TS, and for each pixel on e... | 0.001631 |
def params_size(num_components, event_shape=(), name=None):
"""The number of `params` needed to create a single distribution."""
return MixtureSameFamily.params_size(
num_components,
IndependentLogistic.params_size(event_shape, name=name),
name=name) | 0.003546 |
def perturb(model, verbose=False, steady_state=None, eigmax=1.0-1e-6,
solve_steady_state=False, order=1, details=True):
"""Compute first order approximation of optimal controls
Parameters:
-----------
model: NumericModel
Model to be solved
verbose: boolean
... | 0.005694 |
def delete_issue_remote_link_by_id(self, issue_key, link_id):
"""
Deletes Remote Link on Issue
:param issue_key: str
:param link_id: str
"""
url = 'rest/api/2/issue/{issue_key}/remotelink/{link_id}'.format(issue_key=issue_key, link_id=link_id)
return self.delete(u... | 0.009288 |
def setup(self):
""" performs data collection for qpid dispatch router """
options = ""
if self.get_option("port"):
options = (options + " -b " + gethostname() +
":%s" % (self.get_option("port")))
# gethostname() is due to DISPATCH-156
# for ei... | 0.002066 |
def savebinary(fname, X, savecoloring=True):
"""
Save a tabarray to a numpy binary file or archive.
Save a tabarray to a numpy binary file (``.npy``) or archive
(``.npz``) that can be loaded by :func:`tabular.io.savebinary`.
The ``.npz`` file is a zipped archive created using
:func:`numpy.... | 0.005319 |
def transform_multiple(sequence, transformations, iterations):
"""Chains a transformation a given number of times.
Args:
sequence (str): a string or generator onto which transformations are applied
transformations (dict): a dictionary mapping each char to the string that is
substitu... | 0.004847 |
def register_actions(self, shortcut_manager):
"""Register callback methods fot triggered actions.
:param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager: Shortcut Manager Object holding mappings
between shortcuts and actions.
"""
shortcut_manager.add_callback_fo... | 0.011111 |
def get_entity(self, table_name, partition_key, row_key, select=None,
accept=TablePayloadFormat.JSON_MINIMAL_METADATA,
property_resolver=None, timeout=None):
'''
Get an entity from the specified table. Throws if the entity does not exist.
:param str table_n... | 0.007964 |
def new(self, key=None, data=None, content_type='application/json',
encoded_data=None):
"""A shortcut for manually instantiating a new
:class:`~riak.riak_object.RiakObject` or a new
:class:`~riak.datatypes.Datatype`, based on the presence and value
of the :attr:`datatype <Buc... | 0.001382 |
def _valid_config(self, settings):
"""Scan through the returned settings to ensure they appear sane.
There are time when the returned buffer has the proper information, but
the reading is inaccurate. When this happens, temperatures will swing
or system values will be set to improper val... | 0.001828 |
def last_location_of_minimum(x):
"""
Returns the last location of the minimal value of x.
The position is calculated relatively to the length of x.
:param x: the time series to calculate the feature of
:type x: numpy.ndarray
:return: the value of this feature
:return type: float
"""
... | 0.002445 |
def _run_macro(self, statement: Statement) -> bool:
"""
Resolve a macro and run the resulting string
:param statement: the parsed statement from the command line
:return: a flag indicating whether the interpretation of commands should stop
"""
from itertools import islic... | 0.004615 |
def git_str(self):
"""
If the distribution is not installed via git, return an empty string.
If the distribution is installed via git and pip recognizes the git
source, return the pip requirement string specifying the git URL and
commit, with an '*' appended if :py:attr:`~.git_i... | 0.001835 |
def consolidate(self,
volume: float,
source: List[Well],
dest: Well,
*args, **kwargs) -> 'InstrumentContext':
"""
Move liquid from multiple wells (sources) to a single well(destination)
:param volume: The amount of ... | 0.007168 |
def get_albums_for_artist(self, artist, full_album_art_uri=False):
"""Get an artist's albums.
Args:
artist (str): an artist's name.
full_album_art_uri: whether the album art URI should be
absolute (i.e. including the IP address). Default `False`.
Returns... | 0.001951 |
def reduce_activities(stmts_in, **kwargs):
"""Reduce the activity types in a list of statements
Parameters
----------
stmts_in : list[indra.statements.Statement]
A list of statements to reduce activity types in.
save : Optional[str]
The name of a pickle file to save the results (stm... | 0.001208 |
def get(self, table='', start=0, limit=0, order=None, where=None):
"""
Get a list of stat items
:param table: str database table name
:param start: int
:param limit: int
:param order: list|tuple
:param where: list|tuple
:return:
"""
parame... | 0.002703 |
def cmd_time(self, args):
'''show autopilot time'''
tusec = self.master.field('SYSTEM_TIME', 'time_unix_usec', 0)
if tusec == 0:
print("No SYSTEM_TIME time available")
return
print("%s (%s)\n" % (time.ctime(tusec * 1.0e-6), time.ctime())) | 0.006803 |
def create_fork(self, repo):
"""
:calls: `POST /repos/:owner/:repo/forks <http://developer.github.com/v3/repos/forks>`_
:param repo: :class:`github.Repository.Repository`
:rtype: :class:`github.Repository.Repository`
"""
assert isinstance(repo, github.Repository.Repositor... | 0.005814 |
def listing(
source: list,
ordered: bool = False,
expand_full: bool = False
):
"""
An unordered or ordered list of the specified *source* iterable where
each element is converted to a string representation for display.
:param source:
The iterable to display as a list.
... | 0.001026 |
def mixpanel(parser, token):
"""
Mixpanel tracking template tag.
Renders Javascript code to track page visits. You must supply
your Mixpanel token in the ``MIXPANEL_API_TOKEN`` setting.
"""
bits = token.split_contents()
if len(bits) > 1:
raise TemplateSyntaxError("'%s' takes no arg... | 0.002747 |
def set_opcode(self, opcode):
"""Set the opcode.
@param opcode: the opcode
@type opcode: int
"""
self.flags &= 0x87FF
self.flags |= dns.opcode.to_flags(opcode) | 0.009662 |
def stop(self):
"""Stops all session activity.
Blocks until io and writer thread dies
"""
if self._io_thread is not None:
self.log.info("Waiting for I/O thread to stop...")
self.closed = True
self._io_thread.join()
if self._writer_thread is n... | 0.003861 |
def get_ip(source='aws'):
''' a method to get current public ip address of machine '''
if source == 'aws':
source_url = 'http://checkip.amazonaws.com/'
else:
raise Exception('get_ip currently only supports queries to aws')
import requests
try:
response = reques... | 0.006693 |
def add_predicate(self, name: str, function: Callable, side_arguments: List[str] = None):
"""
Adds a predicate to this domain language. Typically you do this with the ``@predicate``
decorator on the methods in your class. But, if you need to for whatever reason, you can
also call this ... | 0.008118 |
def filter_requires_grad(pgroups):
"""Returns parameter groups where parameters
that don't require a gradient are filtered out.
Parameters
----------
pgroups : dict
Parameter groups to be filtered
"""
warnings.warn(
"For filtering gradients, please use skorch.callbacks.Freeze... | 0.001835 |
def ws_url(self):
"""websocket url matching the current request
turns http[s]://host[:port] into
ws[s]://host[:port]
"""
proto = self.request.protocol.replace('http', 'ws')
host = self.application.ipython_app.websocket_host # default to config value
if ho... | 0.011737 |
def teardown_tempdir(dir):
r'''
Cleanup temporary directory.
'''
if ssh_conn:
delete_tree(dir)
assert_valid_dir(dir)
shutil.rmtree(dir) | 0.005917 |
def _store_status(self, section, command, name):
"""
Based on new command execution attempt, update instance's
data structures with information about the success/fail status.
Return the result of the execution test.
"""
succeeded = is_command_callable(command, name)
... | 0.002907 |
def add_team_member(name, team_name, profile="github"):
'''
Adds a team member to a team with team_name.
name
The name of the team member to add.
team_name
The name of the team of which to add the user.
profile
The name of the profile configuration to use. Defaults to ``gi... | 0.001979 |
def _manage_http_servers(self):
"""
Compares the running services with the current settings configuration
and adjusts the running services to match it if different.
The services are identified only by their postion in the server list,
so a change than only involves a position mo... | 0.006472 |
def _geom_points(geom):
"""GeoJSON geometry to a sequence of point tuples
"""
if geom['type'] == 'Point':
yield tuple(geom['coordinates'])
elif geom['type'] in ('MultiPoint', 'LineString'):
for position in geom['coordinates']:
yield tuple(position)
else:
raise Inv... | 0.002481 |
async def create_vm(self, preset_name: str, image: str, flavor: str, security_groups: List=None,
userdata: Dict=None, key_name: str=None, availability_zone: str=None,
subnets: List=None) -> Any:
"""
Create (boot) a new server.
:arg string preset_n... | 0.017408 |
def _create_dom(data):
"""
Creates doublelinked DOM from `data`.
Args:
data (str/HTMLElement): Either string or HTML element.
Returns:
obj: HTMLElement containing double linked DOM.
"""
if not isinstance(data, dhtmlparser.HTMLElement):
data = dhtmlparser.parseString(
... | 0.002358 |
def parse_metadata(self):
"""Parse the INDEX_JSON file and reorganize it as a dictionary of lists."""
all_models = defaultdict(list)
with open(self.metadata_index_json) as f:
loaded = json.load(f)
for m in loaded['index']:
all_models[m['uniprot_ac']].append(m)
... | 0.008264 |
def configure_upload(graph, ns, mappings, exclude_func=None):
"""
Register Upload endpoints for a resource object.
"""
convention = UploadConvention(graph, exclude_func)
convention.configure(ns, mappings) | 0.004444 |
def _get_selected_item(self):
"""The currently selected item"""
selection = self.get_selection()
if selection.get_mode() != gtk.SELECTION_SINGLE:
raise AttributeError('selected_item not valid for select_multiple')
model, selected = selection.get_selected()
if selected... | 0.005155 |
def _empty_except_predicates(xast, node, context):
'''Check if a node is empty (no child nodes or attributes) except
for any predicates defined in the specified xpath.
:param xast: parsed xpath (xpath abstract syntax tree) from
:mod:`eulxml.xpath`
:param node: lxml element to check
:param context:... | 0.008584 |
def client(self, name=None):
"""Initialize a backend's client with given name or default."""
name = name or self.default
if not name:
return NullClient(self, None, None)
params = self.backends_hash[name]
ccls = self.backends_schemas.get(params.scheme, TCPClient)
... | 0.005089 |
def template_request(configuration, spec):
"""
Calls the get template request
:param configuration:
:param spec:
:return:
"""
# Template request, nonce will be regenerated.
req = CreateUO.get_template_request(configuration, spec)
# Do the request... | 0.004819 |
def gen_challenge(self, state):
"""This function generates a challenge for given state. It selects a
random number and sets that as the challenge key. By default, v_max
is set to the prime, and the number of chunks to challenge is the
number of chunks in the file. (this doesn't guaran... | 0.002845 |
def current(place):
"""return data as list of dicts with all data filled in."""
lat, lon = place
url = "https://api.forecast.io/forecast/%s/%s,%s?solar" % (APIKEY, lat,
lon)
w_data = json.loads(urllib2.urlopen(url).read())
currently = w_... | 0.002732 |
def patterson_f2(aca, acb):
"""Unbiased estimator for F2(A, B), the branch length between populations
A and B.
Parameters
----------
aca : array_like, int, shape (n_variants, 2)
Allele counts for population A.
acb : array_like, int, shape (n_variants, 2)
Allele counts for popula... | 0.000903 |
def run_scan():
"""
show all available partitions
"""
all_disks = walk_data(sess, oid_hrStorageDescr, helper)[0]
print "All available disks at: " + host
for disk in all_disks:
print "Disk: \t'" + disk + "'"
quit() | 0.011278 |
def get_or_create(cls, mp, part_number):
"""Get or create a part."""
obj = cls.get_or_none(mp, part_number)
if obj:
return obj
return cls.create(mp, part_number) | 0.009756 |
def north_arrow_path(feature, parent):
"""Retrieve the full path of default north arrow logo."""
_ = feature, parent # NOQA
north_arrow_file = setting(inasafe_north_arrow_path['setting_key'])
if os.path.exists(north_arrow_file):
return north_arrow_file
else:
LOGGER.info(
... | 0.001828 |
def read_associations(assoc_fn, anno_type='id2gos', **kws):
"""Return associatinos in id2gos format"""
# kws get_objanno: taxids hdr_only prt allow_missing_symbol
obj = get_objanno(assoc_fn, anno_type, **kws)
# kws get_id2gos: ev_include ev_exclude keep_ND keep_NOT b_geneid2gos go2geneids
return obj... | 0.005917 |
def find_magic_in_file(filename):
"""
Search the file for any magic incantations.
:param filename: file to search
:returns: a tuple containing the spell and then maybe some extra words (or None if no magic present)
"""
with open(filename, "rt", encoding="utf-8") as f:
for line in f:
... | 0.004539 |
def send(self, to, subject=None, body=None, reply_to=None, template=None, **kwargs):
"""
To send email
:param to: the recipients, list or string
:param subject: the subject
:param body: the body
:param reply_to: reply_to
:param template: template, will use the tem... | 0.002682 |
def _read_data_handler(length, whence, ctx, skip=False, stream_event=ION_STREAM_INCOMPLETE_EVENT):
"""Creates a co-routine for retrieving data up to a requested size.
Args:
length (int): The minimum length requested.
whence (Coroutine): The co-routine to return to after the data is satisfied.
... | 0.003286 |
async def get_playback_settings(self) -> List[Setting]:
"""Get playback settings such as shuffle and repeat."""
return [
Setting.make(**x)
for x in await self.services["avContent"]["getPlaybackModeSettings"]({})
] | 0.011494 |
def from_list(cls, l):
"""Return a Point instance from a given list"""
if len(l) == 3:
x, y, z = map(float, l)
return cls(x, y, z)
elif len(l) == 2:
x, y = map(float, l)
return cls(x, y)
else:
raise AttributeError | 0.01278 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.