content stringlengths 42 6.51k |
|---|
def uvdist2impix(uvdist, imres):
"""
Convert UV disance to image pixels.
Parameters
----------
uvdist: float
UV distance in wavelength
imres: float
Angular resolution of the image pixel in radian
"""
psf_angle = 1. / uvdist
return psf_angle / imres |
def range_overlap(a_min, a_max, b_min, b_max):
"""
Neither range is completely greater than the other
"""
return (a_min <= b_max) and (b_min <= a_max) |
def is_prime(n):
"""
What comes in: An integer n >= 2.
What goes out:
-- Returns True if the given integer is prime,
else returns False.
Side effects: None.
Examples:
-- is_prime(11) returns True
-- is_prime(12) returns False
-- is_prime(2) returns True
No... |
def yellow(text):
""" Print text in yellow to the console """
return "\033[33m" + text + "\033[0m" |
def setActivationThreshold(ar):
"""
@param ar: The new activation threshold
@type ar: Float between 0.1 and 1
@return: 1 if value is not correct
"""
if 0.01 <= ar <= 1:
global ACTIVATION_THRESHOLD
ACTIVATION_THRESHOLD = ar
else:
return 1 |
def CompareMbt(mbt1, mbt2):
""" Compates to measure/beat/tick values """
try:
m1, b1, t1 = mbt1.split(':',3)
m2, b2, t2 = mbt2.split(':',3)
if int(m1) > int(m2):
return False
elif int(m1) == int(m2) and int(b1) > int(b2):
return False
elif... |
def api_configuration_to_flocker_deploy_configuration(api_configuration):
"""
Convert a dictionary in a format matching the JSON returned by the HTTP
API to a dictionary in a format matching that used as the value of
a single application entry in a parsed Flocker configuration.
"""
deploy_config... |
def format_response(response_collection):
"""Re-format responses to a dict"""
return {
"code": response_collection[0]['code'],
"message": "%s created" % response_collection[0]['resource'],
"status": response_collection[0]['status'],
"payload": response_collection
} |
def binarySearch(dictionary, word):
"""finds a word in a dictionary, using binary search"""
if len(dictionary) == 0:
return False
else:
mid = len(dictionary) // 2
if dictionary[mid] == word:
return True
elif dictionary[mid] > word:
return binarySear... |
def split_enum_to_string(enum):
"""Converts enum field to string by removing _ from the enum
:param enum: Enum field to be converted to string
:return: Split string
"""
enum_str = None
if enum:
enum_str = str(enum).replace("_", " ").title()
return enum_str |
def get_github_path(owner: str, repo: str) -> str:
"""Get github path from owner and repo name"""
return "%s/%s" % (owner, repo) |
def is_even(input_number):
"""
Input:
input_number: common-or-garden Integer number to
check if it odd or even
Output:
True if even, False if odd.
"""
return not (input_number % 2) |
def rstrip_extra(fname):
"""Strip extraneous, non-discriminative filename info from the end of a file.
"""
to_strip = ("_R", "_", "fastq", ".", "-")
while fname.endswith(to_strip):
for x in to_strip:
if fname.endswith(x):
fname = fname[:len(fname) - len(x)]
... |
def farid_filters(n=3):
"""Farid's differentiation filters
From Differentiation of Discrete Multidimensional Signals, H. Farid & E. P. Simoncelli, IEEE 2004
n : number of taps, either 3 or 5
returns p, d : p is the interpolation filter, d, is the derivative filter
e.g:
p,d = farid_filters(5)
... |
def resolve_none_string(val: str):
""" To avoid 'none' or 'NONE' as strings, we need to resolve this to the NoneType
Args:
val(str): The potential none value as string
Returns:
None if the string is resolvable to None or the input parameter itself
"""
val_u = val.upper()
if val_... |
def to_str(bytes_or_str):
"""Given a string or bytes instance, return a string."""
if isinstance(bytes_or_str, bytes):
value = bytes_or_str.decode('utf-8')
else:
value = bytes_or_str
return value |
def get_index_of_first_list_elem_greater_starting_smaller(list_in, value):
"""If the list_in first elem is larger than value, return None; if list_in has no
element larger than value, return None; else, return the index of the first elem larger
than value."""
if list_in[0] > value:
return None
... |
def yellow(message):
"""
yellow color
:return: str
"""
return f"\x1b[33;1m{message}\x1b[0m" |
def pick(record, field, default=None):
"""Get the value for a key in a dict, or None if there is no dict.
!!! warning
But if the value for `field` in the record is `None`, `None` will be returned.
Parameters
----------
record: dict | `None`
`pick` should work in both cases.
fie... |
def sanitize_name(name: str) -> str:
"""Make a name safe for use as a keyspace name."""
# For now just change dashes to underscores. Fix this more in the future
return name.replace("-", "_") |
def one_line(num: int) -> int:
"""
@ref https://leetcode.com/problems/number-of-steps-to-reduce-a-number-to-zero/discuss/592198/Python-100-100-1-liner
"""
# Each 0 in bin(num) represents a place to divide by 2, i.e. to bit shift to
# right by 1 (assume they are 0s before nonzero most significant bi... |
def format_attrs(attrlist, attrs):
"""filter keys to avoid SysfsObject cache miss on all attrs"""
attr_fmt = ('%s: {%s}' % t for t in attrlist)
iargs = dict((k, attrs.get(k, 'N/A')) for _, k in attrlist)
return ', '.join(attr_fmt).format(**iargs) |
def get_keras_blocks(keras_weight_names):
"""Extract the block names from list of full weight names."""
# example: 'block1a_dwconv/depthwise_kernel:0' -> 'block1a'
keras_blocks = {x.split('_')[0] for x in keras_weight_names if 'block' in x}
return sorted(keras_blocks) |
def data_section(values):
"""
>>> data_section(range(0, 260))
'0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,... |
def _mask_to_shift(mask):
""" Return the index of the least significant bit in the mask """
shift = 0
while mask & 0x1 == 0:
shift += 1
mask >>= 1
return shift |
def getName(full_name):
"""
the getName function splits the name of the application returning the executable name and
ignoring the path details.
:param full_name: the path and executable name
:return: the executable name
"""
# Determine if '\\' and ':' are within the full_name
if ':' in ... |
def get_number_of_events_rl(event):
"""Counts events with category 'relatedLinkClicked' and action'Related content'."""
if event[0][0] == 'relatedLinkClicked' and 'Related content' in event[0][1]:
return event[1]
return 0 |
def _get_sub_charset(raw_headers: list) -> list:
"""Hardcode for some invalid mail-encoding."""
for k, _ in raw_headers:
if b'X-QQ' in k:
return ['gbk']
return [] |
def calc_efficiency(motion_time, elapsed_time):
""" It calculates the efficiency. """
efficiency = float(((motion_time) / (elapsed_time)) * 100)
return efficiency |
def delete_none(_dict):
"""Delete None values recursively from all of the dictionaries"""
for key, value in list(_dict.items()):
if isinstance(value, dict):
delete_none(value)
elif value is None:
del _dict[key]
elif isinstance(value, list):
for v_i in ... |
def duplicate_number(arr):
"""
:param - array containing numbers in the range [0, len(arr) - 2]
return - the number that is duplicate in the arr
"""
current_sum = 0
expected_sum = 0
for num in arr:
current_sum += num
for i in range(len(arr) - 1):
expected_su... |
def clean_blogname(blogname):
"""
Cut of the 'tumblr.com'
:param blogname:
:return: short blogname
"""
if blogname is None:
return None
stripped_blogname = blogname.strip()
return stripped_blogname[:-11] if stripped_blogname.endswith('.tumblr.com') else stripped_blogname |
def difference_quotient(f, x, h):
"""Calculates the difference quotient of 'f' evaluated at x and x + h
Parameters
----------
f(x) : Callable function
x : float
h : float
Returns
-------
'(f(x + h) - f(x)) / h'
"""
return (f(x + h) - f(x)) / h |
def split_batch(games, batch_size, use_padding):
"""
Split a list of games into sublist of games of size batch_size
:param games: list of games that is going to be used to create a batch
:param batch_size: number of games used by batch
:param use_padding: pad with already used games to fill the las... |
def pathendswith(path, *end):
"""
A helper for matching paths in the json dictionary.
"""
if len(end) > len(path):
return False
for a, b in zip(path[-len(end):], end):
if type(b)==type:
if type(a)!=b:
return False
elif type(b)==int:
if ... |
def springForce(k, x, p):
""" Calculate the spring force """
return -k*x**(p - 1) |
def calc_asue_el_th_ratio(th_power):
"""
Estimate Stromkennzahl according to ASUE 2015 data sets
Parameters
----------
th_power : float
Thermal power in Watt
Returns
-------
el_th_ratio : float
Current el. to th. power ratio (Stromkennzahl)
"""
el_th_ratio = 0.... |
def limit(value, v_min, v_max):
"""
limit a float or int python var
:param value: value to limit
:param v_min: minimum value
:param v_max: maximum value
:return: limited value
"""
try:
return min(max(value, v_min), v_max)
except TypeError:
return None |
def move_to_ctx(arr, ctx):
"""Move a nested structure of array to the given context
Parameters
----------
arr
The input array
ctx
The MXNet context
Returns
-------
new_arr
The array that has been moved to context
"""
if isinstance(arr, tuple):
re... |
def _eval_split_partition_fn(example, num_partitions, eval_fraction, all_ids):
"""Partition function to split into train/eval based on the hash ids."""
del num_partitions
example_id = example[0]
eval_range = int(len(all_ids) * eval_fraction)
for i in range(eval_range):
if all_ids[i] == example_id:
r... |
def get_session_colormap(session, key):
"""
Get the colormap form a legend stored in the user session and identified
by key.
"""
raster_legends = session.get('raster_legends', {})
legend = raster_legends.get(key)
if legend:
return legend['colormap'] |
def _darknet_required_attr(attr, key):
"""Check the attribute exists and return if exists, if not return error."""
assert isinstance(attr, dict)
if key not in attr:
raise AttributeError("Required attribute {} not found.".format(key))
return attr[key] |
def itemReadPredicted(W, A, R, t):
"""Weight predicted at time t.
Weight predicted by given weight vector W at time t given
arrival and removal matrices A and R.
Args:
W: R^N weight vector where N is the number of ItemReads.
A: R^{TxN} arrival matrix where A[t][i] is whether
... |
def label_selector_overlap(label_selector_1, label_selector_2):
"""
Returns the intersection of two label selectors
"""
if label_selector_1 and label_selector_2:
return any(item in label_selector_2.items() for item in label_selector_1.items())
# if one of the label selector dicts is empty, t... |
def balanced(banked_chemicals):
"""return true if all non-ore chemicals have non-negative amounts."""
def _enough(chemical):
return chemical == "ORE" or banked_chemicals[chemical] >= 0
return all(map(_enough, banked_chemicals)) |
def format_movie_year_min(pick_movie_year_min):
"""
Ensures that the minimum movie year is properly formatted (parameter is the minimum movie year)
"""
if bool(pick_movie_year_min) == True:
movie_year_min = str(pick_movie_year_min) + "-01-01"
else:
movie_year_min = None
retur... |
def fmt_variant_name(v):
"""
v:
('rs1045288|11:237087:A:G',
'rs1128320|11:244167:C:T',)
"""
res = ''
for i in v:
rs = i.split('|')[0]
ref = i.split(':')[-2]
alt = i.split(':')[-1]
res = res + f"_{rs}({ref},{alt})"
return res |
def where_point_within_range(point, range):
"""
a where bool, where geom is within the range (metres)
:input: point - (lon, lat), range - positive number
:output: a where clause string
"""
radius_string = "ST_DWithin(ST_PointFromText('POINT({p[0]} {p[1]})', 4326) ::geography, geom, {r})"
rad... |
def _guess_at_location(fields, names):
"""Guess where the values should be located."""
node_fields = set(fields["node"].keys())
cell_fields = set(fields["cell"].keys())
if names is None or len(names) == 0:
if len(fields["node"]) > 0:
at = "node"
else:
at = "cell"... |
def remove_items(garbages):
"""
Removes the items/garbages that are no longer visible on the screen.
Args:
garbages(list): A list containing the garbage rects
Returns:
garbages(list): A list containing the garbage rects
"""
for garbage_rect in garbages: # Loop through all the ... |
def handle_problem_type(problem_type):
"""Handles the problem type passed to be returned in a consistent way.
:param problem_type: The problem type to match.
:type problem_type: str
:return: The standardized problem type.
:rtype: str
"""
if problem_type.lower() in ["regression"]:
pr... |
def overlaps(a, b):
"""
Return the amount of overlap, in bp
between a and b.
If >0, the number of bp of overlap
If 0, they are book-ended.
If <0, the distance in bp between them
"""
return min(a[1], b[1]) - max(a[0], b[0]) |
def fetch_file_name(patch_url):
""" fetch zuul file name from a gerrit URL
:param patch_url: Gerrit patch URL in a string format
:returns file_name: string
"""
splitted_patch_url = [x for x in patch_url.split('/') if x]
if 'yaml' in splitted_patch_url[-1]:
if splitted_patch_url[-2] == 'z... |
def transformSynapseCoordinates(bboxCoordinates):
"""
Downsample bounding box coordinates
Parameters
-----------
bboxCoordinates : dict - boundingbox object created by get_anno_boundingbox()
Returns
-----------
bboxCoordinates : dict
"""
xoffset = 0 # 7096.0*3.0/100.0
yoff... |
def NEST_UPLOAD_CUST_OUTPUT(cust):
""" Upload all gcs artifacts step name"""
return 'Upload the output of {}'.format(cust) |
def is_lock(lock):
"""
Tests if the given lock is an instance of a lock class
"""
if lock is None:
# Don't do useless tests
return False
for attr in ('acquire', 'release', '__enter__', '__exit__'):
if not hasattr(lock, attr):
# Missing something
retur... |
def Pack(flatten, nmap_list):
"""Packs the list of tensors according to `.NestedMap` in `nmap_list`.
`Pack` is loosely the inverse of `Flatten`.
Args:
flatten: A list of tensors.
nmap_list: A list of `.NestedMap`.
Returns:
A list of `.NestedMap`, say ret is the returned list. We have
1. le... |
def add_rank(customers, sorted_totals):
""" list[list] -> dict[dict] """
# get customer id
cust_list = []
for i in customers:
cust_list.append(i)
# add rank
for i in range(len(customers)):
for j in range(len(sorted_totals)):
if cust_list[i] == sorted_totals[j][1]:
... |
def upgradeDriverCfg(version, dValue={}, dOption=[]):
"""Upgrade the config given by the dict dValue and dict dOption to the
latest version."""
# the dQuantUpdate dict contains rules for replacing missing quantities
dQuantReplace = {}
# update quantities depending on version
if version == '1.0':... |
def _mask_for_bits(i): # pragma: no cover
"""Generate a mask to grab `i` bits from an int value."""
return (1 << i) - 1 |
def get_raw_data_location(dry_run: bool = False):
"""
Gets raw data location, depending on the dry_run parameter
Returns just a small amount of data in case of dry run, used
in testing setting
Keyword Arguments:
dry_run {bool} -- Users choice of it is testing or no (default: {False})
R... |
def remove_multiple_spaces(s):
"""Replace multiple spaces between words by a single space."""
new_s = s.replace(" ", " ")
while(len(new_s) < len(s)):
s = new_s
new_s = s.replace(" ", " ")
return s |
def map_skip_none(fn, it):
"""
emulate list(map(fn, it)) but leave None as it is.
"""
ret = []
for x in it:
if x is None:
ret.append(None)
else:
ret.append(fn(x))
return ret |
def BOOL(value): # noqa: N802
"""Convert the values 0 and 1 into booleans."""
if value in ('1', '0'):
return bool(int(value))
raise ValueError('%r is not 0 or 1' % value) |
def strReplace( x, idx1, idx2, y):
""" method strReplace
The substring of 'x' specified by idx1,idx2 is replaced by the string y.
@param x input string
@param idx1 first character position at which to replace (inclusive)
@param idx2 last character position at which to replace (exclusive)
@param y string ... |
def recognize_plurals(line: str) -> bool:
""" Recognizes .po file plural source string. """
if line.startswith("msgid_plural"):
return True
return False |
def value_to_bit_matrix(a, s=(8, 8)):
""" convert a from n-bit wide value to
s[0] x s[1] bit matrix"""
bit_matrix = [[0] * s[1] for i in range(s[0])]
for i in range(s[0]):
for j in range(s[1]):
index = j + i * s[0]
bit = (a & (1 << index)) >> index
bit_mat... |
def znes_colors(n=None):
"""Return dict with ZNES colors.
Examples
--------
>>> znes_colors().keys() # doctest: +ELLIPSIS
dict_keys(['darkblue', 'red', 'lightblue', 'orange', 'grey',...
"""
colors = {
'darkblue': '#00395B',
'red': '#B54036',
'lightblue': '#74ADC0',
... |
def rgb_to_luminance(r, g, b, base=256):
"""
Calculates luminance of a color, on a scale from 0 to 1, meaning that 1 is the
highest luminance. r, g, b arguments values should be in 0..256 limits, or base
argument should define the upper limit otherwise.
"""
return (0.2126 * r + 0.7152 * g + 0.07... |
def is_failed(status, **_):
"""For when= function to test if a pod has failed."""
return status.get('phase') == 'Failed' |
def _get_vert(vert=None, orientation=None, **kwargs):
"""
Get the orientation specified as either `vert` or `orientation`. This is
used internally by various helper functions.
"""
if vert is not None:
return kwargs, vert
elif orientation is not None:
return kwargs, orientation !=... |
def _episode_slice(data, delim):
"""
function: divide by episode
"""
episodes = []
start = 0
for end in delim:
epi = data[start:end]
episodes.append(epi)
start = end
return episodes |
def val2bits(val, nbits):
"""Convert decimal integer to list of {0, 1}."""
# We return the bits in order high to low. For example,
# the value 6 is being returned as [1, 1, 0].
return [int(c) for c in format(val, '0{}b'.format(nbits))] |
def get_mean(l):
""" Returns the mean of the given list """
return sum(l) / len(l) |
def dbm_to_mw(dBm):
"""This function converts a power given in dBm to a power given in mW."""
return 10**((dBm)/10.) |
def is_severity_malicious(severity, reputation_params):
"""
determine if severity is malicious in reputation_params
"""
return severity and severity.lower() in reputation_params['override_severity_malicious'] |
def diff_all_filter(trail, key=lambda x: x['pid']):
""" Filter out trails with last key appeared before
"""
return trail if key(trail[-1]) not in set([key(c) for c in trail]) else None |
def rgb_blend(col1, col2, fraction=0.5):
"""
Calculates colour between two colors.
Definition
----------
def rgb_blend(col1, col2, fraction=0.5):
Input
-----
col1 1st rgb colour tuple
col2 2nd rgb colour tuple
Optional Input
--------------
fractio... |
def translate_to_wsl(path):
"""Translate a windows path to unix path for WSL.
WSL stands for Windows Subsystem for Linux and allows to run native linux
programs on Windows. In order to access Windows' filesystem the local
drives are mounted to /mnt/<Drive> within the WSL shell. This little helper
f... |
def split_remote_branch(branch):
"""Splits a remote branch's name into the name of the remote and the name
of the branch.
Parameters
----------
branch: str
the remote branch's name to split
Returns
-------
list of str
"""
assert '/' in branch, \
"remote branch %s ... |
def _remove_trailing_string(content, trailing):
"""
Strip trailing component `trailing` from `content` if it exists.
Used when generating names from view classes.
"""
if content.endswith(trailing) and content != trailing:
return content[:-len(trailing)]
return content |
def _is_numeric(v):
"""
Returns True if the given value is numeric.
:param v: the value to check.
:return: True if the value is numeric, False if not.
"""
try:
float(v)
return True
except ValueError:
return False |
def addToInventory(inventory, addedItems):
"""Loops through loot, adds to inventory."""
numberAdded = 0
for i in addedItems:
inventory.setdefault(i, 0)
inventory[i] += 1
return 1 |
def get_total(taxa_list, delim):
"""Return the total abundance in the taxa list.
This is not the sum b/c taxa lists are trees, implicitly.
"""
total = 0
for taxon, abund in taxa_list.items():
tkns = taxon.split(delim)
if len(tkns) == 1:
total += abund
return total |
def InrecaMoreIsBetter(caseAttrib, queryValue, jump, weight):
"""
Returns the similarity of two numbers following the INRECA - More is better formula.
"""
try:
queryValue = float(queryValue)
# build query string
queryFnc = {
"function_score": {
"query": {
"match_all": {}
},
"script_score... |
def clamp(frm, to, value):
"""
Clamps an ordinable type between two others.
Complexity: O(1)
params:
frm: the lower end
to: the upper end
value: the value
returns: the clamped value
"""
if frm > to:
raise ValueError("frm cannot be bigger than to in clamp")
... |
def _escape_non_ascii_chars(string):
"""
Returns a copy of the given string with all non-ASCII characters replaced
in Python Unicode-Escape encoding (e.g., '\u2013').
"""
return ''.join([(ord(c) < 128 and c) or r'\u{0:0>4x}'.format(ord(c))
for c in string]) |
def value_of_symbol(symbol):
"""Return an integer representing the "rank" of a card's symbol.
For instance, '2' maps to 2, and 'J' maps to 11.
Consecutive cards have consecutive integers."""
if symbol in '23456789':
return int(symbol)
else:
return ({
'T': 10,
'J': 11,
'Q': 1... |
def set_bypass(bypass_type=None):
"""Set bypass flag for each fire module in SqueezeNet architecture.
Parameters
----------
bypass_type : {None, 'simple', 'complex'}
Bypass type to be applied, see Fig. 2 [1] for more detail.
Returns
-------
bypass : dict
Dictiona... |
def triangle_area(p1, p2, p3):
"""
calculates the area of a triangle given its vertices
"""
return abs(p1[0] * (p2[1] - p3[1]) + p2[0] * (p3[1] - p1[1]) + p3[0] * (p1[1] - p2[1])) / 2. |
def _is_ambiguous(tags, skip_space_ambiguity=True):
"""
>>> _is_ambiguous(['NOUN sing,masc'])
False
>>> _is_ambiguous(['NOUN sing,masc', 'NOUN masc,sing'])
True
>>> _is_ambiguous(['NOUN masc,sing', 'NOUN,masc sing'])
False
>>> _is_ambiguous(['NOUN masc,sing', 'NOUN,masc sing'], skip_spac... |
def set_cmdlinevars(cmdargs, argdict):
"""
Add a dicitionary of LAMMPS arguments in a command line argument string.
Parameters
----------
cmdargs : list
Command line argument string. Will be mutated by this function.
argdict : dict
Dictionary to be added to LAMMPS command line ... |
def add(coord1, coord2):
"""
A 'smart' tuple adder that checks that it's on the chessboard
"""
ret = tuple([coord1[i] + coord2[i] for i in range(len(coord1))])
for i in ret:
if (i < 0 or i > 7):
return (None)
return (ret) |
def seconds_readable(seconds: int) -> str:
"""Turn seconds as an int into 'DD:HH:MM:SS'."""
r: list[str] = []
days, seconds = divmod(seconds, 60 * 60 * 24)
if days:
r.append(f'{days:02d}')
hours, seconds = divmod(seconds, 60 * 60)
if hours:
r.append(f'{hours:02d}')
minutes... |
def escape(inp):
"""
Escape `quote` in string `inp`.
Example usage::
>>> escape('hello "')
'hello "'
Args:
inp (str): String in which `quote` will be escaped.
Returns:
str: Escaped string.
"""
output = ""
for c in inp:
if c == '"':
... |
def sum(x, y):
"""Sum x and y
>>> sum(10, 20)
30
>>> sum(-10, 20)
10
>>> sum('10', 20)
Traceback (most recent call last):
...
AssertionError: x needs to be in or float
"""
assert isinstance(x, (int, float)), 'x needs to be in or float'
assert isinstance(y, (int, float)), 'x needs to be in or float'
re... |
def posgresql_dsn_formatter(credentials):
"""
Returns formatted Posgresql credentials as DSN.
Args:
credentials (dict):
The credentials dictionary from the relationships.
Returns:
(string) A formatted postgresql DSN.
"""
return "postgresql://{0}:{1}@{2}:{3}/{4}".fo... |
def is_bool(obj):
"""Returns ``True`` if `obj` is a ``bool``."""
return isinstance(obj, bool) |
def sim_lorentz_gamma(x, x0, gamma):
"""
Simulate a Lorentzian lineshape with unit height at the center.
Simulates discrete points of the continuous Cauchy-Lorentz (Breit-Wigner)
distribution with unit height at the center. Gamma (the half-width at
half-maximum, HWHM) is used as the scale paramete... |
def TransformCollection(r, undefined=''): # pylint: disable=unused-argument
"""Returns the current resource collection.
Args:
r: A JSON-serializable object.
undefined: This value is returned if r or the collection is empty.
Returns:
The current resource collection, undefined if unknown.
"""
# T... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.