code: def _validate_script_path(
      path: tfds.core.Path,
  ) -> Optional[tfds.core.Path]:
      """Validates and returns the `dataset_builder.py` generation script path."""
      if path.suffix != ".py":
          raise ValueError(
              f"Expected `.py` file. Invalid dataset path: {path}."
          )
      if not path.exists():
          raise FileNotFoundError(
              f"Could not find dataset generation script: {path}. "
          )
      return path
  
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 6 for calling a global function with example usage: _validate_script_path(path) and returns: path