code: def test_generate_examples_drop_metadata(
      audio_file_with_metadata, drop_metadata, drop_labels
  ):
      audio_file, audio_metadata_file = audio_file_with_metadata
      audiofolder = AudioFolder(
          drop_metadata=drop_metadata,
          drop_labels=drop_labels,
          data_files={"train": [audio_file, audio_metadata_file]},
      )
      gen_kwargs = audiofolder._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 = audiofolder._generate_examples(**gen_kwargs)
      expected_columns = {"audio"}
      if gen_kwargs["add_metadata"]:
          expected_columns.add("text")
      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 librosa
  import numpy
  import pytest
  import soundfile
  from datasets import Audio, ClassLabel, Features, Value
  from datasets.data_files import DataFilesDict, get_data_patterns
  from datasets.download.streaming_download_manager import StreamingDownloadManager
  from datasets.packaged_modules.audiofolder.audiofolder import AudioFolder
  from ..utils import require_sndfile
label_desc: Use image node_id 12 for calling a global function with example usage: test_generate_examples_drop_metadata(audio_file_with_metadata, drop_metadata, drop_labels) without return types