code: def wrap_exceptions(fun):
      """Decorator which translates bare OSError exceptions into
      NoSuchProcess and AccessDenied.
      """
  
      @functools.wraps(fun)
      def wrapper(self, *args, **kwargs):
          try:
              return fun(self, *args, **kwargs)
          except ProcessLookupError:
              if is_zombie(self.pid):
                  raise ZombieProcess(self.pid, self._name, self._ppid)
              else:
                  raise NoSuchProcess(self.pid, self._name)
          except PermissionError:
              raise AccessDenied(self.pid, self._name)
          except cext.ZombieProcessError:
              raise ZombieProcess(self.pid, self._name, self._ppid)
  
      return wrapper
  
imports: import contextlib
  import errno
  import functools
  import os
  from collections import namedtuple
  from .None import _common
  from .None import _psposix
  from .None import _psutil_osx
  from .None import _psutil_posix
  from ._common import AccessDenied
  from ._common import conn_tmap
  from ._common import conn_to_ntuple
  from ._common import isfile_strict
  from ._common import memoize_when_activated
  from ._common import NoSuchProcess
  from ._common import parse_environ_block
  from ._common import usage_percent
  from ._common import ZombieProcess
  from ._compat import PermissionError
  from ._compat import ProcessLookupError
label_desc: Use image node_id 17 for calling a global function with example usage: wrap_exceptions(fun) and returns: wrapper, fun