code: def create_single_tf_record_dataset(
      filename: Text,
      load_buffer_size: int = 0,
      shuffle_buffer_size: int = 10000,
      num_parallel_reads: Optional[int] = None,
      decoder: Optional[DecoderFnType] = None,
      reward_shift: float = 0.0,
      action_clipping: Optional[Tuple[float, float]] = None,
      use_trajectories: bool = True,
  ):
      """Create a TF dataset for a single TFRecord file.
  
      Args:
        filename: Path to a single TFRecord file.
        load_buffer_size: Number of bytes in the read buffer. 0 means no buffering.
        shuffle_buffer_size: Size of the buffer for shuffling items within a single
          TFRecord file.
        num_parallel_reads: Optional, number of parallel reads in the TFRecord
          dataset. If not specified, no parallelism.
        decoder: Optional, a custom decoder to use rather than using the default
          spec path.
        reward_shift: Value to add to the reward.
        action_clipping: Optional, (minimum, maximum) values to clip actions.
        use_trajectories: Whether to use trajectories. If false, use transitions.
  
      Returns:
        A TF.Dataset of experiences.
      """
      dataset = example_encoding_dataset.load_tfrecord_dataset(
          filename,
          buffer_size=load_buffer_size,
          as_experience=use_trajectories,
          as_trajectories=use_trajectories,
          add_batch_dim=False,
          num_parallel_reads=num_parallel_reads,
          decoder=decoder,
      )
  
      def _sample_to_experience(sample):
          dummy_info = ()
          return (
              updated_sample(
                  sample,
                  reward_shift,
                  action_clipping,
                  use_trajectories,
              ),
              dummy_info,
          )
  
      dataset = dataset.map(
          _sample_to_experience,
          num_parallel_calls=tf.data.experimental.AUTOTUNE,
      )
  
      dataset = dataset.shuffle(shuffle_buffer_size)
      dataset = dataset.prefetch(tf.data.experimental.AUTOTUNE)
      return dataset
  
file_path: agents/tf_agents/examples/cql_sac/kumar20/data_utils.py
imports: import functools
  from typing import Any, Callable, MutableSequence, Optional, Text, Tuple
  import numpy
  import tensorflow
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
  from tf_agents.typing import types
  from tf_agents.utils import example_encoding
  from tf_agents.utils import example_encoding_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: create_single_tf_record_dataset(filename, load_buffer_size, shuffle_buffer_size, num_parallel_reads, decoder, reward_shift, action_clipping, use_trajectories) and returns: dataset, updated_sample,  dummy_info