code: def _find_builder_dir_single_dir(
      builder_name: str,
      *,
      data_dir: epath.PathLike,
      config_name: Optional[str] = None,
      version_str: Optional[str] = None,
  ) -> Optional[str]:
      """Same as `find_builder_dir` but requires explicit dir."""
  
      builder_dir = epath.Path(data_dir) / builder_name
  
      # If the version is specified, check if the dataset dir exists and return.
      if version_str and version_lib.Version.is_valid(version_str):
          dataset_dir = _get_dataset_dir(
              builder_dir=builder_dir,
              version_str=version_str,
              config_name=config_name,
          )
          if _contains_dataset(dataset_dir):
              return os.fspath(dataset_dir)
  
      # If no config_name or an empty string was given, we try to find the default
      # config and load the dataset for that.
      if not config_name:
          default_config_name = _get_default_config_name(
              builder_dir=builder_dir, name=builder_name
          )
          if default_config_name:
              return _find_builder_dir_single_dir(
                  builder_name=builder_name,
                  data_dir=data_dir,
                  config_name=default_config_name,
                  version_str=version_str,
              )
  
      # Dataset wasn't found, try to find a suitable available version.
      found_version_str = _get_version_str(
          builder_dir,
          config_name=config_name,
          requested_version=version_str,
      )
      if found_version_str and (
          version_str is None or found_version_str != version_str
      ):
          return _find_builder_dir_single_dir(
              builder_name=builder_name,
              data_dir=data_dir,
              config_name=config_name,
              version_str=found_version_str,
          )
  
      # If no builder found, we populate the error_context with useful information
      # and return None.
      error_utils.add_context(
          "No builder could be found in the directory: "
          f"{data_dir} for the builder: {builder_name}."
      )
      return None
  
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 8 for calling a global function with example usage: _find_builder_dir_single_dir(builder_name) and returns: None, _find_builder_dir_single_dir, os, _find_builder_dir_single_dir