def makeops(op, lists):
    """ Construct operations from an op and parition lists

    >>> from logpy.assoccomm import makeops
    >>> makeops('add', [(1, 2), (3, 4, 5)])
    (('add', 1, 2), ('add', 3, 4, 5))
    """
    return tuple(l[0] if len(l) == 1 else build(op, l) for l in lists)
dataset/ETHPy150Open logpy/logpy/logpy/assoccomm.py/makeops/original