def ishomogeneous(ds):
    """ Does datashape contain only one dtype?

    >>> from datashape import int32
    >>> ishomogeneous(int32)
    True
    >>> ishomogeneous('var * 3 * string')
    True
    >>> ishomogeneous('var * {name: string, amount: int}')
    False
    """
    ds = dshape(ds)
    return len(set(remove(isdimension, collect(isscalar, ds)))) == 1
dataset/ETHPy150Open blaze/datashape/datashape/predicates.py/ishomogeneous/original