content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def main(params):
""" the main_train entry point """
logging.info('running...')
if not os.path.exists(params['path_out']):
assert os.path.isdir(os.path.dirname(params['path_out'])), \
'missing folder: %s' % os.path.dirname(params['path_out'])
os.mkdir(params['path_out'])
... | 45,800 |
def infer(model, text_sequences, input_lengths):
"""
An inference hook for pretrained synthesizers
Arguments
---------
model: Tacotron2
the tacotron model
text_sequences: torch.Tensor
encoded text sequences
input_lengths: torch.Tensor
input lengths
Returns
-... | 45,801 |
def build_info(image, spack_version):
"""Returns the name of the build image and its tag.
Args:
image (str): image to be used at run-time. Should be of the form
<image_name>:<image_tag> e.g. "ubuntu:18.04"
spack_version (str): version of Spack that we want to use to build
Retur... | 45,802 |
def _get_data_attr(data, attr):
"""Get data object field."""
if isinstance(data, dict):
# `Data` object's id is hydrated as `__id` in expression engine
data = data["__id"]
data_obj = Data.objects.get(id=data)
return getattr(data_obj, attr) | 45,803 |
def main():
"""Main function"""
conf_path = MODULE.params['conf_path']
new_password = MODULE.params['new_password']
config = ConfigParser.SafeConfigParser()
config.read(conf_path)
username = config.get('usmqepytest', 'usm_username')
password = config.get('usmqepytest', 'usm_password')
... | 45,804 |
def get_user_project(user, dds_project_id):
"""
Get a single Duke DS Project for a user
:param user: User who has DukeDS credentials
:param dds_project_id: str: duke data service project id
:return: DDSProject: project details
"""
try:
remote_store = get_remote_store(user)
pr... | 45,805 |
def _event_split(elist):
"""Split event list into dictionary of event keywords
"""
eventdict = dict()
dictkeys = (roxar.EventType.WLIMRATE,
roxar.EventType.WLIMPRES,
roxar.EventType.WLIMRATIO,
roxar.EventType.WHISTRATE,
roxar.EventT... | 45,806 |
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no" or None (meaning
an answer ... | 45,807 |
def gather_requirements_from_modules(errors, reqs):
"""Collect the requirements from the modules directly."""
for package in sorted(
explore_module("homeassistant.scripts", True)
+ explore_module("homeassistant.auth", True)
):
try:
module = importlib.import_module(package... | 45,808 |
def latexify(fig_width=None, fig_height=None, columns=1):
"""Set up matplotlib's RC params for LaTeX plotting.
Call this before plotting a figure.
Parameters
----------
fig_width : float, optional, inches
fig_height : float, optional, inches
columns : {1, 2}
"""
# code adapted fro... | 45,809 |
def generate_reply(utt, dais):
"""Generate a reply task for the given utterance and DAIs list."""
ret = DataLine(dat='reply', abstr_utt=utt, abstr_da='&'.join([unicode(dai) for dai in dais]))
utt, dais = deabstract(utt, dais)
# offer a ride (meeting the specifications in dais)
if all([dai.dat in ... | 45,810 |
def create_concept_graphs(example_indices, grakn_session):
"""
Builds an in-memory graph for each example, with an example_id as an anchor for each example subgraph.
Args:
example_indices: The values used to anchor the subgraph queries within the entire knowledge graph
grakn_session: Grakn S... | 45,811 |
def GetChange(host, change):
"""Queries a Gerrit server for information about a single change."""
path = 'changes/%s' % change
return _SendGerritJsonRequest(host, path) | 45,812 |
def train_net(logger, dims=20, deep=True, conv_channel=32, init="glorot_uniform", fast=False, num_iterations=20,
visual_name="", lr_start=1e-3, LR_decay=0.95, size=1600, input_name="new_eval", N_Cls=10,
bn=True, batch_size=32, input=None, use_sample_weights=False, mins=None, maxs=None,
... | 45,813 |
def test_private_key_invalid():
"""Test private key is not valid"""
loop = asyncio.get_event_loop()
keys = [
'0xcfe4018c59e50e0e1964c979e6213ce5eb8c751cbc98a44251eb48a0985adc5' # too short
'0xcfe4018c59e50e0e1964c979e6213ce5eb8c751cbc98a44251eb48a0985adc555' # too long
'0xcxe4018... | 45,814 |
def main():
"""
Parse command line arguments. And call functions which do
the real work.
"""
#TODO: Add mutually exclusive command line argument groups.
parser = argparse.ArgumentParser()
parser.add_argument('in_filename',
help='Path to the input text file to read from.')
... | 45,815 |
def block_shape(f):
"""
find the block shape (nxb, nyb, nzb) given the hdf5 file f
returns
dimension, (nxb, nyb, nzb)
"""
if 'integer scalars' in f.root:
params = f.getNode(f.root, 'integer scalars').read()
p_dict = dict((name.rstrip(), val) for name, val in params)
... | 45,816 |
def model_init(rng_key, batch, encoder_sizes=(1000, 500, 250, 30)):
"""Initialize the standard autoencoder."""
x_size = batch.shape[-1]
decoder_sizes = encoder_sizes[len(encoder_sizes) - 2::-1]
sizes = (x_size,) + encoder_sizes + decoder_sizes + (x_size,)
keys = jax.random.split(rng_key, len(sizes) - 1)
par... | 45,817 |
def do2_SVU(calphase, temp, csv):
"""
Description:
Stern-Volmer-Uchida equation for calculating temperature
corrected dissolved oxygen concentration. OOI L1 data product.
Usage:
DO = do2_SVU(calphase, temp, csv)
where
DO = dissolved oxygen [micro-mole/L]
... | 45,818 |
def create_bet(
player: int, better: int, bet: int, prediction: bool, created: int
):
"""
creates a new bet on a player
"""
bet = LoLBets(player, better, bet, prediction, created)
session.add(bet)
session.commit() | 45,819 |
def main(**params):
"""
Train Model
"""
with tracking(
experiment="train",
params=params,
local_dir=params["save_path"],
tracking=params["tracking"]
):
target = params["target"]
os.makedirs(params["save_path"], exist_ok=True)
metadata = get_met... | 45,820 |
def _make_rotation_matrix(vector_1,vector_2):
"""" Generates the rotation matrix from vector_1 to vector_2"""
# Use formula for rotation matrix: R = I + A + A^2 * b
# https://math.stackexchange.com/questions/180418/calculate-rotation-matrix-to-align-vector-a-to-vector-b-in-3d
v = np.cross(vector_1,vecto... | 45,821 |
def check_rank(X):
"""
This function checks if X is rank deficient.
:param matrix_X: is interpreted as:
- a ``[n*d]`` data matrix, a matrix with ``n`` samples in ``d`` dimensions
:type matrix_X: 2D `numpy.array`
:rtype: None
:raise: Raises Exception if X matrix is rank deficient.
... | 45,822 |
def get_models(models='all'):
"""
Returns model names as a list
Parameters
----------
models: str
OPTIONAL. Default value is 'all' in which case all keys in defaule_models are returned.
If 'mixed' is passed, only the MixedFluid model names are returned.
"""
if models == 'all':
return list(default_models.ke... | 45,823 |
def other_language_code():
"""Language code used for testing, currently not set by user."""
return 'de-DE' | 45,824 |
def load_dummy_threading(finder, module):
"""the dummy_threading module plays games with the name of the threading
module for its own purposes; ignore that here"""
finder.ExcludeModule("_dummy_threading") | 45,825 |
def do_novelty_detection(
baseline_image_matrix, test_image_matrix, image_normalization_dict,
predictor_names, cnn_model_object, cnn_feature_layer_name,
ucn_model_object, num_novel_test_images,
percent_svd_variance_to_keep=97.5):
"""Does novelty detection.
Specifically, this met... | 45,826 |
def main():
"""Testing"""
# Set premise and query
premise = u"A is bigger than B"
query = u"A is not greater than C"
all_premises = [u"A is bigger than B",u"B is bigger than C"]
premise = u"A Swede won a Nobel prize"
query = u"A Scandinavian won a Nobel prize"
all_premises = [u"... | 45,827 |
def parse_last_timestamp(df):
"""
Parse last timestamp from dataframe.
Add one minute forward to prevent the script from fetching the same value.
The last timestamp already in database, so we need to fetch the weather data
one minute forward.
"""
if df.empty:
return None
date_st... | 45,828 |
def write_ms(
tree_sequence,
output,
print_trees=False,
precision=4,
num_replicates=1,
write_header=True,
):
"""
Write ``ms`` formatted output from the genotypes of a tree sequence
or an iterator over tree sequences. Usage:
.. code-block:: python
import tskit as ts
... | 45,829 |
def len_subword_features():
""" TODO: There is probably a better way to centralize this """
# Grapheme embedding (4), grapheme duration (1)
LEN_GRAPHEME_FEATURES = 5
return LEN_GRAPHEME_FEATURES | 45,830 |
def NextLexem_OperatorPredicate(op_value):
""" construct a predicate: lexem_list -> boolean
which checks if the next lexem is an operator whose value macthes
@p op_value (do not consume it) """
def predicate(lexem_list):
if len(lexem_list) == 0:
return False
head_lexe... | 45,831 |
def optim_inits(objective, x_opt, inference_samples, partition_samples, edge_mat_samples, n_vertices,
acquisition_func=expected_improvement, reference=None):
"""
:param x_opt: 1D Tensor
:param inference_samples:
:param partition_samples:
:param edge_mat_samples:
:param n_vertices... | 45,832 |
def configure_axes(axes):
""" Configure the axis style
"""
axes.spines['right'].set_visible(False)
axes.spines['top'].set_visible(False)
axes.spines['left'].set_visible(False)
axes.spines['bottom'].set_visible(False)
axes.grid(color='lightgrey', linewidth=0.25)
return | 45,833 |
def suggest_max_coverage(alignment_file, y):
"""Estimate a max-coverage value for use with dysgu. Mean genome coverage is estimated from the index file, so
will only be useful for whole-genome alignment files"""
f = pysam.AlignmentFile(alignment_file)
cov, read_length = index_stats(f)
cov = round(co... | 45,834 |
def stack(mems):
"""
Stack a list of tensors
Could use torch.stack here but torch.stack is much slower
than torch.cat + view
Submitted an issue for investigation:
https://github.com/pytorch/pytorch/issues/22462
FIXME: Remove this function after the issue above is resolved
"""
shape ... | 45,835 |
def success_msg_via_pager(text):
"""Success message."""
click.echo_via_pager(click.style(text, fg="green")) | 45,836 |
def dfu(serial, connect_attempts, detach, dry_run, firmware):
"""Program via STMicroelectronics DFU interface.
Enter dfu mode using `solo program aux enter-dfu` first.
"""
import time
from intelhex import IntelHex
import usb.core
dfu = solo.dfu.find(serial, attempts=connect_attempts)
... | 45,837 |
def _pushb2phases(pushop, bundler):
"""handle phase push through bundle2"""
if 'phases' in pushop.stepsdone:
return
b2caps = bundle2.bundle2caps(pushop.remote)
if not 'pushkey' in b2caps:
return
pushop.stepsdone.add('phases')
part2node = []
enc = pushkey.encode
for newrem... | 45,838 |
def test_default_field_matches_upper_bound_inclusive(default_field):
"""
Assert that all fields with the default value match their upper bound inclusively.
"""
assert _field_matches_upper_bound_inclusive(default_field) | 45,839 |
def print_help():
"""
sub function for printing help documentation
"""
print('-------------------------------------------------------'
'------------------------')
print('EXIT: EXIT quits with the currently presented'
' bioprocess.')
print('\nVIEW [MODULE]: VIEW ... | 45,840 |
def predict_all(model, all_data):
"""
Predict odor probabilities for all trials.
:param model: (keras) decoding model
:param all_data: (4d numpy array) data of format [trial, window, neuron, time]
:return: (3d numpy array) prediction of format [trial, time, odor]
"""
test = stack_data(all_d... | 45,841 |
def normalize(X):
"""Normalize the given dataset X
Args:
X: ndarray, dataset
Returns:
(Xbar, mean, std): tuple of ndarray, Xbar is the normalized dataset
with mean 0 and standard deviation 1; mean and std are the
mean and standard deviation respectively.
Note:
... | 45,842 |
def tst_gz(indir='./corpus'):
"""
test decompression speed and accuracy of files in folder indir
Parameters
----------
indir : str
folder with uncompressed files to test (default, './corpus')
"""
methods = []
if os.path.exists('gzip') or shutil.which('gzip'):
... | 45,843 |
def get_lat_lon(exif_data):
"""Returns the latitude and longitude, if available, from the provided exif_data (obtained through get_exif_data above)"""
lat = None
lon = None
if "GPSInfo" in exif_data:
gps_info = exif_data["GPSInfo"]
gps_latitude = _get_if_exist(gps_info, "GP... | 45,844 |
def cli():
"""
Tool to manage CloudEvents triggers for the syncing job behind hud.pytorch.org.
To use, you must set the ACCOUNT_ID environment variable:
# You can also get the ID from any ARN on the account
$ aws sts get-caller-identity --query Account --output text
123456
$ export ACCOUNT... | 45,845 |
def get_rendered_original_stream(warc_filename, warc_offset, compressedendoffset, payload_only=True):
"""
Grabs a resource.
"""
# If not found, say so:
if warc_filename is None:
return None, None
# Grab the payload from the WARC and return it.
url = "%s%s?op=OPEN&user.name=%s&offset... | 45,846 |
def enable_api_call():
"""Contextmanager which locally re-enable API calls."""
with mock.patch.object(github_path.GithubApi, 'query',
_original_query_github):
yield | 45,847 |
def get_parser() -> argparse.ArgumentParser:
"""Create and return the argparser for concord flask/cheroot server"""
parser = argparse.ArgumentParser(
description="Start the concord flask/cheroot server",
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
)
parser.add_argument("-d",... | 45,848 |
def set_seeds(seed=1234):
"""[Set seeds for reproducibility.]
Keyword Arguments:
seed {int} -- [The seed value] (default: {1234})
"""
np.random.seed(seed)
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
print("[INFO] THE SEED IS ", seed) | 45,849 |
def reduce_dimensions(df, reduce_cols=None, n_components=2):
"""
given a dataframe, columns to reduce and number of components for dimensionality reduction algorithm
returns a dictionary of reduction algorithm to it's name and reduced df.
dimensionality reduction or dimension reduction is the process o... | 45,850 |
def clear_screen():
""" Convenience function that you can use to clear the terminal
screen after each move. """
cmd = "cls" if platform.system() == "Windows" else "clear"
os.system(cmd) | 45,851 |
async def upload(u_event):
""" For .upload command, allows you to upload a file from the userbot's server """
await u_event.edit("Processing ...")
input_str = u_event.pattern_match.group(1)
cap = "Chala Jaa Bhosdike. Hack hona h kya tujhe"
if input_str in ("BOT_TOKEN.session", "config.env"):
... | 45,852 |
def device_found(data, mgmt_class):
"""
Callback for when device is found
:param data: Device found event packet
:param mgmt_class: Mgmt class object to access enums etc
"""
if data.event_frame.address == beacon_address:
eir_data = data.event_frame.eir_data
manuf_data = eir_data... | 45,853 |
def _dct_or_dst_type3(
x, n=None, axis=-1, norm=None, forward=True, dst=False, overwrite_x=False
):
"""Forward DCT/DST-III (or inverse DCT/DST-II) along a single axis.
Parameters
----------
x : cupy.ndarray
The data to transform.
n : int
The size of the transform. If None, ``x.s... | 45,854 |
def indi_events(person, tags=None):
"""Returns all events for a given individual.
Parameters
----------
person : `ged4py.model.Individual`
GEDCOM INDI record.
tags : `list` [ `str` ], optional
Set of tags to return, default is all event tags.
Returns
-------
events : `l... | 45,855 |
def list_files(dir_pathname,
recursive=True,
topdown=True,
followlinks=False):
"""
Enlists all the files using their absolute paths within the specified
directory, optionally recursively.
:param dir_pathname:
The directory to traverse.
:param rec... | 45,856 |
def device_tracking_unit_test(device, options=None):
""" Run device-tracking unit tests
Args:
device ('obj'): device object
options ('list'): list of policy configuration options:
dictionary contains any of the following keys:
association ('dict', ... | 45,857 |
def encrypt(key, plaintext):
"""Encrypt the string and return the ciphertext"""
return ''.join(key[l] for l in plaintext) | 45,858 |
def test_format_version_info():
"""ensures the return value of _format_version_info() has the format x.x.x"""
sys_vi = sys.version_info
version_str = _format_version_info(sys_vi)
assert version_str == "{}.{}.{}".format(sys_vi.major, sys_vi.minor, sys_vi.micro) | 45,859 |
def rename_keys(
mapping: T.Dict[str, T.Any],
*,
prefix: T.Optional[str] = None,
suffix: T.Optional[str] = None
) -> T.Dict[str, T.Any]:
"""Renames every key in `mapping` with a `prefix` and/or `suffix`.
Args:
mapping (T.Dict): Mapping.
prefix (str, optional): String to prepend.... | 45,860 |
def any_root_path(path):
"""Rendering the React template."""
return render_template('index.html') | 45,861 |
def test_requisites_full_sls_require(state, state_tree):
"""
Test the sls special command in requisites
"""
full_sls_contents = """
B:
cmd.run:
- name: echo B
C:
cmd.run:
- name: echo C
"""
sls_contents = """
include:
- fullsls
A:
cmd.run:
... | 45,862 |
def getChartdata():
"""
获取图表数据
params: request
return: response
"""
data = {'staff': {}}
data['staff']['is_worker'] = Staff.query.filter(Staff.is_leave==True).count()
data['staff']['not_worker'] = Staff.query.filter(Staff.is_leave==False).count()
data['staff']['total_worker'] = data[... | 45,863 |
def md_to_html(content):
""" Converts markdown content to HTML """
html = markdown.markdown(content)
return html | 45,864 |
def userdata_loader(s3_training_bucket='', trainer_script_name='trainer-script.sh'):
"""
Given the filepath for the trainer-script, load and return its contents as a str.
:param s3_training_bucket:
:param trainer_script_name:
:return:
"""
try:
# If the user didn't pass in another lo... | 45,865 |
def setup(c, platform=None, project=None, disable_op=False, env='local'):
"""
Convenience task which runs all setup tasks in the correct sequence
:param c: invoke context
:param platform: dbt profile platform (Optional if defaults already set)
(Optional if defaults already set)
:... | 45,866 |
def timer(string,i,f):
"""
Takes in:
i = starting time;
f = finishing time.
Returns: Time taken in full minutes and seconds.
"""
sec = f - i # Total time to run.
mins, sec= divmod(sec, 60.0)
time = string+' time: '+str(int(mins))+'min '+str(int(sec))+'s'
print(time)
... | 45,867 |
def consumption_lower_than_app(sample, app, use_case=None):
"""Test that a given sample spends less energy than a known app.
Args:
sample (list of Measurement): sample of measurements
app (string): identifier/package of the app to be compared
use_case (string): select only data from a g... | 45,868 |
def format_server_wrs(world_records, server_id):
"""Format the world records on the server browser to a table
world_records format: {server_id: [list of records]}
where every record is a tuple like {map_name, mode, date, time, player_name, steam_id, rank} accessible like sqlalchemy result"""
if ... | 45,869 |
def clean_file(path=Path('data') / 'Fangraphs Leaderboard.csv',
level='MLB', league='', season='', position=''):
"""Update names for querying and provide additional context.
Args:
level (str): the minor/major leave level selected. Default MLB.
league (str): optionally add a... | 45,870 |
def TextRangeCommandStart(builder):
"""This method is deprecated. Please switch to Start."""
return Start(builder) | 45,871 |
def test_config_machine_config_params(test_microvm_with_api, test_config):
"""
Test microvm start with optional `machine_config` parameters.
@type: functional
"""
test_microvm = test_microvm_with_api
# Test configuration determines if the file is a valid config or not
# based on the CPU
... | 45,872 |
def ai_derp(gstate: TicTacToe, *args):
"""AI that randomly picks the next move"""
return random.choice(list(gstate.next_moves.keys())) | 45,873 |
def get_logits_img(features, n_classes, mode, params):
"""Computes logits for provided features.
Args:
features: A dictionary of tensors that are the features
and whose first dimension is batch (as returned by input_fn).
n_classes: Number of classes from which to predict (i.e. the number
... | 45,874 |
def get_config_variables():
"""
Generator which yields all config variables of this app.
There are two main groups: 'General' and 'Projector'. The group 'General'
has subgroups. The generator has to be evaluated during app loading
(see apps.py).
"""
yield ConfigVariable(
name="gener... | 45,875 |
def test_slice_with_equal_substring():
"""
Если опустить оба параметра, оставив двоеточие, то срез совпадет с данной строкой
"""
str1 = "Python anywhere"
assert str1[:] == ___ | 45,876 |
def ccnv(pad=0):
"""Current canvas"""
global _cnvs
if pad == 0:
return _cnvs[-1]
_cnvs[-1].cd(pad)
return _cnvs[0].GetPad(pad) | 45,877 |
def check_run_results_table(client, table_id):
"""
Check if run_results table exists in BigQuery, and if not create it
"""
try:
client.get_table(table_id)
except NotFound:
print("Table {} is not found.".format(table_id))
current_folder = pathlib.Path(__file__).parent.absolute... | 45,878 |
def NetworkTest(reason='Skipping network test'):
"""Decorator for unit tests. Skip the test if --network is not specified."""
def Decorator(test_item):
@functools.wraps(test_item)
def NetworkWrapper(*args, **kwargs):
if GlobalTestConfig.NETWORK_TESTS_DISABLED:
raise unittest.SkipTest(reason)
... | 45,879 |
def azure_firewall_network_rule_collection_update_command(client: AzureFirewallClient,
args: Dict[str, Any]) -> CommandResults:
"""
Update network rule collection in firewall or policy.
Args:
client (AzureFirewallClient): Azure Firewall API c... | 45,880 |
def get_stream(id: Optional[str] = None,
ledger_name: Optional[str] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetStreamResult:
"""
Resource schema for AWS::QLDB::Stream.
"""
__args__ = dict()
__args__['id'] = id
__args__['ledgerName'] = ledger... | 45,881 |
def test_is_representation(rep):
"""
rep(Z(a1) Y(b1) Z(c1) Z(a2) Y(b2) Z(c2)) = rep(Z(a1) Y(b1) Z(c1)) rep(Z(a2) Y(b2) Z(c2))
"""
with torch_default_dtype(torch.float64):
a1, b1, c1, a2, b2, c2 = torch.rand(6)
r1 = rep(a1, b1, c1)
r2 = rep(a2, b2, c2)
a, b, c ... | 45,882 |
def _is_course_or_run_deleted(title):
"""
Returns True if '[delete]', 'delete ' (note the ending space character)
exists in a course's title or if the course title equals 'delete' for the
purpose of skipping the course
Args:
title (str): The course.title of the course
Returns:
... | 45,883 |
def merge_alignment_diffs(resource_dir, fasta_list, output_prefix="merged"):
""" Merge the results of "differences" type lastZ alignments into a
single file. This is used to process the alignment results from the
align_genes_for_design function where target sequences are aligned
against the reference ge... | 45,884 |
def copy_installer_dict(installer_dict, default_installer):
"""Copy installer dict.
The installer rules themselves are not deep-copied.
'default_installer' installer names are replaced according to
``default_installer``.
:param str default_installer: name of the default installer
"""
resu... | 45,885 |
def pbg_dispersion_1d_imre(
results,
wave="p",
size=(6,4), xlim=(-1, 1), ylim=(0, 1)
):
"""
Plots the photonic dispersion (Bloch wavevector) of a photonic crystal structure,
computed for a range of frequencies (wavelengths) and one angle of incidence.
Takes one polar... | 45,886 |
def map_constructor(loader, node):
"""
Constructs a map using OrderedDict.
:param loader: YAML loader
:param node: YAML node
:return: OrderedDictionary data
"""
loader.flatten_mapping(node)
return OrderedDict(loader.construct_pairs(node)) | 45,887 |
def index():
"""首页"""
return redirect(url_for('site.hot')) | 45,888 |
def tpr(df, label_column):
"""Measure the true positive rate."""
fp = sum((df['predictions'] >= 0.0) & (df[label_column] > 0.5))
ln = sum(df[label_column] > 0.5)
return float(fp) / float(ln) | 45,889 |
def get_pathway_names(
database: str,
pathway_df: pd.DataFrame,
kegg_manager: Optional[bio2bel_kegg.Manager] = None,
reactome_manager: Optional[bio2bel_reactome.Manager] = None,
wikipathways_manager: Optional[bio2bel_wikipathways.Manager] = None
):
"""Get pathway names from d... | 45,890 |
def printTriggerTimes():
"""When a test is started, print to the console when the triggers will
take place, both in actual time and message time.
Running test groups is pretty much the same as watching paint dry (on a
sunny day, paint dries faster). Much
of the time you are waiting hours after the ... | 45,891 |
def gather_rgi_results(rgi_sample_list: [RGIResult], outdir: Path) -> tuple:
"""
Symlinks RGI result files to a single destination folder -- required for rgi heatmap command
:param rgi_sample_list: List containing RGIResult object instances
:param outdir: Destination directory for result files
:retu... | 45,892 |
def retention(retention):
"""
Serialize a retention object to retention JSON
:param retention: PropertyInstance.Retention
:return: jsonified string represenation of obj
"""
from connio.rest.api.v3.account.propertyy import PropertyInstance
if retention is values.unset or retention is No... | 45,893 |
def get_tool_path(loader, node):
""" yaml tag handler to access tools dict at load time """
py_str = loader.construct_python_str(node)
return py_str.format(**tools) | 45,894 |
def test_create_runner_parser(with_config: bool) -> None:
"""
Test parsing of commandline arguments:
From arguments to the runner, can we reconstruct arguments for AzureConfig and for the model config?
Check that default and non-default arguments are set correctly and recognized as default/non-default.
... | 45,895 |
def get_health_check_output(name: Optional[pulumi.Input[str]] = None,
project: Optional[pulumi.Input[Optional[str]]] = None,
opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetHealthCheckResult]:
"""
Get information about a HealthCheck.
... | 45,896 |
def _get_oath2_access_token(client_key, client_secret):
"""
Query the vistara API and get an access_token
"""
if not client_key and not client_secret:
log.error(
"client_key and client_secret have not been specified "
"and are required parameters."
)
retu... | 45,897 |
def run_uncertain_performance_simulation():
"""Run routing simulations for a given day with uncertain performance."""
start = Location(-149.426, -17.651)
finish = Location(-157.92, 21.83)
start_date = datetime(1976, 5, 1, 0, 0)
n_nodes = 150
n_width = n_nodes
print("Nodes in rank: ", n_nodes... | 45,898 |
def sanity_check_dp(A_org, XW, U, L, delta_l, delta_g, check_symmetry=True, \
activation='linear'):
"""
Sanity approach for solving min_{A_G^{1+2+3}} F_c(A) + np.sum(A.*L)
param:
A_org: original adjacency matrix
XW: X... | 45,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.