content stringlengths 42 6.51k |
|---|
def partition_list(array, pivot):
"""
Given an unsorted list and a pivot integer, partition the list in two depending if the elements are smaller or greater than the pivot.
O(n) time & space
"""
smaller = []
bigger = []
for element in array:
if element < pivot:
smaller.append(element)
else:
bigger.appe... |
def replace(text: str, replacements: dict) -> str:
"""
Returns a copy of text with the replacements applied.
>>> replace('abc.-.', {'.': '*', '-': '<===>'})
'abc*<===>*'
>>> replace('Hola1 que2 ase3', {'Hola': 'Hi', 'que': 'ase', 'ase': None})
'Hi1 ase2 3'
"""
if not replacements:
... |
def error_response(error_message):
"""Return a well-formed error message."""
return {
"success": False,
"test_name": "s3_png_metadata",
"error_message": error_message,
} |
def extract_expand_info(kernel_info):
"""Convert the json into a more friendly format"""
input_desc = []
if 'input_desc' in kernel_info and kernel_info['input_desc']:
for desc in kernel_info['input_desc']:
input_desc += desc
attrs = {}
if 'attr' in kernel_info and kernel_info['at... |
def unify_units(dic):
"""Unifies names of units.
Some units have different spelling although they are the same units.
This functions replaces different spelling options by unified one.
Example of British English spelling replaced by US English spelling::
>>> unify_units({'units': ['metres'], ... |
def fit_simulaid(phi):
"""
DEPRECATED AND WORKING FOR SMALL NUMBER OF SAMPLES
--
Fit theta such as:
phi_i = theta * i + phi_0 (E)
Solving the system:
| SUM(E)
| SUM(E*i for i)
that can be written:
| a11 * theta + a12 * phi_0 = b1
| a21 * theta + a22 * ph... |
def _hex_to_bin(hexstring):
"""Convert hexadecimal readouts (memory) to binary readouts."""
return str(bin(int(hexstring, 16)))[2:] |
def _first_available(color_list):
"""
(https://en.wikipedia.org/wiki/Greedy_coloring)
Return smallest non-negative integer not in the given list of colors.
:param color_list: List of neighboring nodes colors
:type color_list: list of int
:rtype: int
"""
color_set = set(color_list)
c... |
def readCurrent(obj, container=True):
"""
Persistence safe wrapper around zodb connection readCurrent;
also has some built in smarts about typical objects that need
to be read together.
"""
# Per notes from session_storage.py, remember to activate
# the objects first; otherwise the serial t... |
def ens_to_indx(ens_num, max_start=1000000):
"""
Get the index related to the ensemble number : e.g 101 => 0
:param ens_num: ensemble number, int
:param max_start: max number of ensembles, int
:return: index, int
"""
start = 100
while start < max_start:
ind = ens_num % start
... |
def is_valid_location(location, bounds):
"""Check if location is in drone bounds."""
if min(bounds[0]) <= location[0] <= max(bounds[0]):
if min(bounds[1]) <= location[1] <= max(bounds[1]):
return True
return False |
def _get_template_disk_size(template):
"""Get disk size from template."""
return int(
template['properties']['disks'][0]['initializeParams']['diskSizeGb']) |
def unwrap_error_with_hosts(error_obj):
"""Extracts original error from a wrapper listing hosts
where the error occurred"""
error_id = error_obj.get('id')
description = error_obj.get('description')
details = error_obj.get('details', {})
nodes = []
if error_id == 'errorOnNodes' and 'error' i... |
def is_attorney(descr):
""" If a string description is a attorney description """
return any(map(lambda s: s in descr.upper(), ('ATTORNEY','ATTNY'))) |
def find(func, iterable):
"""
find the first item in iterable for which func returns something true'ish.
@returns None if no item in iterable fulfills the condition
"""
for i in iterable:
if func(i):
return i
return None |
def spread(nodes, n):
"""Distrubute master instances in different nodes
{
"192.168.0.1": [node1, node2],
"192.168.0.2": [node3, node4],
"192.168.0.3": [node5, node6]
} => [node1, node3, node5]
"""
target = []
while len(target) < n and nodes:
for ip, node_group i... |
def fizzGame(num):
"""Checks input and computer fizz or buzz
This function returns "fizz", "buzz", "fizz buzz",
or original number if it is divisible by 3, 5, both, or neither.
Args:
num: number that will be checked for fizz or buzz
Returns:
Output for game, (str) "fizz", "buzz", "... |
def get_fn_names(component):
"""If `component` has a `function` attribute and it is True,
appends the names in the function handler to `fn_names` and
returns it, else returns an empty list.
:param component: the component object to get it's list of function names for
:type component: object
:re... |
def create_text(lines):
"""
For a list of strings, creates a single string with elements of list
separated by line.
:param lines: list of strings
:return: string
"""
return '\n'.join(lines) |
def parse_messages(messages):
"""Parse messages."""
return [message.strip() for message in messages.split('\n')] |
def convert_input_to_dice(to_re_roll):
"""
Parse the user intput into a list of dice
:param to_re_roll: the raw comma-separated string received from the user input
:return: a list of dice which are integers
"""
if to_re_roll:
dice = [int(d) for d in to_re_roll.split(",")]
retur... |
def STRING_BOUNDARY(e):
"""
:return: expr that matches an entire line
"""
return r"^{e}$".format(e=e) |
def is_valid(glyph_str):
""" Validates if glyph_str is alphanumeric and contains unique chars
Parameters
----------
glyph_str : string
glyph alphabet to be used for number encoding
Returns
-------
True when:
glyph string is alphanumeric
Each char occurs only once
... |
def clean_string(string):
"""
Remove the double spaces from a string.
"""
string = string.replace(" ", " ")
if string.startswith(" "): string = string[1:]
if string.endswith(" "): string = string[-2:]
return string |
def parse(prog):
"""Parse a Chicken program into bytecode."""
OPs = []
prog = prog.split('\n')
for line in prog:
OPs.append(line.count("chicken"))
return OPs |
def unify(facts, query):
"""
Simplistic unification of a query with one of several facts.
Query and each fact should be a tuple.
"Variables" are indicated by None in the query
Valid substitutions with literals from the facts are returned
"""
matches = set()
for fact in facts:
if ... |
def fix_broken_format(x):
"""
Fix the broken
"""
if "*^" in x:
tokens = x.split("*^")
a = float(tokens[0])
b = int(tokens[1])
return a * 10**b
else:
return float(x) |
def head(list1: list) -> object:
"""Return the head of a list.
If the input list is empty, then return `None`.
:param list list1: input list
:return: the first item
:rtype: object
>>> head([])
None
>>> head([1,2,3])
1
"""
if len(list1) == 0:
return None
... |
def _boolify_envvar(val):
"""Interpret boolean environment variables.
True whenever set/exported, even if value is an empty string,
"null", or "none".
"""
falsey = ("false", "nil", "no", "off", "0")
return (val if val is not None else "false").lower() not in falsey |
def _len_guards(m: int):
"""Handle small or incorrect window lengths"""
if int(m) != m or m < 0:
raise ValueError("Window length m must be a non-negative integer")
return m <= 1 |
def line(x, a, b):
"""
Line equation, used
for curve fitting algorithm
Args:
x: x value
a: line coefficient
b: line constant term
Returns:
The y coordinate of the point
"""
return a*x + b |
def lin_portfolio(q1, q2, c1=2, c2=1, *args):
"""Simple linear function with analytic EE solution for the next test."""
return c1 * q1 + c2 * q2 |
def gpr_to_abi(gpr):
"""Convert a general purpose register to its corresponding abi name"""
switcher = {
"x0" : "zero",
"x1" : "ra",
"x2" : "sp",
"x3" : "gp",
"x4" : "tp",
"x5" : "t0",
"x6" : "t1",
"x7" : "t2",
"x8" : "s0",
"x9" : "s1",
"x10" : "a0",
"x11" :... |
def recursive_dict_to_list(dict_data):
""" Returns a list containing all values from
a dictionary and any child contained dictionary.
"""
list_data = []
for v in dict_data.values():
if type(v) == dict:
for v1 in recursive_dict_to_list(v):
list_data.append(v1)
... |
def knotvector_normalize(knotvector=()):
""" Normalizes the input knot vector between 0 and 1.
:param knotvector: input knot vector
:type knotvector: tuple
:return: normalized knot vector
:rtype: list
"""
if len(knotvector) == 0:
return knotvector
first_knot = float(knotvector[... |
def to3(p):
"""
Returns a string representation of p with at least 3 chars
Adds leading 0's if necessary
Parameter n: number to pad
Precondition: p is an int
"""
assert type(p) == int, repr(p)+' is not an int' # get in the habit
if p < 10:
return '00' + str(p)
elif p <... |
def json_or_empty(response):
"""
Return response JSON as python dict or empty dict.
:param response:
:return:
"""
response_json = {}
try:
response_json = response.json()
except Exception:
pass
return response_json |
def stricmp(sFirst, sSecond):
"""
Compares to strings in an case insensitive fashion.
Python doesn't seem to have any way of doing the correctly, so this is just
an approximation using lower.
"""
if sFirst == sSecond:
return 0;
sLower1 = sFirst.lower();
sLower2 = sSecond.lower()... |
def preOrder(node, mx):
""" visit node,
process left subtree
process right subtree
return results
"""
count = 0
# node empty
if (node == None):
return mx, 0
# If the current node value
# is greater or equal to the
# max value, then update count
# varia... |
def elide_string_middle(text, max_length):
"""Replace the middle of the text with ellipses to shorten text to the desired length.
Args:
text (str): Text to shorten.
max_length (int): Maximum allowable length of the string.
Returns:
(str) The elided text, e.g. "Some really long tex ... |
def get_client_msg(message, client_id):
"""get_client_msg: get the client-based-message"""
return message + '@' + client_id |
def distance(strand_a, strand_b):
"""
Calculates the Hamming's distance between two strads.
:param str Strand A.
:param str Strand B.
"""
if len(strand_a) != len(strand_b):
raise ValueError('Strands must be of equal length.')
return sum(i != j for i, j in zip(strand_a, strand_b)) |
def try_classmro(fn, cls):
"""
Try `fn` with the `cls` by walking its MRO until a result is returned.
eg, `try_classmro(field_dict.get, forms.CharField)`
"""
for cls in cls.mro():
result = fn(cls)
if result is not None:
return result |
def vcd_convert(data, signals):
"""
`data` obtained from .get_signals() has a form of a dictionary with strange
key names (e.g. '7#'), then, for each key, it has a dictionary with keys:
'references' - here we will have the actual signal name
'size' - N bytes
'var_type' - e.g. 'wire'
... |
def sublist(list, start, len):
"""
Returns the sub-list of List1 starting at Start and with (max) Len elements. It is not an error for Start+Len to exceed the length of the list.
>>> x
[-1, 2, 10, 23, 23.23]
>>> f.sublist(x, 1, 3)
[2, 10, 23]
>>> f.sublist(x, 2, 3)
[10, 23, 23.23]
>... |
def clip(data, start_idx):
"""Return data[start_idx:]"""
return data[start_idx:] |
def task_request_statistics(contributions):
"""Returns a list of task requests."""
task_requests = []
for contribution in contributions:
# If contribution wasn't staff picked skip it
if "task" in contribution["category"]:
task_requests.append(contribution)
return {"task_requ... |
def cpp_string(s: str) -> str:
"""Convert a python string into a c++ string literal """
s = s.replace('\\', '\\\\')
s = s.replace('"', '\\"')
s = s.replace('\a', '\\a')
s = s.replace('\b', '\\b')
s = s.replace('\f', '\\f')
s = s.replace('\n', '\\n')
s = s.replace('\v', '\\v')
s = s.r... |
def choose_max_efficiency(efficiencies):
"""
Given a single or list of DOM efficiencies choose the highest
"""
if type(efficiencies) == list or type(efficiencies) == tuple:
return max(map(float,efficiencies))
else:
return float(efficiencies) |
def _filter_subs(lst):
"""Return a copy of the list with any subvars of basevars in the list
removed.
"""
bases = [n.split('[',1)[0] for n in lst]
return [n for i,n in enumerate(lst)
if not (bases[i] in lst and n != bases[i])] |
def hasTemplate (s):
""" Return True if string s has string templates """
return '{' in s and '}' in s |
def find_index(text, pattern, index=0, iterator=0):
"""Return the starting index of the first occurrence of pattern in text,
or None if not found.
Runtime, worst case: O(n), n is len(text)
Runtime, best case: O(1), if text == ''
Space Complexity: O(1), creating no new variables
"""
assert is... |
def strip_whitespace(value):
"""
Remove leading and trailing whitespace from strings. Return value if not a string.
:param value:
:return: stripped string or value
"""
if isinstance(value, str):
return value.strip()
return value |
def gray(n):
"""
Calculate n-bit gray code
"""
g = [0,1]
for i in range(1,int(n)):
mg = g+g[::-1] # mirror the current code
first = [0]*2**(i) + [2**(i)]*2**(i) # first bit 0/2**i for mirror
g = [mg[j] + first[j] for j in range(2**(i+1))]
return g |
def phase_flip(phase):
"""
Flip phasing
"""
return [(y,x) for x,y in phase] |
def _get_glsl(to_insert, shader_type=None, location=None, exclude_origins=()):
"""From a `to_insert` list of (shader_type, location, origin, snippet), return the
concatenated snippet that satisfies the specified shader type, location, and origin."""
return '\n'.join((
snippet
for (shader_typ... |
def get_rgba_from_color(rgba):
"""Return typle of R, G, B, A components from given color.
Arguments:
rgba - color
"""
r = (rgba & 0xFF000000) >> 24
g = (rgba & 0x00FF0000) >> 16
b = (rgba & 0x0000FF00) >> 8
a = (rgba & 0x000000FF)
return r, g, b, a |
def walk_json(obj, *fields, default=None):
""" for example a=[{"a": {"b": 2}}]
walk_json(a, 0, "a", "b") will get 2
walk_json(a, 0, "not_exist") will get None
"""
try:
for f in fields:
obj = obj[f]
return obj
except:
return default |
def attributes_dict_to_string(attributes_dict):
"""
Converts an attributes dict back into GTF string format.
Args:
attributes_dict: a dict mapping attribute keywords to their
values
Returns:
a string of the given attributes in GTF format
>>> attributes_dict_to_string({... |
def check_complexity(check_bytes: bytes, complexity: int) -> bool:
"""Check the complexity of a bystream to see if it has the proper amount of leading 0 bits
Args:
bytes: byte stream to check for complexity bits
complexity: number of leading bits that must be 0 in order to pass complexity
Re... |
def part2(data):
"""
>>> part2(140)
142
>>> part2(800)
806
>>> part2(INPUT)
349975
"""
x = 0
y = 0
i = 1
value = 1
max_x = 0
max_y = 0
min_x = 0
min_y = 0
direction = 'right'
values = {}
values[(0, 0)] = 1
def adjacent(x, y):
try... |
def get_span_labels(sentence_tags, inv_label_mapping=None):
"""
Desc:get from token_level labels to list of entities, it doesnot matter tagging scheme is BMES or BIO or BIOUS
Returns: a list of entities [(start, end, labels), (start, end, labels)]
"""
if inv_label_mapping:
sentence_tags = [i... |
def make_filename(parts_list):
"""
Assemble items in a list into a full path
Creates a full path file name from a list of parts such as might
have been created by full_path.split('/')
@param parts_list : list of str
@return: str
"""
name = ''
for part in parts_list:
name += '/'+part
return ... |
def square_int_list(int_list):
"""Function that takes a list of integers and squares them
Args:
int_list ([integer]): List that its numbers are going to be squared
Returns:
[list]: List with all its numbers squared
"""
for index in range(len(int_list)):
int_list[index] *= i... |
def raw_name_to_display(raw_name):
"""
Converts the given raw application command name to it's display name.
Parameters
----------
raw_name : `str`
The name to convert.
Returns
-------
display_name : `str`
The converted name.
"""
return '-'.join([w for w... |
def InfoValuesFromAPI(values):
"""Converts a list of strings to an API JsonValue equivalent.
Args:
values: the list of JsonValue strings to be converted
Returns:
An equivalent list of strings
"""
return [v.string_value for v in values] |
def _merge_dictionaries(dictionaries):
"""
Collapse a sequence of dictionaries into one, with collisions resolved by
taking the value from later dictionaries in the sequence.
:param [dict] dictionaries: The dictionaries to collapse.
:return dict: The collapsed dictionary.
"""
result = {}
... |
def eval_string(s):
"""evaluate python statement (String)"""
if s.startswith("eval("):
try:
return eval(s[5:-1])
except:
return s
else:
return s |
def extract_error_msg_from_ldap_exeception(e):
"""
When the LDAP library raises an exeption the error message
contains a descrition and additional info. Return those seperately
instead of a single string.
"""
s = str(e)
d = eval(s)
return d['desc'], d['info'] |
def mnemonic_to_string(mnemonic_str):
"""
Converts a menmonic to a user readable string in the terminal.
"""
mnemonic = mnemonic_str.split()
mnemonics_string = ""
for i in range(0, len(mnemonic)):
mnemonics_string += f"{i + 1}) {mnemonic[i]}"
if i != len(mnemonic) - 1:
... |
def get_lookup_title(window):
"""Get the lookup title for a window."""
parts = window.get("name").split(" - ")
wclass = window.get("window_properties", {}).get("class")
mark = window.get("mark")
if wclass:
parts = [part for part in parts if part.lower() != wclass.lower()]
parts.inser... |
def blinks_count(smiles_list):
"""
groups
:param smiles_list:
:return:
"""
res = []
for i in range(0, len(smiles_list), 4):
a = smiles_list[i: i + 4]
res.append(1) if sum(a) >= 2 else res.append(0)
for element in range(1, len(res) - 1):
if res[element - 1] != res... |
def get_motion(Letter, Word, i):
"""Only consider 'motions' of one character. If a letter
only needs to be move by one position, this is 1/2 an error."""
LWord = len(Word)
if i >= LWord - 1: return 0
if Word[i].lower() == Letter.lower(): return 0
if i > 0:
if Word[i - 1].lower()... |
def get_recipes_in_node(node):
"""Gets the name of all recipes present in the run_list of a node"""
recipes = []
for elem in node.get('run_list'):
if elem.startswith("recipe"):
recipe = elem.split('[')[1].split(']')[0]
recipes.append(recipe)
return recipes |
def reverse(string: str) -> str:
"""Return the string reversed."""
reversed_string = ""
for index in range(len(string) - 1, -1, -1):
reversed_string += string[index]
return reversed_string |
def pangrams(s):
"""Hackerrank Problem: https://www.hackerrank.com/challenges/pangrams/problem
Roy wanted to increase his typing speed for programming contests. His friend suggested that he type the sentence
"The quick brown fox jumps over the lazy dog" repeatedly. This sentence is known as a pangram becau... |
def ord_if_char(value):
"""
Simple helper used for casts to simple builtin types: if the argument is a
string type, it will be converted to it's ordinal value.
This function will raise an exception if the argument is string with more
than one characters.
"""
return ord(value) if (isinstanc... |
def GetCols(x, *columns):
"""
iterable >> GetCols(*columns)
Extract elements in given order from x. Also useful to change the order of
or clone elements in x.
>>> from nutsflow import Collect
>>> [(1, 2, 3), (4, 5, 6)] >> GetCols(1) >> Collect()
[(2,), (5,)]
>>> [[1, 2, 3], [4, 5... |
def binary_search (arr, item):
"""The binary_Search function takes input the sorted list of elements and the item to be searched
and returns the position of the item, if found in the list, else it returns -1 """
beg, end = 0, len(arr)-1
mid = (beg+end)//2
while beg<=end:
mid = (b... |
def successor(node):
"""
Successor is the next highest value.
In a bst, every value in the left tree is smaller than the node and every value in the right is greater.
8
4 13
2 6 10 16
1 3 5 7 9 11 15 18
"""
if not node:
return None
... |
def get_correct_narrative_timestep(
sim_yr,
narrative_timesteps
):
"""Based on simulated year select the correct
narrative timestep, i.e. the year which is
to be used from the narrative
Arguments
---------
sim_yr : int
Simulation year
narrative_timesteps : list
... |
def trimmed_split(s, seps=(";", ",")):
"""Given a string s, split is by one of one of the seps."""
for sep in seps:
if sep not in s:
continue
data = [item.strip() for item in s.strip().split(sep)]
return data
return [s] |
def detect_roi(u_array, c_array, u_cutoff, min_length=50):
"""Report u_array regions that are above u_cutoff"""
roi = list()
in_region = False
base_pos = 1
for u_score, c_score in zip(u_array, c_array):
if in_region == False and u_score >= u_cutoff:
in_region = True # turn... |
def WriteDubious(outfile,infile,code, station, time):
"""
Write note to dubious file list.
:param string outfile: filename to be written to
:param string infile: filename of dubious file
:param string code: text identifier of variables being tested
:param string station: station ID being pr... |
def mem_text(trial):
"""
input: current memory trial # (int)
output: memory instruction text (string) for given memory trial
"""
mem1 = ' Now we\'re going to test your memory. ' \
'\n Just like the practice round, you will rate single images using the following scale: ' \
... |
def get_user_group(dest):
"""
Given a dictionary object representing the dest JSON in the late bind config's parameter file, return two
values, the user and group
Args:
dest: dict object from the late bind config's parameters file e.g. dest["user_group"] = "Bob:devops"
Returns:
user: user that th... |
def _catc_tags(start_num, end_num):
"""
Return a list of CATC tags corresponding to the start test number and end
test number. For example, start=1 and end=3 would return:
["CATC-001", "CATC-002", "CATC-003"].
"""
return ["CATC-0{0:02d}".format(i) for i in range(start_num, end_num + 1)] |
def seven_byte_length(value):
"""
Returns the minimum number of bytes required to represent the integer
if we can use seven bits per byte.
Positive integers only, please!
"""
q, rem = divmod(value.bit_length(), 7)
if rem or not q:
# (the not q is in case value is 0, we can't have 0 b... |
def html_header(title, page_heading=None, highlight_targets=False):
"""Write HTML file header. TITLE and PAGE_HEADING parameters are
expected to already by HTML-escaped if needed. If HIGHLIGHT_TARGETS
is true, then write out a style header that causes anchor targets to be
surrounded by a red border when they are ... |
def tabout(*args):
"""Return a tab-delimited string from the list
"""
output = ['NA' if x is None else str(x) for x in args]
return "\t".join(output) |
def initialize_contral_vars(ubr_index,slabs,keys):
"""
for multi-dimensional minimum, variables should be a list or array
"""
# to change the pandas matrix in ubr_index to list
def tolist(mat):
# get the matrix size
c,r = mat.shape
# targ... |
def _solve_datasets_references(dsets: list) -> dict:
"""
Solve datasets/dictionary internal references
"""
def _solve_self_references(mapin: dict) -> dict:
"""
Return version of 'maps_in' where simple "{internal}-{reference}" are resolved.
Example:
input:
... |
def sfrd(z,theta):
""" Computes star formation history according to chosen parametrisation """
ap,bp,cp,dp = theta
rhosfr = ap*(1+z)**bp/(1+((1.+z)/cp)**dp)
return rhosfr |
def format_number(number):
"""Format a number to more readable sting.
Args:
str: A string containing the formated number.
Example:
>>> format_number(321)
'321'
>>> format_number(5_432)
'5,432'
>>> format_number(7_654_321)
'7,654,321'
>>> f... |
def merge_dicts(*dictionaries):
""" Merge multiple dictionaries. Last argument can be a boolean determining if the dicts can erase each other's content
Examples
--------
>>> dict1 = {'label': 'string'}
>>> dict2 = {'c': 'r', 'label': 'something'}
>>> merge_dicts(dict1, dict2, False)
{'labe... |
def ansible_host(server, host_vars):
"""Get the ansible host. This will be used to ssh into the host.
Change this to whatever you need.
In this example we take the first IP from the "provider-790"
network. If not present, try the first ip.
:param server: Server object from nova api
:type serve... |
def ifpure(list2judge: list, typeexpected: type):
"""
"""
for i in list2judge:
if type(i) is not typeexpected:
return False
return True |
def transform_prediction_to_scidtb_format(edus, arcs):
"""
Parameters
----------
edus: list[list[str]]
arcs: list[(int, int, str)]
Returns
-------
dict[str, list[str, any]]
"""
output = {"root": []}
output["root"].append({"id": 0,
"parent": -1,
... |
def is_scalar(value):
"""
Primitive version, relying on the fact that JSON cannot
contain any more complicated data structures.
"""
return not isinstance(value, (list, tuple, dict)) |
def cmp_column_indices(x,y):
"""Comparision function for column indices
x and y are XLS-style column indices e.g. 'A', 'B', 'AA' etc.
Returns -1 if x is a column index less than y, 1 if it is
greater than y, and 0 if it's equal.
"""
# Do string comparision on reverse of column indices
ret... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.