code: def test_generate_examples_drop_labels(
      data_files_with_labels_no_metadata, drop_metadata, drop_labels
  ):
      audiofolder = AudioFolder(
          drop_metadata=drop_metadata,
          drop_labels=drop_labels,
          data_files=data_files_with_labels_no_metadata,
      )
      gen_kwargs = audiofolder._split_generators(
          StreamingDownloadManager()
      )[0].gen_kwargs
      # removing the labels explicitly requires drop_labels=True
      assert gen_kwargs["add_labels"] is not bool(drop_labels)
      assert (
          gen_kwargs["add_metadata"] is False
      )  # metadata files is not present in this case
      generator = audiofolder._generate_examples(**gen_kwargs)
      if not drop_labels:
          assert all(
              example.keys() == {"audio", "label"}
              and all(val is not None for val in example.values())
              for _, example in generator
          )
      else:
          assert all(
              example.keys() == {"audio"}
              and all(val is not None for val in example.values())
              for _, example in generator
          )
  
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 11 for calling a global function with example usage: test_generate_examples_drop_labels(data_files_with_labels_no_metadata, drop_metadata, drop_labels) without return types