code: def test_data_files_with_metadata_and_archives(
      streaming, cache_dir, data_files_with_zip_archives
  ):
      imagefolder = ImageFolder(
          data_files=data_files_with_zip_archives, cache_dir=cache_dir
      )
      imagefolder.download_and_prepare()
      datasets = (
          imagefolder.as_streaming_dataset()
          if streaming
          else imagefolder.as_dataset()
      )
      for split, data_files in data_files_with_zip_archives.items():
          num_of_archives = len(
              data_files
          )  # the metadata file is inside the archive
          expected_num_of_images = 2 * num_of_archives
          assert split in datasets
          dataset = list(datasets[split])
          assert len(dataset) == expected_num_of_images
          # make sure each sample has its own image and metadata
          assert (
              len(
                  {
                      np.array(example["image"])[0, 0, 0]
                      for example in dataset
                  }
              )
              == expected_num_of_images
          )
          assert (
              len({example["caption"] for example in dataset})
              == expected_num_of_images
          )
          assert all(
              example["caption"] is not None for example in dataset
          )
  
imports: import shutil
  import textwrap
  import numpy
  import pytest
  from datasets import ClassLabel, Features, Image, Value
  from datasets.data_files import DataFilesDict, get_data_patterns
  from datasets.download.streaming_download_manager import StreamingDownloadManager
  from datasets.packaged_modules.imagefolder.imagefolder import ImageFolder
  from ..utils import require_pil
label_desc: Use image node_id 17 for calling a global function with example usage: test_data_files_with_metadata_and_archives(streaming, cache_dir, data_files_with_zip_archives) without return types