code: def _validate_rlds_episode_spec(rlds_data: tf.data.Dataset) -> None:
      """Validates the dataset of RLDS data.
  
      Validates that rlds_data has RLDS steps.
  
      Args:
        rlds_data: An RLDS dataset is tf.data.Dataset of RLDS episodes, where each
          episode contains a tf.data.Dataset of RLDS steps. An RLDS step is a
          dictionary of tensors containing is_first, is_last, observation, action,
          reward, is_terminal, and discount.
  
      Raises:
        ValueError: If no RLDS steps exist in rlds_data.
      """
      episode_spec = rlds_data.element_spec
      if rlds.STEPS not in episode_spec:
          raise ValueError(
              f"No dataset representing RLDS {rlds.STEPS} exist in the data."
          )
  
file_path: agents/tf_agents/replay_buffers/rlds_to_reverb.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from typing import Callable, Dict, List, Optional, Tuple, Union
  from absl import logging
  import numpy
  import rlds
  import tensorflow
  from tf_agents.replay_buffers import reverb_utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.trajectories import time_step
  from tf_agents.trajectories import trajectory
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_rlds_episode_spec(rlds_data) without return types