code: def get_log_paths(root_dir: str) -> List[str]:
      """Returns the paths of environment logs under a (set of) directories.
  
      We assume that a sub-directory with metadata.riegeli file contains the logs.
  
      Args:
        root_dir: Root directory to search for log paths.
  
      Returns:
        A list of paths that contain the environment logs.
  
      Raises:
        ValueError if the specified pattern matches a non-directory.
      """
      paths = []
      if not tf.io.gfile.isdir(root_dir):
          raise ValueError(f"{root_dir} is not a directory.")
      for path, _, files in tf.io.gfile.walk(root_dir):
          if "metadata.riegeli" in files:
              paths.append(path)
      return paths
  
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 2 for calling a global function with example usage: get_log_paths(root_dir) and returns: paths