human
I wrote the below code

    eq_types = ({'i', 'f'} if numeric_equal else {})
    def equal_dtypes(a, b):
        if (is_categorical_dtype(a) != is_categorical_dtype(b)):
            return False
        if ((a is '-') or (b is '-')):
            return False
        return (((a.kind in eq_types) and (b.kind in eq_types)) or (a == b))
    if (not isinstance(meta, (pd.Series, pd.Index, pd.DataFrame))):
        raise TypeError(('Expected    partition    to    be    DataFrame,    Series,    or    Index,    got    `%s`' % type(meta).__name__))
    if (type(x) != type(meta)):
        errmsg = ('Expected    partition    of    type    `%s`    but    got    `%s`' % (type(meta).__name__, type(x).__name__))
    elif isinstance(meta, pd.DataFrame):
        dtypes = pd.concat([x.dtypes, meta.dtypes], axis=1)
        bad = [(col, a, b) for (col, a, b) in dtypes.fillna('-').itertuples() if (not equal_dtypes(a, b))]
        if (not bad):
            return x
        errmsg = ('Partition    type:    `%s`\n%s' % (type(meta).__name__, asciitable(['Column', 'Found', 'Expected'], bad)))
    else:
        if equal_dtypes(x.dtype, meta.dtype):
            return x
        errmsg = ('Partition    type:    `%s`\n%s' % (type(meta).__name__, asciitable(['', 'dtype'], [('Found', x.dtype), ('Expected', meta.dtype)])))
    raise ValueError(('Metadata    mismatch    found%s.\n\n%s' % ((('    in    `%s`' % funcname) if funcname else ''), errmsg)))

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def check_meta(x, meta, funcname=None, numeric_equal=True):