code: def _make_builder(
      builder_cls: Type[tfds.core.DatasetBuilder],
      overwrite: bool,
      fail_if_exists: bool,
      **builder_kwargs,
  ) -> tfds.core.DatasetBuilder:
      """Builder factory, eventually deleting pre-existing dataset."""
      builder = builder_cls(
          **builder_kwargs
      )  # pytype: disable=not-instantiable
      data_exists = builder.data_path.exists()
      if fail_if_exists and data_exists:
          raise RuntimeError(
              "The `fail_if_exists` flag was True and "
              f"the data already exists in {builder.data_path}"
          )
      if overwrite and data_exists:
          builder.data_path.rmtree()  # Delete pre-existing data
          # Re-create the builder with clean state
          builder = builder_cls(
              **builder_kwargs
          )  # pytype: disable=not-instantiable
      return builder
  
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 7 for calling a global function with example usage: _make_builder(builder_cls, overwrite, fail_if_exists) and returns: builder