code: def extract_files(datapath, type=None):
      """
      Given a dir-path, it extracts full path of all wav files
      and sorts them.
  
      Arguments:
      ----------
      datapath :str
          Path to synthesized SAR data
      type : str
          Type of split: clean, noisy, noise.
  
      Returns
      -------
      list
          Sorted list of all wav files found in the given path.
      """
      if type:
          path = os.path.join(datapath, type)
          files = glob.glob(path + "/*.wav")
  
          # Sort all files based on the suffixed file_id (ascending order)
          files.sort(
              key=lambda f: int(f.split("fileid_")[-1].strip(".wav"))
          )
      else:
          # Sort all files by name
          files = sorted(glob.glob(datapath + "/*.wav"))
  
      return files
  
file_path: speechbrain/recipes/RescueSpeech/ASR/noise-robust/rescuespeech_prepare.py
imports: import os
  import re
  import csv
  import glob
  import logging
  import torchaudio
  import unicodedata
  from tqdm import tqdm
  from tqdm.contrib import tzip
  from speechbrain.dataio.dataio import read_audio
label_desc: Use image node_id 10 for calling a global function with example usage: extract_files(datapath, type) and returns: files