def _get_dtype(arr_or_dtype):
if arr_or_dtype is None:<EOL><INDENT>raise TypeError("<STR_LIT>")<EOL><DEDENT>elif isinstance(arr_or_dtype, np.dtype):<EOL><INDENT>return arr_or_dtype<EOL><DEDENT>elif isinstance(arr_or_dtype, type):<EOL><INDENT>return np.dtype(arr_or_dtype)<EOL><DEDENT>elif hasattr(arr_or_dtype, '<STR_LIT>'):<EOL><INDENT>arr_or_dtype = arr_or_dtype.dtype<EOL><DEDENT>return pandas_dtype(arr_or_dtype)<EOL>
Get the dtype instance associated with an array
or dtype object.

Parameters
----------
arr_or_dtype : array-like
    The array-like or dtype object whose dtype we want to extract.

Returns
-------
obj_dtype : The extract dtype instance from the
            passed in array or dtype object.

Raises
------
TypeError : The passed in object is None.