code: def generate_test_files(
      src, dest, nseconds, fmts=[".mp3", ".wav"], padding=10
  ):
      """
      Generates a test file for each file recursively in `src` directory
      of given format using `nseconds` sampled from the audio file.
  
      Results are written to `dest` directory.
  
      `padding` is the number of off-limit seconds and the beginning and
      end of a track that won't be sampled in testing. Often you want to
      avoid silence, etc.
      """
      # create directories if necessary
      if not exists(dest):
          makedirs(dest)
  
      # find files recursively of a given file format
      for fmt in fmts:
          testsources = get_files_recursive(src, fmt)
          for audiosource in testsources:
              print("audiosource:", audiosource)
  
              filename, extension = splitext(basename(audiosource))
              length = get_length_audio(audiosource, extension)
              starttime = get_starttime(length, nseconds, padding)
  
              test_file_name = f"{join(dest, filename)}_{starttime}_{nseconds}sec.{extension.replace('.', '')}"
  
              subprocess.check_output(
                  [
                      "ffmpeg",
                      "-y",
                      "-ss",
                      f"{starttime}",
                      "-t",
                      f"{nseconds}",
                      "-i",
                      audiosource,
                      test_file_name,
                  ]
              )
  
imports: import fnmatch
  import json
  import logging
  import random
  import re
  import subprocess
  import traceback
  from os import listdir, makedirs, walk
  from os.path import basename, exists, isfile, join, splitext
  import matplotlib.pyplot
  import numpy
  from pydub import AudioSegment
  from dejavu.config.settings import DEFAULT_FS, DEFAULT_OVERLAP_RATIO, DEFAULT_WINDOW_SIZE, HASHES_MATCHED, OFFSET, RESULTS, SONG_NAME, TOTAL_TIME
  from dejavu.logic.decoder import get_audio_name_from_path
label_desc: Use image node_id 5 for calling a global function with example usage: generate_test_files(src, dest, nseconds, fmts, padding) without return types