code: def list_files(basePath, validExts=None, contains=None):
      # loop over the directory structure
      for rootDir, dirNames, filenames in os.walk(basePath):
          # loop over the filenames in the current directory
          for filename in filenames:
              # if the contains string is not none and the filename does not contain
              # the supplied string, then ignore the file
              if contains is not None and filename.find(contains) == -1:
                  continue
  
              # determine the file extension of the current file
              ext = filename[filename.rfind(".") :].lower()
  
              # check to see if the file is an audio and should be processed
              if validExts is None or ext.endswith(validExts):
                  # construct the path to the audio and yield it
                  audioPath = os.path.join(rootDir, filename)
                  yield audioPath
  
file_path: TTS/TTS/demos/xtts_ft_demo/utils/formatter.py
imports: import os
  import gc
  import torchaudio
  import pandas
  from faster_whisper import WhisperModel
  from glob import glob
  from tqdm import tqdm
  import torch
  import torchaudio
  from TTS.tts.layers.xtts.tokenizer import multilingual_cleaners
  import os
label_desc: Use image node_id 2 for calling a global function with example usage: list_files(basePath, validExts, contains) without return types