code: def convert_to_dtype(tensor_or_dtype, dtype=None, dtype_hint=None):
      """Get a dtype from a list/tensor/dtype using convert_to_tensor semantics."""
      if tensor_or_dtype is None:
          return dtype or dtype_hint
  
      # Tensorflow dtypes need to be typechecked
      if tf.is_tensor(tensor_or_dtype):
          dt = base_dtype(tensor_or_dtype.dtype)
      elif isinstance(tensor_or_dtype, tf.DType):
          dt = base_dtype(tensor_or_dtype)
      # Numpy dtypes defer to dtype/dtype_hint
      elif isinstance(tensor_or_dtype, np.ndarray):
          dt = base_dtype(dtype or dtype_hint or tensor_or_dtype.dtype)
      elif np.issctype(tensor_or_dtype):
          dt = base_dtype(dtype or dtype_hint or tensor_or_dtype)
      else:
          # If this is a Python object, call `convert_to_tensor` and grab the dtype.
          # Note that this will add ops in graph-mode; we may want to consider
          # other ways to handle this case.
          dt = tf.convert_to_tensor(
              tensor_or_dtype, dtype, dtype_hint
          ).dtype
  
      if not SKIP_DTYPE_CHECKS and dtype and not base_equal(dtype, dt):
          raise TypeError(
              "Found incompatible dtypes, {} and {}.".format(dtype, dt)
          )
      return dt
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow.python.util import nest
label_desc: Use image node_id 6 for calling a global function with example usage: convert_to_dtype(tensor_or_dtype, dtype, dtype_hint) and returns: dt, unknown