def safe_rmtree(directory):
  """Delete a directory if it's present. If it's not present, no-op.

  Note that if the directory argument is a symlink, only the symlink will
  be deleted.

  :API: public
  """
  if os.path.islink(directory):
    safe_delete(directory)
  else:
    shutil.rmtree(directory, ignore_errors=True)
Delete a directory if it's present. If it's not present, no-op.

  Note that if the directory argument is a symlink, only the symlink will
  be deleted.

  :API: public