content stringlengths 42 6.51k |
|---|
def GetErrorReason(error_content):
"""Returns the error reason as a string."""
if not error_content:
return None
if (not error_content.get('error') or
not error_content['error'].get('errors')):
return None
error_list = error_content['error']['errors']
if not error_list:
return None
return ... |
def to_list(item):
"""
Wrap almost anything besides list into a list.
If the input item is a tuple, covert it to a list.
"""
if isinstance(item, tuple):
item = list(item)
elif not isinstance(item, list):
item = [item]
return item |
def _ri_gr(gr,dr=False,dg=False):
"""(r-i) = f(g-r), with Juric et al. (2008) stellar locus for g-r,
BOVY: JUST USES LINEAR APPROXIMATION VALID FOR < M0"""
if dg:
return 1./2.34
elif dr:
return 1./2.34
else:
ri= (gr-0.07)/2.34
return ri |
def humanbytes(B):
"""
Return the given bytes as a human friendly KB, MB, GB, or TB string
:param B: Byte value
:return: human friendly string
"""
B = float(B)
KB = float(1024)
MB = float(KB ** 2) # 1,048,576
GB = float(KB ** 3) # 1,073,741,824
TB = float(KB ** 4) # 1,099,511,... |
def chooseElements(arr, keep):
"""
Take a list of elements, and remove certain elements determined by keep.
:param arr: The list of elements
:param keep: A function returning True if an element in keep should be kept, False otherwise
:return: The list of elements with only valid elements
"""
... |
def cs_gn(A):
"""Cross section for A(g,n)X averaged over E[.3, 1.] GeV
Returns cross section of photoneutron production averaged
over the energy range [.3, 1.] GeV, in milibarn units.
Arguments:
A {int} -- Nucleon number of the target nucleus
"""
return 0.104 * A**0.81 |
def barsize(Nbar, units="psi"):
""" bar_area = barsize(Nbar or bar_area) """
bar_area = {3: 0.11, 4: 0.20, 5: 0.31, 6: 0.44, 7: 0.60,
8: 0.79, 9: 1, 10: 1.27, 11: 1.56, 14: 2.25, 18: 4.00}
return bar_area.get(Nbar, Nbar) |
def is_seqlib(cfg):
"""
Check if the given configuration object specifies a
:py:class:`~enrich2.seqlib.SeqLib` derived object.
Args:
cfg (dict): decoded JSON object
Returns:
bool: True if `cfg` if specifies a :py:class:`~enrich2.seqlib.SeqLib`
derived object, else False.
... |
def get_npm_license_from_licenses_array(licenses_array):
"""
Extract licenses name from licenses array and join them with AND
"licenses": [{"type":"MIT"}, {"type":"Apache"}]
Arguments:
json_data {json} -- json data to parse license from
version {str} -- version of the package
Ret... |
def extract_keywords(icss):
"""Helper function
Parameters
----------
icss : string
comma-separated string
Returns
-------
kws : list of string
set of keywords
paramdict : dict
dict of {parameterized_keyword: parameter_valu... |
def compass_restify(data: dict) -> list:
"""Format a dictionary of key-value pairs into the correct format for Compass.
It seems that JSON data MUST be in the rather odd format of {"Key": key, "Value": value} for each (key, value) pair.
"""
return [{"Key": f"{k}", "Value": f"{v}"} for k, v in data.item... |
def isPal(x):
"""requires x to be a list
returns True if the list is a palindrome; False otherwise"""
assert type(x) == list
temp = x[:]
print(temp)
temp.reverse()
print("temp:", temp)
print("x:", x)
if temp == x:
return True
else:
return False |
def bool_to_tuple(input):
"""Converts a single :class:`bool <python:bool>` value to a
:class:`tuple <python:tuple>` of form ``(bool, bool)``.
:param input: Value that should be converted.
:type input: :class:`bool <python:bool>` / 2-member :class:`tuple <python:tuple>`
:returns: :class:`tuple <pyt... |
def merged_data(data_left: list, data_right: list, join_on: str) -> list:
"""Merge Join two sorted datasets (tables) into one on unique key
Parameters
----------
data_left : list
Left data stored in list of dicts
data_right : list
Right data stored in list of dicts
join_on : st... |
def tens_to_text(num):
"""
>>> tens_to_text(20)
'twenty'
>>> tens_to_text(50)
'fifty'
"""
if num == 20:
return 'twenty'
elif num == 30:
return 'thirty'
elif num == 40:
return 'forty'
elif num == 50:
return 'fifty'
elif num == 60:
return... |
def sites_2d(n, s):
"""
Args:
n(int): Number of scales
s(int): The index of the scale. The top is s=1, the second is s=2, etc.
Returns:
list(int): A list of sites that appear up to the s'th scale.
"""
myslice = [i*(2**(n-s)) for i in range(2**s)]
return {(x,y): (myslice[... |
def find_even_index(arr):
"""
You are going to be given an array of integers.
Your job is to take that array and find an index N where
the sum of the integers to the left of N is equal to the sum
of the integers to the right of N. If there is no index that
would make this happen, return -1.
... |
def set_show_paint_rects(result: bool) -> dict:
"""Requests that backend shows paint rectangles
Parameters
----------
result: bool
True for showing paint rectangles
"""
return {"method": "Overlay.setShowPaintRects", "params": {"result": result}} |
def hours_to_days(hours):
"""
Convert the given amount of hours to a 2-tuple `(days, hours)`.
"""
days = int(hours // 8)
hours_left = hours % 8
return days, hours_left |
def get_recursive(d, names):
""" Recursively get dictionary keys
The ``names`` argument should be a list of keys from top level to bottom.
Example::
>>> get_recursive({'foo': 'bar', 'baz': {'fam': 12}}, ['baz', 'fam'])
12
"""
n = names.pop(0)
if not names:
return d[n]... |
def msToHMS(duration : int):
"""
msToHMS:
convert given to duration to a H:M:S format
@param duration (int): duration to be converted
"""
seconds = int((duration/1000)%60)
minutes = int((duration/(1000*60))%60)
hours = int((duration/(1000*60*60))%24)
return f"{hours}:{minute... |
def parse_interface(interface_name):
"""
convert the interface name in the nsd to the according vnf_id, vnf_interface names
:param interface_name:
:return:
"""
if ':' in interface_name:
vnf_id, vnf_interface = interface_name.split(':')
vnf_sap_docker_name = interface_name.replac... |
def _ge_from_gt(self, other):
"""Return a >= b. Computed by @total_ordering from (a > b) or (a == b)."""
op_result = self.__gt__(other)
return op_result or self == other |
def profile(data: dict) -> str:
"""Return string representation of a profile
:param data: data of a user as retrieved from firebase database
"""
string_so_far = f'Username: {data["userID"]} \n \n'
if 'movies' in data:
string_so_far += 'Favourite Movie categories: ' + ', '.join(data['movies'... |
def hue_brightness_to_hass(value):
"""Convert hue brightness 1..254 to hass format 0..255."""
return min(255, round((value / 254) * 255)) |
def swap_bytes(word_val):
"""swap lsb and msb of a word"""
msb = (word_val >> 8) & 0xFF
lsb = word_val & 0xFF
return (lsb << 8) + msb |
def _get_cl_ordering(probes):
"""
Utility function to get the indices for Cls from a list of probes
"""
n_tracers = sum([p.n_tracers for p in probes])
# Define an ordering for the blocks of the signal vector
cl_index = []
for i in range(n_tracers):
for j in range(i, n_tracers):
... |
def Between(field, from_value, to_value):
"""
A criterion used to search for records having `field`'s value included in a range defined by `from_value` and `to_value`.
This is an idea criterion to seahrch using date conditions. For example
* search for cases created between two dates
* search ... |
def _panel_indices(p_idx: int, p_sz: int, row_size: int, col_size: int):
"""
Finds the starting index of the current row and column panel for SUMMA.
Args:
p_idx: Loop iteration number.
p_sz: Size of the panels.
row_size: Local dimension from which row panels are taken.
col_size: Local dimension f... |
def find_quarter(fields):
"""Find the fields with project quarters"""
return [field for field in fields if field.startswith("Q")] |
def remove_parameters(all_parameters, template_parameters):
"""Removes all parameters that the template does not need."""
template_parameter_keys = [p['ParameterKey'] for p in template_parameters]
template_parameters = []
for parameter in all_parameters:
if parameter['ParameterKey'] in template_... |
def fix_url(url):
"""Prefix a schema-less URL with http://."""
if "://" not in url:
url = "http://" + url
return url |
def processing_func_name(func_name):
"""Converts a python function name into its equivalent Processing name.
"""
func_name = func_name.split('_')
return ''.join(func_name[:1] + [s.capitalize() for s in func_name[1:]]) |
def wav2RGB(wavelength):
"""http://codingmess.blogspot.com/2009/05/conversion-of-wavelength-in-nanometers.html"""
w = int(wavelength)
# colour
if w >= 380 and w < 440:
R = -(w - 440.) / (440. - 350.)
G = 0.0
B = 1.0
elif w >= 440 and w < 490:
R = 0.0
G = ... |
def batch_indices(batch_nb, data_length, batch_size):
"""
!Adapted from cleverhansl2l Utils!
This helper function computes a batch start and end index
Args:
batch_nb: the batch number
data_length: the total length of the data being parsed by batches
batch_size: the nu... |
def merge(a, b):
"""
Merge two dict into one.
"""
r = a.copy()
r.update(b)
return r |
def murmur3_32(data, seed=0):
"""MurmurHash3 was written by Austin Appleby, and is placed in the
public domain. The author hereby disclaims copyright to this source
code."""
c1 = 0xcc9e2d51
c2 = 0x1b873593
length = len(data)
h1 = seed
roundedEnd = (length & 0xfffffffc) # round d... |
def extract_children(tree):
"""
Extract the immediate child nodes of a tree root
Inputs:
tree: a plan decomposition tree
Outputs:
children: the immediate child nodes of root (with their own subtrees omitted)
"""
return tuple(child if type(child[0])==str else child[0] for child in... |
def lat_to_yindex(lat, res=1):
"""
For a given latitude return the y index in a 1x1x5-day global grid
:param lat: Latitude of the point
:param res: resolution of the grid
:type lat: float
:type res: float
:return: grid box index
:rtype: integer
The routine assumes that the ... |
def connection_string(db_type, database, host='localhost', port=None, username=None, password=None):
"""creates the connection string"""
if db_type == 'mysql':
if port:
return f"mysql://{username}:{password}@{host}:port/{database}"
else:
return f"mysql://{username}:{passw... |
def chebyshev(v1, v2):
""" Computes Chebyshev distance between two points.
http://en.wikipedia.org/wiki/Chebyshev_distance
"""
return max((abs(v[0] - v[1]) for v in zip(v1, v2))) |
def unmap(widget):
"""Unmap a mapped WIDGET."""
result = False
if widget and widget.winfo_exists() and widget.winfo_ismapped():
result = True
geom_mgr = widget.winfo_manager()
if geom_mgr == "grid":
widget.grid_forget()
elif geom_mgr == "pack":
widget.... |
def _lists_share_element(list_a, list_b):
""" _lists_share_element
Check if list_a shares and element with list_b
"""
return not set(list_a).isdisjoint(list_b) |
def prepare_nogui_packer_ansible_playbook(hosts_config, cluster_config):
""" Write to playbook """
content = """---
# Install and config Spectrum Scale on nodes
- hosts: {hosts_config}
any_errors_fatal: true
pre_tasks:
- include_vars: group_vars/{cluster_config}
roles:
- core/cluster
""".format(... |
def create_poll(poll_options: list) -> dict:
"""
Creates a poll of a list of options
:param poll_options:
:return:
"""
poll_opts_map = {}
for opt in poll_options:
poll_opts_map.update({opt.lstrip(" ").rstrip(" "): 0})
return poll_opts_map |
def sec2interval(seconds):
"""Convert seconds to tuple of day, hour, minute and second
:param seconds: integer
:returns: tuple day, hour, minute, second
"""
i = int(seconds)
second = i % 60
i //= 60
minute = i % 60
i //= 60
hour = i % 24
i //= 24
return i, hour, minute,... |
def hex(r, g, b):
"""
Args:
r (int): Red color value.
g (int): Green color value.
b (int): Blue color value.
Returns:
(str): A hex color code as a string.
"""
return bytes((r, g, b)).hex() |
def get_month(date):
"""
Return the month
:param: Date
"""
return date.split('/')[0] |
def escape_html(text: str) -> str:
"""Replace <, >, &, " with their HTML encoded representation. Intended to
prevent HTML errors in rendered displaCy markup.
text (str): The original text.
RETURNS (str): Equivalent text to be safely used within HTML.
"""
text = text.replace("&", "&")
te... |
def extract_coord(var_name):
"""Assuming prefix_R_C format, return (prefix,row,column) tuple.
prefix is of type string, row and column are integers.
The "nowhere" coordinate has form prefix_n_n. To indicate this,
(-1, -1) is returned as the row, column position.
If error, return None or throw exc... |
def sorted_by_key(x, i, reverse=False):
"""For a list of lists/tuples, return list sorted by the ith
component of the list/tuple,
Examples:
Sort on first entry of tuple:
>>> sorted_by_key([(1, 2), (5, 1)], 0)
[(1, 2), (5, 1)]
Sort on second entry of tuple:
... |
def answer_score(num_humans) -> float:
"""
Calculates VQA score in [0,1] depending on number of humans having given the same answer
"""
if num_humans == 0:
return .0
elif num_humans == 1:
return .3
elif num_humans == 2:
return .6
elif num_humans == 3:
return .... |
def var_ex_model(ng, nf, params):
""" Variance Excess Model
Measured pixel variance shows a slight excess above the measured values.
The input `params` describes this excess variance. This function can be
used to fit the excess variance for a variety of different readout patterns.
"""
return 1... |
def adjustrow(row):
"""
Convert a grid row to a list-table row.
:param row: a row of grid table text
:type row: str
:return: a row of list-table text
:rtype: str
"""
if row.startswith('+') is True:
return('\n')
row = row.split('|')
new_row = []
for entry in row:
... |
def reverseArray(data, dqMarker):
"""
reverses the contents of the array 'data'
before the spot marked by the int dqMarker
returns the array after reversing it
"""
print("Reversing array")
temp = -1
counter = 0
#iterate through the list until halfway point (not counting dqs... |
def minimum_migration_time_max_cpu(last_n, vms_cpu, vms_ram):
""" Selects the VM with the minimum RAM and maximum CPU usage.
:param last_n: The number of last CPU utilization values to average.
:type last_n: int,>0
:param vms_cpu: A map of VM UUID and their CPU utilization histories.
:type vms_c... |
def asbool(obj):
"""
Interprets an object as a boolean value.
:rtype: bool
"""
if isinstance(obj, str):
obj = obj.strip().lower()
if obj in ('true', 'yes', 'on', 'y', 't', '1'):
return True
if obj in ('false', 'no', 'off', 'n', 'f', '0'):
return Fals... |
def binary_search(target, nums):
"""See if target appears in nums"""
# We think of floor_index and ceiling_index as "walls" around
# the possible positions of our target so by -1 below we mean
# to start our wall "to the left" of the 0th index
# (we *don't* mean "the last index")
floor_index = -... |
def build_url_from_netloc(netloc, scheme='https'):
# type: (str, str) -> str
"""
Build a full URL from a netloc.
"""
if netloc.count(':') >= 2 and '@' not in netloc and '[' not in netloc:
# It must be a bare IPv6 address, so wrap it with brackets.
netloc = '[{}]'.format(netloc)
r... |
def get_season_from_game_id(game_id):
"""
Gets season from nba.com game id
4th and 5th digits of game id represent year season started
ex 0021900001 is for the 2019-20 season
:param str game_id: nba.com game id
:return: season - Format YYYY-YY ex 2019-20
:rtype: string
"""
if game_i... |
def _get_str_from_bin(src: bytearray) -> str:
"""Join data in list to the string.
:param src: source to process
:type src: bytearray
:return: decoded string
:rtype: str
"""
return src.rstrip().decode(encoding="utf-8", errors="backslashreplace") |
def resetChapterProgress(chapterProgressDict, chapter, initRepeatLevel):
"""This method resets chapter progress and sets initial level for repeat routine.
Args:
chapterProgressDict (dict): Chapter progress data.
chapter (int): Number of the chapter.
initRepeatLevel (int): Initial level ... |
def compute_accuracy(true_positive, true_negative, false_positive, false_negative):
""" Function to compute Accuracy"""
if true_positive + true_negative == 0:
return 0
return float(true_positive + true_negative) / \
float(true_positive + true_negative + false_positive + false_negative) |
def _cols_if_none(X, self_cols):
"""Since numerous transformers in the preprocessing
and feature selection modules take ``cols`` arguments
(which could end up as ``None`` via the ``validate_is_pd``
method), this will return the columns that should be used.
Parameters
----------
X : Pandas ... |
def analyzeParams(params):
"""
@param params: as `i:Node; j:Node`
@return a tuple as `{'i': 'Node', 'j': 'Node'}, '[paramdef "i" "Node"; paramdef "j" "Node"]'`
"""
if not params:
return {}, '[]'
parts = params.split(';')
param_name_dict = {}
for p in parts: param_name_dict[p.spli... |
def get_node_types(node_list):
"""
- create a list of node types, based on the input node list
- each node type is created in respect to the type of node within the input node list
- the input node list contains elements, where each node item is represented by a tuple
- the tuple contains a field th... |
def jump(make_jump, usr_y, jump_counter):
"""Moves the character up and down on the y-axis to create the illusion of a jump.
Args:
make_jump: boolean value about the need to jump.
usr_y: user y coordinate.
jump_counter: counter displacement of the character during a jump.
Ret... |
def get_neuron_connections(neuron_id, connections, bidirectional):
"""
Get the connections for a single neuron
:param neuron_id: ID of neuron
:param connections: connection list
:param bidirectional: Flag determining whether both incoming/outgoing connections are returned
:return: subset of conn... |
def ring_float_to_class_int(rings:float, step=0.1):
"""Ring value rounded to classifier value; rounded to nearest step size"""
return round(rings/step) |
def args_list(s):
"""Parse argument string as list of values separated by commas.
:param s: Argument string
:return: Parsed value
:rtype: list
"""
if s is None:
return []
return [item.strip() for item in s.split(',')] |
def case_transfer_matching(cased_text: str, uncased_text: str) -> str:
"""Transfers the casing from one text to another - assuming that they are
'matching' texts, alias they have the same length.
Args:
cased_text: Text with varied casing.
uncased_text: Text that is in lowercase only.
R... |
def none_or_int(input_arg):
"""
Utility to return None or int value
"""
if input_arg == 'None':
value = None
else:
value = int(input_arg)
return value |
def _get_tas_var(dataset_name, rad_var):
"""Get correct tas data for a certain radiation variable."""
if dataset_name == 'MultiModelMean':
return f'tas_{rad_var}'
return 'tas' |
def ecsv_identify(origin, filepath, fileobj, *args, **kwargs):
"""Identify if object uses the Table format.
Returns
-------
bool
"""
return filepath is not None and filepath.endswith(".ecsv") |
def to_hex(number):
"""Convert an integer to appropriate hex.
Args:
number (int): The number to convert.
"""
n_str = format(int(number), "x")
if len(n_str) % 2:
return "0%s" % n_str
return n_str |
def _add(shape, solution):
"""
Adds all points of the shape to the solution if they are not already
contained.
Returns True if all points could be added or False otherwise
"""
if any([ point in solution for point in shape ]):
return False
for point in shape:
solution.append... |
def merge(left, right, path=None):
"""Merge dicts"""
if path is None:
path = []
for key in right:
if key in left:
if isinstance(left[key], dict) and isinstance(right[key], dict):
merge(left[key], right[key], path + [str(key)])
elif left[key] == right[... |
def bool_convert(string: str) -> bool:
"""Needed to save to the database"""
if string == 'True':
return True
else:
return False |
def complete_subdomain_name(possibly_subdomain, domain_name):
""" Complete a full domain name from a possibly subdomain name.
eg)
complete_subdomain_name("abc", "example.com.") => "abc.example.com."
complete_subdomain_name("abc.ab.", "example.com.") => "abc.ab."
complete_... |
def calculate_orientation(
index: int, clip_start: int, clip_end: int, target_start: int, target_end: int,
) -> str:
"""
Calculate the orientation of the insertion. The clip start and end should
be on either the left or the right of the target region depending on the
strand.
Ambiguous cases whe... |
def define_title(overlap_kind):
"""
This function sets the specification of the title of the plots.
:param bool overlap_kind: the boolean that determines if the overlap
is per pixel or shoebox
:returns: title
"""
if overlap_kind:
title = "per pixel"
els... |
def partition(arr, low, high):
""" Partition is a helper function for the quicksort. It takes a pivot and
places lower values to the left and higher values to the right
"""
i = (low-1)
pivot = arr[high]
for j in range(low, high):
if arr[j] <= pivot:
i = i+1
arr[i... |
def byte(value):
"""Converts a char or int to its byte representation."""
if isinstance(value, str) and len(value) == 1:
return ord(value)
elif isinstance(value, int):
if value > 127:
return byte(value - 256)
if value < -128:
return byte(256 + value)
r... |
def get_headers(token):
"""
get headers
:param token: float token
:return: a dictionary of headers
"""
return {'Authorization': 'Bearer {}'.format(token),
'Accept': 'application/json'} |
def distribute(N,nmax):
"""
Distribute N things into cells as equally as possible such that
no cell has more than nmax things.
"""
actual_max = int(2.*(nmax+1)/3.)
numcells = int(round(N*1./actual_max))
each_cell = [actual_max]*(numcells-1)
rem = N-sum(each_cell)
if rem>0: each_cell... |
def mermin_klyshko_classical_bound(n):
"""The classical bound for the Mermin-Klyshko inequality is :math:`2^{n-1}`.
:param n: The number of measurement nodes.
:type n: Int
:returns: The classical bound.
:rtype: Float
"""
return 2 ** (n - 1) |
def cast_str_to_int_float_bool_or_str(str_, fmt='{:.3f}'):
"""
Convert string into the following data types (return the first successful): int, float, bool, or str.
:param str_: str;
:param fmt: str; formatter for float
:return: int, float, bool, or str;
"""
value = str(str_).strip()
f... |
def _MergeProguardConfigs(proguard_configs):
"""Merging the given proguard config files and returns them as a string."""
ret = []
for config in proguard_configs:
ret.append('# FROM: {}'.format(config))
with open(config) as f:
ret.append(f.read())
return '\n'.join(ret) |
def hamming_distance(sA, sB):
"""Hamming distance between two strings
of equal length is the number of positions
at which the corresponding symbols are different.
"""
if len(sA) != len(sB):
raise ValueError('Sequences must be of equal length to compute hamming distance')
return sum(ele1 ... |
def v6_int_to_packed(address):
"""Represent an address as 16 packed bytes in network (big-endian) order.
Args:
address: An integer representation of an IPv6 IP address.
Returns:
The integer address packed as 16 bytes in network (big-endian) order.
"""
try:
retur... |
def sum_of_multiples(limit: int, factors: list) -> int:
"""Give sum of all the multiples of given numbers untill given limit"""
set_of_multiples = {i
for factor in factors
if factor != 0
for i in range(factor, limit, factor)
... |
def color_triple(color):
"""
Convert a command line color value to a RGB triple of integers.
FIXME: Somewhere we need support for greyscale backgrounds etc.
"""
if color.startswith('#') and len(color) == 4:
return (int(color[1], 16),
int(color[2], 16),
int(col... |
def escape(in_str):
""" Escapes a string to make it suitable for storage in JSON """
return in_str.replace('"', '\\"').replace('\n', '\\n').replace('\r', '\\r') |
def _hashable_var_key(var):
"""Returns a hashable key to identify the given Variable."""
# In TF 2, Variables themselves are not hashable, so cannot be dict keys.
# Error is "Tensor is unhashable if Tensor equality is enabled. Instead, use
# tensor.experimental_ref() as the key". For a related issue, see:
# ... |
def _parse_coord(sample, variables):
"""
See if the variables in the sample are a valid encoding of a coordinate.
The encoding is defined this way:
For n-1 variables, the axis' range is {0, 1, ..., n}.
A coordinate with value x is encoded as
v_i = 0 for x <= i < n - 1
... |
def read_file(file):
"""
Load a file
How do we want to handle this for input?
# This should be turned into a generator [Future]
"""
return open(file).read()
# except UnicodeEncodeError as error:
# print(error) |
def sort_lists(dict_structure):
"""Sorts the lists in a dict_structure
"""
if dict_structure is not None and isinstance(dict_structure, dict):
for key, value in dict_structure.items():
if value is not None:
if isinstance(value, list):
dict_structure[k... |
def is_valid_process(timing, realization_bounds, realization_id):
"""helper function to check if the current graph node or edge is valid to be added in the current time
realization"""
if realization_id != 0:
if realization_bounds[realization_id] >= timing > realization_bounds[realization_id -... |
def get_interface_name_from_api(data, index):
"""Process data from sw_interface_dump API and return index
of the interface specified by name.
:param data: Output of interface dump API call.
:param index: Index of the interface to find.
:type data: list
:type index: int
:returns: Name ... |
def run_project_crosscheck(db_user_projects, public_projects, project_api_projects):
"""Compute cross-check of allowed projects for the specified user
with the verified projects(one with values that can be used) from the projectAPI
It finds allowed private projects from the Users_Permission table.
Then... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.