code: def test_exclude_datasets():
      # Exclude all datasets except 2
      all_ds = [
          b
          for b in tfds.list_builders()
          if b not in ("mnist", "cifar10")
      ]
      all_ds_str = ",".join(all_ds)
  
      assert _build(f"--exclude_datasets {all_ds_str}") == [
          "cifar10",
          "mnist",
      ]
  
      with pytest.raises(
          ValueError, match="--exclude_datasets can't be used"
      ):
          _build("mnist --exclude_datasets cifar10")
  
imports: import contextlib
  import os
  import pathlib
  from typing import Dict, Iterator, List, Optional
  from unittest import mock
  from absl.testing import parameterized
  from etils import epath
  import pytest
  import tensorflow_datasets
  from tensorflow_datasets import testing
  from tensorflow_datasets.core import download
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.scripts.cli import build
  from tensorflow_datasets.scripts.cli import main
label_desc: Use image node_id 8 for calling a global function with example usage: test_exclude_datasets() without return types