code: def _get_dtype(arr_or_dtype) -> DtypeObj:
      """
      Get the dtype instance associated with an array
      or dtype object.
  
      Parameters
      ----------
      arr_or_dtype : array-like or dtype
          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.
      """
      if arr_or_dtype is None:
          raise TypeError("Cannot deduce dtype from null object")
  
      # fastpath
      if isinstance(arr_or_dtype, np.dtype):
          return arr_or_dtype
      elif isinstance(arr_or_dtype, type):
          return np.dtype(arr_or_dtype)
  
      # if we have an array-like
      elif hasattr(arr_or_dtype, "dtype"):
          arr_or_dtype = arr_or_dtype.dtype
  
      return pandas_dtype(arr_or_dtype)
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING, Any, Callable
  import warnings
  import numpy
  from pandas._libs import Interval, Period, algos, lib
  from pandas._libs.tslibs import conversion
  from pandas.util._exceptions import find_stack_level
  from pandas.core.dtypes.base import _registry
  from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, ExtensionDtype, IntervalDtype, PeriodDtype, SparseDtype
  from pandas.core.dtypes.generic import ABCIndex
  from pandas.core.dtypes.inference import is_array_like, is_bool, is_complex, is_dataclass, is_decimal, is_dict_like, is_file_like, is_float, is_hashable, is_integer, is_interval, is_iterator, is_list_like, is_named_tuple, is_nested_list_like, is_number, is_re, is_re_compilable, is_scalar, is_sequence
label_desc: Use image node_id 35 for calling a global function with example usage: _get_dtype(arr_or_dtype) and returns: pandas_dtype, arr_or_dtype, np