def infer_dtype_from_object(dtype):
if isinstance(dtype, type) and issubclass(dtype, np.generic):<EOL><INDENT>return dtype<EOL><DEDENT>elif isinstance(dtype, (np.dtype, PandasExtensionDtype, ExtensionDtype)):<EOL><INDENT>try:<EOL><INDENT>_validate_date_like_dtype(dtype)<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>return dtype.type<EOL><DEDENT>try:<EOL><INDENT>dtype = pandas_dtype(dtype)<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>if is_extension_array_dtype(dtype):<EOL><INDENT>return dtype.type<EOL><DEDENT>elif isinstance(dtype, str):<EOL><INDENT>if dtype in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>return DatetimeTZDtype.type<EOL><DEDENT>elif dtype in ['<STR_LIT>']:<EOL><INDENT>raise NotImplementedError<EOL><DEDENT>if dtype == '<STR_LIT>' or dtype == '<STR_LIT>':<EOL><INDENT>dtype += '<STR_LIT>'<EOL><DEDENT>try:<EOL><INDENT>return infer_dtype_from_object(getattr(np, dtype))<EOL><DEDENT>except (AttributeError, TypeError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return infer_dtype_from_object(np.dtype(dtype))<EOL>
Get a numpy dtype.type-style object for a dtype object.

This methods also includes handling of the datetime64[ns] and
datetime64[ns, TZ] objects.

If no dtype can be found, we return ``object``.

Parameters
----------
dtype : dtype, type
    The dtype object whose numpy dtype.type-style
    object we want to extract.

Returns
-------
dtype_object : The extracted numpy dtype.type-style object.