code: def _chmod(func, p, excinfo):  # noqa: ARG001
      perm = os.lstat(p).st_mode
      perm |= stat.S_IWRITE
  
      try:
          os.chmod(p, perm)
      except OSError as exc:
          # broken symlink or file is not owned by us
          if exc.errno not in [errno.ENOENT, errno.EPERM]:
              raise
  
      func(p)
  
file_path: dvc/dvc/utils/fs.py
imports: import errno
  import os
  import shutil
  import stat
  import sys
  from typing import TYPE_CHECKING
  from dvc.exceptions import DvcException
  from dvc.log import logger
label_desc: Use image node_id 2 for calling a global function with example usage: _chmod(func, p, excinfo) without return types