content stringlengths 22 815k | id int64 0 4.91M |
|---|---|
def resolve_grant_endpoint(doi_grant_code):
"""Resolve the OpenAIRE grant."""
# jsonresolver will evaluate current_app on import if outside of function.
from flask import current_app
pid_value = '10.13039/{0}'.format(doi_grant_code)
try:
_, record = Resolver(pid_type='grant', object_type='re... | 5,349,300 |
def from_tiff(path: Union[Path, str]) -> OME:
"""Generate OME metadata object from OME-TIFF path.
This will use the first ImageDescription tag found in the TIFF header.
Parameters
----------
path : Union[Path, str]
Path to OME TIFF.
Returns
-------
ome: ome_types.model.ome.OME... | 5,349,301 |
def increase_structure_depth(previous_architecture, added_block, problem_type):
"""Returns new structure given the old one and the added block.
Increases the depth of the neural network by adding `added_block`.
For the case of cnns, if the block is convolutional, it will add it before
the flattening operation.... | 5,349,302 |
def elina_linexpr0_set_cst_scalar_double(linexpr, num):
"""
Set the constant of an ElinaLinexpr0 by using a c_double.
Parameters
----------
linexpr : ElinaLinexpr0Ptr
Destination.
num : c_double
Source.
Returns
-------
None
"""
try:
elina_linexpr0_... | 5,349,303 |
def create_table_string(data, highlight=(True, False, False, False), table_class='wikitable', style=''):
"""
Takes a list and returns a wikitable.
@param data: The list that is converted to a wikitable.
@type data: List (Nested)
@param highlight: Tuple of rows and columns that should be highlighte... | 5,349,304 |
def group_tokens(tokens):
"""
Join and separate tokens to be more suitable for diffs.
Transformations:
- Empty tokens are removed
- Text containing newlines is split to have the newline be one token
- Other sequential whitespace tokens are joined
- Token types which contain freeform text (i... | 5,349,305 |
def path_to_dnd(path: Path) -> str:
"""Converts a `Path` into an acceptable value for `tkinterdnd2.`"""
# tkinterdnd2 will only accept fs paths with forward slashes, even on Windows.
wants_sep = '/'
if os.path.sep == wants_sep:
return str(path)
else:
return wants_sep.join(str(path).... | 5,349,306 |
def modify_reflection(args, json_reflection, rid):
"""
modify a reflection
"""
base_url, token = get_base_url_token(args)
x = _modify_reflection(token, base_url, rid, json_reflection, ssl_verify=args.get("ssl_verify", True))
click.echo(json.dumps(x)) | 5,349,307 |
async def current_page_error(call: CallbackQuery):
"""The function handles clicking on the current page"""
await call.answer(cache_time=60) | 5,349,308 |
def registry_dispatcher_document(self, code, collection):
"""
This task receive a list of codes that should be queued for DOI registry
"""
return _registry_dispatcher_document(code, collection, skip_deposited=False) | 5,349,309 |
def get_reddit_oauth_scopes(
scopes: Collection[str] | None = None,
) -> dict[str, dict[str, str]]:
"""Get metadata on the OAUTH scopes offered by the Reddit API."""
# Set up the request for scopes
scopes_endpoint = "/api/v1/scopes"
scopes_endpoint_url = REDDIT_BASE_URL + scopes_endpoint
headers... | 5,349,310 |
def loop_filtering(preprocessed_file: str = None,
unprocessed_text_file: str = None,
output_file: str = r'./preprocessed_filtered.txt',
unprocessed_filtered_file: str = r'./unprocessed_filtered.txt',
saved_file: str = None,
t... | 5,349,311 |
def beta_reader(direc):
"""
Function to read in beta values for each tag
"""
path = direc
H_beta = np.loadtxt('%s/Beta Values/h_beta_final2.txt' % path)
Si_beta = np.loadtxt('%s/Beta Values/si_beta_final2.txt' % path)
He_emi_beta = np.loadtxt('%s/Beta Values/he_emi_beta_final2.txt' % path)
... | 5,349,312 |
def import_people(
ctx: DataFunctionContext,
user_key: str,
use_sample: bool = False,
):
"""
Params:
user_key: User API key from crunchbase.
use_sample: Whether to use the sample bulk CSV endpoint (default False)
"""
base_import(
data_source="people",
user_key... | 5,349,313 |
def boto3_s3_upload(s3, dst, file):
"""Upload Item to s3.
:param s3: -- Sqlalchemy session object.
:param dst: -- str. Location to storage ???
:param file: -- ???. File object.
Return Type: Bool
"""
s3.Object(settings.config_type['AWS_BUCKET'], file).put(Body=open(os.path.join(dst, file), ... | 5,349,314 |
def get_logging_format():
"""return the format string for the logger"""
formt = "[%(asctime)s] %(levelname)s:%(message)s"
return formt | 5,349,315 |
def plot_hydrogen_balance(results):
""" Plot the hydrogen balance over time """
n_axes = results["times"].shape[0]
fig = plt.figure(figsize=(6.0, 5.5))
fig.suptitle('Hydrogen production and utilization over the year', fontsize=fontsize+1, fontweight='normal', color='k')
axes = fig.subplots(n_axes)
... | 5,349,316 |
def ref_dw(fc, fmod):
"""Give the reference value for roughness by linear interpolation from the data
given in "Psychoacoustical roughness:implementation of an optimized model"
by Daniel and Weber in 1997
Parameters
----------
fc: integer
carrier frequency
fmod: integer
modu... | 5,349,317 |
def points_2d_inside_image(
width: int,
height: int,
camera_model: str,
points_2d: np.ndarray,
points_3d: Optional[np.ndarray] = None,
) -> np.ndarray:
"""Returns the indices for an array of 2D image points that are inside the image canvas.
Args:
width: Pixel width of the image canv... | 5,349,318 |
def list2tensors(some_list):
"""
:math:``
Description:
Implemented:
[True/False]
Args:
(:):
(:):
Default:
Shape:
- Input: list
- Output: list of tensors
Examples::
"""
t_list=[]
for i in some_list:
t_lis... | 5,349,319 |
def print_sys_info(verbosity=None):
"""Print package information as a formatted table."""
global _COL_MAX
pkgs = get_info_fluiddyn()
pkgs_third_party = get_info_third_party()
widths = None
width_pkg_name = 0
for _pkgs in (pkgs, pkgs_third_party):
for pkg_name, pkg_details in _pkgs.i... | 5,349,320 |
def interpret_input(inputs):
""" convert input entries to usable dictionaries """
for key, value in inputs.items(): # interpret each line's worth of entries
if key in ['v0', 'y0', 'angle']: # for variables, intepret distributions
converted = interpret_distribution(key,... | 5,349,321 |
def time(prompt=None, output_hour_clock=24, milli_seconds=False, fill_0s=True, allow_na=False):
"""
Repeatedly ask the user to input hours, minutes and seconds until they input valid values and return this in a defined format
:param prompt: Message to display to the user before asking them for inputs. Defa... | 5,349,322 |
def main():
"""
Simple tests for the L3OrderBookManager class
"""
os.system("cls")
print("------------ORDERBOOK TEST------------")
order_book = L3OrderBookManager()
# Testing insertion
order1 = create_order(1, 100, 10, 1, 2)
order2 = create_order(2, 100, 20, 1, 2)
order3 = creat... | 5,349,323 |
def update_notes(text1, text2, index):
"""
Displays notes with the given index in given text widgets.
If index is lower than 0, displays notes for index 0.
If index is higher than the highest index there are
notes for the text widgets are left empty.
text2 is always given the notes at index (index + 1) if exis... | 5,349,324 |
def PySys_GetFile(space, name, def_):
"""Return the FILE* associated with the object name in the
sys module, or def if name is not in the module or is not associated
with a FILE*."""
raise NotImplementedError | 5,349,325 |
def byol_a_url(ckpt, refresh=False, *args, **kwargs):
"""
The model from URL
ckpt (str): URL
"""
return byol_a_local(_urls_to_filepaths(ckpt, refresh=refresh), *args, **kwargs) | 5,349,326 |
def parse_csv_row(obj: dict[str, Any], rowtype: str, content: str) -> None:
"""Parses a row in the CSV."""
if rowtype == 'row':
if 'dataset_labels' not in obj:
obj['dataset_labels'] = defaultdict(list)
assert '|' in content
ds, ds_label = content.split('|')
obj['data... | 5,349,327 |
def bellman_ford(g, start):
"""
Given an directed graph with possibly negative edge weights and with n vertices and m edges as well
as its vertex s, compute the length of shortest paths from s to all other vertices of the graph.
Returns dictionary with vertex as key.
- If vertex not present in th... | 5,349,328 |
def _read_date(settings_file):
"""Get the data from the settings.xml file
Parameters
----------
settings_file : Path
path to settings.xml inside open-ephys folder
Returns
-------
datetime
start time of the recordings
Notes
-----
The start time is present in the... | 5,349,329 |
def conv_res_step(x, hparams, padding, mask):
"""One step of convolutions and mid-residual."""
k = (hparams.kernel_height, hparams.kernel_width)
k2 = (hparams.large_kernel_size, 1)
dilations_and_kernels1 = [((1, 1), k), ((1, 1), k)]
dilations_and_kernels2 = [((1, 1), k2), ((4, 4), k2)]
with tf.variable_scop... | 5,349,330 |
def _get_kind_name(item):
"""Returns the kind name in CollectionDef.
Args:
item: A data item.
Returns:
The string representation of the kind in CollectionDef.
"""
if isinstance(item, (six.string_types, six.binary_type)):
kind = "bytes_list"
elif isinstance(item, six.integer_types):
kind = ... | 5,349,331 |
def set_default_config(app):
"""
:param app:
"""
app.config.setdefault('RB_DEFAULT_ACCEPTABLE_MIMETYPES', {
v.mimetype for _, v in DEFAULT_BUILDERS.items()
})
app.config.setdefault('RB_DEFAULT_RESPONSE_FORMAT', DEFAULT_BUILDERS['json'].mimetype)
app.config.setdefault('RB_FORMAT_KEY'... | 5,349,332 |
def Froude_number(v, h, g=9.80665):
"""
Calculate the Froude Number of the river, channel or duct flow,
to check subcritical flow assumption (if Fr <1).
Parameters
------------
v : int/float
Average velocity [m/s].
h : int/float
Mean hydrolic depth float [m].
g : in... | 5,349,333 |
def handle_error(
func: Callable[[Command | list[Command]], Any]
) -> Callable[[str], Any]:
"""Handle tradfri api call error."""
@wraps(func)
async def wrapper(command: Command | list[Command]) -> None:
"""Decorate api call."""
try:
await func(command)
except Request... | 5,349,334 |
def write(ser, command, log):
"""Write command to serial port, append what you write to log."""
ser.write(command)
summary = " I wrote: " + repr(command)
log += summary + "\n"
print summary
return log | 5,349,335 |
def update(probabilities, one_gene, two_genes, have_trait, p):
"""
Add to `probabilities` a new joint probability `p`.
Each person should have their "gene" and "trait" distributions updated.
Which value for each distribution is updated depends on whether
the person is in `have_gene` and `have_trait`... | 5,349,336 |
def anscombe(x):
"""Compute Anscombe transform."""
return 2 * np.sqrt(x + 3 / 8) | 5,349,337 |
def max_accuracy(c1, c2):
"""
Relabel the predicted labels *in order* to
achieve the best accuracy, and return that
score and the best labelling
Parameters
----------
c1 : np.array
numpy array with label of predicted cluster
c2 : np.array
numpy array with label of true ... | 5,349,338 |
def create_sphere():
"""Create and return a single sphere of radius 5."""
sphere = rt.sphere()
sphere.radius = 5
return sphere | 5,349,339 |
def calc_entropy(data):
"""
Calculate the entropy of a dataset.
Input:
- data: any dataset where the last column holds the labels.
Returns the entropy of the dataset.
"""
entropy = 0.0
###########################################################################
# TODO: Implement... | 5,349,340 |
def get_input(prompt=None):
"""Sets the prompt and waits for input.
:type prompt: None | list[Text] | str
"""
if not isinstance(prompt, type(None)):
if type(prompt) == str:
text_list = [Text(prompt, color=prompt_color,
new_line=True)]
elif type(... | 5,349,341 |
def alpha_liq(Nu, lyambda_feed, d_inner):
"""
Calculates the coefficent of heat transfer(alpha) from liquid to wall of pipe.
Parameters
----------
Nu : float
The Nusselt criterion, [dimensionless]
lyambda_feed : float
The thermal conductivity of feed, [W / (m * degreec celcium)]
... | 5,349,342 |
def get_dataset(opts):
""" Dataset And Augmentation
"""
if opts.dataset == 'camvids':
mean, std = camvids.get_norm()
train_transform = train_et.ExtCompose([
# et.ExtResize(size=opts.crop_size),
train_et.ExtRandomScale((0.5, 2.0)),
train_et.ExtRandomHorizo... | 5,349,343 |
def gen_sankey_diagram_distribute_query(query_statement, params, final_entites_name):
"""
桑基图数据分布查询
:param query_statement:
:param params:
:param final_entites_name:
:return:
"""
query_statement = dgraph_get_project_count(query_statement)
# 第一层的节点
first_level_sql = """select a.c... | 5,349,344 |
def draw_rotation_button(button_data: ButtonData) -> None:
"""Draw the rotation button according to the button data given. This
essentially consists into filling the button surface and drawing a little
arrow onto it.
"""
if button_data['drawable']:
button_surface = button_data['surface']
... | 5,349,345 |
def declare(objective:str, displayname:str=None, criteria:str="dummy"):
"""
objective:str -> The id/name given to a scoreboard
displayname:str -> The name that will be displayed on screen
criteria:str -> The criteria of the scoreboard
"""
f = f"scoreboard objectives add {objective} {criteria}"
... | 5,349,346 |
def complement_angle(angle):
""" 90 minus angle, in degrees"""
return 90 - angle; | 5,349,347 |
def parse_custom_commands(command, separator=";"):
"""Parse run custom command string into the commands list
:param str command: run custom [config] command(s)
:param str separator: commands separator in the string
:rtype: list[str]
"""
if not command:
return []
return command.stri... | 5,349,348 |
def lower_volatility_band(c, dev_target, band_target, center_target):
"""
| Calculates the lower volatility band
| Name: lower\_volatility\_band\_\ **c**\ \_times\_\ **band_target.name**\ &\ **dev_target.name**\ \_over\_\ **center_target.name**
:param c: Multiplier constant
:type c: float
:para... | 5,349,349 |
def find_by_attr(node, value, name="name", maxlevel=None):
"""Identical to :any:`search.find_by_attr` but cached."""
return search.find_by_attr(node, value, name=name, maxlevel=maxlevel) | 5,349,350 |
def training(request):
""" Function: training
* training top
"""
def _get_selected_object():
project_name = request.session.get('training_view_selected_project', None)
selected_project = Project.objects.get(name=project_name)
model_name = request.session.get('training_v... | 5,349,351 |
def remind(phenny, input):
"""Set a reminder"""
m = r_command.match(input.bytes)
if not m:
return phenny.reply("Sorry, didn't understand the input.")
length, scale, message = m.groups()
length = float(length)
factor = scaling.get(scale, 60)
duration = length * factor
if durat... | 5,349,352 |
def compile_shader(path_to_glslc, shader_path, stage, out_name, md5_name):
"""
-fauto-map-locations SPIR-V and later GLSL versions require inputs and outputs to be bound to an attribute location, this just assigns them automagically
-fauto-bind-uniforms SPIR-V and later GLSL versions require uniforms to ha... | 5,349,353 |
def set_random_seed(seed, device=None):
""" Set random seed before running training.
Refs:
https://qiita.com/TokyoMickey/items/cc8cd43545f2656b1cbd
https://github.com/chainer/chainer/issues/4550
"""
print(
"==> Set manual random seed to {} in process PID={} PPID={} on device={}"... | 5,349,354 |
def get_timestamps_from_sensor_folder(sensor_folder_wildcard: str) -> NDArrayInt:
"""Timestamp always lies at end of filename.
Args:
sensor_folder_wildcard: string to glob to find all filepaths for a particular
sensor files within a single log run
Returns:
Numpy array o... | 5,349,355 |
def plot(topography, subplot_location=111):
"""
Plot an image of the topography using matplotlib.
Parameters
----------
topography : :obj:`SurfaceTopography`
Height information
"""
# We import here because we don't want a global dependence on matplotlib
import matplotlib.pyplot ... | 5,349,356 |
def vehicles_missing(request):
"""
Displays to users their theft reports
"""
reports = TheftReport.objects.all()
return render(request, "vms/theft_reports.html", {
'reports': reports,
}) | 5,349,357 |
def isfile(path):
"""
Test for existence of input file.
"""
if not os.path.isfile(path):
log("Input file not found: %s" % path)
sys.exit(1)
else:
return os.path.abspath(path) | 5,349,358 |
def create_distribution_p_dest(tfs):
""" Calculates probability distributions of choosing a destination.
Note that city zones correspond to positions in datatensor and not
the origional IDs from the city_zone_coordinates.index array.
"""
p_dest = np.zeros(
(
tfs.number_zones,
... | 5,349,359 |
def get_limits(data):
""" Get the x, y ranges of the ST data.
"""
y_min = 1e6
y_max = -1e6
x_min = 1e6
x_max = -1e6
for doc in data:
x = doc["x"]
y = doc["y"]
y_min = y if y < y_min else y_min
y_max = y if y > y_max else y_max
x_min = x if x < x_min e... | 5,349,360 |
def test_upload_list(staff_client):
"""Listview does not support GET"""
response = staff_client.get(api_path)
assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED | 5,349,361 |
def get_bool(prompt: str | None = None, default: bool = False) -> bool:
"""Gets a boolean response from the command line.
:param prompt: Input prompt.
:param default: Default value used if no characters are typed.
:return: Input boolean.
"""
input_str = input(_prompt_from_message(prompt, defau... | 5,349,362 |
def create_config_file(access_key='', secret_key=''):
"""
Creates a config file for secret stuff. Option to provide keys.
Parameters:
access_key: Unsplash access key.
secret_key: Unsplash secret key.
"""
config = configparser.ConfigParser()
if not os.path.exists('config.ini'):
... | 5,349,363 |
def proj_helsinki(x, y):
"""Project Helsinki coordinates into ETRS-GK25 (EPSG:3879).
https://www.hel.fi/helsinki/fi/kartat-ja-liikenne/kartat-ja-paikkatieto/paikkatiedot+ja+-aineistot/koordinaatistot_ja+_korkeudet/koordinaatti_ja_korkeusjarjestelmat # pylint: disable=line-too-long
"""
# pylint: disable... | 5,349,364 |
def _check_start_stop(raw, start, stop):
"""Aux function."""
out = list()
for st in (start, stop):
if st is None:
out.append(st)
else:
try:
out.append(_ensure_int(st))
except TypeError: # not int-like
out.append(raw.time_as... | 5,349,365 |
def main(function, js):
"""Console script for es_reindex."""
args = json.loads(js)
config = args['config']
# e.g. --json='{"config": "./es_index_tool/data/example_config.json"}'
tool = ESIndexTool(config_path=config)
if 'id' not in args:
tool.reindex()
else:
# e.g., --json='{... | 5,349,366 |
def read(
datapath,
qt_app=None,
dataplus_format=True,
gui=False,
start=0,
stop=None,
step=1,
convert_to_gray=True,
series_number=None,
use_economic_dtype=True,
dicom_expected=None,
orientation_axcodes="original",
**kwargs
):
"""Returns 3D data and its metadata.
... | 5,349,367 |
def simulate(rmg, diffusion_limited=True):
"""
Simulate the RMG job and run the sensitivity analysis if it is on, generating
output csv files
diffusion_limited=True implies that if it is a liquid reactor diffusion limitations will be enforced
otherwise they will not be in a liquid reactor
"""
... | 5,349,368 |
def test_sombrero_start():
"""
Checks if the second and last values are right.
"""
xbegin = -0.899999995500383
ybegin = 8.99884295089148e-06
test = so.stingray(0.18, -0.9, 0, 50)
assert math.isclose(test[0][1], xbegin)
assert math.isclose(test[1][1], ybegin) | 5,349,369 |
def sum_squares2(n):
"""
Returns: sum of squares from 1 to n-1
Example: sum_squares(5) is 1+4+9+16 = 30
Parameter n: The number of steps
Precondition: n is an int > 0
"""
# Accumulator
total = 0
print('Before while')
x = 0
while x < n:
print('Start loo... | 5,349,370 |
def make_bgm(
music_path_list: list,
output_dir: str,
output_tmp_filename: str,
music_total_time: int = 0,
fade_time: list = [1000, 1000],
) -> str:
"""
调整BGM时长以适应视频
Args:
music_path_list (list): BGM文件的存放路径
output_dir (str): 转换过后BGM文件的输出路径
output_tmp_filename (st... | 5,349,371 |
def read_image(src):
"""Read and resize individual images"""
im = cv2.imread(src, cv2.IMREAD_COLOR)
im = cv2.resize(im, (COLS, ROWS), interpolation=cv2.INTER_CUBIC)
return im | 5,349,372 |
def add_db_entry():
"""
Store received data to database if validation is okay
:return: validation information and error code
"""
data = request.get_json()
app.logger.debug("Received Data (POST)")
app.logger.debug(pformat(data))
# Make sure the data is valid
validation, err_... | 5,349,373 |
def pattern_classifier(data, pattern_threshold):
"""Return an array mask passing our selection."""
return data["key_pattern"] > pattern_threshold | 5,349,374 |
def is_scalar(a) -> bool:
"""
Tests if a python object is a scalar (instead of an array)
Parameters
----------
a : object
Any object to be checked
Returns
-------
bool
Whether the input object is a scalar
"""
if isinstance(a, (list, tuple)):
return False... | 5,349,375 |
def median(ts: TimeSeries, /, window_length: int = 3) -> TimeSeries:
"""
Calculate a moving median.
On n-dimensional data, filtering occurs on the first axis (time).
Parameters
----------
ts
Input TimeSeries
window_length
Optional. Kernel size, must be odd. The default is ... | 5,349,376 |
def execute_read_query(connection, query):
"""Execute a read query on the postgres database.
Args:
connection (Psycopg2 Connection): The connection to the postgres database.
query (string): The SQL query to be run.
Returns:
list(tuples): The results of the SQL query.
"""
l... | 5,349,377 |
def extract_strings_from_file(filename):
"""
extracts strings from a provided filename
Returns the a list of extracted strings found in a provided filename.
Entries are stripped when processing and lines leading with a comment are
ignored.
Args:
filename: the filename
Returns:
... | 5,349,378 |
def event_income():
"""
>>> SELECT event.name, SUM((((registration.ticket * (100 - registration.discount)) * event.ticket_price) / 100)) AS price
FROM registration INNER JOIN event ON (registration.event_id = event.id) GROUP BY event.name
"""
tickets_price = F('ticket') * (100 - F('discount')) *... | 5,349,379 |
def convert_polynomial_coefficients(A_in, B_in, C_in, D_in, oss=False, inverse=False,
parent_aperture=None):
"""Emulate some transformation made in nircam_get_polynomial_both.
Written by Johannes Sahlmann 2018-02-18, structure largely based on nircamtrans.py code
by Coli... | 5,349,380 |
def spinner_runner_factory(spec, t_compile, extra_commands):
"""Optimized spinner runner, which receives the spec of an animation, and controls
the flow of cycles and frames already compiled to a certain screen length and with
wide chars fixed, thus avoiding any overhead in runtime within complex spinners,
... | 5,349,381 |
def _project_im_rois(im_rois, im_scale_factor, im_crop):
"""Project image RoIs into the rescaled training image."""
im_rois[:, 0] = np.minimum(
np.maximum(im_rois[:, 0], im_crop[0]), im_crop[2])
im_rois[:, 1] = np.minimum(
np.maximum(im_rois[:, 1], im_crop[1]), im_crop[3])
im_rois[:, 2] ... | 5,349,382 |
def evaluate_error_absolute(poses_to_test: List[Tuple[str, kapture.PoseTransform]],
poses_ground_truth: List[Tuple[str, kapture.PoseTransform]]
) -> List[Tuple[str, float, float]]:
"""
Evaluate the absolute error for poses to a ground truth.
:param po... | 5,349,383 |
def restricted_offset(parent_dimensions, size, offset):
""" Get offset restricted by various factors
"""
limit_x = (parent_dimensions[0] - size[0]) / 2
limit_y = (parent_dimensions[1] - size[1]) / 2
x = clamp(offset[0], -limit_x, limit_x)
y = clamp(offset[1], -limit_y, limit_y)
return x, y | 5,349,384 |
def plot_object_var(ax, arr, top=10, color=DEFAULT_COLOR, label=None, alpha=1.):
"""Plots a bar plot into an matplotlib axe.
Parameters
----------
ax: plt.axes.Axes
axe where to add the plot
arr: array like
Array of object values
color: str (default DEFAULT_COLOR)
color... | 5,349,385 |
def wt_sgrna(target='none'):
"""
Return the wildtype sgRNA sequence.
The construct is composed of 3 domains: stem, nexus, and hairpins. The
stem domain encompasses the lower stem, the bulge, and the upper stem.
Attachments are allowed pretty much anywhere, although it would be prudent
to r... | 5,349,386 |
def export_nodes(nodes, csvfilepath):
"""
Writes the standard nodes data in `nodes` to the CSV file at `csvfilepath`.
"""
with open(csvfilepath, "w") as csv_file:
csvwriter = csv.DictWriter(csv_file, STANDARD_NODE_HEADER_V0)
csvwriter.writeheader()
for node in nodes:
... | 5,349,387 |
def _var_network(graph,
add_noise=True,
inno_cov=None,
invert_inno=False,
T=100,
initial_values=None):
"""Returns a vector-autoregressive process with correlated innovations.
Useful for testing.
Example:
graph=num... | 5,349,388 |
def build_features(component, borders, initial_group):
"""
Integrate peaks within similarity components and build features
:param component: a groupedROI object
:param borders: dict - key is a sample name, value is a (n_borders x 2) matrix;
predicted, corrected and transformed to normal values b... | 5,349,389 |
def test_rl():
"""Test the RL algorithm using an openai gym environment"""
ENVS = ('Pendulum-v0', 'MountainCarContinuous-v0', 'BipedalWalker-v3', 'LunarLanderContinuous-v2',
'BipedalWalkerHardcore-v3')
ENV = ENVS[0]
model_dir = os.path.join(os.getcwd(), 'models')
os.makedirs(os.path.j... | 5,349,390 |
def get_cred_fh(library: str) -> str:
"""
Determines correct SimplyE credential file
"""
if library == "BPL":
return ".simplyE/bpl_simply_e.yaml"
elif library == "NYPL":
return ".simplyE/nyp_simply_e.yaml"
else:
raise ValueError("Invalid library code passsed") | 5,349,391 |
def create_app(enviornment):
"""Construct the core application."""
app = Flask(__name__, static_url_path = "")
app.config.from_object(Config)
if enviornment == 'test':
app.config['TESTING'] = True
return app
db.init_app(app)
with app.app_context():
# Imports
fr... | 5,349,392 |
async def on_member_update(before: Member, after: Member):
""" """
# todo
pass | 5,349,393 |
def list_characters(caller, character_list, roster_type="Active Characters", roster=None,
titles=False, hidden_chars=None, display_afk=False, use_keys=True):
"""
Formats lists of characters. If we're given a list of 'hidden_chars', we compare
the list of names in character_list to that, ... | 5,349,394 |
def initLogging(logFilename):
"""Init for logging
"""
logging.basicConfig(
level = logging.DEBUG,
#format = '%(name)-12s.%(lineno)-4d %(levelname)-8s %(message)s',
format = 'LINE %(lineno)-4d %(levelname)-8s %(message)s',
# ('%(name)-1... | 5,349,395 |
def test_list_g_day_max_length_nistxml_sv_iv_list_g_day_max_length_1_2(mode, save_output, output_format):
"""
Type list/gDay is restricted by facet maxLength with value 5.
"""
assert_bindings(
schema="nistData/list/gDay/Schema+Instance/NISTSchema-SV-IV-list-gDay-maxLength-1.xsd",
instanc... | 5,349,396 |
def destroyDomain():
"""
Delete the domain. Warning, deletes all items as well!
"""
global sdbConnection
global sdbDomain
sdbConnect()
try:
sdbConnection.delete_domain(config.AWS_SDB_DOMAIN_NAME)
sdbDomain = None
return
except Exception as e:
debug(e)
... | 5,349,397 |
def weighted_percentiles(a, percentiles, weights=None):
"""Compute weighted percentiles by using interpolation of the weighted ECDF.
Parameters
----------
a : np.ndarray
Vector of data for computing quantiles
percentiles : np.ndarray
Vector of percentiles in [0, 100]
weights... | 5,349,398 |
def mirror_image(images: List[str], registry: Registry):
"""Synchronize all source images to target registry, only pushing changed layers."""
sync_config = SyncConfig(
version=1,
creds=[registry.creds],
sync=[sync_asset(image, registry) for image in images],
)
with NamedTemporary... | 5,349,399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.