code: def get_dir(cfg, param_name, new_dir_name):
      """Helper function to retrieve directory name if it exists,
      create it if it doesn't exist"""
  
      if param_name in cfg:
          dir_name = cfg[param_name]
      else:
          dir_name = os.path.join(
              os.path.dirname(__file__), new_dir_name
          )
      if not os.path.exists(dir_name):
          os.makedirs(dir_name)
      return dir_name
  
file_path: speechbrain/recipes/DNS/noisyspeech_synthesizer/utils.py
imports: import os
  import csv
  from shutil import copyfile
  import glob
label_desc: Use image node_id 1 for calling a global function with example usage: get_dir(cfg, param_name, new_dir_name) and returns: dir_name