content stringlengths 42 6.51k |
|---|
def _format_default(expr):
"""
Return text from a default value expression.
Return a simplified form of a PostgreSQL default value.
"""
if expr.lower().startswith('nextval('):
r = expr.split("'", 1)[1]
r = r.rsplit("'", 1)[0]
return r + '()'
elif expr.startswith("'"):
... |
def _nbaLeague(x):
"""Takes in initials of league and returns numeric API Code
Input Values: "NBA", "WNBA", or "NBADL"
Used in: _Draft.Anthro(), _Draft.Agility(), _Draft.NonStationaryShooting(),
_Draft.SpotUpShooting(), _Draft.Combine()
"""
leagues = {"NBA":"00", "WNBA":"10", "NBADL":"20"}
... |
def pretty_keys(dictionary):
""" return pretty printed list of dictionary keys, num per line """
if not dictionary:
return []
# - number of keys printed per line
num = 5
# - turn into sorted list
keys = list(dictionary.keys())
keys.sort()
# - fill with blank elements to width num... |
def Name_Validation(Name):
""" Function to Validate a Name for Input: Allowing Spaces, - and '"""
for Char in Name:
if ("A" <= Char <= "Z" or "a" <= Char <= "z"
or Char == "-" or Char == "'"):
continue
else:
return False
return True |
def __sort_element(a, b, offset: int) -> bool:
"""
Sort elements based on the offset
"""
# 140, 141, 142 are treated as one point here
if abs(a[0] - b[0]) < offset:
return a[1] - b[1]
return a[0] - b[0] |
def sigmoid_derivative(x):
"""
args: x - some number
return: derivative of sigmoid given x
"""
x_prime = x*(1-x)
return x_prime |
def count_bits(x):
"""
A program to count the number of bits
in a non-negative integer.
It tests one bit at a time, starting with
the least significant bit.
"""
num_bits = 0
while x:
num_bits += x & 1
x >>= 1
print(x)
return num_bits |
def lifetime(duration):
"""Returns a dictionary that converts a number of seconds into a dictionary object with keys of 'days', 'hours', 'minutes', and 'seconds'.
Parameters
----------
duration (int):
The duration (in seconds) to be transformed into a dictionary.
Returns
-------... |
def _divide_or_zero(numerator, denominator):
"""
Divide numerator by denominator. If the latter is 0, return 0.
>>> _divide_or_zero(1, 2)
0.5
>>> _divide_or_zero(1, 0)
0.0
:param numerator: float.
:param denominator: float.
:return: float.
"""
if denominator == 0:
r... |
def make_list(arg):
"""Returns the argument as a list. If already a list, ``arg`` is returned.
"""
if not isinstance(arg, list):
arg = [arg]
return arg |
def bezier_quadratic(p0, p1, p2, t):
"""returns a position on bezier curve defined by 3 points at t"""
return p1 + (1-t)**2*(p0-p1) + t**2*(p2-p1) |
def quote(arg: object) -> object:
"""
Puts quotes around a string (so it appears as a string in output). Otherwise returns
argument unchanged.
:param arg: argument to transform.
:return: argument quoted if a string, otherwise unchanged.
"""
if isinstance(arg,str):
return f"'{arg}'"
... |
def eratosthenes(n):
"""
This function generates a list of all primes smaller than n using eratosthenes's algorithm
"""
#generate a list of integers to filter
integers = [x for x in range(2,n)]
i = 0
while i<len(integers):
#remove all elements that are divisible by the largest prime ... |
def _split_tag_path_pattern(tag_path_pattern):
"""
Returns a list of tag patterns and the prefix for a given tag path pattern.
Args:
tag_path_pattern (str)
"""
if tag_path_pattern.startswith('+/') or tag_path_pattern.startswith('*/'):
prefix = tag_path_pattern[:2]
tag_path_pattern = tag_pa... |
def isinsidebbox(bbox,p):
""" does point ``p`` lie inside 3D bounding box ``bbox``?"""
return p[0] >= bbox[0][0] and p[0] <= bbox[1][0] and\
p[1] >= bbox[0][1] and p[1] <= bbox[1][1] and\
p[2] >= bbox[0][2] and p[2] <= bbox[1][2] |
def factorial(n):
"""Return the factorial of n
A factorial is a number multiplied by all the numbers before it until 1
It's written as the number followed by an exclamation mark: 5!
So 5! = 5 * 4 * 3 * 2 * 1 = 120
eg factorial(4) should return:
24
"""
result = 1
for i in... |
def GetUIntLength(length_descriptor):
"""Returns the amount of bytes that will be consumed,
based on the first read byte, the Length Descriptor."""
assert 0 <= length_descriptor <= 0xFF
length = 0
for i in range(8): # big endian
if (length_descriptor & (0x80 >> i)) != 0: # 128, 64, 32, ..., 1
length = i + 1... |
def octave_from_midi(midi_note):
"""
Get octave number from MIDI number
:param midi_note: MIDI note number
:return: octave number
"""
octave = None
if midi_note >= 12:
octave = int((midi_note / 12) - 1)
elif midi_note >= 0:
octave = -1
return octave |
def get_max_chkpt_int(algorithm_states):
"""Get the maximum time in seconds between checkpoints.
"""
max_chkpt_int = -1
for s in algorithm_states:
max_chkpt_int = max(s['chkpt_int'], max_chkpt_int)
return max_chkpt_int |
def format_description(text):
"""Format the description.
This is too complex to be done in the Jinja template. It can be done, but
it'll be messy.
- convert underscores in text to URLs and bold,
- no need to convert asterisk, since they're underline in myAST already,
- no need to format http:/... |
def bytes2bin(bites, sz=8):
"""Accepts a string of ``bytes`` (chars) and returns an array of bits
representing the bytes in big endian byte order. An optional max ``sz`` for
each byte (default 8 bits/byte) which can be used to mask out higher
bits."""
if sz < 1 or sz > 8:
raise ValueError("... |
def validate_sim_measure_type(sim_measure_type):
"""Check if the input sim_measure_type is one of the supported types."""
sim_measure_types = ['COSINE', 'DICE', 'EDIT_DISTANCE', 'JACCARD',
'OVERLAP']
if sim_measure_type.upper() not in sim_measure_types:
raise TypeError('\'' ... |
def rotate(s, x, y, rx, ry):
"""Rotate a point."""
if ry is 0:
if rx is 1:
x = s - 1 - x
y = s - 1 - y
x, y = y, x
return (x, y) |
def is_even(x: int) -> bool:
"""Checks if x is an even number"""
return x/2 == x // 2 |
def is_palindrome(phrase):
"""Is phrase a palindrome?
Return True/False if phrase is a palindrome (same read backwards and
forwards).
>>> is_palindrome('tacocat')
True
>>> is_palindrome('noon')
True
>>> is_palindrome('robert')
False
Should ignore capi... |
def _base_url(host, port):
"""
Provides base URL for HTTP Management API
:param host: JBossAS hostname
:param port: JBossAS HTTP Management Port
"""
return "http://{host}:{port}/management".format(host=host, port=port) |
def generate_num_processes_default(AUTOMS_NUM_PROCESSES):
""" Generates the default num processes parameter value to use using configured 'num processes' """
if AUTOMS_NUM_PROCESSES is None:
num_processes_default = 1
else:
num_processes_default = AUTOMS_NUM_PROCESSES
return num_proces... |
def redcap_event_to_vbr_protocol(event_name: str) -> int:
"""Map redcap event name to VBR protocol."""
# NOTE - this must be manually synced with src/scripts/data/protocol.csv
events = {
"informed_consent_arm_1": 2,
"baseline_visit_arm_1": 3,
"6wks_postop_arm_1": 30,
"3mo_pos... |
def _parse_mdcstat(post_params):
"""
parses mdcstat from bld in post_params.
Parameters
----------
post_params: dict
Examples :
{
"bld": "dbms/MDC/STAT/standard/MDCSTAT01701",
"tboxisuCd_finder_stkisu0_2": "060310/3S",
"isuCd": "KR7060310000",
... |
def join_url(base_url, leaf):
"""Return the result of joining two parts of a url together.
Usage Examples:
>>> join_url('http://example.com/', 'mypage/')
'http://example.com/mypage/'
>>> join_url('http://example.com', 'mypage/')
'http://example.com/mypage/'
:base_url: the... |
def R0(dw, hmin):
"""
R0 Determining the nominal diameter d
and checking the lomiting size G
"""
# DSV [Throught bolted joint]
G = hmin + dw # (R0/1)
# ESV [Tapped thread joint]
# G1 = (1.5,...,2) dw
return G
# |
def get_subset_dict(dictionary, subkey):
"""Function to seperate inner key and its values - to extracting pharmacogenomics_therapeutics,
pharmacogenomics_combined_variants_therapeutics, adverse_effect_therapeutics,
adverse_effect_combined_variants_therapeutics."""
sub = {}
for key, value in dictio... |
def gnome_sort(unsorted):
"""Pure implementation of the gnome sort algorithm in Python."""
if len(unsorted) <= 1:
return unsorted
i = 1
while i < len(unsorted):
if unsorted[i - 1] <= unsorted[i]:
i += 1
else:
unsorted[i - 1], unsorted[i] = unsorted[i], u... |
def sse_pack(d):
"""For sending sse to client. Formats a dictionary into correct form for SSE"""
buf = ''
for k in ['retry','id','event','data']:
if k in d.keys():
buf += '{}: {}\n'.format(k, d[k])
return buf + '\n' |
def get_neighb_ver(curr_i, curr_j, off, w, h):
"""Computes the neighbour with vertical offset for upper half of the image and
horizontal offset for the lower part of the cubemap image."""
if(0 <= curr_i < h):
if(0 <= curr_j < w):
if ((curr_i + off) >= h): return 2*h-(curr_i+off-h+... |
def round_to_nearest(value, round_value=1000):
"""Return the value, rounded to nearest round_value (defaults to 1000).
Args:
value: Value to be rounded.
round_value: Number to which the value should be rounded.
Returns:
Value rounded to nearest desired integer.
"""
if round... |
def smallest_sums(partition:list, num_of_sums:int=1)->float:
"""
Given a partition, return the sum of the smallest k parts (k = num_of_sums)
>>> smallest_sums([[1,2],[3,4],[5,6]])
3
>>> smallest_sums([[1,2],[3,4],[5,6]], num_of_sums=2)
10
"""
sorted_sums = sorted([sum(part) for part in p... |
def classify_attachments(files):
""" Return an (audio_files, related_docs) tuple. """
audio = []
related = []
for f in files:
if 'audio' in f['file_mime']:
audio.append(f)
else:
related.append(f)
return audio, related |
def only_digits(name: str) -> str:
""" "O1" -> "1" """
return ''.join([i for i in name if i.isdigit()]) |
def is_keys_str_decimals(dictionary: dict):
"""
Checks if the keys are string decimals
Args:
dictionary: Dictionary object to check
Returns:
True if keys are numerical strings
"""
keys = dictionary.keys()
are_decimals = [isinstance(k, str) and k.isdecimal() for k in keys... |
def is_delete_name(name):
"""
Determines if the specified name is flagged for deletion with the "!" prefix.
:param name: the name to be checked
:return: True if the name is prefixed, false otherwise
"""
return name.startswith("!") |
def f(x):
"""
"""
return x*x+1 |
def oidc_to_user_data(payload):
"""
Map OIDC claims to Django user fields.
"""
payload = payload.copy()
field_map = {
'given_name': 'first_name',
'family_name': 'last_name',
'email': 'email',
}
ret = {}
for token_attr, user_attr in field_map.items():
if t... |
def getTypeFromStr(s):
"""
determine the type of the input string
string s: the string whose type we wish to get
Returns the type of the input string
"""
try:
int(s)
return "int"
except ValueError:
return "string" |
def get_comments(events, comments=None):
"""
Pick comments and pull-request review comments out of a list of events.
Args:
events: a list of (event_type str, event_body dict, timestamp).
comments_prev: the previous output of this function.
Returns:
comments: a list of dict(author... |
def dq_string(data):
""" repr a string with double quotes. This is probably a fragile
hack, so if it breaks, please do something better! """
return '"'+repr("'"+data)[2:] |
def remove_duplicates(elements, condition=lambda _: True, operation=lambda x: x):
"""
Removes duplicates from a list whilst preserving order.
We could directly call `set()` on the list but it changes
the order of elements.
"""
local_set = set()
local_set_add = local_set.add
filtered_li... |
def big (cave):
"""Indicates whether or not `cave` is big."""
return cave.isupper() |
def factorial(n):
""" To Find Factorial Of n """
if n == 0:
result = 1
else:
result = n * factorial(n-1)
return result |
def calc_conformance(results):
"""Returns a tuple with the number of total and failed testcase variations and the conformance as percentage."""
total = len(results)
passed = failed = skipped = 0
for status, _ in results.values():
if status == 'PASS':
passed += 1
elif status =... |
def update_values_in_key_list(existing_values: list, new_values: list or str, remove_values: list or str,
replace_values: list or str):
"""
Updates values within a list by first appending values in the new_values list, removing values in the remove_values
list and then replacing values... |
def nice(val):
"""nice printer"""
if val == 'M':
return 'M'
if val < 0.01 and val > 0:
return 'Trace'
return '%.2f' % (val, ) |
def check_prev_char(password, current_char_set):
"""Function to ensure that there are no consecutive
UPPERCASE/lowercase/numbers/special-characters."""
index = len(password)
if index == 0:
return False
else:
prev_char = password[index - 1]
if prev_char in current_char_set:
... |
def get_pathless_file_size(data_file):
"""
Takes an open file-like object, gets its end location (in bytes),
and returns it as a measure of the file size.
Traditionally, one would use a systems-call to get the size
of a file (using the `os` module). But `TemporaryFileWrapper`s
do not feature a ... |
def check_uniqueness_in_rows(board: list):
"""
Check buildings of unique height in each row.
Return True if buildings in a row have unique length, False otherwise.
>>> check_uniqueness_in_rows(['***21**', '412453*', '423145*',\
'*543215', '*35214*', '*41532*', '*2*1***'])
True
>>> check_uniqu... |
def get_recommended_simplification_params(warning_len):
"""Return the recommended geometry simplification tolerance and buffer.
These settings are based on the number of warnings present, and designed
to prevent the map interface from lagging if many warnings are present.
Parameters
----------
... |
def mergelistmult(lst1,lst2):
"""returns the product at each index comparing 2 lists"""
try:
return [lst1[i]*lst2[i] for i in range(len(lst1))]
except:
print('incompatible lists') |
def _get_sfn_execution_arn_by_name(state_machine_arn, execution_name):
"""
* Given a state machine arn and execution name, returns the execution's ARN
* @param {string} state_machine_arn The ARN of the state machine containing the execution
* @param {string} execution_name The name of the execution
... |
def validate_severity(parser, arg):
"""Check that the severity level provided is correct."""
_VALID_SEVERITIES = {'info': 0, 'warning': 1, 'error': 2}
if arg.strip().lower() not in _VALID_SEVERITIES:
parser.error("Invalid severity. Options are error, warning, or info")
else:
return _VAL... |
def slugify(value):
"""
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens.
"""
import re
import unicodedata
value = str(value)
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore').decode('utf8').strip().lower()
va... |
def can_be_index(obj):
"""Determine if an object can be used as the index of a sequence.
:param any obj: The object to test
:returns bool: Whether it can be an index or not
"""
try:
[][obj]
except TypeError:
return False
except IndexError:
return True |
def parseStyle(style):
"""Parse style attribute into dict"""
if style is None or style.strip() == '':
return {}
else:
return dict([[part.strip() for part in prop.split(":")] for prop in style.split(";")]) |
def dictlist_to_dict(dictlist, key):
"""turn a list of dicts with a common key into a dict. values
of the key should be unique within the dictlist
Example
-------
>>>dict_list = [{"id":"a"}, {"id":"b"}]
>>>dictlist_to_dict(dict_list, "id")
{'a': {'id': 'a'}, 'b': {'id': 'b'}}
"""
r... |
def readVector(text):
"""Reads a vector from text 'n v1 ... vn'"""
items = text.split()
if int(items[0])+1 != len(items):
raise ValueError("Invalid number of items")
return [float(v) for v in items[1:]] |
def parse_header_prot_name(
protocol_int # type: int
):
"""Parse InMon-defined header protocol names"""
if protocol_int == 1:
protocol_name = "Ethernet"
elif protocol_int == 2:
protocol_name = "Token Bus"
elif protocol_int == 3:
protocol_name = "Token Ring"
elif protocol_int == 4:
protocol_name = "FDDI"
... |
def permut(block, table):
"""Permut the given block using the given table (so generic method)"""
return [block[x] for x in table] |
def isbool(string):
"""
Checks if a string can be converted into a boolean.
Parameters
----------
value : str
Returns
-------
bool:
True/False if the string can/can not be converted into a boolean.
"""
return string in ("True", "true", "False", "false") |
def _ListOpToList(listOp):
"""Apply listOp to an empty list, yielding a list."""
return listOp.ApplyOperations([]) if listOp else [] |
def __calculate_percentage_difference(measure_1, measure_2):
"""
Percentage difference calculation
"""
try:
return round(abs(100*(measure_1-measure_2)/((measure_1+measure_2)/2)),3)
except ZeroDivisionError:
return 0 |
def skill_lvl(lvl, exp_required):
"""Calculate the essential skills of the player"""
for i in range(len(exp_required)):
if lvl < exp_required[i]:
return i
if lvl > exp_required[len(exp_required) - 1]:
if len(exp_required) == 50:
return 50
else:... |
def v_bar(cv):
"""Return the trace of ``cv`` divided by 2
:arg cv: a variance-covariance matrix
:type cv: 4-element sequence of float
:returns: float
**Example**::
>>> x1 = 1-.5j
>>> x2 = .2+7.1j
>>> z1 = ucomplex(x1,(1,.2))
>>> z2 = ucom... |
def numericrange_to_tuple(r):
"""Helper method to normalize NumericRange into a tuple."""
if r is None:
return (None, None)
lower = r.lower
upper = r.upper
if lower and not r.lower_inc:
lower -= 1
if upper and not r.upper_inc:
upper -= 1
return lower, upper |
def demandValue(taglist,liste,phrase1,mot):
"""
put values of all items in string to insert in database
taglist: list with name of all items
liste: list of item value
phrase1: string with values of all items
mot: value of an item
return a string with values of all items separated with ','
... |
def bool(x):
"""Implementation of `bool`."""
return x.__bool__() |
def kpoints_str(lst, base='nk'):
"""[3,3,3] -> "nk1=3,nk2=3,nk3=3"
Useful for QE's phonon toolchain ph.x, q2r.x, matdyn.x
"""
return ','.join(['%s%i=%i' %(base, i+1, x) for i, x in enumerate(lst)]) |
def unflatten(iter, n=2):
"""Group ``iter`` into tuples of length ``n``. Raise an error if
the length of ``iter`` is not a multiple of ``n``.
"""
if n < 1 or len(iter) % n:
raise ValueError('iter length is not a multiple of %i' % n)
return list(zip(*(iter[i::n] for i in range(n)))) |
def calculate_node_degree_in_collection(collection, v):
"""
calculates the degree of node v in collection by the formula:
deg(v, collection) = the number of clusters in collection, v belongs to
:param collection: collection of clusters
:param v: node
:return: degree of v in collection
"""
... |
def rgb_to_hex1(rgb):
"""Receives (r, g, b) tuple, checks if each rgb int is within RGB
boundaries (0, 255) and returns its converted hex, for example:
Silver: input tuple = (192,192,192) -> output hex str = #C0C0C0"""
if not all(0 <= val <= 255 for val in rgb):
raise ValueError(f"rgb {rg... |
def recusive_del_key(dic: dict, key: str):
"""
Recusively remove keys in a dictionary.
>>> recusive_del_key({'a': 2, 'b': 1}, 'a')
{'b': 1}
>>> recusive_del_key({'b': 1}, None)
{'b': 1}
>>> recusive_del_key({'b': 1}, 'c')
{'b': 1}
>>> recusive_del_key({'b': {'a': 1, 'c': 4}}, 'c'... |
def camel_to_snake_fast(s: str) -> str:
"""Converts the given text from CamelCase to snake_case, faster.
This function is *slightly* faster than the :obj:`camel_to_snake`
implementation, however that comes at the expense of accuracy.
Please see the warnings below for more information.
Parameters
... |
def listobj_or_none(hash, list_obj, list_hash):
"""
A convenience function for determining which object in a list to return
based on a list of the hash values for the objects.
Parameters
----------
1. hash : int
The hash value for the desired object
2. list_obj : list
... |
def sessions(event_id=None):
"""Returns the session ids for the event."""
return [1, 2, 3] |
def _merge(*parts):
"""
Utility function to merge various strings together with no breaks
"""
return ' '.join(parts) |
def _all_good_hits_with_scores(hits_scores, max_bit_score_delta_for_good_hits):
"""
return a list of (id, score, evalue) tuples representing good scores
based on difference between alignment score for each hit and score of the best hit.
:param hits_scores: list of tuples [(id,score,evalue),(id,score,ev... |
def groupby(seq, key):
"""
Description
----------
Create a dictionary with keys composed of the return value of the funcion/key\n
applied to each item in the sequence. The value for each key is a list of values\n
that produced the key.
Parameters
----------
seq : (list or tuple or s... |
def get_program_frames(command_dicts):
"""
Parces command_dicts to produce a list of frames that represent the
programs timestep
:param command_dicts: list formatted by mimic_program containing dicts of
program info at each program timestep
:return frames: list
"""
frames = []
f... |
def Mean(values):
"""Returns the arithmetic mean of |values|."""
if not values or None in values:
return None
return sum(values) / float(len(values)) |
def transform_resource_name(ctx, param, value):
"""Callback to transform resource_name into title case."""
if value is not None:
return value.title()
return value |
def get_id_field_from_input_field_name(input_field_name: str) -> str:
"""
Map plural input fields like children to the appropriate field child_ids in this
case.
"""
if input_field_name == "children":
return "child_ids"
return input_field_name.rstrip("s") + "_ids" |
def deltawords(num, arg):
"""An adverb to come after the word 'improved' or 'slipped'
"""
delta = abs(num - arg)
# We only pick out changes over 10%; over 30% in 9 months is unheard of.
if delta == 0:
word = "not at all"
elif delta < 10:
word = "slightly"
elif delta < 20:
... |
def extend_points(tip=[[0], [0], [0]], end=[[0], [0], [0]], factor=2):
"""
returns new coordinates of the points to extend
in a list
the default value of tip is the origin
end is also a list
"""
# print("extending coords...")
xnew = factor * (end[0][0] - tip[0][0]) + tip[0][0]
ynew =... |
def upper_camel_case(snake_str):
"""
Convert a snake case str to upper camel case
"""
words = snake_str.split("_")
return "".join([w.title() for w in words]) |
def check_valid_image(path_to_image):
"""
Function to check if a file has valid image extensions and return True if it does.
Note: Azure Cognitive Services only accepts below file formats.
"""
valid_extensions = ['.png', '.jpg', '.jpeg', '.gif', '.bmp', '.jfif']
if path_to_image.endswith((tup... |
def statuscheck(status, item):
"""since we are doing this a lot might as well return something more meaningful"""
if status == 404:
out = "It appears {} does not exist.".format(item)
elif status == 503:
out = "Qur'an API is having problems, it would be best to check back later."
else:
... |
def build_fib_recursive(n):
"""
n: number of elements in the sequence
Returns a Fibonacci sequence of n elements by recursive method
"""
if n == 1:
return [0]
elif n == 2:
return [0, 1]
else:
last_elem = build_fib_recursive(n-1)[-1] + build_fib_recursive(n-2)[-1]
... |
def fill_clusters(clusters, element_i, element_j):
"""
Fill the list of clusters (sets) with two elements from the same cluster.
>>> clusters = []
>>> fill_clusters(clusters, 1, 10)
[{1, 10}]
>>> fill_clusters(clusters, 10, 100)
[{1, 10, 100}]
>>> fill_clusters(clusters, 20, 30)
[{1... |
def binary_search(a_list, item):
"""Performs iterative binary search to find the position of an integer in a given, sorted, list.
a_list -- sorted list of integers
item -- integer you are searching for the position of
"""
first = 0
last = len(a_list) - 1
while first <= last:
i = (f... |
def MakeUrl(host, port=80, location=''):
"""
Create a Tasmota host url
@param host:
hostname or IP of Tasmota host
@param port:
port number to use for http connection
@param location:
http url location
@return:
Tasmota http url
"""
return "http://{shost}... |
def format_policy_listing(data):
"""Formats a list of policies into human readable format
Args:
data (list): A list of policies
Returns:
The formated string
"""
import re
import textwrap
out = ""
i = 1
for p in data:
# Shorten to max chars, r... |
def partition_names_by_comp(names, compmap=None, boundary_vars=()):
"""Take an iterator of names and return a dict with component names
keyed to lists of variable names. Simple names (having no '.' in them)
will have a key of None.
For example, the list ['abc.def', 'abc.pdq', 'foo', 'bar'] would retur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.