code: def _build_datasets(args: argparse.Namespace) -> None:
      """Build the given datasets."""
      # Eventually register additional datasets imports
      if args.imports:
          list(
              importlib.import_module(m)
              for m in args.imports.split(",")
          )
  
      # Select datasets to generate
      datasets = (args.datasets or []) + (args.datasets_keyword or [])
      if (
          args.exclude_datasets
      ):  # Generate all datasets if `--exclude_datasets` set
          if datasets:
              raise ValueError(
                  "--exclude_datasets can't be used with `datasets`"
              )
          datasets = set(
              tfds.list_builders(with_community_datasets=False)
          ) - set(args.exclude_datasets.split(","))
          datasets = sorted(datasets)  # `set` is not deterministic
      else:
          datasets = datasets or [""]  # Empty string for default
  
      # Parallelize datasets generation.
      builders = itertools.chain(
          *(_make_builders(args, dataset) for dataset in datasets)
      )
      process_builder_fn = functools.partial(
          _download if args.download_only else _download_and_prepare,
          args,
      )
  
      if args.num_processes == 1:
          for builder in builders:
              process_builder_fn(builder)
      else:
          with multiprocessing.Pool(args.num_processes) as pool:
              pool.map(process_builder_fn, builders)
  
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 2 for calling a global function with example usage: _build_datasets(args) without return types