aboutsummaryrefslogtreecommitdiff
path: root/test/ec/utils.py
blob: e1812b3a3fec7f2ef324aabe6767eed8e9e8c090 (plain)
1
2
3
4
5
6
7
8
9
10
from itertools import product
from functools import reduce

def slow(func):
    func.slow = 1
    return func

def cartesian(*items):
    for cart in product(*items):
        yield reduce(lambda x, y: x + y, cart)