class_docstr: Replace a KeyboardInterrupt with SystemExit(1)
  
  >>> def do_interrupt():
  ...     raise KeyboardInterrupt()
  >>> on_interrupt('error')(do_interrupt)()
  Traceback (most recent call last):
  ...
  SystemExit: 1
  >>> on_interrupt('error', code=255)(do_interrupt)()
  Traceback (most recent call last):
  ...
  SystemExit: 255
  >>> on_interrupt('suppress')(do_interrupt)()
  >>> with __import__('pytest').raises(KeyboardInterrupt):
  ...     on_interrupt('ignore')(do_interrupt)()
class_docstr_tok: ["Replace","a","KeyboardInterrupt","with","SystemExit","(","1",")",">",">",">","def","do_interrupt","(",")",":","...","raise","KeyboardInterrupt","(",")",">",">",">","on_interrupt","(","'error","'",")","(","do_interrupt",")","(",")","Traceback","(","most","recent","call","last",")",":","...","SystemExit",":","1",">",">",">","on_interrupt","(","'error","'",",","code=255",")","(","do_interrupt",")","(",")","Traceback","(","most","recent","call","last",")",":","...","SystemExit",":","255",">",">",">","on_interrupt","(","'suppress","'",")","(","do_interrupt",")","(",")",">",">",">","with","__import__","(","'pytest","'",")",".raises","(","KeyboardInterrupt",")",":","...","on_interrupt","(","'ignore","'",")","(","do_interrupt",")","(",")"]
code: def __exit__(self, exctype, excinst, exctb):
      if exctype is not KeyboardInterrupt or self.action == "ignore":
          return
      elif self.action == "error":
          raise SystemExit(self.code) from excinst
      return self.action == "suppress"
  
imports: import os
  import subprocess
  import contextlib
  import functools
  import tempfile
  import shutil
  import operator
  import warnings
label_desc: Use image node_id 3 for calling the on_interrupt obj's underlying member method code with example usage: obj.__exit__(exctype, excinst, exctb) and returns: unknown