code: def install_exception_handler():
      global _installed
      global _original
      if not _installed:
          _original = py4j.protocol.get_return_value
          _installed = True
          # The original `get_return_value` is not patched, it's idempotent.
          patched = handle_java_exception(_original)
          # only patch the one used in py4j.java_gateway (call Java API)
          py4j.java_gateway.get_return_value = patched
  
imports: from typing import Mapping, Set, Tuple
  import abc
  import socket
  import socketserver
  import sys
  from threading import Thread
  import orjson
  import requests
  import py4j
  from py4j.java_gateway import JavaObject, JVMView
  import hail
  from hail.expr import construct_expr
  from hail.ir import JavaIR
  from hail.utils.java import FatalError, Env, scala_package_object
  from .backend import ActionTag, Backend, fatal_error_from_java_error_triplet
  from ..hail_logging import Logger
  import http.client
label_desc: Use image node_id 1 for calling a global function with example usage: install_exception_handler() without return types