def assocsized(op, tail, n):
    gsizess = groupsizes(len(tail), n)
    partitions = (groupsizes_to_partition(*gsizes) for gsizes in gsizess)
    return (makeops(op, partition(tail, part)) for part in partitions)
All associative combinations of x in n groups
dataset/ETHPy150Open logpy/logpy/logpy/assoccomm.py/assocsized