class_docstr: Manages a single kernel in a subprocess on this host.
  
  This version starts kernels with Popen.
class_docstr_tok: ["Manages","a","single","kernel","in","a","subprocess","on","this","host",".","This","version","starts","kernels","with","Popen","."]
docstr: Kill the running kernel.
  
  This is a private method, callers should use shutdown_kernel(now=True).
docstr_tok: ["Kill","the","running","kernel",".","This","is","a","private","method",",","callers","should","use","shutdown_kernel","(","now=True",")","."]
code: def _kill_kernel(self):
      """Kill the running kernel.
  
      This is a private method, callers should use shutdown_kernel(now=True).
      """
      if self.has_kernel:
          # Signal the kernel to terminate (sends SIGKILL on Unix and calls
          # TerminateProcess() on Win32).
          try:
              if hasattr(signal, "SIGKILL"):
                  self.signal_kernel(signal.SIGKILL)
              else:
                  self.kernel.kill()
          except OSError as e:
              # In Windows, we will get an Access Denied error if the process
              # has already terminated. Ignore it.
              if sys.platform == "win32":
                  if e.winerror != 5:
                      raise
              # On Unix, we may get an ESRCH error if the process has already
              # terminated. Ignore it.
              else:
                  from errno import ESRCH
  
                  if e.errno != ESRCH:
                      raise
  
          # Block until the kernel terminates.
          self.kernel.wait()
          self.kernel = None
      else:
          raise RuntimeError(
              "Cannot kill kernel. No kernel is running!"
          )
  
imports: from __future__ import absolute_import
  from contextlib import contextmanager
  import os
  import re
  import signal
  import sys
  import time
  import warnings
  import zmq
  from ipython_genutils.importstring import import_item
  from .localinterfaces import is_local_ip, local_ips
  from traitlets import Any, Float, Instance, Unicode, List, Bool, Type, DottedObjectName
  from jupyter_client import launch_kernel, kernelspec
  from .connect import ConnectionFileMixin
  from .managerabc import KernelManagerABC
label_desc: Use image node_id 27 for calling the KernelManager obj's underlying member method code with example usage: obj._kill_kernel() without return types