code: def _check_shape_and_dtype(value, shape, dtype):
      """Check that `value` has expected shape and dtype."""
      value_dtype = tf.as_dtype(value.dtype.newbyteorder("N"))
      if shape != value.shape or dtype != value_dtype:
          raise ValueError(
              "Expected shape %s of %s, got: shape %s of %s"
              % (shape, dtype.name, value.shape, value_dtype.name)
          )
  
file_path: agents/tf_agents/utils/example_encoding.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from collections import abc
  import io
  import gin
  import numpy
  from PIL import Image
  import tensorflow
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 6 for calling a global function with example usage: _check_shape_and_dtype(value, shape, dtype) without return types