code: def check_errhandler(obj):
      if rc.errors == "default":
          if isinstance(obj, MPI.File):
              check_eh = MPI.ERRORS_RETURN
          else:
              check_eh = MPI.ERRORS_ARE_FATAL
      elif rc.errors == "exception":
          check_eh = MPI.ERRORS_RETURN
      elif rc.errors == "abort":
          if MPI.ERRORS_ABORT != MPI.ERRHANDLER_NULL:
              check_eh = MPI.ERRORS_ABORT
          else:
              check_eh = MPI.ERRORS_ARE_FATAL
      elif rc.errors == "fatal":
          check_eh = MPI.ERRORS_ARE_FATAL
      else:
          assert 0
      eh = obj.Get_errhandler()
      try:
          assert eh == check_eh
      finally:
          if eh != MPI.ERRHANDLER_NULL:
              eh.Free()
  
imports: import os
  import sys
  from mpi4py import rc
  from mpi4py import MPI
label_desc: Use image node_id 1 for calling a global function with example usage: check_errhandler(obj) without return types