content stringlengths 42 6.51k |
|---|
def _is_asn(asnstr):
""" check if asnstr is a valid AS number"""
if asnstr.upper().startswith('AS'):
return True
return False |
def hello_name(name: str) -> str:
"""Return `Hello name!`.
:return:`Hello name!`
"""
return f'Hello {name}!' |
def DAY_OF_YEAR(expression):
"""
Returns the day of the year for a date as a number between 1 and 366.
See https://docs.mongodb.com/manual/reference/operator/aggregation/dayOfYear/
for more details
:param expression: expression or variable of a Date, a Timestamp, or an ObjectID
:return: Aggregat... |
def prep_err_bars(intervals, metrics):
"""
Convert confidence intervals to specific values to be plotted, because xerr values are +/- sizes relative to the data:
"""
if intervals is None:
return None
errs = [[], []]
for index, interval in enumerate(intervals):
min_bar = interval[... |
def sanitize(some_tuple) :
"""
some_tuple: a tuple of strings
Removes all spaces, dashes, and open/closed parenthesis in each string
Returns a tuple with cleaned up string elements
"""
clean_str = ()
for s in some_tuple :
s = s.replace(" ", "")
s = s.replace("-", "")
... |
def VR(radius, thickness):
"""
Volume ratio
@param radius: core radius
@param thickness: shell thickness
"""
return (1, 1)
whole = 4.0/3.0 * pi * (radius + thickness)**3
core = 4.0/3.0 * pi * radius**3
return whole, whole - core |
def do_list_like(the_list, ref_list, force=False):
""" if the_list is not a list of lists, it returns a list with n copies
of the_list, where n is len(ref_list)."""
if force or (the_list is not None and not type(the_list[0]) is list):
return [the_list for x in range(len(ref_list))]
else:
... |
def split_message(message: str, limit: int=2000):
"""Splits a message into a list of messages if it exceeds limit.
Messages are only split at new lines.
Discord message limits:
Normal message: 2000
Embed description: 2048
Embed field name: 256
Embed field value: 1024"""
... |
def _update_indices(source_idcs, update_idcs, update):
"""
For every element s in source_idcs, change every element u in update_idcs
according to update, if u is larger than s.
"""
if not update_idcs:
return update_idcs
for s in source_idcs:
update_idcs = [u + update if u > s el... |
def process_data(employee_list):
"""
Takes the employee list built by read_employees() and does a count of the Department data
"""
department_list = []
for employee_data in employee_list:
department_list.append(employee_data['Department'])
department_data = {}
for department_name ... |
def check_value(value: bytearray, size_value: int) -> bool:
"""
Check the correctness of the variable.
This function checks the type ('bytes' or 'bytearray') and whether
the size of the 'value' variable matches the 'size_value' value.
Args:
value: The variable that you want to check.
... |
def rectify(link:str, parent:str, path:str):
"""A function to check a link and verify that it should be captured or not.
For e.g. any external URL would be blocked. It would also take care that all the urls are properly formatted.
Args:
**link (str)**: the link to rectify.
**parent (str)**: the complete url of ... |
def null_padded(string: str, length: int) -> bytes:
"""
Force a string to a given length by right-padding it with zero-bytes,
clipping the initial string if necessary.
"""
return bytes(string[:length] + ('\0' * (length - len(string))), 'latin1') |
def combine_name(name1, name2):
""" Function used to combine team and project name """
return f'{name1} ({name2})' |
def _sp_display(species):
"""Format species classification for reports, see also _sp_sort_key."""
if " " in species:
return species
elif species:
return species + " (unknown species)"
else:
return "Unknown" |
def get_instances_output(instances):
"""
@type instances: list
"""
ret = ""
for instance in instances:
ret += "{0}\n".format(instance.get('InstanceId'))
if ret:
return ret.rstrip() |
def ToStr(byte_string):
"""Converts a string in bytes form to UTF-8.
Args:
byte_string: A byte-encoded string.
Returns:
The byte-encoded string in UTF-8, or the original object if already a string.
"""
if isinstance(byte_string, str):
return byte_string
else:
return byte_string.decod... |
def unflatten_dict(d_flat):
"""Unflattens single-level-tuple-keyed dict into dict
"""
result = type(d_flat)()
for k_tuple, v in d_flat.items():
d_curr = result
for i, k in enumerate(k_tuple):
if i == len(k_tuple) - 1:
d_curr[k] = v
elif k not in d_... |
def gen_numvec(numb, length):
"""
Given a number return a vector of 1's and 0's corresponding to that
number's binary value.
"""
ovec = []
for _ in range(0, length):
ovec.append(numb % 2)
numb //= 2
return ovec |
def joints_2_str(joints):
"""Contverts a joint target to a string"""
return '[%s]' % (', '.join(format(ji, ".5f") for ji in joints)) |
def test_record_min_max(record):
"""Determine whether the desired char is represented a certain number of times
(inclusively between a given min & max)
"""
pw = record['pw']
for rule in record['rules']:
true_num = pw.count(rule['char'])
if (true_num < rule['low']) | (true_num > ... |
def get_module_params_subsection(module_params, tms_config, resource_key=None):
"""
Helper method to get a specific module_params subsection
"""
mp = {}
if tms_config == "TMS_GLOBAL":
relevant_keys = [
"certificate",
"compression",
"source_interface",
... |
def _strip(tag):
"""
Tag renaming function to remove whitespace, depending on the csv format
column heading items can pick up some extra whitespace when read into Pandas
"""
return tag.strip() |
def project_directory(packaged_scene, package_root, source_scene):
"""
Project directory to use in scene settings
Returns:
Project directory str
"""
return " project_directory \"[python nuke.script_directory()]\"\n" |
def _get_command_name(command_raw: str) -> str:
"""Return command name by splitting up DExTer command contained in
command_raw on the first opening paranthesis and further stripping
any potential leading or trailing whitespace.
"""
return command_raw.split('(', 1)[0].rstrip() |
def sorted_k_partitions(seq, k):
"""Returns a list of all unique k-partitions of `seq`.
Each partition is a list of parts, and each part is a tuple.
The parts in each individual partition will be sorted in shortlex
order (i.e., by length first, then lexicographically).
The overall list of partiti... |
def convert_sco_ndfd_datetime_str(datetime_str):
"""
Description: takes string of format "%Y-%m-%d %H:%M" and converts it to the "%Y%m%d%H", "%Y%m%d", and "%Y%m" formats
Parameters:
datetime_str (str): A string in "%Y-%m-%d %H:%M" format (e.g., "2016-01-01 00:00")
Returns:
datetime_ym_st... |
def _component_code_key(val):
"""
Compare two single character component codes according to sane ZNE/ZRT/LQT
order. Any other characters are sorted afterwards alphabetically.
>>> from random import shuffle
>>> from string import ascii_lowercase, ascii_uppercase
>>> lowercase = list(ascii_lowerc... |
def sort_publications(pubs):
"""Sort a list of publications by repository version.
Higher repository versions are listed first.
"""
def key(pub):
# Format: /pulp/api/v3/repositories/rpm/rpm/<repo UUID>/versions/<version>/
rv = pub["repository_version"]
return int(rv.split("/")[-... |
def get_number(input_string: str) -> tuple:
"""
Return a float out of the input string.
Parameters
----------
input_string : str
String with the number.
Returns
-------
tuple
The number and the length of the number in the string.
"""
number_sting = ""
if inp... |
def insert_into_sentence(sentence, insertions):
"""Sorts and performs insertions from right.
Args:
sentence: Sentence to perform insertions into
insertions: List of insertions, format: (position, text_insert)
Returns:
sentence: Inplace inserted sentence
"""
insertions = sorted(insertions, key=l... |
def sum_pairs(nums, goal):
"""Return tuple of first pair of nums that sum to goal.
For example:
>>> sum_pairs([1, 2, 2, 10], 4)
(2, 2)
(4, 2) sum to 6, and come before (5, 1):
>>> sum_pairs([4, 2, 10, 5, 1], 6) # (4, 2)
(4, 2)
(4, 3) sum to 7, and finish before (5, 2):
... |
def _first_largest(scores):
""" Similar to max, but returns the first element achieving the high score
If max receives a tuple, it will break a tie for the highest value
of entry[i] with entry[i+1]. We don't want that here - to better match
with the results of other tools, we want to be able to define ... |
def redswir1(b4, b11):
"""
Red and SWIR bands difference (Jacques et al., 2014).
.. math:: RedSWIR1 = b4 - b11
:param b4: Red.
:type b4: numpy.ndarray or float
:param b11: SWIR 1.
:type b11: numpy.ndarray or float
:returns RedSWIR1: Index value
.. Tip::
Jacques D.C. et al... |
def getDatasetCount(baseSize, datasetSize, numTests):
"""Try to adapt the number of test datasets to upload per test so that
the total size of all test does not exceed baseSize. But keep
within some reasonable limits.
"""
return min(max(int(baseSize / (numTests * datasetSize)), 5), 200) |
def polygonal(i, n):
"""
Compute i-polygonal number n
For example, if i=3, the nth triangle number will be returned
"""
return n * ((i - 2) * n + 4 - i) // 2 |
def squash_dict(d, delimiter='/', crunch=False, layers=-1):
"""
Combine recursively nested dicts into the top level dict by prefixing their
keys with the top level key and delimiter.
Use the layers parameter to limit the recursion depth.
Adding the prefixed keys could collide with keys already in th... |
def copy_list_dicts(lines):
"""
Convert a lazy cursor from psycopg2 to a list of dictionaries to reduce the access times
when a recurrent access is performed
:param lines: The psycopg2 cursor with the query result
:return: A list of dictionaries
"""
res = list()
for line in lines:
... |
def rename_with_err(file_name):
"""
This method is used to rename the file with err postfix.
:param file_name: type str
:return:
"""
return file_name.replace('.csv', '_err.csv') |
def re_remote_url(s):
""" Tests if a string is a "remote" URL, http, https, ftp. """
s = s.lower()
if s.startswith("http://"):
return True
if s.startswith("https://"):
return True
if s.startswith("ftp://"):
return True
return False |
def create_contact_info_card(name: str, text: str, href: str, svg: str) -> dict:
"""Return HTML/CSS card created with the information provided."""
return {
'name': name,
'text': text,
'href': href,
'svg': svg
} |
def group_three(vec):
"""Group an array of values into threes.
Parameters
----------
vec : 1d array
Array of items to group by 3. Length of array must be divisible by three.
Returns
-------
list of list
List of lists, each with three items.
Raises
------
ValueE... |
def parse_range(astr):
"""
Parse the input string numeric range and return a set of numbers.
>>> parse_range('1-3, 5, 8, 10')
[1, 2, 3, 5, 8, 10]
>>> parse_range('1, 2, 3, 4, 5')
[1, 2, 3, 4, 5]
>>> parse_range('1-5, 9-5') # Negative ranges are ignored
[1, 2, 3, 4, 5]
"""
result ... |
def is_kde_lib(d):
"""Is the kde object a dict of dicts {lib:{taxon:scipy_kde}}?
Parameters
----------
d : dict
{taxon_name:kde} or {libID:{taxon_name:kde}}
Returns
-------
b : boolean
"""
try:
k1 = d.keys()[0]
d[k1].keys()
except AttributeError:
... |
def get_item_properties(item, fields, mixed_case_fields=[], formatters={}):
"""Return a tuple containing the item properties.
:param item: a single item resource (e.g. Server, Tenant, etc)
:param fields: tuple of strings with the desired field names
:param mixed_case_fields: tuple of field names to pre... |
def chunker(df, size):
"""
Split dataframe *df* into chunks of size *size*
"""
return [df[pos:pos + size] for pos in range(0, len(df), size)] |
def average(coords):
"""Average a list of coordinates."""
x = 0
y = 0
for coord in coords:
x += coord[0]
y += coord[1]
count = len(coords)
return (x/count, y/count) |
def mid(p1, p2):
"""
Get mid point of two points.
"""
return [(p1[0] + p2[0]) / 2, (p1[1] + p2[1]) / 2] |
def cql_schemas(cql_components):
"""
Get the schemas from OpenAPI 3.0 Document
:param cql_components: OpenAPI 3.0 Document components object
:returns: OpenAPI Document schemas YAML dict
"""
openapi_schemas = cql_components.get('schemas', None)
return openapi_schemas |
def clean_args_references(args):
""" Removes the information used as reference for the scripts
"""
if "all_fields" in args and args["all_fields"] and \
"new_fields" not in args:
del args["all_fields"]
if "objective_field" in args and \
isinstance(args["objective_field"],... |
def direction_to_degree(direction):
""" Translates direction to degree
:param direction: 'N', 'E', 'S', or 'W'
:return: 0, 90, 180 or 270
"""
north, east, south, west = 0, 90, 180, 270
if direction == 'N':
return north
elif direction == 'E':
return east
elif direction =... |
def sign(x) -> int:
"""Finds the sign of a numeric type.
Args:
x: A signed numeric type
Returns:
The sign [-1|1] of the input number
"""
return 1 - (x < 0) * 2 |
def _spec_alias_lookup( defs, alias):
"""
Internal function.
This is a helper function that reverse looks up an alias
value in a given definition map to obtain the standardized
key.
Parameters:
defs - key --> alias map to lookup with
alias - alias to lookup (str)
Retur... |
def IsLocalId(model_id):
"""Returns true if the given id is a local id, false otherwise."""
try:
int(model_id)
except ValueError:
return False
return True |
def number(loc, state, multiplier=1):
"""number operator; equivalent to a.dag a or sigma.dag sigma
Args:
loc: (cavity, emitter) tuple
state: basis state given as list of quants locs
multiplier: scaler
Returns (state, val * multiplier) where val is the number of quanta at
loc = (... |
def get_bit(data, bit_index):
"""
Get bit as integer at index bit_index from bytes array.
Order is from left to right, so bit_index=0 is MSB.
"""
if bit_index < 8 * len(data):
cur_byte = data[bit_index // 8]
return (cur_byte >> (7 - bit_index % 8)) & 0x1
raise RuntimeError("Out o... |
def _lr_schedule(epoch, init_lr, peak_lr, n_warmup_epochs, decay_schedule={}):
"""Learning rate schedule function.
Gives the learning rate as a function of epoch according to
additional settings:
base_lr: baseline unscaled learning rate at beginning of training.
peak_lr: scaled learning at ... |
def mayberevnum(repo, prefix):
"""Checks if the given prefix may be mistaken for a revision number"""
try:
i = int(prefix)
# if we are a pure int, then starting with zero will not be
# confused as a rev; or, obviously, if the int is larger
# than the value of the tip rev. We stil... |
def delDotPrefix(string):
"""Delete dot prefix to file extension if present"""
return string[1:] if string.find(".") == 0 else string |
def jacobi(a, n):
"""Jacobi Symbol (a / n)"""
if a == 0:
return 0
elif a == 1:
return 1
elif a == 2:
if (n % 8) in set([3, 5]):
return -1
else:
return 1
elif a % 2 == 0:
return jacobi(2, n) * jacobi(a // 2, n)
elif a >= n:
r... |
def insertion_sort(l):
"""
@param {list} l - the list to sort
@return {tuple(list, number)} - Tuple(sorted list, number of iterations)
"""
sweeps = 0
for i in range(1, len(l)):
sweeps += 1
current_val = l[i]
j = i - 1
while (j >= 0) and (l[j] > current_val):
... |
def practice_problem4a(sequence):
"""
What comes in: A non-empty sequence.
What goes out: Returns a list of integers,
where the integers are the places (indices)
where an item in the given sequence appears twice in a row.
Side effects: None.
Examples:
Given sequence (9, 33, 8, 8, 0... |
def split_ngrams(seq, n):
"""
Work for protein or nucleic acid sequences.
n==3: 'AGAMQSASM' => [['AGA', 'MQS', 'ASM'], ['GAM','QSA'], ['AMQ', 'SAS']]
n==4: 'AGAMQSASM' => [['AGAM', 'QSAS'], ['GAMQ', 'SASM'], ['AMQS'], ['MQSA']]
n==5: ...
"""
frames=[]
if n==3:
a, b, c = ... |
def duplication_in_array_no_edit(nums):
"""
:param nums: list to search
:return: duplicated num
"""
import collections
dup_num = None
count = collections.Counter(nums)
for num in count:
if count[num] > 1:
dup_num = num
break
return dup_num |
def findFirstPar(theDict, name, _depth=0):
""" Find the given par. Return tuple: (its own (sub-)dict, its value).
Returns the first match found, without checking whether the given key name
is unique or whether it is used in multiple sections. """
for key in theDict:
val = theDict[key]
# ... |
def hyperheader2dic(head):
"""
Convert a hypercomplex block header into a python dictionary.
"""
dic = dict()
dic["s_spare1"] = head[0]
dic["status"] = head[1]
dic["s_spare2"] = head[2]
dic["s_spare3"] = head[3]
dic["l_spare1"] = head[4]
dic["lpval1"] = head[5]
dic["rpva... |
def get_previous_module_dotted_name(dotted_name, list_of_module_names):
"""
For a given module
:param dotted_name: the module for which the previous module's dotted name is returned.
:param list_of_module_names: list of a model's module names
:return: the previous module's dotted name.
"""
... |
def get_t0_neigh(tbinfo, topo_config):
"""
get all t0 router names which has vips defined
"""
dut_t0_neigh = []
for vm in tbinfo['topo']['properties']['topology']['VMs'].keys():
if 'T0' in vm:
if topo_config[vm].has_key('vips'):
dut_t0_neigh.append(vm)
return ... |
def get_value(d, key):
"""Return value from source based on key."""
for k in key.split('.'):
if k in d:
d = d[k]
else:
return None
if isinstance(d, list):
return ', '.join([str(i) for i in d])
else:
return d |
def get_immersion_ri(immersion):
"""Get refractive index for an immersion type"""
if immersion == 'air':
return 1.0
elif immersion == 'water':
return 1.33
elif immersion == 'oil':
return 1.5115
else:
raise ValueError('Immersion "{}" is not valid (must be air, water, o... |
def _post_process_all_floats(columns, plot_type):
"""Convert all data read from file or stdin to float.
This function is invoked by get_data()"""
for k, v in columns.items():
try:
columns[k] = list(map(float, v))
except ValueError:
print("All elements of a", plot_typ... |
def filter_related_term_list(hpo_counts, related_terms, min_diff):
"""
Retain pairs of related terms with sample size differences < min_diff
"""
filtered_pairs = []
for termA, termB in related_terms:
countA = hpo_counts.get(termA, 0)
countB = hpo_counts.get(termB, 0)
... |
def rand(x):
"""
Returns a random floating-point number between 0 and the maximum value.
Args:
x(float): maximum value.
Returns:
float: random number between 0 and `x`
"""
from random import random
return random() * x |
def sanitize(str, strip=[" "], remove=["\r", "\n"]):
"""Return a whitespace-stripped, newline-stripped string.
Args:
str (str): The string to be sanitized.
strip (str[], optional) Additional things to be stripped.
remove (str[], optional) Additional things to be removed.
Returns:
(str) ... |
def get_grey_value(pixel, gamma=2):
"""converts colored pixel into grey scale\n1, 3 and 4 length tuples supported"""
return pixel[0] if len(pixel) == 1 else ((pixel[0]**gamma + pixel[1]**gamma + pixel[2]**gamma)/3)**(1/gamma) if len(pixel) == 3 else ((pixel[0]**gamma + pixel[1]**gamma + pixel[2]**gamma)... |
def valid_byr(byr):
"""byr (Birth Year) - four digits; at least 1920 and at most 2002."""
if len(byr) == 4 and int(byr) >= 1920 and int(byr) <= 2002:
return True
else:
return False |
def sat_key(sat: str):
"""
Provides the key for sorting sat orbits from closest to earth to furthest away from earth.
:param sat: The satellite name to sort
:return:
"""
try:
return ['NONE', 'LEO', 'MEO', 'GEO'].index(sat.upper())
except ValueError:
return -1 |
def _ToJsonName(name):
"""Converts name to Json name and returns it."""
capitalize_next = False
result = []
for c in name:
if c == '_':
capitalize_next = True
elif capitalize_next:
result.append(c.upper())
capitalize_next = False
else:
result += c
return ''.join(result) |
def check_near_equality(f1, f2, resolution=2):
"""Check if two numbers are 'nearly' equal.
:param <float> f1: Number 1
:param <float> f2: Number 2
:param <int> resolution: Number of decimal points
:return <bool> flag: True/False
"""
return round(f1, resolution) == round(f2, resolution) |
def _search_entity(entity, name):
"""Helper function to that recursivly looks at subentities
Returns a serialized entity that matches the name given or None"""
if 'name' in entity:
my_name = entity['name']
if my_name == name:
return entity
else:
if "subsegment... |
def add_overextends(template):
"""Amend Django template engines to include the `overextends` tag"""
if template['BACKEND'] == ('django.template.backends.django.'
'DjangoTemplates'):
options = template['OPTIONS'] = template.get('OPTIONS', {})
builtins = options['bui... |
def dataset_to_dict(dataset):
"""
Transform a key/value dataset to a pythonic dictionary
Parameters
----------
dataset : str
dataset name
Returns
-------
dictionary
"""
return dict([(k.strip().decode(),v) for (k,v) in dataset]) |
def englishTextNull(englishInputNull):
"""
This function returns true if input is empty
"""
if englishInputNull == '':
return True |
def is_private_bool(script_dict):
""" Returns is_private boolean value from user dictionary object """
return script_dict['entry_data']['ProfilePage'][0]['graphql']['user']['is_private'] |
def convert_longitude(x):
"""
Converts longitude-coordinates based on North/East value.
"""
direction = str(x)[-1]
if direction == 'E':
return float(str(x)[:-1])
else:
return -float(str(x)[:-1]) |
def trouver_lettre(lettre, mot):
"""
Find if a letter is in a word
returns the indexes of the letter
"""
i = 0
lettre_indexes = []
for character in mot:
if character == lettre:
lettre_indexes.append(i)
i += 1
return lettre_indexes |
def secondary_activity(data, meta):
"""
Returns activity of named component
@ In, data, dict, request for data
@ In, meta, dict, state information
@ Out, data, dict, filled data
@ In, meta, dict, state information
"""
data = {'driver': meta['HERON']['activity']['electricity']}
return data, m... |
def deflatten(structure_pattern,data_stream):
"""
The deflatten function takes a structure pattern flat and a data stream (list of values), and produces a nested data structure according to those inputs.
This is the inverse function of flatten()
>>> deflatten('..[.[..[.]].]...',[1, 'abc', 0, 1, 1, 5, 'd... |
def human2bytes(s):
"""
Attempts to guess the string format based on default symbols
set and return the corresponding bytes as an integer.
When unable to recognize the format ValueError is raised.
>>> human2bytes('0 B')
0
>>> human2bytes('1 K')
1024
>>> human2bytes('1 M')
... |
def summary_html(title, summary):
"""Return HTML formatted summary."""
return f"""
<h3>{title}</h3>
<table>
<tr>
<td>ID</td><td>{summary.get('sha256')}</td>
</tr>
<tr>
<td>Names</td><td>{summary.get('names')}</td>
</tr>
<tr>
<td>File Type</td><td>{summary.get(... |
def get_rdf_lables(obj_list):
"""Get rdf:labels from a given list of objects."""
rdf_labels = []
for obj in obj_list:
rdf_labels.append(obj['rdf:label'])
return rdf_labels |
def data_is_valid(data):
"""Check to see if data is valid for this class. Returns a tuple of
(bool, string) indicating valididty and any error message.
"""
if type(data) == dict and len(data) == 0:
return True, None
return False, "Data is not an object or not empty." |
def time33(t):
"""
time33: function(t) {
for (var e = 0, n = t.length, i = 5381; e < n; ++e)
i += (i << 5) + t.charAt(e).charCodeAt();
return 2147483647 & i
}
"""
i = 5381
for e in range(len(t)):
i += (i << 5) + ord(t[e])
return 2147483647 & i |
def must_be_skipped(positions):
"""
entries of length 2 with an indentical
start- and endpoint must be skipped
"""
if not len(positions) == 2:
return False
start = positions[0]
end = positions[1]
if start == end:
return True |
def signal_attribute_name(property_name):
""" Return a magic key for the attribute storing the signal name. """
return f"_{property_name}_prop_signal_" |
def main(values):
"""
step 1: loop through the list of integers
step 2: remove current value from temp list of original values
step 3: multiply remaining items and add product to new list
step 4: return new list of products
"""
products_list = list()
for value in valu... |
def remove_prefix(element):
"""Remove the prefix (B/I-) from the tag of each token.
The span of the named will be assigned later."""
tagList = []
if type(element) is not list:
if element != "O":
tagList.append(element[2:])
else:
tagList.append("O")
... |
def _format_pos_to_db(pos) -> str:
"""
Returns a database-ready string that contains the position in the form x/y
"""
return "{}/{}".format(pos[0], pos[1]) |
def get_current_access_key_from_config(aws_credentials, profile):
"""
Get the current Access key so we know which to delete
"""
return aws_credentials[profile]['aws_access_key_id'] |
def update_input_video_frame_rate_metric(ml_channel_id, ml_channel_name):
"""Update the metrics of the "Input Video Frame Rate (avg)" dashboard widget"""
result = []
entry = ["MediaLive", "InputVideoFrameRate", "ChannelId", ml_channel_id, "Pipeline", "0",
{"label": ml_channel_name + "-0"}]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.