code: def _ensure_dir(directory, description):
      
      if not os.path.exists(directory):
          try:
              os.makedirs(directory)
          except OSError, e:
              sys.stderr.write("could not create %s directory %s: %s" % (
                               description, directory, str(e)))
docs: Ensure the given directory exists, creating it if not.
  
      @raise errors.FatalError: if the directory could not be created.