summaryrefslogtreecommitdiffhomepage
path: root/test/ec/utils.py
blob: 67a9cc01ac12c1f2ad6ab2b715fdb4f9fc88c5e2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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)