def pandas_dtype(dtype):
    """
    Converts input into a pandas only dtype object or a numpy dtype object.

    Parameters
    ----------
    dtype : object to be converted

    Returns
    -------
    np.dtype or a pandas dtype
    """
    if isinstance(dtype, string_types):
        try:
            return DatetimeTZDtype.construct_from_string(dtype)
        except __HOLE__:
            pass

        try:
            return CategoricalDtype.construct_from_string(dtype)
        except TypeError:
            pass

    return np.dtype(dtype)
dataset/ETHPy150Open pydata/pandas/pandas/types/api.py/pandas_dtype