code: def process_metadata_file(
      csv_path,
      freqs,
      n_src,
      aishell1_dir,
      wham_dir,
      out_dir,
      modes,
      types,
  ):
      """Process a metadata generation file to create sources and mixtures"""
      md_file = pd.read_csv(csv_path, engine="python")
      for freq in freqs:
          # Get the frequency directory path
          freq_path = os.path.join(out_dir, "wav" + freq)
          # Transform freq = "16k" into 16000
          freq = int(freq.strip("k")) * 1000
  
          for mode in modes:
              # Path to the mode directory
              mode_path = os.path.join(freq_path, mode)
              # Subset metadata path
              subset_metadata_path = os.path.join(mode_path, "metadata")
              os.makedirs(subset_metadata_path, exist_ok=True)
              # Directory where the mixtures and sources will be stored
              dir_name = (
                  os.path.basename(csv_path)
                  .replace(f"aishell1mix{n_src}_", "")
                  .replace(".csv", "")
              )
              dir_path = os.path.join(mode_path, dir_name)
              # Create subdir
              if types == ["mix_clean"]:
                  subdirs = [f"s{i + 1}" for i in range(n_src)] + [
                      "mix_clean"
                  ]
              else:
                  subdirs = (
                      [f"s{i + 1}" for i in range(n_src)]
                      + types
                      + ["noise"]
                  )
              # If the files already exist then continue, otherwise remove the dir and regenerate
              sounds = glob.glob(
                  os.path.join(dir_path, "**/*.wav"), recursive=True
              )
              if len(md_file) * len(subdirs) == len(sounds):
                  print(
                      f"Directory {dir_path} already exist. "
                      f"Files won't be overwritten"
                  )
                  continue
              shutil.rmtree(dir_path, ignore_errors=True)
              print(
                  f"Creating mixtures and sources from {csv_path} "
                  f"in {dir_path}"
              )
              # Create directories accordingly
              for subdir in subdirs:
                  os.makedirs(os.path.join(dir_path, subdir))
              # Go through the metadata file
              process_utterances(
                  md_file,
                  aishell1_dir,
                  wham_dir,
                  freq,
                  mode,
                  subdirs,
                  dir_path,
                  subset_metadata_path,
                  n_src,
              )
  
imports: import os
  import argparse
  import soundfile
  import pandas
  import numpy
  import functools
  from scipy.signal import resample_poly
  import tqdm.contrib.concurrent
  import glob
  import shutil
label_desc: Use image node_id 3 for calling a global function with example usage: process_metadata_file(csv_path, freqs, n_src, aishell1_dir, wham_dir, out_dir, modes, types) without return types