code: def install_handler():
      if sys.platform == "win32":
          if sys.stdin is not None and sys.stdin.isatty():
              # this is Console based application
              import win32api
  
              win32api.SetConsoleCtrlHandler(handler, True)
  
imports: import threading
  import time
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: install_handler() without return types