

def maxshape(shapes):
    '\n\n    >>> maxshape([(10, 1), (1, 10), ()])\n    (10, 10)\n\n    >>> maxshape([(4, 5), (5,)])\n    (4, 5)\n    '
    shapes = [shape for shape in shapes if shape]
    if (not shapes):
        return ()
    ndim = max(map(len, shapes))
    shapes = [(((1,) * (ndim - len(shape))) + shape) for shape in shapes]
    for dims in zip(*shapes):
        if (len((set(dims) - set([1]))) >= 2):
            raise ValueError(("Shapes don't align, %s" % str(dims)))
    return tuple(map(maxvar, zip(*shapes)))

dataset/ETHPy150Open blaze/blaze/blaze/expr/utils.py maxshape/original