content stringlengths 42 6.51k |
|---|
def get_point(coords, lat_first):
"""Converts GeoJSON coordinates into a point tuple"""
if lat_first:
point = (coords[1], coords[0])
else:
point = (coords[0], coords[1])
return point |
def is_newer_version(localv: str, remotev: str) -> bool:
"""Checks if there is a more current version."""
if float(localv) < float(remotev):
return True
else:
return False |
def move_anchor_to_key(obj):
"""
Recursively add a 'anchor' key based on the yaml anchor.
@param obj: the object we are currently processing.
@return: If applicable, object with ['anchor'] = obj.anchor.value.
"""
# If this is a list, return a list of modified objects.
if isinstance(obj, list... |
def rect_corners(rect):
""" Returns cornerpoints of given rectangle.
>>> rect_corners((1,2,1,3))
((1, 2), (2, 2), (2, 5), (1, 5))
"""
tl = (rect[0],rect[1])
tr = (rect[0]+rect[2],rect[1])
br = (rect[0]+rect[2],rect[1]+rect[3])
bl = (rect[0],rect[1]+rect[3])
return (tl,tr... |
def round_decimal_to_str(value, to=3):
"""
Utility method for rounding the decimal value to string to given digits
@param value : value to round
@param to : how many decimal points to round to
"""
rounded_value = "-"
if value is None:
return rounded_value
rounded... |
def xact_amount(xact, negate, append_currency):
"""Returns a string with the formatted transaction amount"""
v = -xact["amount"] if negate else xact["amount"]
fmt_str = "{:.2f} {}" if append_currency else "{:.2f}"
ccode = xact["iso_currency_code"]
return fmt_str.format(v, ccode) |
def isanyinstance(o, classes):
"""calls isinstance on a list of classes.
true if any matches"""
for cls in classes:
if isinstance(o, cls):
return True
return False |
def dict_to_paths(root, d):
"""Get all the paths in a dictionary.
For example:
>>> root = ('root', 'subroot')
>>> d = {
... 'a': {
... 'b': 'c',
... },
... 'd': 'e',
... }
>>> dict_to_paths(root, d)
[(('root', 'subroot', 'a', 'b'), 'c'), (('root', 'subro... |
def is_substitution_two_bases_nonadjacent(hgvs):
"""
This function takes an hgvs formatted string and returns True if the hgvs string indicates
there were substitutions (non-adjacent) in the codon.
Parameters
----------
hgvs : string
hgvs formatted string
Returns
-------
su... |
def assign(target, *sources):
"""
Description
----------
Assign all values from the sources into the target dictioanary.\n
Mutates target dictionary.
Parameters
----------
target : dict - target dictionary to assign values to\n
*sources : dict - dictionaries to pull keys and vlaues ... |
def snippet2js(expr):
"""Convert several lines (e.g. a Code Component) Python to JS"""
# for now this is just adding ';' onto each line ending so will fail on
# most code (e.g. if... for... will certainly fail)
# do nothing for now
return expr |
def frange(min, max, delta):
""" Floating point range. """
count = int(round((max - min) / delta)) + 1
return [min + i*delta for i in range(count)] |
def is_user_in_group(user, group):
"""
Return True if user is in the group, False otherwise.
Args:
user(str): user name/id
group(class:Group): group to check user membership against
"""
if user is None or len(user) == 0 or group is None:
return False
if user in group.users:... |
def valid_limit(limit, ubound=100):
"""Given a user-provided limit, return a valid int, or raise."""
assert limit is not None, 'limit must be provided'
limit = int(limit)
assert limit > 0, "limit must be positive"
assert limit <= ubound, "limit exceeds max (%d > %d)" % (limit, ubound)
return lim... |
def isOnlySpecialCharacters(word):
"""
Checks if the string passed is comprised entirely of special characters typically allowed in passwords
"""
for i in range(len(word)):
if word[i].isalpha() or word[i].isdigit():
return False
return True |
def get_subsecond_component(frac_seconds, frac_seconds_exponent,
subsec_component_exponent, upper_exponent_limit):
"""Return the number of subseconds from frac_seconds *
(10**frac_seconds_exponent) corresponding to subsec_component_exponent that
does not exceed upper_exponent_lim... |
def factorial(n: int) -> int:
"""Factorial"""
if n <= 1:
return 1
return n * factorial(n - 1) |
def window_optical_flow(vec, window):
"""
Return pairs of images to generate the optical flow.
These pairs contains the first and the last image of the optical flow
according to the size of the window.
Parameters:
-----------
vec : array_like
sorted list containing the image ids... |
def UnclippedObjective(probs_ratio, advantages):
"""Unclipped Objective from the PPO algorithm."""
unclipped_objective = probs_ratio * advantages
return unclipped_objective |
def e_sudoeste(arg):
"""
e_sudoeste: direcao --> logico
e_sudoeste(arg) tem o valor verdadeiro se arg for o elemento 'SW' e falso
caso contrario.
"""
return arg == 'SW' |
def dollars2cents(dollars):
"""Convert dollars to cents"""
cents = dollars * 100
return cents |
def get_nested_val(data, key):
"""
Return value of dictionary by nested key separated by a '.' character used
in e.g. Mongodb notation.
:param data: Nested dictionary
:param key: Nested key (Example "level1.level2.level3")
:return: Value of field or None if the field doesn't exist, true or... |
def blockchain_buyin_calc(desired_buyin: int):
"""blockchain.poker clean buy-in calculator with 2.5/2.5% tournament rake"""
fee = desired_buyin / 19
return round(desired_buyin + fee) |
def merge_sort(array):
"""
Merge Sort
Complexity: O(NlogN)
"""
if len(array) > 1:
mid = len(array) // 2
left = array[:mid]
right = array[mid:]
left = merge_sort(left)
right = merge_sort(right)
array = []
# This is a queue implem... |
def minimize_int(c, f):
"""Return the smallest byte for which a function `f` returns True, starting
with the byte `c` as an unsigned integer."""
if f(0):
return 0
if c == 1 or f(1):
return 1
elif c == 2:
return 2
if f(c - 1):
hi = c - 1
elif f(c - 2):
... |
def windows_path_to_sublime_path(path):
"""
Removes the colon after the drive letter and replaces backslashes with
slashes.
e.g.
windows_path_to_sublime_path("C:\somedir\somefile")
== "C/somedir/somefile"
"""
assert path[1] == u':'
without_colon = path[0] + path[2:]
re... |
def is_divisible(x, y):
""" checks if x is divisible by y"""
return x >= y and float(x) / y == x // y |
def get_boolean_attribute_value(attrs, attr_name):
""" Helper function to convert a string version
of Boolean attributes to integer for ONNX.
Takes attribute dictionary and attr_name as
parameters.
"""
return 1 if attrs.get(attr_name, 0) in ["True", "1"] else 0 |
def verify_account_available(email):
"""
Check to see if this email is already registered
"""
#Run a query, use an ORM, use Twilio to call someone and ask them :-)
return True |
def _log2_ratio_to_absolute_pure(log2_ratio, ref_copies):
"""Transform a log2 ratio to absolute linear scale (for a pure sample).
Purity adjustment is skipped. This is appropriate if the sample is germline
or if scaling for tumor heterogeneity was done beforehand.
.. math :: n = r*2^v
"""
ncop... |
def _ReportErrorFileAndLine(filename, line_num, dummy_line):
"""Default error formatter for _FindNewViolationsOfRule."""
return '%s:%s' % (filename, line_num) |
def check_game_over(board):
"""
Return:
-1 --> Game not over
0 --> X won
1 --> O won
2 --> draw
"""
for i in range(3):
if all([board[i + 3*n] > -1 for n in range(3)]) and board[i] % 2 == board[i + 3] % 2 == board[i + 6] % 2:
return board[i] % 2
if a... |
def remove_line_matching_from_hosts(dns_name):
"""Removes the first line that contains dns_name from /etc/hosts"""
return "sudo sed -i.bak '/" + dns_name + "/d' /etc/hosts && sudo rm /etc/hosts.bak\n" |
def _json_serializer(obj):
"""
JSON add-on that will transform classes into dicts, and sets into special
objects to be decoded back into sets with `util.JSONDecoder`.
"""
if getattr(obj, '__dict__', False):
return {'__type': type(obj).__name__, '__dict': obj.__dict__}
if isinstance(obj, ... |
def non_strict_neg(a):
"""Non-strict negation
Arguments:
- `a`: a boolean
"""
if a == None:
return None
else:
return not a |
def get_bits(x, h, l):
"""
Extract a bitrange from an integer
"""
return (x & ((1<<(h+1))-1)) >> l |
def resize_quota_delta(context, new_flavor, old_flavor, sense, compare):
"""Calculate any quota adjustment required at a particular point
in the resize cycle.
:param context: the request context
:param new_flavor: the target instance type
:param old_flavor: the original instance type
:param sen... |
def get_image_name(name: str, tag: str, image_prefix: str = "") -> str:
"""Get a valid versioned image name.
Args:
name (str): Name of the docker image.
tag (str): Version to use for the tag.
image_prefix (str, optional): The prefix added to the name to indicate an organization on Docke... |
def toplexify(simplices):
"""Reduce a simplicial complex to merely specification of its toplices"""
simplices = sorted(simplices, key=len, reverse=True)
return [
spx
for i, spx in enumerate(simplices)
if not [
sp2
for j, sp2 in enumerate(simplices)
... |
def url_path_join(*pieces):
"""Join components of url into a relative url
Use to prevent double slash when joining subpath. This will leave the
initial and final / in place
"""
initial = pieces[0].startswith('/')
final = pieces[-1].endswith('/')
stripped = [s.strip('/') for s in pieces]
... |
def euler_problem_26(n=1000):
"""
A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
1/2 = 0.5
1/3 = 0.(3)
1/4 = 0.25
1/5 = 0.2
1/6 = 0.1(6)
1/7 = 0.(142857)
1/8 = 0.125
1/9 = 0.(1)
1/10= ... |
def get_instance_eni_mapping(instance_type, eni_mapping):
"""Get instance elastic network interface mapping
Args:
instance_type (string): Instance type
eni_mapping (dict): Elastic network interface mappings
Returns:
Tuple: Instance elastic network interface mapping
"""
inst... |
def clean_pos(pos):
"""clean and split tags
:return tags: list of tags in a word
"""
tags = []
for tag in pos.split("_"):
tag = tag.strip("@")
tag = tag.strip("%")
tags.append(tag)
return tags |
def divide_num(a, b):
"""
Given two number, this function will return the first number divided by the second
Returned numerical's type is a float
"""
if(b == 0):
raise TypeError("Divide by Zero Not Allowed")
else:
return a/b |
def get_current_state(slack, usergroups):
"""
Get the current state of the Slack cluster usergroups.
:param slack: client for calling Slack API
:type slack: reconcile.utils.slack_api.SlackApi
:param usergroups: cluster usergroups to get state of
:type usergroups: Iterable
:return: current... |
def interval_intersection(interval1, interval2):
"""Compute the intersection of two open intervals.
Intervals are pairs of comparable values, one or both may be None to
denote (negative) infinity.
Returns the intersection if it is not empty.
>>> interval_intersection((1, 3), (2, 4))
(2, 3)
... |
def interpretFromString(value):
"""
returns the python equivalent value from an xml string (such as an attribute value):
value - the html value to interpret
"""
lowerCaseValue = value.lower()
if lowerCaseValue == "true":
return True
elif lowerCaseValue == "false":
... |
def _height(current):
"""Calculate the height of a given node by descending recursively until
there are no further child nodes. Return the number of children in the
longest chain down.
This is a helper function for the AVL class and BST.__str__().
Abandon hope all ye who modify this function.
... |
def get_page_uuid(pg_num, paginations):
"""Get page annotation uuid
Args:
pg_num (int): img num
paginations (dict): pagination layer
Returns:
uuid: uuid of page annotation of pg num
"""
for uuid, pagination in paginations.items():
if pagination["imgnum"] == pg_num:
... |
def _usaf_to_city(usaf):
"""
The raw data-file uses USAF-codes to identify weather-stations.
If you download another data-set from NCDC then you will have to
change this function to use the USAF-codes in your new data-file.
"""
table = \
{
60300: 'Aalborg',
60700... |
def detect_script(script_or_function):
""" Detects if argument is script or function | obj --> bool
Returns True for script or False for function
"""
script_fail_error = 'Failed to detect if route points to script or function.\n'
script_fail_error += 'Please specify it manually with the script kwar... |
def _validate_registrar_token_dict(token: dict) -> bool:
"""
Make sure registrar token has correct fields
Args:
token: dictionary token from registrar
Returns:
True if token has required fields
False if token is missing required fields
"""
try:
assert token.get("... |
def get_summary(error_total, mismatch_total, missing_total, extra_total):
"""Get one-line summary of validation results."""
is_diff = mismatch_total or missing_total or extra_total
if not error_total and not is_diff:
return 'Validation successful. No differences detected.'
summary = ''
if error_total:
... |
def reduce_pes_dct_to_user_inp(pes_dct, pesnums):
""" get a pes dictionary containing only the PESs the user is running
"""
run_pes_dct = {}
for pes_idx, formula in enumerate(pes_dct):
if pes_idx+1 in pesnums:
run_pes_dct[formula] = pes_dct[formula]
return run_pes_dct |
def iou(bbox1, bbox2):
"""
Calculates the intersection-over-union of two bounding boxes.
Args:
bbox1 (numpy.array, list of floats): bounding box in format x,y,w,h.
bbox2 (numpy.array, list of floats): bounding box in format x,y,w,h.
Returns:
int: intersection-over-onion of bbox1,... |
def repo_url_to_name(url: str) -> str:
"""Method to generate a directory name from the repo URL for local storage
Assumes URL of the form whatever/namespace/repo(.git)(@branch). SSH URLs will not work.
Args:
url(str): repository URL
Returns:
str
"""
if "@" in url:
url,... |
def v7_is_anagram(word1, word2):
"""Return True if the given words are anagrams.
Replacing the alphabet.
"""
word1, word2 = word1.lower(), word2.lower()
letters1 = sorted(c for c in word1 if c.isalpha())
letters2 = sorted(c for c in word2 if c.isalpha())
return letters1 == letters2 |
def get_vocabs(datasets):
"""Build vocabulary from an iterable of datasets objects
Args:
datasets: a list of dataset objects
Returns:
a set of all the words in the dataset
"""
print("Building vocab...")
vocab_intents = set()
vocab_words = set()
vocab_tags = set()
f... |
def int_to_roman(value):
"""
Convert from decimal to Roman
"""
if not 0 <= value < 4000:
raise ValueError("Argument must be between 1 and 3999")
ints = (1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1)
nums = ('M', 'CM', 'D', 'CD', 'C', 'XC',
'L', 'XL', 'X', 'IX', 'V', '... |
def assign_params(sess, params, network):
"""Assign the given parameters to the TensorLayer network.
Parameters
----------
sess : TensorFlow Session. Automatically run when sess is not None.
params : a list
A list of parameters in order.
network : a :class:`Layer` class
The netw... |
def IntersectionBoolean(x: list, y: list, z: int) -> bool:
"""Returns whether or not two lists overlap with at least z common elements."""
return len(set(x) & set(y)) >= z |
def get_class_names_from_class_mapping(class_mapping):
"""
Parameters
----------
class_mapping : list(list), optional
class_mapping as it represented in deployment_document.json:
[["GALAXY", 0], ["QSO", 1], ["STAR", 2]]
Returns
-------
classes, sorted list of class labels
... |
def get_core_info_str(json_data):
""" extracts the important information from the push payload as string"""
result = {'id': json_data['id'],
'owner': json_data['repository']['owner_name'],
'repo': json_data['repository']['name'],
'state': json_data['status_message'],
... |
def precision_score(true_entities, pred_entities):
"""Compute the precision."""
nb_correct = len(true_entities & pred_entities)
nb_pred = len(pred_entities)
score = nb_correct / nb_pred if nb_pred > 0 else 0
return score |
def rgba_to_pl(rgb_color, alpha=False):
"""
"""
# res = []
# for color in rgb_colors:
# if not alpha:
# color = color[:3]
return '#{:x}{:x}{:x}'.format(*rgb_color) |
def _compare_items(a, b):
"""
Compares the items of the specified nodes.
In particular, this function will:
- return True if both nodes are null.
- return False if one node is null and the other is not.
- return the comparison of each node's items, otherwise.
:param a: A node t... |
def find_min_max(values: list):
"""Print the minimum and maximum value from values.
"""
min = None
max = None
for value in values:
if max == None or value > max:
max = value
if min == None or value < min:
min = value
print('The minimum value is {0}'.format... |
def _pad_sequences(maxlen, seq, pad_x=0, pad_y=0, pad_v=0):
"""Removes sequences that exceed the maximum length.
# Arguments
maxlen: Int, maximum length of the output sequences.
seq: List of lists, where each sublist is a sequence.
label: List where each element is an integer.
# Re... |
def r_dis_a(k, cao, x):
"""
rate of consumption (disappearance) of species A for HW3 prob 1
:param k: rate coefficient at temp of interest (1/min)
:param cao: initial concentration of A in mol/L
:param x: conversion of A
:return: rate in mol/L-mib
"""
return k * cao * (1 - x) |
def ground(visited_node_dict, end_node):
"""
'grounds' a rod: it returns a list of nodes given a dict of nodes pointing to their precessor.
For example:
{2 : 1, 3 : 2, 5 : 3}, 5 -> [1, 2, 3, 5]
"""
res = []
curr = end_node
while curr is not None:
res.append(curr)
... |
def get_url(provider, tail):
"""
This function will construct the base URL for REST API execution
"""
api_root = 'https://{}:14161'.format(provider)
return api_root + tail |
def _tef_P(P):
"""Define the boundary between Region 3e-3f, T=f(P)
>>> "%.7f" % _tef_P(40)
'713.9593992'
"""
return 3.727888004*(P-22.064)+647.096 |
def remove_pin_from_model(pin, model):
"""
Removes the pin from model name if present.
Arguments
---------
pin: str
Pin name
mode: str
Timing model name
Returns
-------
str
Updated timing model name
>>> remove_pin_from_model("q", "ff_init_d_q")
'f... |
def snake_to_camel_case(name, answers=None):
"""
Accept a snake_case string and return a CamelCase string.
For example::
>>> snake_to_camel_case('cidr_block')
'CidrBlock'
"""
if answers and name in answers:
return answers[name]
name = name.replace("-", "_")
return "".join... |
def _name_filter(files, name):
"""Filtre par nom de fichier"""
filtered_files = []
for file in files:
file_name = ".".join("".join(file.split('/')[-1]).split('.')[:-1])
if file_name == name:
filtered_files.append(file)
return filtered_files |
def _clean_args(*args):
"""
Helper function for delegating arguments to Python string
functions.
Many of the Python string operations that have optional arguments
do not use 'None' to indicate a default value. In these cases,
we need to remove all None arguments, and those following the... |
def _check_list(remote_values, local_values):
"""
Tests that all the elements of the sublist are present in the collection
:param list remote_values: The tested values
:param list local_values: The member values
:rtype: bool
"""
if remote_values is None:
remote_values = []
if lo... |
def loop_detection(xs, N, M, DEBUG=False):
"""
>>> loop_detection([3, 2, 1, 1], 5, 10, True) == sum([3, 2, 1, 1, 1])
loop: [1]
True
>>> loop_detection([3, 2, 1, 2], 5, 10, True) == sum([3, 2, 1, 2, 1])
loop: [2, 1]
True
>>> loop_detection([3, 2, 1, 3], 5, 10, True) == sum([3, 2, 1, 3, ... |
def frontiers_from_bar_to_time(seq, bars):
"""
Converts the frontiers (or a sequence of integers) from bar indexes to absolute times of the bars.
The frontier is considered as the end of the bar.
Parameters
----------
seq : list of integers
The frontiers, in bar indexes.
bars : list... |
def _py_for_stmt(iter_, extra_test, body, get_state, set_state, init_vars):
"""Overload of for_stmt that executes a Python for loop."""
del get_state, set_state
state = init_vars
if extra_test is not None:
if extra_test(*state):
for target in iter_:
state = body(target, *state)
if not... |
def dict_without_none_entries(dictionary):
"""
Return the shallow copy of the dictionary excluding the items that have None values.
"""
return {key: value for key, value in dictionary.items() if value is not None} |
def format_git_describe(git_str, pep440=False):
"""format the result of calling 'git describe' as a python version"""
if git_str is None:
return None
if "-" not in git_str: # currently at a tag
return git_str
else:
# formatted as version-N-githash
# want to convert to ve... |
def write_table_dict(table_dict, string, label, pos, total, alt_info, tensor_shape, pileup):
"""
Write pileup or full alignment tensor into a dictionary.compressed bin file.
table_dict: dictionary include all training information (tensor position, label, altnative bases).
string: input tensor string, ne... |
def fudgeToEndlInterpolation( interpolation ) :
"""This function converts a fudge interpolation value into an end interpolation value (see endlToFudgeInterpolation
for valid interpolation vales."""
if( ( interpolation < 0 ) or ( interpolation > 3 ) ) : raise Exception( "Invalid FUDGE interpolation value = ... |
def parse_gpu_list(gpu_list_str):
"""
Parse a string representing a list of GPU indices to a list of
numeric GPU indices. The indices should be separated by commas.
Two special values are understood: the string "None" will produce
an empty list, and the string "all" will produce the value None
... |
def constant_increment_growth_rule(increment, level):
"""
The number of samples in the 1D quadrature rule where number of of points
grow by a fixed constant at each level.
Parameters
----------
level : integer
The level of the quadrature rule
Return
------
num_samples_1d : i... |
def multiply(value, arg):
"""Multiply the value"""
try:
return float(value) * float(arg)
except ValueError:
pass
return "" |
def is_sequence(arg):
"""Returns true if arg is a list or another Python Sequence, and false otherwise.
source: https://stackoverflow.com/a/17148334/99379
"""
return (not hasattr(arg, "strip") and
hasattr(arg, "__getitem__") or
hasattr(arg, "__iter__")) |
def flip_v(grid):
"""Flip grid vertically."""
return '\n'.join(reversed(grid.split('\n'))) |
def add(num1: float, num2: float) -> float:
"""Add two numbers"""
result = num1 + num2
print(f"{num1} + {num2} = {result}")
return result |
def n_queens(n):
"""Return a solution to the n-queens problem for an nxn board.
This uses E. Pauls' explicit solution, which solves n > 3.
A solution is possible for all n > 3 and n = 1.
Pauls' solution gives back 1-based indices, and we want 0-based, so all
points have an extra -1 from the origina... |
def dict_merge(a, b):
"""
Merges two dictionaries, combining their keys/values at each level of nesting. If keys are duplicated between
dictionaries, the values in the latter dictionary (b) will override those in the former (a).
(This is different from a regular dict.update() in that it is recursive, r... |
def get_edge(s, t, source_label, target_label, edge_label):
"""Get edge by the ids of its incident nodes."""
query =\
"MATCH (n:{} {{id: '{}'}})-[rel:{}]->(m:{} {{id: '{}'}})".format(
source_label, s, edge_label, target_label, t) +\
"RETURN rel\n"
return query |
def get_party_leads_sql_string(party_id):
"""
:type party_id: integer
"""
str = """ select
lr.candidate_id,
c.fullname as winning_candidate,
lr.constituency_id,
cons.name as constituency,
lr.party_id,
lr.max_votes,
(lr.max_votes-sr.votes) as lead,
... |
def smart_str(s, encoding='utf8'):
""" Convert unicode to str. If s is str, return itself.
>>> smart_str(u'')
''
>>> smart_str(u'abc')
'abc'
>>> smart_str(u'\u4f60\u597d') == '\xe4\xbd\xa0\xe5\xa5\xbd'
True
>>> smart_str('abc')
'abc'
>>> smart_str('\xe4\xbd\xa0\xe5\xa5\xbd') == ... |
def first_item(a):
"""
Return the first item of an iterable.
Parameters
----------
a : object
Iterable to get the first item from.
Returns
-------
object
Raises
------
StopIteration
If the iterable is empty.
Examples
--------
>>> a = range(10)
... |
def advance(board):
"""
Advance the board one step and return it.
"""
new_board = set()
for cell in board:
# your code below
pass
return new_board |
def winnow(statuses, arg, status_key, func=None):
"""
Call with a list of statuses, and the ctx.<key>
'arg' that you may want to filter by.
If arg is not None, filter statuses by either:
1) func=None: filter by status[status_key] == arg
remove any status that fails
2) func=<filter function... |
def filter_partition(partition, group_by_func, nop, bucket_number):
"""
"""
filtered_list = list()
for k, v in partition:
if (group_by_func(k) % nop) == bucket_number:
filtered_list.append((k, v))
return filtered_list |
def OBJECT_TO_ARRAY(_object):
"""
Converts a document to an array. The return array contains a element for each field/value pair in the original document.
See https://docs.mongodb.com/manual/reference/operator/aggregation/objectToArray/
for more details
:param _object: can be any valid expression as... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.