code: def builder_from_directory(
      builder_dir: epath.PathLike,
  ) -> dataset_builder.DatasetBuilder:
      """Loads a `tfds.core.DatasetBuilder` from the given generated dataset path.
  
      Reconstructs the `tfds.core.DatasetBuilder` without requiring the original
      generation code.
  
      From `<builder_dir>/features.json` it infers the structure (feature names,
      nested dict,...) and content (image, sequence,...) of the dataset. The
      serialization format is defined in
      `tfds.features.FeatureConnector` in `to_json()`.
  
      Note: This function only works for datasets generated with TFDS `4.0.0` or
      above.
  
      Args:
        builder_dir: `str`, path of the directory containing the dataset to read (
          e.g. `~/tensorflow_datasets/mnist/3.0.0/`).
  
      Returns:
        builder: `tfds.core.DatasetBuilder`, builder for dataset at the given path.
      """
      return ReadOnlyBuilder(builder_dir=builder_dir)
  
imports: import functools
  import os
  import typing
  from typing import Any, List, Optional, Tuple, Type
  from etils import epath
  from tensorflow_datasets.core import dataset_builder
  from tensorflow_datasets.core import dataset_info
  from tensorflow_datasets.core import logging
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.features import feature
  from tensorflow_datasets.core.proto import dataset_info_pb2
  from tensorflow_datasets.core.utils import error_utils
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import version
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: builder_from_directory(builder_dir) and returns: ReadOnlyBuilder