code: def test_generate_examples_duplicated_label_key(
      audio_files_with_labels_and_duplicated_label_key_in_metadata,
      drop_metadata,
      drop_labels,
      cache_dir,
      caplog,
  ):
      (
          fr_audio_file,
          uk_audio_file,
          audio_metadata_file,
      ) = audio_files_with_labels_and_duplicated_label_key_in_metadata
      audiofolder = AudioFolder(
          drop_metadata=drop_metadata,
          drop_labels=drop_labels,
          data_files=[
              fr_audio_file,
              uk_audio_file,
              audio_metadata_file,
          ],
          cache_dir=cache_dir,
      )
      if drop_labels is False:
          # infer labels from directories even if metadata files are found
          audiofolder.download_and_prepare()
          warning_in_logs = any(
              "ignoring metadata columns" in record.msg.lower()
              for record in caplog.records
          )
          assert (
              warning_in_logs
              if drop_metadata is not True
              else not warning_in_logs
          )
          dataset = audiofolder.as_dataset()["train"]
          assert audiofolder.info.features["label"] == ClassLabel(
              names=["fr", "uk"]
          )
          assert all(
              example["label"]
              in audiofolder.info.features["label"]._str2int.values()
              for example in dataset
          )
      else:
          audiofolder.download_and_prepare()
          dataset = audiofolder.as_dataset()["train"]
          if drop_metadata is not True:
              # labels are from metadata
              assert audiofolder.info.features["label"] == Value(
                  "string"
              )
              assert all(
                  example["label"] in ["Fr", "Uk"]
                  for example in dataset
              )
          else:
              # drop both labels and metadata
              assert audiofolder.info.features == Features(
                  {"audio": Audio()}
              )
              assert all(
                  example.keys() == {"audio"} for example in dataset
              )
  
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 10 for calling a global function with example usage: test_generate_examples_duplicated_label_key(audio_files_with_labels_and_duplicated_label_key_in_metadata, drop_metadata, drop_labels, cache_dir, caplog) without return types