utilities¶
Module with useful functions¶
- successive_pairs
following_pairs_second_item(ell, search_pair)
¶
Used to get affected table names
Source code in xerini/utilities.py
meaningful_strings_count(text=None)
¶
We need this function to determine whether the text used to initialize a SQL Statement only has
a single statement
:param text: an arbitrary text
:param separator: space, tab, but most likely ;
:return: the number of meaningful string in the original text
Source code in xerini/utilities.py
minimal_nodes(directed)
¶
Returns the set of nodes in the network that have no incoming edges
:param directed: the graph from which we should extract the minimal nodes
:return: a set of mininal nodes
Source code in xerini/utilities.py
parallel_decomposition(directed)
¶
Decompose the DAG into stages
Source code in xerini/utilities.py
random_id8()
¶
Returns an ascii string of length 8 which starts with a lower case character
:return:
Source code in xerini/utilities.py
random_partitions(number_of_partitions, items)
¶
Partitions the elements of items into a tuple of random lists of roughly equal size
Source code in xerini/utilities.py
successive_pairs(iterable)
¶
Given an iterable this function returns a generator of the successive overlapping
pairs taken from the input iterable,
>>> list(successive_pairs('ABCDEFG'))
[('A', 'B'), ('B', 'C'), ('C', 'D'), ('D', 'E'), ('E', 'F'), ('F', 'G')]