content stringlengths 42 6.51k |
|---|
def merge_data(template_id, substitutions):
"""Template push merge_data creation.
:param template_id: Required, UUID.
:param substitutions: Required, dictionary of template variables and their
substitutions, e.g. {"FIRST_NAME": "Bob", "LAST_NAME": "Smith"}
"""
md = {}
md['template_id... |
def array_rotate(arr, n):
"""
This method would rotate the array by breaking down the array into two pieces
1. The rotated part
2. The remaining part
Then an array would be reconstructed using these two parts.
Space complexity = O(n)
Time complexity = O(1)
:param arr: The array to ro... |
def _convert_id_to_name(cluster, transaction):
"""
Helper function to convert the cluster with ids to cluster with names.
"""
new_cluster = set()
for element in cluster:
graql_query = f'match $char id {element}, has name $name; get $name;'
iterator = transaction.query(graql_query)
... |
def validate_json(keys, json_like_object, empty=False):
"""Check if keys are present."""
missing = ""
for key in keys:
try:
value = json_like_object[key]
if isinstance(value, str):
if not value.strip():
if empty is True:
... |
def clean_ns(tag):
"""Return a tag and its namespace separately."""
if '}' in tag:
split = tag.split('}')
return split[0].strip('{'), split[-1]
return '', tag |
def c(v):
"""convert"""
if v == "NAN" or v == "-INF" or v == "INF":
return None
return v |
def pair_subtract(lst: list) -> int:
"""
Cleanly subtract the elements of a 2 element list.
Parameters
----------
lst: lst
The list to subtract elements from.
Returns
-------
int
"""
assert len(lst) == 2
return lst[1] - lst[0] |
def get_next_code(last_code):
"""Generate next code based on the last_code."""
return (last_code * 252533) % 33554393 |
def _get_author_weight(authors_in_paper):
""" Method that returns the weight of a single author in a paper"""
#I check if there is at least 1 author otherwise the weight is 0
if len(authors_in_paper) > 0:
return 1./len(authors_in_paper)
else:
return 0 |
def rmchars(chars: str, s: str) -> str:
"""Remove chars from s.
>>> rmchars("123", "123456")
'456'
>>> rmchars(">=<.", ">=2.0")
'20'
>>> rmchars(">=<.", "")
''
"""
for c in chars:
s = s.replace(c, "")
return s |
def check_class_dict(param_type):
"""Check the class dict"""
dict_type = str(param_type).replace("<", "")
dict_type = dict_type.replace(">", "")
dict_type = dict_type.split(" ")[-1]
check_dect = dict_type != "dict" and not isinstance(param_type, dict)
if not hasattr(param_type, '__annotations__'... |
def get_default_dict(template_dict):
"""
Return a default dict from a template dictionary
Args:
:template_dict: Template dictionary
Returns:
:default_dict: New dictionary with defaults generated from 'template_dict'
The template dictionary must have a specific structure as outline... |
def subdivideData(d):
"""
subdivide data into categories (names, emails, passwords, subjects, bodies, recipients)
"""
nm = em = pw = sb = bd = rcp = [];
for x in range (len(d)):
nm.append(d[x][0])
em.append(d[x][1])
pw.append(d[x][2])
sb.append(d[x][3])
bd.app... |
def create_events_model(areas, virus_states):
"""Create events for the model.
Parameters
----------
virus_states : list of strings
List containing the names of all virus variants.
Returns
-------
events: dict
Dictionary that contains the event names as keys
and dici... |
def turned_off_response(message):
"""Return a device turned off response."""
return {
"requestId": message.get("requestId"),
"payload": {"errorCode": "deviceTurnedOff"},
} |
def merge(line):
"""
Helper function that merges a single row or column in 2048
"""
result = [0] * len(line)
result_position = 0
# iterate over all line values
for line_value in line:
if line_value != 0:
# merge two tiles
if result[result_position] =... |
def batch_list(inputlist, batch_size):
"""
Returns the inputlist split into batches of maximal length batch_size.
Each element in the returned list (i.e. each batch) is itself a list.
"""
list_of_batches = [inputlist[ii: ii+batch_size]
for ii in range(0, len(inputlist), batch_... |
def tri_recursion(k):
"""recursion of a value"""
if(k>0):
result = k + tri_recursion(k-1)
# print(result)
else:
result = 0
return result |
def price_fixer(price):
"""
Removes the unnecessary strings from the price tag
Parameters
----------
price : str
raw price decription taken from the website.
Returns
-------
float
filtered price .
"""
price = price.replace('KDV',"")
price = pric... |
def getGeolocalisationFromJson(image):
"""Get geolocalisation data of a image in the database
Parameters:
image (json): image from the validation data
Returns:
float: lng (degree)
float: lat (degree)
float: alt (degree)
float: azimuth (degree)
float: tilt (degree)
float: roll (... |
def load_required_field(value):
"""load required_field"""
if value == "y":
return True
return False |
def remove_empty_buckets(json_data):
"""Removes empty buckets in place"""
if 'bucket' not in json_data:
return json_data
idxs_to_remove = []
for i, bucket in enumerate(json_data.get('bucket')):
dataset = bucket['dataset']
if len(dataset) == 1 and dataset[0]['point'] == []:
... |
def met_barpres(mbar):
"""
Description:
OOI Level 1 Barometric Pressure core data product, which is calculated
by scaling the measured barometric pressure from mbar to Pascals.
Implemented by:
2014-06-25: Christopher Wingard. Initial code.
Usage:
Pa = met_barpres(mba... |
def detect_linear(errortype, atom_types, cclib_data):
"""
Check whether a linear molecule contain the right number of frequencies
"""
linear_options_3 = [
["I", "I", "I"],
["N", "N", "N"],
["N", "C", "H"],
["O", "C", "O"],
["O", "C", "S"],
["S"... |
def clip_black_by_luminance(color, threshold):
"""If the color's luminance is less than threshold, replace it with black.
color: an (r, g, b) tuple
threshold: a float
"""
r, g, b = color
if r+g+b < threshold*3:
return (0, 0, 0)
return (r, g, b) |
def merge_usage_periods(periods, new_period):
"""Merge a time period into an existing set of usage periods"""
outlist = []
for period in periods:
if new_period[0] > period[1]:
# No overlap - past the end
outlist.append(period)
continue
if new_period[1] < p... |
def findall_containing_string(list, string, inelement = False):
"""
Description:
Find all elements containing a substring and return those elements.
Input:
list - list object
string - string to look for
invert - if True, find all that do not contain string
"""
# ... |
def _bookmark_data(entry):
"""
We encode bookmark info in a similar way to Pixiv to make it simpler to work
with them both in the UI.
"""
if not entry.get('bookmarked'):
return None
return {
'tags': entry['bookmark_tags'].split(),
'private': False,
} |
def _trim(strings):
"""Remove leading and trailing whitespace from each string."""
return [x.strip() for x in strings] |
def game_with_rows_all_zeroes(game):
""" Checks whether there is not full zero row in game """
for row in game:
if 1 not in row or 0 not in row:
return True
return False |
def syncsort(a, b):
"""
sorts a in ascending order (and b will tag along, so each element of b is still associated with the right element in a)
"""
a, b = (list(t) for t in zip(*sorted(zip(a, b))))
return a, b |
def calc(temp):
"""calculates total value of the investment after the given time frame"""
name, amount, interest, times, years = temp
interest = interest/100
total = amount*(1+interest/times)**(times*years)
return name, amount, interest*100, times, years, total |
def liss(root):
"""
largest independent set in a given binary tree
"""
if root is None:
return 0
if root.liss:
return root.liss
if root.left is None and root.right is None:
root.liss = 1
return root.liss
# Size excluding current node
size_excluding = liss(root.left) + liss(root.right)
# Size incl... |
def find_first(data):
"""
>>> find_first([[0, 0], [0, 1]])
(1, 1)
>>> find_first([[0, 0], [0, 0]])
"""
for y_index, y_value in enumerate(data):
for x_index, x_value in enumerate(y_value):
if x_value == 1:
return (x_index, y_index)
return None |
def _sort_key(item):
""" Robust sort key that sorts items with invalid keys last.
This is used to make sorting behave the same across Python 2 and 3.
"""
key = item[0]
return not isinstance(key, int), key |
def dup_links(links):
"""Check for duplicated links"""
print(f'Checking for duplicated links...')
hasError = False
seen = {}
dupes = []
for link in links:
if link not in seen:
seen[link] = 1
else:
if seen[link] == 1:
dupes.append(link)
... |
def get_charge_style(
charge_styles, cutoffs, ewald_accuracy=None, dsf_damping=None
):
"""Get the Charge_Style section of the input file
Parameters
----------
charge_styles : list
list of charge styles, one for each box
cutoffs :
list of coulombic cutoffs, one for each box. For ... |
def orientation_string_nib2sct(s):
"""
:return: SCT reference space code from nibabel one
"""
opposite_character = {'L': 'R', 'R': 'L', 'A': 'P', 'P': 'A', 'I': 'S', 'S': 'I'}
return "".join([opposite_character[x] for x in s]) |
def detect_read_more(bs4tag):
"""
Not all news has read more thus it must be detected before hand to avoid errors
For this function a bs4.tag.elemnt is passed as an argument
It returns an empty string if there is no URL for readmore
Else it return the URL for readmore
"""
if bs4tag is None:
... |
def area(p):
"""Area of a polygone
:param p: list of the points taken in any orientation,
p[0] can differ from p[-1]
:returns: area
:complexity: linear
"""
A = 0
for i in range(len(p)):
A += p[i - 1][0] * p[i][1] - p[i][0] * p[i - 1][1]
return A / 2. |
def _roman_to_int(r):
""" Convert a Roman numeral to an integer. """
if not isinstance(r, str):
raise TypeError(f'Expected string, got type(input)')
r = r.upper()
nums = {'M': 1000, 'D': 500, 'C': 100, 'L': 50, 'X': 10, 'V': 5, 'I': 1}
integer = 0
for i in range(len(r)):
try:
... |
def strip(L, e=0):
""" strip all copies of e from end of list"""
if len(L) == 0: return L
i = len(L) - 1
while i>=0 and L[i] == e:
i -= 1
return L[:i+1] |
def AddRepositoryTags(prefix=''):
"""Add repository tagging into the output.
Args:
prefix: comment delimiter, if needed, to appear before tags
Returns:
list of text lines containing revision data
"""
tags = []
p4_id = '%sId:%s' % ('$', '$')
p4_date = '%sDate:%s' % ('$', '$')
tags.append('%s%s' ... |
def process_col_bool(attr_list, str_find):
"""
Function that creates the boolean columns.
Parameters
----------
attr_list : list
List containing the boolean attributes of an apartment.
str_find : str
String to find in each attribute from 'attr_list'.
Returns
-------
T... |
def quote_and_escape_value(value):
# type: (str) -> str
"""
Quote a string so it can be read from Lisp.
"""
return '"' + value.replace('\\', '\\\\').replace('"', '\\"') + '"' |
def get_added_lines(patch):
"""
Get lines added with a patch.
(e.g., git diff between two versions of a file)
:param patch: the content of the patch
:return: the lines added by the patch
"""
added_lines = ""
lines = patch.split('\n')
for line in lines:
if line.startswith("+... |
def estimate_cudnn_parameter_size(input_size, hidden_size, direction):
"""
Compute the number of parameters needed to
construct a stack of LSTMs.
"""
single_rnn_size = 8 * hidden_size + 4 * (hidden_size * input_size) + 4 * (hidden_size * hidden_size)
return direction * single_rnn_size |
def above_threshold(student_scores, threshold):
"""
:param student_scores: list of integer scores
:param threshold : integer
:return: list of integer scores that are at or above the "best" threshold.
"""
best_students = []
for score in student_scores:
if score >= threshold:
... |
def is_chinese_char(cp):
"""Checks whether CP is the codepoint of a CJK character."""
# This defines a "chinese character" as anything in the CJK Unicode block:
# https://en.wikipedia.org/wiki/CJK_Unified_Ideographs_(Unicode_block)
#
# Note that the CJK Unicode block is NOT all Japanese and Korean... |
def as_uri(value):
""" puts <> around if not a CURIE """
try:
parts = value.split(":")
if len(parts) == 2 :
return value
except:
pass
return value.join("<",">") |
def is_permuation(s1, s2):
"""
s1: string
s2: string
return: True or False
"""
# we can get the ascii value for each charactor in the list and add it
ascii_s1, ascii_s2 = 0,0
if len(s1)!=len(s2) or not s1 or not s2: # O(1)
# handeling the edge cases, so that we wont waste time if one of the string is
# ... |
def period_modified(p0, pdot, no_of_samples, tsamp, fft_size):
"""
returns period with reference to the middle epoch of observation
"""
if (fft_size == 0.0):
return p0 - pdot * \
float(1 << (no_of_samples.bit_length() - 1) - no_of_samples) * tsamp / 2
else:
return p0 - pd... |
def parseCitationList(str2parse,occurList,commandName):
"""
Parses one citation list that has been identified by ``parseTexDocument``
and returns a list containing the :term:`bibtex` keys.
"""
outStrList=[]
for occurence in occurList:
startIndex=occurence+len(commandName)-1
whil... |
def ftime(secs):
"""
Format a time duration `secs` given in seconds into a human readable
string.
>>> ftime(12345)
'3h25m45s'
"""
units = ("d", "h", "m", "s")
factors = (86400, 3600, 60, 1)
res = ""
if secs < 0.0:
# add sign
secs = abs(secs)
res += "-"
... |
def left_to_right_check(input_line: str, pivot: int):
"""
Check row-wise visibility from left to right.
Return True if number of building from the left-most hint is visible looking to the right,
False otherwise.
input_line - representing board row.
pivot - number on the left-most hint of the in... |
def idx2ht(idx, vertex_set_length):
"""Gets h_idx, t_idx from enumerated idx from h_t_idx_generator"""
h_idx = idx // (vertex_set_length - 1)
t_idx = idx % (vertex_set_length - 1)
if t_idx >= h_idx:
t_idx += 1
return h_idx, t_idx |
def toSnakeCase(text):
"""converts camel case to snake case
"""
return ''.join(['_' + c.lower() if c.isupper() else c for c in text]).lstrip('_') |
def t_area(t_str: str) -> float:
"""Calculate area of a triangle (basic).
Args:
t_str: <str> triangle shape as a string.
Returns: <float> triangle area.
"""
rows = t_str.split('\n')[2:-1]
base = rows[-1].count(' ')
height = sum(map(lambda string: ' ' in string, rows))
return (b... |
def expand_init_dict(init_dict):
"""Enhances read in initialization dictionary by
adding model parameters derived from the
specified initialisation file"""
# Calculate range of years of education in the (simulated) sample
educ_min = init_dict["INITIAL_CONDITIONS"]["educ_min"]
educ_max = init_di... |
def response_list(input_list):
"""xmltodict returns different structure if there's one item on the list."""
if isinstance(input_list, dict):
input_list = [input_list]
return input_list |
def FIELD(name: str) -> str:
"""
Creates a reference to a field
Args:
name: field name
Usage:
>>> FIELD("First Name")
'{First Name}'
"""
return "{%s}" % name |
def add_config(config):
"""Adds config section"""
uml = ''
if config is not None and len(config) >= 3:
# Remove all empty lines
config = '\n'.join([line.strip() for line in config.split('\n') if line.strip() != ''])
uml += '\n\' Config\n\n'
uml += config
uml += '\n\n'... |
def k_value(B=0.5, period=18):
""" k = e/2/pi/m/c*period*B
B is peak field of undulator [T]
period is period in mm """
return 0.09337 * B * period |
def simple_decomp(compressed):
"""Decompress string skipping markers within the scope of a previous one."""
decompressed = 0
i = 0
while i < len(compressed):
if compressed[i] == '(':
marker = ''
in_marker = True
j = 1
while in_marker:
... |
def filename_parse(filename):
"""
Parses filename to get information about the method used.
It is assumed that u-pbe/avtz on hcn will be named
hnc_pbe_avtz_u.xxx, where xxx is an arbitrary extension.
"""
# Since SV-P is misspelled as SV-P_, catch that
filename = filename.replace("SV-P_", "S... |
def invert_dict(dict_to_invert):
"""Invert Python dictionary.
Examples
--------
>>> invert_dict({'key': 'value'})
{'value': 'key'}
"""
return {v: k for k, v in dict_to_invert.items()} |
def use_clip_fps_by_default(f, clip, *a, **k):
""" Will use clip.fps if no fps=... is provided in **k """
def fun(fps):
if fps is not None:
return fps
elif getattr(clip, "fps", None):
return clip.fps
raise AttributeError(
"No 'fps' (frames per second)... |
def convert_to_base7(num):
"""
:type num: int
:rtype: str
"""
if num == 0:
return '0'
o = ''
a = abs(num)
while a != 0:
o = str(a % 7) + o
a /= 7
return o if num > 0 else '-' + o |
def msToTime(ms):
""" Convert milliseconds to human readable time"""
secs = int(ms / 1000)
mins = int(secs / 60)
if mins < 60:
return str(mins) + " mins"
else:
hrs = int(mins / 60)
mins = int(mins % 60)
return str(hrs) + "h " + str(mins) + "m" |
def num_min_repeat(arr):
"""
Discuss the length of the longest increasing sequence.
length = the number of distinct elements
Use an end to store the last element's index of the seq.
Loop the sorted array temp(monotonically increasing), and let index = arr.index(x).
(interviewer helped me modif... |
def saturated_vapour_pressure_average(svp_24_max, svp_24_min):
"""
Average saturated vapour pressure based on two saturated vapour pressure values
calculated using minimum and maximum air temperature respectively. This is preferable
to calculating saturated vapour pressure using the average air temperat... |
def get_concat_level_bits(i, n):
"""Returns the bits of multiplying the current variable by the i-th index of the previous one.
Take in integers i and n, returns a string containing the smt2 concat
operation combining the bits of the multiplication of the current variable
by the i-th index of the previous vari... |
def validate_numeric(input): # test
"""Validates input to see if it's an int or integer numeric string
Args:
input: data corresponding to key in dictionary from POST request
Returns:
boolean: False if input cannot be cast as int
int: value of input if castable as int
"""
t... |
def redshift_correct(z, wavelengths):
""" Redshift correction
Correct a given numpy array of wavelengths for redshift effects using an accepted redshift value.
Args:
z (float): a redshift value
wavelengths (array): a numpy array containing wavelenth values
Returns:
array: a numpy ... |
def get_clean_fips(fips):
"""
Given a FIPS code, ensure it is returned as a properly formatted FIPS code of length 5
Example:
get_clean_fips(123) = "00123"
get_clean_fips("0002") = "00002"
get_clean_fips("00001") = "00001
:param fips: The FIPS code to clean
:return: The 5-digit FIPS co... |
def get_ordinal(number):
"""Produces an ordinal (1st, 2nd, 3rd, 4th) from a number"""
if number == 1:
return "st"
elif number == 2:
return "nd"
elif number == 3:
return "rd"
else:
return "th" |
def next_greater_digit_index(digits: list, i: int) -> int:
"""
Find the next greater digit in the right portion of
number[i] - that is from digit at index i+1 to last
digit. Let that digit be number[j] at index 'j'.
:param digits: list of digits
:param i: index of number[i]
:return: next gr... |
def format_filename(name):
"""Take a string and return a valid filename constructed from the string.
Uses a whitelist approach: any characters not present in valid_chars are
removed. Also spaces are replaced with underscores.
Note: this method may produce invalid filenames such as ``, `.` or `..`
When I use this m... |
def size(n, abbriv='B', si=False):
"""size(n, abbriv='B', si=False) -> str
Convert the length of a bytestream to human readable form.
Arguments:
n(int,str): The length to convert to human readable form
abbriv(str):
Example:
>>> size(451)
'451B'
>>> size(1000)
... |
def as_dir(directory):
""" Add a forward slash if one is not at the end of a string. """
if directory[-1] != '/':
return directory + "/"
else:
return directory |
def replace_non_digits(input_string):
"""Replaces non-digits in known dates with digits"""
input_string = input_string.replace('O', '0')
input_string = input_string.replace('o', '0')
input_string = input_string.replace('l', '1')
input_string = input_string.replace('I', '1')
input_string = input_... |
def peek_ahead(string, pos):
"""
Return the next character from ``string`` at the given position.
Return ``None`` at the end of ``string``.
We never need to peek more than one character ahead.
"""
return None if pos == len(string) else string[pos] |
def UC_V(V_mm, A_catch, outUnits):
"""Convert volume from mm to m^3 or to litres. outUnits 'm3' or 'l'"""
factorDict = {'m3':10**3, 'l':10**6}
V = V_mm * factorDict[outUnits] * A_catch
return V |
def parse_type_opts(ostr):
"""
Parse options included in type definitions
Type definitions consist of 1) type name, 2) parent type, 3) options string, 4) list of fields/items
Returns a dict of options:
String Dict key Dict val Option
------ -------- ------- ------------
">*" "... |
def extract_exp_from_diff(diff_exp):
"""
Takes in an expression that has been ran through pass_reverse_diff and
returns just the main expression, not the derrivatives
"""
assert(diff_exp[0] == "Return")
assert(len(diff_exp) == 2)
diff_retval = diff_exp[1]
if diff_retval[0] != "Tuple":
... |
def get_updated_jobs(jobs, name_map):
"""get updated jobs."""
new_jobs = []
for job in jobs:
if job["name"] in name_map.keys():
job["cluster"] = name_map[job["name"]]
new_jobs.append(job)
return new_jobs |
def verse(day: int):
"""Create a verse"""
ordinal = [
'first',
'second',
'third',
'fourth',
'fifth',
'sixth',
'seventh',
'eighth',
'ninth',
'tenth',
'eleventh',
'twelfth'
]
verse: list = [
f'On the {o... |
def filter_length(d, n):
"""Select only the words in d that have n letters.
d: map from word to list of anagrams
n: integer number of letters
returns: new map from word to list of anagrams
"""
res = {}
for word, anagrams in d.items():
if len(word) == n:
res[word] = anagra... |
def _parse_date(date: str) -> tuple:
"""Return date as a tuple of ints in the format (D, M, Y)."""
date_split = date.split("/")
return int(date_split[0]), int(date_split[1]), int(date_split[2]) |
def parse_headers(response, convert_to_lowercase=True):
"""
Receives an HTTP response/request bytes object and parses the HTTP headers.
Return a dict of all headers.
If convert_to_lowercase is true, all headers will be saved in lowercase form.
"""
valid_headers = (
b"NOTIFY * HTTP/1.1\r\... |
def create_coin(coin: tuple = ('HEADS', 'TAILS',)):
"""Define a your coin.
coin - tuple with 2 values. Default (heads, tails,)
"""
COIN = {True: coin[0], False: coin[1]}
return COIN |
def bounds(points):
"""
>>> bounds([(0, 0)])
((0, 0), (0, 0))
>>> bounds([(7, 1), (-1, 9)])
((-1, 1), (7, 9))
"""
left = min(x for (x, y) in points)
right = max(x for (x, y) in points)
top = min(y for (x, y) in points)
bottom = max(y for (x, y) in points)
return ((left, top... |
def dict_py_to_bash(d, bash_obj_name="DICT"):
"""
Adapted from source:
* https://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash
Converts a Python dictionary or pd.Series to a bash dictionary.
"""
bash_placeholder = "declare -A {}=(".format(bash_obj_name)
for k,v i... |
def strip_2tuple(dict):
"""
Strips the second value of the tuple out of a dictionary
{key: (first, second)} => {key: first}
"""
new_dict = {}
for key, (first, second) in dict.items():
new_dict[key] = first
return new_dict |
def split_text(text, n=100, character=" "):
"""Split the text every ``n``-th occurrence of ``character``"""
text = text.split(character)
return [character.join(text[i: i + n]).strip() for i in range(0, len(text), n)] |
def underscore_to_pascalcase(value):
"""Converts a string from underscore_case to PascalCase.
Args:
value: Source string value.
Example - hello_world
Returns:
The string, converted to PascalCase.
Example - hello_world -> HelloWorld
"""
if not value:
return value
def __CapWord(seq):... |
def viralAdvertising(n):
"""
Calculate the number of viral.
Args:
n: (todo): write your description
"""
count = 0
start = 5
for i in range(0,n):
count =count + start/2
start = (start/2)*3
return count |
def get_mean_value(predicted_values):
"""
Method for calculate mean prediction value by all predicted value
:param predicted_values: all predicted values
:type predicted_values: list
:return: mean prediction value
:rtype: float
"""
if len(predicted_values) == 0:
return None
... |
def construct_filter(specs, match_template):
"""
Build parser according to specification
:param match_template:
:param specs: list of strings of specifications
:return: filter string
"""
spec_string = " & ".join(specs)
return match_template.format(specs=spec_string) |
def recFibonacci(n):
"""Recursive Fibonacci function. """
if n <= 0:
return 0
elif n ==1:
return 1
else:
return recFibonacci(n-2) + recFibonacci(n-1) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.