def fromkeyvals_transpose(keys, *args): args = immutable_array(zip(*args)) return Graph.fromkeyvals(keys, args, adjacent_variations)
def sanitize(variations): result = [] for var in variations: clean = re.sub("[^01]", "", var) result.append(immutable_array(map(int, clean), dtype='b')) return result