code: def _generate_examples_from_log_path(
      log_path: str,
  ) -> Generator[Tuple[str, Dict[str, Any]], None, None]:
      """Yields examples from a directory containing log files.
  
      Args:
        log_path: Path of the directory containing the log files.
  
      Yields:
        a unique example ID and dictionary pair for each episode.
      """
      envlogger = tfds.core.lazy_imports.envlogger
      logging.info("Processing directory %s.", log_path)
      counter = 0
      # TFDS suggests using the basename to avoid having the user path in the key.
      key_prefix = os.path.basename(log_path)
      with envlogger.Reader(log_path) as reader:
          for episode_dict in envlogger_reader.generate_episodes(
              reader
          ):
              # The example ID should be unique.
              episode_id = counter
              if "episode_id" in episode_dict:
                  episode_id = episode_dict["episode_id"]
              yield f"{key_prefix}/{episode_id}", episode_dict
              counter += 1
  
file_path: datasets/tensorflow_datasets/rlds/rlds_base.py
imports: from __future__ import annotations
  import dataclasses
  import os
  from typing import Any, Dict, Generator, List, Optional, Tuple, Union
  from absl import logging
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
  from tensorflow_datasets.rlds import envlogger_reader
label_desc: Use image node_id 5 for calling a global function with example usage: _generate_examples_from_log_path(log_path) without return types