code: def fit_lengths(source_list, mode):
      """Make the sources to match the target length"""
      sources_list_reshaped = []
      # Check the mode
      if mode == "min":
          target_length = min([len(source) for source in source_list])
          for source in source_list:
              sources_list_reshaped.append(source[:target_length])
      else:
          target_length = max([len(source) for source in source_list])
          for source in source_list:
              sources_list_reshaped.append(
                  np.pad(
                      source,
                      (0, target_length - len(source)),
                      mode="constant",
                  )
              )
      return sources_list_reshaped
  
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 14 for calling a global function with example usage: fit_lengths(source_list, mode) and returns: sources_list_reshaped