def safe_mkdir_for ( path , clean = False ) : safe_mkdir ( os . path . dirname ( path ) , clean = clean )
python safe make dir
Ensure that the parent directory for a file is present .
def safe_mkdir_for(path, clean=False):
  """Ensure that the parent directory for a file is present.

  If it's not there, create it. If it is, no-op.
  """
  safe_mkdir(os.path.dirname(path), clean=clean)