def is_shape(df, shape):
    """
    Asserts that the DataFrame is of a known shape.

    Parameters
    ==========

    df : DataFrame
    shape : tuple
      (n_rows, n_columns). Use None or -1 if you don't care
      about a dimension.

    Returns
    =======
    df : DataFrame
    """
    try:
        check = np.all(np.equal(df.shape, shape) | (np.equal(shape, [-1, -1]) |
                                                    np.equal(shape, [None, None])))
        assert check
    except __HOLE__ as e:
        msg = ("Expected shape: {}\n"
               "\t\tActual shape:   {}".format(shape, df.shape))
        e.args = (msg,)
        raise
    return df
dataset/ETHPy150Open TomAugspurger/engarde/engarde/checks.py/is_shape