code: def is_bool(dtype):
      """Returns whether this is a boolean data type."""
      dtype = tf.as_dtype(dtype)
      if hasattr(dtype, "is_bool"):
          return dtype.is_bool
      # We use `kind` because:
      # np.issubdtype(np.uint8, np.bool_) == True.
      return np.dtype(dtype).kind == "b"
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 8 for calling a global function with example usage: is_bool(dtype) and returns: unknown, dtype