code: def test_generate_examples_drop_metadata(
      image_file_with_metadata, drop_metadata, drop_labels
  ):
      image_file, image_metadata_file = image_file_with_metadata
      imagefolder = ImageFolder(
          drop_metadata=drop_metadata,
          drop_labels=drop_labels,
          data_files={"train": [image_file, image_metadata_file]},
      )
      gen_kwargs = imagefolder._split_generators(
          StreamingDownloadManager()
      )[0].gen_kwargs
      # since the dataset has metadata, removing the metadata explicitly requires drop_metadata=True
      assert gen_kwargs["add_metadata"] is not bool(drop_metadata)
      # since the dataset has metadata, adding the labels explicitly requires drop_labels=False
      assert gen_kwargs["add_labels"] is (drop_labels is False)
      generator = imagefolder._generate_examples(**gen_kwargs)
      expected_columns = {"image"}
      if gen_kwargs["add_metadata"]:
          expected_columns.add("caption")
      if gen_kwargs["add_labels"]:
          expected_columns.add("label")
      result = [example for _, example in generator]
      assert len(result) == 1
      example = result[0]
      assert example.keys() == expected_columns
      for column in expected_columns:
          assert example[column] is not None
  
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 12 for calling a global function with example usage: test_generate_examples_drop_metadata(image_file_with_metadata, drop_metadata, drop_labels) without return types