code: def get_base_dir(paths):
      def is_relative_to(path1, path2):
          try:
              path1.relative_to(path2)
              return True
          except ValueError:
              return False
  
      def common_path(path1, path2):
          while path1 is not None:
              if is_relative_to(path2, path1):
                  return path1
              path1 = path1.parent if path1 != path1.parent else None
          return None
  
      base_dir = None
      for p in paths:
          audio_dir = Path(p).parent
          if base_dir is None:
              base_dir = audio_dir
              continue
          base_dir = common_path(base_dir, audio_dir)
  
      return base_dir
  
imports: import functools
  import os
  import random
  import traceback
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple
  import librosa
  import numpy
  import torch
  from einops import rearrange
  from scipy import ndimage
  from torch.special import gammaln
  from nemo.collections.asr.parts.preprocessing.segment import AudioSegment
label_desc: Use image node_id 10 for calling a global function with example usage: get_base_dir(paths) and returns: base_dir, None, True, False, path1