code: def parse_encoded_spec_from_file(input_path):
      """Returns the tensor data spec stored at a path.
  
      Args:
        input_path: The path to the TFRecord file which contains the spec.
  
      Returns:
        `TensorSpec` nested structure parsed from the TFRecord file.
      Raises:
        IOError: File at input path does not exist.
      """
      if not tf.io.gfile.exists(input_path):
          raise IOError("Could not find spec file at %s." % input_path)
      dataset = tf.data.TFRecordDataset(input_path, buffer_size=1)
      dataset_iterator = eager_utils.dataset_iterator(dataset)
      signature_proto_string = eager_utils.get_next(dataset_iterator)
      if tf.executing_eagerly():
          signature_proto = struct_pb2.StructuredValue.FromString(
              signature_proto_string.numpy()
          )
      else:
          # In non-eager mode a session must be run in order to get the value
          with tf.Session() as sess:
              signature_proto_string_value = sess.run(
                  signature_proto_string
              )
          signature_proto = struct_pb2.StructuredValue.FromString(
              signature_proto_string_value
          )
      return tensor_spec.from_proto(signature_proto)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import logging
  import tensorflow
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import trajectory
  from tf_agents.utils import eager_utils
  from tf_agents.utils import example_encoding
  from tf_agents.utils import nest_utils
  from tensorflow.core.protobuf import struct_pb2
label_desc: Use image node_id 2 for calling a global function with example usage: parse_encoded_spec_from_file(input_path) and returns: tensor_spec