class_docstr: Launch a kernel by name in a local subprocess.
      
class_docstr_tok: ["Launch","a","kernel","by","name","in","a","local","subprocess","."]
docstr: Shutdown on SIGTERM or SIGINT (Ctrl-C)
docstr_tok: ["Shutdown","on","SIGTERM","or","SIGINT","(","Ctrl-C",")"]
code: def setup_signals(self):
      """Shutdown on SIGTERM or SIGINT (Ctrl-C)"""
      if os.name == "nt":
          return
  
      def shutdown_handler(signo, frame):
          self.loop.add_callback_from_signal(self.shutdown, signo)
  
      for sig in [signal.SIGTERM, signal.SIGINT]:
          signal.signal(sig, shutdown_handler)
  
file_path: catboost/contrib/python/jupyter-client/py2/jupyter_client/kernelapp.py
imports: import os
  import signal
  import uuid
  from jupyter_core.application import JupyterApp, base_flags
  from tornado.ioloop import IOLoop
  from traitlets import Unicode
  from .None import __version__
  from .kernelspec import KernelSpecManager, NATIVE_KERNEL_NAME
  from .manager import KernelManager
label_desc: Use image node_id 2 for calling the KernelApp obj's underlying member method code with example usage: obj.setup_signals() without return types