code: def _search_script_path(ds_to_build: str) -> Optional[tfds.core.Path]:
      """Check whether the requested dataset match a file on disk."""
      # If the dataset file exists, use it. Valid values are:
      # * Empty string (use default directory)
      # * Dataset folder (e.g. `my_dataset/my_dataset_dataset_builder.py`)
      # * Legacy dataset folder (e.g. `my_dataset/my_dataset.py`)
      # * Dataset file (e.g. `my_dataset.py`)
      # * Dataset module (e.g. `my_dataset`)
  
      path = tfds.core.Path(ds_to_build).expanduser().resolve()
      if path.exists():
          if path.is_dir():
              # dataset-as-folder, use `my_dataset/my_dataset_dataset_builder.py` ...
              module_path = path / f"{path.name}_dataset_builder.py"
              if module_path.exists():
                  return _validate_script_path(module_path)
              # ... or `my_dataset/my_dataset.py` (legacy)
              return _validate_script_path(path / f"{path.name}.py")
          else:  # `my_dataset.py` script
              return _validate_script_path(path)
  
      # Try with `.py`
      path = path.with_suffix(".py")
      if path.exists():
          return path
      # Path not found. Use heuristic to detect if user intended to pass a path:
      elif (
          not ds_to_build
          or ds_to_build.endswith((os.sep, ".py"))  # ds.py
          or tfds.core.Path(ds_to_build).is_absolute()  # /path/to
          or ds_to_build.count(os.sep) > 1  # path/dataset/config
      ):
          raise FileNotFoundError(
              f"Could not find generation script for `{ds_to_build}`: "
              f"{path} not found."
          )
      else:
          return None
  
imports: import argparse
  import functools
  import importlib
  import itertools
  import json
  import multiprocessing
  import os
  import typing
  from typing import Dict, Iterator, Optional, Tuple, Type, Union
  from absl import logging
  from etils import epath
  import tensorflow_datasets
label_desc: Use image node_id 5 for calling a global function with example usage: _search_script_path(ds_to_build) and returns: path, _validate_script_path, _validate_script_path, None, _validate_script_path