code: def test_inferring_labels_from_data_dirs(
      data_files_with_labels_no_metadata, cache_dir
  ):
      autofolder = DummyFolderBasedBuilder(
          data_files=data_files_with_labels_no_metadata,
          cache_dir=cache_dir,
          drop_labels=False,
      )
      gen_kwargs = autofolder._split_generators(
          StreamingDownloadManager()
      )[0].gen_kwargs
      assert autofolder.info.features == Features(
          {"base": {}, "label": ClassLabel(names=["class0", "class1"])}
      )
      generator = autofolder._generate_examples(**gen_kwargs)
      assert all(
          example["label"] in {"class0", "class1"}
          for _, example in generator
      )
  
imports: import importlib
  import shutil
  import textwrap
  import pytest
  from datasets import ClassLabel, DownloadManager, Features, Value
  from datasets.data_files import DataFilesDict, get_data_patterns
  from datasets.download.streaming_download_manager import StreamingDownloadManager
  from datasets.packaged_modules.folder_based_builder.folder_based_builder import FolderBasedBuilder, FolderBasedBuilderConfig
  from datasets.tasks import TextClassification
label_desc: Use image node_id 12 for calling a global function with example usage: test_inferring_labels_from_data_dirs(data_files_with_labels_no_metadata, cache_dir) without return types