code: def ensure_dirs_exist(path):
      """
      Simple helper that ensures that any directories specified in the path are
      created prior to use.
  
      Arguments:
          path (str): the path (may be to a file or directory).  Any intermediate
                      directories will be created.
  
      Returns:
          str: The unmodified path value.
      """
      outdir = os.path.dirname(path)
      if outdir != "" and not os.path.isdir(outdir):
          os.makedirs(outdir)
      return path
  
file_path: neon/neon/util/persist.py
imports: import importlib
  import logging
  import os
  import pkgutil
  import sys
  import appdirs
  from neon.util.compat import pickle, pickle_load
label_desc: Use image node_id 4 for calling a global function with example usage: ensure_dirs_exist(path) and returns: path