code: def _is_dtype(
      numpy_dtypes: List[Union[np.dtype, Type[np.generic]]],
      tf_dtype: Any,
      dtype: TfdsDType,
  ) -> bool:
      if enp.lazy.is_np_dtype(dtype):
          return any(
              [
                  is_np_sub_dtype(dtype, numpy_dtype)
                  for numpy_dtype in numpy_dtypes
              ]
          )
      if enp.lazy.has_tf and isinstance(dtype, tf.dtypes.DType):
          if isinstance(tf_dtype, str):
              return getattr(dtype, tf_dtype)
          return dtype == tf_dtype
      raise TypeError(f"type {dtype} ({type(dtype)}) not recognized")
  
file_path: datasets/tensorflow_datasets/core/utils/dtype_utils.py
imports: from typing import cast, Any, List, Type, Union
  from absl import logging
  from etils import enp
  import numpy
  from tensorflow_datasets.core.utils import py_utils
  from tensorflow_datasets.core.utils import type_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 3 for calling a global function with example usage: _is_dtype(numpy_dtypes, tf_dtype, dtype) and returns: any, unknown, getattr