code: def get_example_serializer(
      spec, compress_image=False, image_quality=95
  ):
      """Returns string serializer of example protos."""
      encoder = get_example_encoder(
          spec,
          compress_image=compress_image,
          image_quality=image_quality,
      )
      return lambda features_nest: encoder(
          features_nest
      ).SerializeToString()
  
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 2 for calling a global function with example usage: get_example_serializer(spec, compress_image, image_quality) and returns: function