code: def install_importhook(config):
      """Try to install the rewrite hook, raise SystemError if it fails."""
      # Jython has an AST bug that make the assertion rewriting hook malfunction.
      if sys.platform.startswith("java"):
          raise SystemError("rewrite not supported")
  
      config._assertstate = AssertionState(config, "rewrite")
      config._assertstate.hook = hook = rewrite.AssertionRewritingHook(
          config
      )
      sys.meta_path.insert(0, hook)
      config._assertstate.trace("installed rewrite import hook")
  
      def undo():
          hook = config._assertstate.hook
          if hook is not None and hook in sys.meta_path:
              sys.meta_path.remove(hook)
  
      config.add_cleanup(undo)
      return hook
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import sys
  import six
  from _pytest.assertion import rewrite
  from _pytest.assertion import truncate
  from _pytest.assertion import util
label_desc: Use image node_id 3 for calling a global function with example usage: install_importhook(config) and returns: hook