Repack list from [[a, b, c], [a', b', c'], ....] to [fn(a, a', ...), fn(b, b', ...), fn(c, c', ...)] where fn can be `tuple` or `list` Assume that all elements of input have the same length
(sets, fn)
| 14 | |
| 15 | |
| 16 | def _repack_list(sets, fn): |
| 17 | """Repack list from [[a, b, c], [a', b', c'], ....] |
| 18 | to [fn(a, a', ...), fn(b, b', ...), fn(c, c', ...)] |
| 19 | where fn can be `tuple` or `list` |
| 20 | Assume that all elements of input have the same length |
| 21 | """ |
| 22 | output_list = [] |
| 23 | arg_list_len = len(sets[0]) |
| 24 | for i in range(arg_list_len): |
| 25 | output_list.append(fn(input_set[i] for input_set in sets)) |
| 26 | return output_list |
| 27 | |
| 28 | |
| 29 | def _repack_output_sets(outputs): |
no test coverage detected