content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def get_install_task_flavor(job_config):
"""
Pokes through the install task's configuration (including its overrides) to
figure out which flavor it will want to install.
Only looks at the first instance of the install task in job_config.
"""
project, = job_config.get('project', 'ceph'),
tas... | 5,355,800 |
def equalize_hist(image, nbins=256):
"""Return image after histogram equalization.
Parameters
----------
image : array
Image array.
nbins : int
Number of bins for image histogram.
Returns
-------
out : float array
Image array after histogram equalization.
N... | 5,355,801 |
def entry_point():
"""gallerycrawler command line utilities.""" | 5,355,802 |
def printMV(*args, **kwargs):
"""
Affiche le texte donné, préfixé de l'acronyme de l'application.
"""
print("[MV]", *args, **kwargs) | 5,355,803 |
def add9336(rh):
"""
Adds a 9336 (FBA) disk to virtual machine's directory entry.
Input:
Request Handle with the following properties:
function - 'CHANGEVM'
subfunction - 'ADD9336'
userid - userid of the virtual machine
parms['diskPool'] - Disk pool
... | 5,355,804 |
def test_compute_fluctuations_rs(tsig_white):
"""Tests fluctuation analysis for the RS method."""
# Test white noise: expected RS of 0.5
t_scales, flucs, exp = compute_fluctuations(tsig_white, FS_HIGH, method='rs')
assert np.isclose(exp, 0.5, atol=0.1) | 5,355,805 |
def window_data(s1,s2,s5,s6,s7,s8, sat,ele,azi,seconds,edot,f,az1,az2,e1,e2,satNu,pfitV,pele):
"""
author kristine m. larson
also calculates the scale factor for various GNNS frequencies. currently
returns meanTime in UTC hours and mean azimuth in degrees
cf, which is the wavelength/2
currently... | 5,355,806 |
def get_related(user, kwargs):
"""
Get related model from user's input.
"""
for item in user.access_extra:
if item[1] in kwargs:
related_model = apps.get_model(item[0], item[1])
kwargs[item[1]] = related_model.objects.get(pk=get_id(kwargs[item[1]]))
return kwargs | 5,355,807 |
def _drive_help(message: Message, cmd1: str, cmd2: str) -> None:
"""
jira 検索コマンドのヘルプを返す
"""
botsend(message, HELP.format(cmd1, cmd2, DEFAULT_PROJECT)) | 5,355,808 |
def make_logical(n_tiles=1):
"""
Make a toy dataset with three labels that represent the logical functions: OR, XOR, AND
(functions of the 2D input).
"""
pat = np.array([
# X X Y Y Y
[0, 0, 0, 0, 0],
[0, 1, 1, 1, 0],
[1, 0, 1, 1, 0],
[1, 1, 1, 0, ... | 5,355,809 |
def get_idmap_etl(
p_idmap: object,
p_etl_id: str,
p_source_table: object =None
):
"""
Генерирует скрипт ETL для таблицы Idmap
:param p_idmap: объект класса Idmap
:param p_etl_id: id etl процесса
:param p_source_table: таблица источник, которую требуется загрузить в idmap
... | 5,355,810 |
def gs_tie(men, women, preftie):
"""
Gale-shapley algorithm, modified to exclude unacceptable matches
Inputs: men (list of men's names)
women (list of women's names)
pref (dictionary of preferences mapping names to list of sets of preferred names in sorted order)
Output: dictiona... | 5,355,811 |
def text_to_docs(text_id):
"""
Query a text against the OSP corpus.
Args:
text_id (int): A text row id.
"""
row = Text.get(Text.id==text_id)
doc_ids = set()
for tokens in row.queries:
# Execute the query.
results = config.es.search(
index='document'... | 5,355,812 |
def is_iterable(value):
"""Return True if the object is an iterable type."""
return hasattr(value, '__iter__') | 5,355,813 |
def get_search_app_by_model(model):
"""
:returns: a single search app (by django model)
:param model: django model for the search app
:raises LookupError: if it can't find the search app
"""
for search_app in get_search_apps():
if search_app.queryset.model is model:
return se... | 5,355,814 |
def opcode_Tj(renderer, string=b''):
"""Show a text string and move the position based on its length"""
renderer.render_text(string) | 5,355,815 |
def create_model_and_store_checkpoint(config: ModelConfigBase, checkpoint_path: Path,
weights_only: bool = True) -> None:
"""
Creates a Lightning model for the given model configuration, and stores it as a checkpoint file.
If a GPU is available, the model is moved to th... | 5,355,816 |
def prct_overlap(adata, key_1, key_2, norm=False, ax_norm="row", sort_index=False):
"""
% or cell count corresponding to the overlap of different cell types
between 2 set of annotations/clusters.
Parameters
----------
adata: AnnData objet
key_1: observational key corresponding to one ce... | 5,355,817 |
def keep_category(df, colname, pct=0.05, n=5):
""" Keep a pct or number of every levels of a categorical variable
Parameters
----------
pct : float
Keep at least pct of the nb of observations having a specific category
n : int
Keep at least n of the variables having a specific categ... | 5,355,818 |
def remove_scope_from_name(name, scope):
"""
Args:
name (str): full name of the tf variable with all the scopes
Returns:
(str): full name of the variable with the scope removed
"""
result = name.split(scope)[1]
result = result[1:] if result[0] == '/' else result
return resul... | 5,355,819 |
async def get_timers_matching(ctx, name_str, channel_only=True, info=False):
"""
Interactively get a guild timer matching the given string.
Parameters
----------
name_str: str
Name or partial name of a group timer in the current guild or channel.
channel_only: bool
Whether to ma... | 5,355,820 |
def comprehension_array(size=1000000):
"""Fills an array that is handled by Python via list comprehension."""
return [random() * i for i in range(size)] | 5,355,821 |
def handle_args():
"""Handles command-line parameters."""
global MODE
global VERBOSE
parser = argparse.ArgumentParser(description='Sync Gettext messages to Google Sheets.')
parser.add_argument('-v', '--verbose', action='store_true')
parser.add_argument('action', choices=['push', 'pull'])
a... | 5,355,822 |
def alignment(alpha, p, treatment):
"""Alignment confounding function.
Reference: Blackwell, Matthew. "A selection bias approach to sensitivity analysis
for causal effects." Political Analysis 22.2 (2014): 169-182.
https://www.mattblackwell.org/files/papers/causalsens.pdf
Args:
alpha (np.a... | 5,355,823 |
def percentiles(a, pcts, axis=None):
"""Like scoreatpercentile but can take and return array of percentiles.
Parameters
----------
a : array
data
pcts : sequence of percentile values
percentile or percentiles to find score at
axis : int or None
if not None, computes scor... | 5,355,824 |
def single_request(gh,kname='CVE exploit',page=1,per_page=50):
"""
解析单页仓库数据,获取CVE和exp标记
:return cve_list:list, cve id in each page by searching github.com
"""
cve=dict()
url="https://api.github.com/search/repositories?q={key_name}&sort=updated&order=desc&page={page}&per_page={per_page}".format(k... | 5,355,825 |
def do_setup():
"""Set-up folder structure and check flags."""
path_analysis = Path(cfg.get("LST1", "ANALYSIS_DIR")) / options.directory
path_dl1 = Path(cfg.get("LST1", "DL1_DIR")) / options.directory
path_dl2 = Path(cfg.get("LST1", "DL2_DIR")) / options.directory
path_sub_analysis = path_analysis /... | 5,355,826 |
def ownerOf(tokenId: bytes) -> UInt160:
"""
Get the owner of the specified token.
The parameter tokenId SHOULD be a valid NFT. If not, this method SHOULD throw an exception.
:param tokenId: the token for which to check the ownership
:type tokenId: ByteString
:return: the owner of the specified... | 5,355,827 |
def test_dequque_after():
"""Validating if front node was removed and didn't have the same value"""
assert new_queue.dequeue() != 'emma'
assert new_queue._size == 0 | 5,355,828 |
def stuff_context(sites, rup, dists):
"""
Function to fill a rupture context with the contents of all of the
other contexts.
Args:
sites (SiteCollection): A SiteCollection object.
rup (RuptureContext): A RuptureContext object.
dists (DistanceContext): A DistanceContext object.... | 5,355,829 |
def number_to_float(value):
"""The INDI spec allows a number of different number formats, given any, this returns a float
:param value: A number string of a float, integer or sexagesimal
:type value: String
:return: The number as a float
:rtype: Float
"""
# negative is True, if the value i... | 5,355,830 |
def spg_line_search_step_length(current_step_length, delta, f_old, f_new,
sigma_one=0.1, sigma_two=0.9):
"""Return next step length for line search."""
step_length_tmp = (-0.5 * current_step_length ** 2 * delta /
(f_new - f_old - current_step_length * delt... | 5,355,831 |
def group_by_iter(metrics_dict):
"""
Restructure our metrics dictionary to have the last list store all the trials' values \
for a given iteration, instead of all the iterations' values for a given trial.
:param metrics_dict: data for an experiment (output of parse_party_data)
:type metrics_dict: `... | 5,355,832 |
def calc_pv_invest(area, kw_to_area=0.125, method='EuPD'):
"""
Calculate PV investment cost in Euro
Parameters
----------
area : float
Photovoltaic area
kw_to_area : float , optional
Ratio of peak power to area (default: 0.125)
For instance, 0.125 means 0.125 kWp / m2 ar... | 5,355,833 |
def procrustes_2d(x, y, n_restart=10, scale=True):
"""Align two sets of coordinates using an affine transformation.
Attempts to find the affine transformation (composed of a rotation
matrix `r` and a transformation vector `t`) for `y` such that
`y_affine` closely matches `x`. Closeness is measures usin... | 5,355,834 |
def samps2ms(samples: float, sr: int) -> float:
"""samples to milliseconds given a sampling rate"""
return (samples / sr) * 1000.0 | 5,355,835 |
def dump_json(json_filepath: str, json_dict: Dict[Any, Any]):
"""
Function to serialize a Python dictionary into a JSON file.
The pretty printing is enabled by default.
Parameters
----------
json_filepath : str
Path to the JSON file to save to
json_dict : Dict[Any, Any]
... | 5,355,836 |
def nice_year(dt, lang=None, bc=False):
"""Format a datetime to a pronounceable year.
For example, generate 'nineteen-hundred and eighty-four' for year 1984
Args:
dt (datetime): date to format (assumes already in local timezone)
lang (string): the language to use, use Mycroft default langua... | 5,355,837 |
def unstub():
"""Unstubs all stubbed methods and functions"""
mock_registry.unstub_all() | 5,355,838 |
def get_results(job_id):
"""
Get the result of the job based on its id
"""
try:
job = Job.fetch(job_id, connection=conn)
if job.is_finished:
return jsonify({
"status": "finished",
"data": job.result
}), 200
elif job.is_f... | 5,355,839 |
def get_clean_dict(obj: HikaruBase) -> dict:
"""
Turns an instance of a HikaruBase into a dict without values of None
This function returns a Python dict object that represents the hierarchy
of objects starting at ``obj`` and recusing into any nested objects.
The returned dict **does not** include ... | 5,355,840 |
def _check_that_field_invisible_if_activatable_group_active_and_not(sdk_client: ADCMClient, path, app):
"""Check that field invisible if activatable group active and not."""
_, config = prepare_cluster_and_get_config(sdk_client, path, app)
group_name = path.split("/")[-1]
with allure.step('Check that f... | 5,355,841 |
def generate_html_frieze(type, value):
"""
Gets the data to be able to generate the frieze.
Calls the function to actually generate HTML.
Input:
- Type (session or dataset) of the second input
- A SQLAlchemy DB session or a dataset (list of mappings)
Output:
- The HTML to be... | 5,355,842 |
def get_folder_name(path, prefix=''):
"""
Look at the current path and change the name of the experiment
if it is repeated
Args:
path (string): folder path
prefix (string): prefix to add
Returns:
string: unique path to save the experiment
"""
if prefix == '':
p... | 5,355,843 |
def instantiate_model(model_to_train: str,
dataset_directory: str,
performance_directory: str,
gpu: Optional[bool] = None):
"""
A function to create the instance of the imported Class,
Classifier.
Args:
model_to_train (str): ... | 5,355,844 |
def is_probably_prime(x: int) -> bool:
"""
probabilistic primarity test (relatively low certainty)
"""
raise NotImplementedError("not implemented!") | 5,355,845 |
def generate_hmac_key():
"""
Generates a key for use in the :func:`~securitylib.advanced_crypto.hmac` function.
:returns: :class:`str` -- The generated key, in byte string.
"""
return generate_secret_key(HMAC_KEY_MINIMUM_LENGTH) | 5,355,846 |
def get_args():
"""! Command line parser for Utterance level classification Leave
one speaker out schema pipeline -- Find Best Models"""
parser = argparse.ArgumentParser(
description='Utterance level classification Leave one '
'speaker out schema pipeline -- Find Best Models' )
... | 5,355,847 |
def main() -> None:
"""Take user numerical grade input and provide letter grade equivalent. Continue until user enters 'n'"""
print('Letter Grade Converter')
continue_character: str = 'y'
while(continue_character.lower() == 'y'):
print()
numerical_grade: int = int(input('Enter nume... | 5,355,848 |
def uscensus(location, **kwargs):
"""US Census Provider
Params
------
:param location: Your search location you want geocoded.
:param benchmark: (default=4) Use the following:
> Public_AR_Current or 4
> Public_AR_ACSYYYY or 8
> Public_AR_Census2010 or 9
:param vintage: (... | 5,355,849 |
def log_error_and_raise(message, exception, logger):
""" logs an 'error' message and subsequently throws an exception
"""
logger.error(message)
raise exception(message) | 5,355,850 |
def getAllItemsWithName(name, cataloglist):
"""Searches the catalogs in a list for all items matching a given name.
Returns:
list of pkginfo items; sorted with newest version first. No precedence
is given to catalog order.
"""
def compare_item_versions(a, b):
"""Internal comparison ... | 5,355,851 |
def reco_source_position_sky(cog_x, cog_y, disp_dx, disp_dy, focal_length, pointing_alt, pointing_az):
"""
Compute the reconstructed source position in the sky
Parameters
----------
cog_x: `astropy.units.Quantity`
cog_y: `astropy.units.Quantity`
disp: DispContainer
focal_length: `astrop... | 5,355,852 |
def segment_annotations(table, num, length, step=None):
""" Generate a segmented annotation table by stepping across the audio files, using a fixed
step size (step) and fixed selection window size (length).
Args:
table: pandas DataFrame
Annotation table.
... | 5,355,853 |
def com_google_fonts_check_name_typographicsubfamilyname(ttFont, expected_style):
"""Check name table: TYPOGRAPHIC_SUBFAMILY_NAME entries."""
failed = False
nametable = ttFont['name']
win_name = nametable.getName(NameID.TYPOGRAPHIC_SUBFAMILY_NAME,
PlatformID.WINDOWS,
... | 5,355,854 |
def get_vdw_style(vdw_styles, cut_styles, cutoffs):
"""Get the VDW_Style section of the input file
Parameters
----------
vdw_styles : list
list of vdw_style for each box, one entry per box
cut_styles : list
list of cutoff_style for each box, one entry per box. For a
box with... | 5,355,855 |
def load_yaml_file(file):
"""
Loads a yaml file from file system.
@param file Path to file to be loaded.
"""
try:
with open(file, 'r') as yaml:
kwargs=ruamel.yaml.round_trip_load(yaml, preserve_quotes=True)
return kwargs
except subprocess.CalledProcessError as e:
... | 5,355,856 |
def test_arbitrage_make_compatible_quantity_increments_with_imcompatible_increments() -> None:
"""Should raise `ImcompatibleQuantityIncrementsError`.
Bid order quantity less than ask order quantity.
Different and imcompatible quantity increments. Make compatible.
"""
ask = ArbitragePayload(
... | 5,355,857 |
def freduce(x, axis=None):
"""
Reduces a spectrum to positive frequencies only
Works on the last dimension (contiguous in c-stored array)
:param x: numpy.ndarray
:param axis: axis along which to perform reduction (last axis by default)
:return: numpy.ndarray
"""
if axis is None:
... | 5,355,858 |
def init_pretraining_params(exe,
pretraining_params_path,
main_program):
"""load params of pretrained model, NOT including moment, learning_rate"""
assert os.path.exists(pretraining_params_path
), "[%s] cann't be found." % pretrai... | 5,355,859 |
def sort_shipping_methods(request):
"""Sorts shipping methods after drag 'n drop.
"""
shipping_methods = request.POST.get("objs", "").split('&')
assert (isinstance(shipping_methods, list))
if len(shipping_methods) > 0:
priority = 10
for sm_str in shipping_methods:
sm_id =... | 5,355,860 |
def appendRecordData(record_df, record):
"""
Args:
record_df (pd.DataFrame):
record (vcf.model._Record):
Returns:
(pd.DataFrame): record_df with an additional row of record (SNP) data.
"""
# Alternate allele bases
if len(record.ALT) == 0:
alt0, alt1 = n... | 5,355,861 |
def get_removed_channels_from_file(fn):
"""
Load a list of removed channels from a file.
Raises
------
* NotImplementedError if the file format isn't supported.
Parameters
----------
fn : str
Filename
Returns
-------
to_remove : list of str
List of channels... | 5,355,862 |
def invertHomogeneous(M, range_space_homogeneous=False, A_property=None):
""" Return the inverse transformation of a homogeneous matrix.
A homogenous matrix :math:`M` represents the transformation :math:`y = A x + b`
in homogeneous coordinates. More precisely,
..math:
M \tilde{x} = \left[ \begi... | 5,355,863 |
def rename(level_folder: str) -> int:
"""Rename a custom level folder to the correct name."""
prefix = load_info(level_folder)[PREFIX].strip()
suffix = load_info(level_folder)[SUFFIX].strip()
prefix = prefix.translate(str.maketrans('', '', string.punctuation))
suffix = suffix.translate(str.make... | 5,355,864 |
def in_line_mention(feature, features, mentions, line):
"""
Set *feature* to `True` for mentions that occur on *line*
Args:
feature: feature name
features: mapping from (lgname, lgcode) pair to features to values
mentions: list of language mentions
line: FrekiLine object to ... | 5,355,865 |
def show_department(department_id):
"""
Returns rendered template to show department with its employees.
:param department_id: department id
:return: rendered template to show department with its employees
"""
url = f'{HOST}api/department/{department_id}'
department = requests.get(url).json(... | 5,355,866 |
def archive_scan():
"""
Returns converted to a dictionary of functions to apply to parameters of archive_scan.py
"""
# Dictionary of default values setter, type converters and other applied functions
d_applied_functions = {
'favor': [bool_converter, favor_default],
'cnn': [bool_conve... | 5,355,867 |
def esOperador(o):
""""retorna true si 'o' es un operador"""
return o == "+" or o == "-" or o == "/" or o == "*" | 5,355,868 |
def valid_identity(identity):
"""Determines whether or not the provided identity is a valid value."""
valid = (identity == "homer") or (identity == "sherlock")
return valid | 5,355,869 |
def is_align_flow(*args):
"""
is_align_flow(ea) -> bool
"""
return _ida_nalt.is_align_flow(*args) | 5,355,870 |
async def async_setup_platform(hass, config, async_add_entities,
discovery_info=None):
"""Set up the OpenTherm Gateway binary sensors."""
if discovery_info is None:
return
gw_vars = hass.data[DATA_OPENTHERM_GW][DATA_GW_VARS]
sensor_info = {
# [device_class,... | 5,355,871 |
def avro_rdd(ctx, sqlContext, hdir, date=None, verbose=None):
"""
Parse avro-snappy files on HDFS
:returns: a Spark RDD object
"""
if date == None:
date = time.strftime("year=%Y/month=%-m/day=%-d", time.gmtime(time.time()-60*60*24))
path = '%s/%s' % (hdir, date)
elif len(str(da... | 5,355,872 |
def generate_gesture_trace(position):
"""
生成手势验证码轨迹
:param position:
:return:
"""
x = []
y = []
for i in position:
x.append(int(i.split(',')[0]))
y.append(int(i.split(',')[1]))
trace_x = []
trace_y = []
for _ in range(0, 2):
tepx = [x[_], x[_ + 1], x[... | 5,355,873 |
def parse_arguments():
"""parse_arguments"""
parser = argparse.ArgumentParser(description="MindSpore Tensorflow weight transfer")
parser.add_argument("--pretrained", default=None, type=str)
parser.add_argument("--name", default="imagenet22k", choices=["imagenet22k",])
args = parser.parse_args()
... | 5,355,874 |
def mad_daub_noise_est(x, c=0.6744):
""" Estimate the statistical dispersion of the noise with Median Absolute
Deviation on the first order detail coefficients of the 1d-Daubechies
wavelets transform.
"""
try:
_, cD = pywt.wavedec(x, pywt.Wavelet('db3'), level=1)
except ValueError:
... | 5,355,875 |
def slugify(value, allow_unicode=False):
"""
Convert to ASCII if 'allow_unicode' is False. Convert spaces to hyphens.
Remove characters that aren't alphanumerics, underscores, or hyphens.
Convert to lowercase. Also strip leading and trailing whitespace.
From Django's "django/template/defaultfilters... | 5,355,876 |
def get_categories() -> dict:
""" :return: dictionary with a hirachy of all categories """
with open("../src/categories.json", "r", encoding="utf-8") as f:
return json.load(f) | 5,355,877 |
def test_set_parameters_fusion(backend):
"""Check gate fusion when ``circuit.set_parameters`` is used."""
c = Circuit(2)
c.add(gates.RX(0, theta=0.1234))
c.add(gates.RX(1, theta=0.1234))
c.add(gates.CNOT(0, 1))
c.add(gates.RY(0, theta=0.1234))
c.add(gates.RY(1, theta=0.1234))
fused_c = c... | 5,355,878 |
def assert_cylindrical_isclose(cyl1: Cylindrical, cyl2: Cylindrical) -> None:
"""Checks two cylindricals are roughly equal."""
assert isclose(cyl1.p, cyl2.p)
assert isclose(cyl1.phi, cyl2.phi)
assert isclose(cyl1.z, cyl2.z) | 5,355,879 |
def check_file_integrity(indir, outdir):
""" Parse file in dir and check integrity """
dic_files={}
dic_param={}
dic_integ={}
for f in os.listdir(indir):
path= os.path.join(indir, f)
#if os.path.isdir(path)==True:
# print (str(f) + "is a dir" )
#elif os.path.i... | 5,355,880 |
def get_ax(rows=1, cols=1, size=16):
"""Return a Matplotlib Axes array to be used in
all visualizations in the notebook. Provide a
central point to control graph sizes.
Adjust the size attribute to control how big to render images
"""
_, ax = plt.subplots(rows, cols, figsize=(size*cols, siz... | 5,355,881 |
def build_arg_parser():
"""
Builds an argparse object to handle command-line arguments passed in.
"""
parser = argparse.ArgumentParser(description="Loads an ontology file in " +
"OBO file format into a Neo4j graph database.")
parser.add_argument('-i', '--input_obo_file', ... | 5,355,882 |
def check_layer_hessians_psd(layers):
"""Check layer Hessians for positive semi-definiteness."""
for l in layers:
if isinstance(l, HBPLinear):
assert all_eigvals_nonnegative(
matrix_from_mvp(l.bias.hvp, dims=2 * (l.bias.numel(),))
)
assert all_eigvals_... | 5,355,883 |
def createSynthModel():
"""Return the modeling mesh, the porosity distribution and the
parametric mesh for inversion.
"""
# Create the synthetic model
world = mt.createCircle(boundaryMarker=-1, segments=64)
tri = mt.createPolygon([[-0.8, -0], [-0.5, -0.7], [0.7, 0.5]],
... | 5,355,884 |
def edits_dir():
"""
Return the directory for the editable files (used by the
website).
"""
return _mkifnotexists("") | 5,355,885 |
def get_expected(stage, test_block_config, sessions):
"""Get expected responses for each type of request
Though only 1 request can be made, it can cause multiple responses.
Because we need to subcribe to MQTT topics, which might be formatted from
keys from included files, the 'expected'/'response' nee... | 5,355,886 |
def convolve_hrf(X, onsets, durations, n_vol, tr, ops=100):
"""
Convolve each X's column iteratively with HRF and align with the timeline of BOLD signal
parameters:
----------
X[array]: [n_event, n_sample]
onsets[array_like]: in sec. size = n_event
durations[array_like]: in sec. size = n_ev... | 5,355,887 |
def flatten(x, params):
"""
Plain ol' 2D flatten
:param x: input tensor
:param params: {dict} hyperparams (sub-selection)
:return: output tensor
"""
return layers.Flatten()(x) | 5,355,888 |
def xml_unescape(text):
""" Do the inverse of `xml_escape`.
Parameters
----------
text: str
The text to be escaped.
Returns
-------
escaped_text: str
"""
return unescape(text, xml_unescape_table) | 5,355,889 |
def p_entry_open_close(t):
"""entry : comment
| open
| close
| note
| balance
| pad"""
t[1].build()
t[0] = t[1] | 5,355,890 |
def test_validate_variants(dummy_data):
"""Ensure that only valid variants are being returned in the correct
format"""
bam_files, vcf_files = dummy_data
registry = Registry(bam_files, vcf_files)
random_start = bam_files[2]
test_colony = Colony(random_start, registry)
print(random_start)
... | 5,355,891 |
def tseb_pt(T_air, T_rad, u, p, z, Rs_1, Rs24, vza, zs,
aleafv, aleafn, aleafl, adeadv, adeadn, adeadl,
albedo, ndvi, lai, clump, hc, time, t_rise, t_end,
leaf_width, a_PT_in=1.32, iterations=35):
"""Priestley-Taylor TSEB
Calculates the Priestley Taylor TSEB fluxes using a s... | 5,355,892 |
def GetPrivateIpv6GoogleAccessTypeMapper(messages, hidden=False):
"""Returns a mapper from text options to the PrivateIpv6GoogleAccess enum.
Args:
messages: The message module.
hidden: Whether the flag should be hidden in the choice_arg
"""
help_text = """
Sets the type of private access to Google ser... | 5,355,893 |
def register(base_command):
"""
Registers `leapp upgrade`
"""
base_command.add_sub(upgrade) | 5,355,894 |
def calc_director(moi):
""" Calculate the director from a moment of inertia.
The director is the dominant eigenvector of the MOI tensor
Parameters:
-----------
moi : list
3x3 array; MOItensor
Returns:
--------
director : list
3 element list of director vector
"""
... | 5,355,895 |
def _solve_upper_triangular(A, b):
""" Solves Ax=b when A is upper triangular. """
return solve_triangular(A, b, lower=False) | 5,355,896 |
def check_create_account_key(key):
"""
Returns the user_id if the reset key is valid (matches a user_id and that
user does not already have an account). Otherwise returns None.
"""
query = sqlalchemy.text("""
SELECT user_id
FROM members
WHERE create_account_key = :k
AND user_id NOT IN (SELEC... | 5,355,897 |
def find_gaia_files_hp(nside, pixlist, neighbors=True):
"""Find full paths to Gaia healpix files in a set of HEALPixels.
Parameters
----------
nside : :class:`int`
(NESTED) HEALPixel nside.
pixlist : :class:`list` or `int`
A set of HEALPixels at `nside`.
neighbors : :class:`bool... | 5,355,898 |
def _crc16(data, start = _CRC16_START) :
"""Compute CRC16 for bytes/bytearray/memoryview data"""
crc = start
for b in data :
crc ^= b << 8
for _ in range(8) :
crc = ((crc << 1) & 0xFFFF) ^ _CRC16_POLY if crc & 0x8000 else (crc << 1)
return crc | 5,355,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.