content stringlengths 42 6.51k |
|---|
def extract_dtype(descriptor, key):
"""
Work around the fact that we currently report jsonschema data types.
"""
reported = descriptor['data_keys'][key]['dtype']
if reported == 'array':
return float # guess!
else:
return reported |
def replace_vars(msg, args):
"""Replace the variables in the message."""
oldmsg = msg
newmsg = msg
for key in args:
newmsg = newmsg.replace(key, str(args[key]))
"""Check if something was replaced, otherwise something went wrong."""
if newmsg is oldmsg:
print("ERROR: ... |
def str2bool(v):
"""Returns instance of string parameter to bool type"""
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise NameError('Boolean value ex... |
def accumulate_rotation(a_in, a_0):
"""
Compares current Axis value with its previous value to determine if there
has been a 360 degree flip in the Axis' evaluation.
e.g.:If a_0 = 94 and a_in = -265; instead of -266, this function would
output a_out = 95
:param a_in: float; current evaluation of... |
def getform(valuelist, theform, notpresent=''):
"""This function, given a CGI form, extracts the data from it, based on
valuelist passed in. Any non-present values are set to '' - although this can be changed.
(e.g. to return None so you can test for missing keywords - where '' is a valid answer but to have... |
def conjugate(x: complex) -> complex:
"""
Returns the conjugate of a complex number
"""
return x.real - x.imag * 1j |
def getEdgesForGrid(edges: list, grid_real):
"""
Calculate the grid geometry (edges).
Parameters
----------
edges : list of 4 int
Edges of the square (row_start, row_end, col_start, col_end)
grid_real : (int, int)
Number of grid rows and columns
Returns
-------
new_... |
def blktime2datetime(blktime):
"""
Convert a bitcoin block timestamp integer to a datetime string.
Note that current timestamp as seconds since 1970-01-01T00:00 UTC.
"""
from datetime import timedelta, datetime
d = datetime(1970, 1, 1, 0, 0, 0) + timedelta(days=int(blktime) / 86400, seconds=int(... |
def parse_str(s):
"""
parser for (stripped) string
:s: the input string to parse
:returns: the string, stripped of leading and trailing whitespace
"""
return s.strip() |
def celsius_to_fahrenheit(value: float) -> float:
"""
returns round((value * 1.8) + 32, 2)
Convert celsius degrees to fahrenheit degrees. Up to 2 point over zero.
:param value: celsius degrees
:type value: float
:returns: fahrenheit value
:rtype: float
:Example:
... |
def tag_key_value_list(tags_dict):
"""
Builds list of tag structures to be passed as parameter to the tag APIs
:param tags_dict: dictionary of tags
:return: list of tags
"""
if tags_dict is None:
return []
valid_tags = {tag_key: tags_dict[tag_key] for tag_key in tags_dict if
... |
def _get_section_content(events, section_label):
"""Extracts a section content from events, given a section_label.
Args:
events: the events json parsed from file.
section_label: the label of the section. e.g. 'residual' or 'command'.
Returns:
A list containing the content of the section.
"""
# I... |
def fizz_buzz(value):
"""Function to do the fizz_buzz on the given value"""
if value % 15 == 0:
return "FizzBuzz"
if value % 3 == 0:
return "Fizz"
if value % 5 == 0:
return "Buzz"
else:
return str(value) |
def find_max_sub(l):
"""Find subset with higest sum.
Example: [-2, 3, -4, 5, 1, -5] -> (3,4), 6
@param l list
@returns subset bounds and highest sum
"""
# max sum
max = l[0]
# current sum
m = 0
# max sum subset bounds
bounds = (0, 0)
# current subset start
s = 0
... |
def rk4_update(dynamics_fun, state, num_updates, delta_t, t=None):
"""Applies num_update Runge-Kutta4 steps to integrate over delta_t. Returns update: delta_state"""
def get_update(update):
dt = delta_t / num_updates
current_state = state + update
k1 = dt * dynamics_fun(current_stat... |
def convert_empty_string_to_none(data):
"""
Nullify empty strings in `data`.
:param data: arbitrary data
:return: data contains no empty string
"""
if isinstance(data, str) and data == "":
data = None
elif isinstance(data, dict):
for key, value in data.items():
d... |
def getHash(expression):
"""
Create a hash of all characters for an expression, every character has
a sign prefixed, so we decrease the count of character if its a '-' else
we keep increasing. We remove the characters if their count is zero
"""
h = {}
for i in range(0, len(expression), 2):
... |
def setup_debug_symbol_if_needed(gn_args, sanitizer, enable_debug):
"""Setup debug symbol if enable_debug is true. See: crbug.com/692620"""
if not enable_debug:
return gn_args
gn_args['sanitizer_keep_symbols'] = 'true'
gn_args['symbol_level'] = '2'
if sanitizer != 'MSAN':
gn_args['is_debug'] = 'true... |
def mws_credentials(cred_access_key, cred_secret_key, cred_account_id, cred_auth_token):
"""Fake set of MWS credentials"""
return {
"access_key": cred_access_key,
"secret_key": cred_secret_key,
"account_id": cred_account_id,
"auth_token": cred_auth_token,
} |
def _object_has_any(obj, **attrs):
"""Test if an object has any of `attrs` name/value pairs (by equality).
>>> _object_has_any(Path('/a/b/c.txt'), name='c.txt', suffix='.txt')
True
>>> _object_has_any(Path('/a/b/c.txt'), name='c.txt', age=112)
True
"""
for name, value in attrs.items():
... |
def read_file(filename):
"""
Reads file and returns output
input: string, a filename to be opened
output: string, the file contents
"""
if type(filename) is not str:
raise TypeError('filename must be a string')
try:
with open(filename + '.txt') as f:
return f.r... |
def format_dependency(dependency: str) -> str:
"""Format the dependency for the table."""
return "[coverage]" if dependency == "coverage" else f"[{dependency}]" |
def an(pos=5):
"""
Alineamiento del texto.
@pos:
1: Abajo izquierda
2: Abajo centro
3: Abajo derecha
4: Mitad derecha
5: Mitad centro
6: Mitad derecha
7: Arriba izquierda
8: Arriba centro
9: Arriba derecha
"""
apos = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
if pos not... |
def serialize(x):
"""recursive function that converts nested arrays to lists and the numpy
numeric data types to native python floats to make the structure json
serializable, so that it can be dumped to json. input is iterable output is
python list"""
out = []
for k in x:
try:
... |
def RK4(x, h, f):
"""Runge-Kutta 4th-order integration method for an autonomous system f."""
K1 = h*f(x)
K2 = h*f(x+(K1 * 0.5))
K3 = h*f(x+(K2 * 0.5))
K4 = h*f(x+K3)
return x+(1/6.0)*(K1 + 2*K2 + 2*K3 + K4) |
def build_examples(to_predict):
"""
Builds a list of dicts in input data format from a list of contexts and qas.
"""
examples = []
for row in to_predict:
context = row["context"]
for qa in row["qas"]:
qa["answers"] = [{"text": " ", "answer_start": 0}]
qa["is_... |
def filter_string(s, where):
"""Returns a string."""
return u''.join(filter(where, s)) |
def pathstr(path):
""" / separated path from array of strings"""
return '/'.join(path) |
def pad_string(x, n):
"""
Pad a numeric string with zeros such that the resulting string len is n.
Args:
x: numeric string, e.g. '6234'
n: length of final string length, e.g. 7
Returns:
a zero padded string, e.g. '0006234'
"""
padding = n - len(x)
x_new = x if padding <=... |
def get_public_endpoint_url_by_name(body_response, endpoint_name, region_name):
"""
Get the public endpoint for service in a region by service NAME
:param body_response: Keystone response (/token)
:param endpoint_name: Service name
:param region_name: Name of the region
:return: Public URL or No... |
def validate_genes(ids, genes):
"""Return valid gene IDs for a list of gene IDs/names"""
valid = []
for id in ids:
if id in genes.index:
valid.append(id)
else:
x = list(genes.loc[genes["geneSymbol"] == id, :].index)
if len(x) > 0:
valid.app... |
def near(threshold, dist1, dist2):
"""Return true if distances is closes than
threshold from each other.
"""
return abs(float(dist1) - float(dist2)) <= float(threshold) |
def quick_sort(input_list):
"""Quick sort function that accepts input_list."""
if isinstance(input_list, list):
if len(input_list) <= 1:
return input_list
less, equal, greater = [], [], []
pivot = input_list[0]
for num in input_list:
if num < pivot:
... |
def update_register(register, register_fn):
"""Nondestructively advance the bit register."""
return register[1:] + [register_fn()] |
def safe_unicode(s):
"""Removes invalid unicode characters from string.
Invalid unicode characters in SQLAlchemy queries will cause exceptions, so
this utility comes in handy in WTForms user input sanitization.
"""
try:
return str(s).encode("utf8", "surrogateescape").decode("utf8")
exce... |
def read_txt_file(file_path, n_num=-1, code_type='utf-8'):
"""
read .txt files, get all text or the previous n_num lines
:param file_path: string, the path of this file
:param n_num: int, denote the row number decided by \n, but -1 means all text
:param code_type: string, the code of this file
... |
def flag(flag):
"""Emit flag field.
Examples:
flag("-foo") -> flag: '-foo'
Args:
flag: value to be emitted to the command line
Returns:
a string to be placed into the CROSSTOOL
"""
return "\n flag: '%s'" % flag |
def generate_ss_text(ss_details):
"""Loops through the captured text of an image and arranges this text line by line.
This function depends on the image layout."""
# Arrange the captured text after scanning the page
parse_text = []
word_list = []
last_word = ''
# Loop through the captured te... |
def jsonNode(ctrlName, parentNode, matrix):
"""
create json node
:param ctrlName: str, fullDagPath with namespace replaced with wildcard sign
:param matrix
:return: json
"""
nodeDict = {
ctrlName:
{
"parent": parentNode,
"matrix": matrix
... |
def inv_dict(mydict):
"""
Reverse key -> val into val -> key.
"""
new_dict = {}
for k in mydict:
new_dict[mydict[k]] = k
return new_dict |
def is_white_key(note):
"""True if note is represented by a white key"""
key_pattern = [
True,
False,
True,
True,
False,
True,
False,
True,
True,
False,
True,
False,
]
return key_pattern[(note - 21) % len(ke... |
def getNextAlphabet(character):
"""
For getting the next letter of the alphabet for prefix.
"""
# a is '97' and z is '122'. There are 26 letters total
nextChar = ord(character) + 1
if nextChar > 122:
nextChar = (nextChar - 97) % 26 + 97
return chr(nextChar) |
def Join(*parts):
"""Join (AFF4) paths without normalizing.
A quick join method that can be used to express the precondition that
the parts are already normalized.
Args:
*parts: The parts to join
Returns:
The joined path.
"""
return "/".join(parts) |
def score(touching_power_pellet, touching_dot):
"""
:param touching_power_pellet: bool - does the player have an active power pellet?
:param touching_dot: bool - is the player touching a dot?
:return: bool
"""
if touching_dot or touching_power_pellet:
return True
else:
retur... |
def _limit(lower, upper):
"""Returns a regular expression quantifier with an upper and lower limit."""
if ((lower < 0) or (upper <= 0) or (upper < lower)):
raise Exception("Illegal argument to _limit")
return u"{%d,%d}" % (lower, upper) |
def echo(message='hello'):
"""
Very simple endpoint that just echos your message back to you
:param message: str of the message to echo
:return: str of the message echoed
"""
return 'ECHO: %s' % message |
def solution(limit: int = 1000000) -> int:
"""
Return the number of reduced proper fractions with denominator less than limit.
>>> solution(8)
21
>>> solution(1000)
304191
"""
primes = set(range(3, limit, 2))
primes.add(2)
for p in range(3, limit, 2):
if p not ... |
def get_day_hour_min_sec_str(duration_in_s):
"""
Return a string representing the duration in days, hours, minutes and seconds of the input value duration_in_s
:param duration_in_s: Duration in seconds
:return:
"""
return "{:d}d {:d}h {:d}m {:d}s".format(int(duration_in_s / (24 * 3600)),... |
def clamp(x, a, b):
"""Clamps value x between a and b"""
return max(a, min(b, x)) |
def make_content_field(doc):
"""
doc: dict containing clinical trial information
desc: transfers the content of the summary field to the new `contents`
field, if summary exists, otherwise contents field becomes emtpy string
"""
summary = doc['brief_summary/textblock']
doc['contents'] = su... |
def convert_ints_to_floats(in_ints, divider):
"""Convert integers to floats by division.
:param in_ints: the integer array
:param divider: the divider
:return the array of floats produced"""
return [x/divider for x in in_ints] |
def get_extrema(list):
"""Returns the max and min x and y values from a list of coordinate tuples in the form of (min_x, max_x, min_y, max_y)."""
max_x = max(list,key=lambda item:item[0])[0]
max_y = max(list,key=lambda item:item[1])[1]
min_x = min(list,key=lambda item:item[0])[0]
min_y = min(list,ke... |
def package_prefix(full_package_name):
"""Returns the package prefix from the package name specified.
:exc:`ValueError` is raised if the package name format is invalid.
>>> package_prefix('com.example.test')
'com.example'
>>> package_prefix('example.test')
'example'
>>> package_prefix('com... |
def Hc1_function(phi):
"""First derivative of the contractive part of the potential H
Args:
phi: phase-field
Returns:
Hc1: First derivative of the contractive part of the potential H
"""
Hc1=phi**3
return Hc1 |
def smallestValue(nd1, nd2):
""" take in any two model-dictionaries nd1 and nd2, return the smallest positive (non-zero) value across both"""
valuesd1 = list(nd1.values()) # list values of each dictionary
valuesd2 = list(nd2.values())
if min(valuesd1) < min(valuesd2): #check which one is the smalles... |
def write_arbitrary_beam_section(inps, ts, brps, nsm, outp_id, core=None):
"""writes the PBRSECT/PBMSECT card"""
end = ''
for key, dicts in [('INP', inps), ('T', ts), ('BRP', brps), ('CORE', core)]:
if dicts is None:
continue
# dicts = {int index : int/float value}
for in... |
def microsoft_initilization_std(shape):
"""
Convolution layer initialization as described in:
http://arxiv.org/pdf/1502.01852v1.pdf
"""
if len(shape) == 4:
n = shape[0] * shape[1] * shape[3]
return (2.0 / n)**.5
elif len(shape) == 2:
return (2.0 / shape[1])**.5
else:
... |
def squashem(matrix):
"""Return squashed list from 2D list of lists"""
return [
item
for row in matrix
for item in row
] |
def get_account_from_fund_code(client, fund_code):
"""Get account number based on a fund code."""
if fund_code is None:
account = "No fund code found"
else:
response = client.get_fund_by_code(fund_code)
account = response.get("fund", [{}])[0].get("external_id")
return account |
def _check_table_size(table, cell_limit=100 * 100000 + 1):
"""
Check a reader object to see if the total number of cells exceeds the set limit
:param table: The reader object containing the table data
:param cell_limit: Max number of cells allowed
:return: True if within the limit or exits if the t... |
def example_rates_to_pmf(example_rates):
"""Creates a probability-mass-function based on relative example rates.
Args:
example_rates: a list or tuple
Returns:
a list of floats
"""
total = sum(example_rates)
return [r / total for r in example_rates] |
def get_metric_BASE_T(map_dict, metric=None):
"""
:param map_dict: Parsed mapping.json as a dict
"""
if not isinstance(map_dict, dict):
raise
if metric is None:
return
for period in map_dict['period_colls']:
metrics = map_dict.get(str(period))
if not metrics:
... |
def backward_propagation(x, theta):
"""
Computes the derivative of J with respect to theta (see Figure 1).
Arguments:
x -- a real-valued input
theta -- our parameter, a real number as well
Returns:
dtheta -- the gradient of the cost with respect to theta
"""
### START CODE HERE ##... |
def centers2edges(centers):
"""Converts a set of bin centers into edges"""
centers = sorted(set(centers))
ret = [-1e99]
ret.extend((c1+c2)/2.0 for c1, c2 in zip(centers, centers[1:]))
ret.append(1e99)
return ret |
def _space_all_but_first(s: str, n_spaces: int) -> str:
"""Pad all lines except the first with n_spaces spaces"""
lines = s.splitlines()
for i in range(1, len(lines)):
lines[i] = " " * n_spaces + lines[i]
return "\n".join(lines) |
def max1(x,y):
"""
Returns: max of x, y
Parameter x: first value
Precondition: x is a number
Parameter y: second value
Precondition: y is a number
"""
if x > y:
return x
return y |
def aggregate_scores_weighted_mean(scores: list):
"""
Aggregate the given scores using a weighted arithmetic mean algorithm
"""
if not scores:
return "N/A"
weights, weight_sum = {}, 0
for i, score in enumerate(scores):
try:
score = float(score)
except ValueEr... |
def redis_update_load_data_button(n):
"""
Let the user load the DRF data once they have chosen an input directory
"""
if n < 1: return True
return False |
def alias(*alias):
"""Select a (list of) alias(es)."""
valias = [t for t in alias]
return {"alias": valias} |
def ekstraksi_aman(sup):
"""Mengekstraksi sup dan mengembalikan .text.strip()-nya secara aman."""
if sup:
return sup.extract().text.strip()
return "" |
def dump_datetime(value):
"""Deserialize datetime object into string form for JSON processing."""
if value is None:
return None
return [value.strftime("%Y-%m-%d"), value.strftime("%H:%M:%S")] |
def makeHtmlLine(str_in):
"""add formatting for a "paragraph" in html to a string
"""
str_in = '<p style="text-indent: 40px">' + str_in + '</p>'
return str_in |
def powerlaw_clouds(nus,kappac0=0.01,nuc0=28571.,alphac=1.):
"""power-law cloud model
Args:
kappac0: opacity (cm2/g) at nuc0
nuc0: wavenumber for kappac0
alphac: power
Returns:
cross section (cm2)
Note:
alphac = - gamma of the definition in petitRadtrans. Also... |
def first(iterable, default=None):
"""
Returns the first item in the given iterable or `default` if empty, meaningful mostly with 'for' expressions.
"""
for i in iterable:
return i
return default |
def convert_time(seconds):
"""
Seconds to minute/second
Ex: 61 -> 1'1"
:param seconds:
:return:
:link: https://en.wikipedia.org/wiki/Prime_(symbol)
"""
one_minute = 60
minute = seconds / one_minute
if minute == 0:
return str(seconds % one_minute) + "\""
else:
... |
def sample_details(document: dict) -> dict:
"""
Capture NWGC sample ID.
Capture details about the go/no-go sequencing call for this sample.
"""
return {
"nwgc_id": [document['sampleId']],
"sequencing_call": {
"comment": document['sampleComment'],
"initial": do... |
def remove_last(path):
"""Removes the last path element and returns both parts.
Note the last '/' is not returned in either part.
Args:
path: A path string represented as a / separated string
Returns:
A tuple of:
0: the path with the last element removed (string)
1: the name of the last... |
def get_val_str(val):
""" return the value as double precision string with max len 7 """
if val > 10 and val < 1000000:
return int(val)
return '%.2g' % val |
def rgb_to_triple(rgb):
"""
Returns triple of ints from rgb color in format #xxxxxx.
>>> rgb_to_triple("#00bd28")
(0, 189, 40)
"""
if rgb[0] == '#':
return (int(rgb[1:3], 16), int(rgb[3:5], 16), int(rgb[5:8], 16))
else:
raise ValueError("Not an rgb value.") |
def fix_slice(slice_, shape):
"""Return a normalized slice.
This function returns a slice so that it has the same length of `shape`,
and no negative indexes, if possible.
This is based on this document:
http://docs.scipy.org/doc/numpy/reference/arrays.indexing.html
"""
# convert `sli... |
def nominative(pronoun):
"""
Method to convert a pronoun to nominative form
"""
if pronoun == 'her':
return 'she'
elif pronoun in ['him','his']:
return 'he'
elif pronoun in ['them','their']:
return 'they'
else:
return pronoun |
def toggle_list_dict(obj):
"""Convert list of dict to dict of list, and vice versa.
Args:
obj: a list or a dict.
Returns:
converted type of obj.
Example:
>>> toggle_list_dict([{'a': 3}, {'a': 5}, {'a': 7}])
>>> # {'a': [3, 5, 7]}
>>> toggle_list_dict({'a': [3, ... |
def strlimit(s, length=72):
"""If the length of the string exceeds the given limit, it will be cut
off and three dots will be appended.
@param s: the string to limit
@type s: string
@param length: maximum length
@type length: non-negative integer
@return: limited string, at most length+3 ch... |
def evaluate(bounds, func):
"""
Evaluates simpson's rule on an array of values and a function pointer.
.. math::
\int_{a}^{b} = \sum_{i}
Parameters
----------
bounds : array_like
An array with a dimension of two that contains the starting and ending
points of... |
def trihex_dist(a1, b1, c1, a2, b2, c2):
"""Returns how many steps one trihex is from another"""
return abs(a1 - a2) + abs(b1 - b2) + abs(c1 - c2) |
def reciprocal_cycles(limit):
"""Find the value of d < limit for which 1/d contains the longest recurring \
cycle in its decimal fraction part."""
max_length = 0
div = 0
for number in range(limit-1, 2, -1):
# pylint: disable=misplaced-comparison-constant
length = next((x for x in ra... |
def sum_of_erf(mu, sigma, N=1000):
"""
Compute the sum of erf term
:param mu: The Gaussian mean
:param sigma: The Gaussian sigma
:param N: The number of iterations in the sum
"""
from math import erf, sqrt
sum1 = 0
sum2 = N * erf((N + 1 - mu) / (sqrt(2) * sigma))
sum3 = N * erf... |
def board_indexed(board, rows, cols):
""" Returns the squares of the given board by index, as a list of tuples `(row, column, square)`.
"""
return [(row, col, board[row * cols + col]) for row in range(rows) for col in range(cols)] |
def hex2dec(hex_value):
""" Returns a decimal representation of a given hex value"""
return str(int(hex_value, 16)) |
def OR(bools):
"""Logical OR."""
if True in bools:
return True
return False |
def split_list_items(l, char):
"""
splits the current item and the next in char is in the current item
:param l: list to process
:param char: character indicating where to splits
:return: processed list
"""
c = 0
while c <= len(l) - 1:
while char in l[c]:
l[c:c] = l.p... |
def partial_match(dict_, key):
"""Returns a value from `dict_` for the associated `key`. If `key` is not
found in `dict_` an attempt will be made to find a key in the dictionary
which contains part of `key` and return its associated value.
"""
if key in dict_:
return dict_[key]
for part... |
def convert_bytes(size: float) -> str:
"""humanize size"""
if not size:
return ""
power = 1024
t_n = 0
power_dict = {0: " ", 1: "Ki", 2: "Mi", 3: "Gi", 4: "Ti"}
while size > power:
size /= power
t_n += 1
return "{:.2f} {}B".format(size, power_dict[t_n]) |
def my_sum_squares1(n):
"""
>>> my_sum_squares1(3)
14.0
"""
return (1/6)*n*(n + 1)*(2*n + 1) |
def analyze_text(text):
"""Analyze the given text for the frequencies of its characters."""
# Initialize Dictionary
frequencies = {}
count = 0
for c in text:
c = c.lower()
if c in frequencies:
frequencies[c] += 1
else:
frequencies[c] = 1
coun... |
def NextPermutation(A, n):
"""
Given an array of values, return the next permutation up until the array is descending in value.
Algorithm works as follows:
1. Start from the last item n. If this is less than the previous item n-1, proceed to n-1 and repeat this step.
2. If item n is greater than it... |
def dict_diff(
dict0,
dict1
):
"""
Function to take the difference of two dict objects.
Assumes that both objects have the same keys.
Args:
dict0, dict1: dict
Dictionaries to be subtracted (dict1 - dict0)
Returns:
result: dict
Key-by-key diff... |
def _chao1_var_no_doubletons(s, chao1):
"""Calculates chao1 variance in absence of doubletons.
From EstimateS manual, equation 7.
`s` is the number of singletons, and `chao1` is the estimate of the mean of
Chao1 from the same dataset.
"""
return s * (s - 1) / 2 + s * (2 * s - 1) ** 2 / 4 - s ... |
def graph_to_edges(graph):
"""Converts a graph to a list of edges.
Args:
graph (dict): A non-empty graph as {src: {dst: weight}, ...}.
Returns:
list: Returns a list of edges of the given graph.
"""
if graph is None or not isinstance(graph, dict):
raise ValueError("... |
def split(circumstances, n):
"""Split a configuration CIRCUMSTANCES into N subsets;
return the list of subsets"""
subsets = []
start = 0
for i in range(n):
len_subset = int((len(circumstances) - start) / float(n - i) + 0.5)
subset = circumstances[start:start + len_subset]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.