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: Starts a kernel on this host in a separate process.
  
  If random ports (port=0) are being used, this method must be called
  before the channels are created.
  
  Parameters
  ----------
  `**kw` : optional
       keyword arguments that are passed down to build the kernel_cmd
       and launching the kernel (e.g. Popen kwargs).
docstr_tok: ["Starts","a","kernel","on","this","host","in","a","separate","process",".","If","random","ports","(","port=0",")","are","being","used",",","this","method","must","be","called","before","the","channels","are","created",".","Parameters","--","--","--","--","--","`","*","*","kw","`",":","optional","keyword","arguments","that","are","passed","down","to","build","the","kernel_cmd","and","launching","the","kernel","(","e.g",".","Popen","kwargs",")","."]
code: def start_kernel(self, **kw):
      """Starts a kernel on this host in a separate process.
  
      If random ports (port=0) are being used, this method must be called
      before the channels are created.
  
      Parameters
      ----------
      `**kw` : optional
           keyword arguments that are passed down to build the kernel_cmd
           and launching the kernel (e.g. Popen kwargs).
      """
      if self.transport == "tcp" and not is_local_ip(self.ip):
          raise RuntimeError(
              "Can only launch a kernel on a local interface. "
              "This one is not: %s."
              "Make sure that the '*_address' attributes are "
              "configured properly. "
              "Currently valid addresses are: %s"
              % (self.ip, local_ips())
          )
  
      # write connection file / get default ports
      self.write_connection_file()
  
      # save kwargs for use in restart
      self._launch_args = kw.copy()
      # build the Popen cmd
      extra_arguments = kw.pop("extra_arguments", [])
      kernel_cmd = self.format_kernel_cmd(
          extra_arguments=extra_arguments
      )
      env = kw.pop("env", os.environ).copy()
      # Don't allow PYTHONEXECUTABLE to be passed to kernel process.
      # If set, it can bork all the things.
      env.pop("PYTHONEXECUTABLE", None)
      if not self.kernel_cmd:
          # If kernel_cmd has been set manually, don't refer to a kernel spec
          # Environment variables from kernel spec are added to os.environ
          env.update(self.kernel_spec.env or {})
  
      # launch the kernel subprocess
      self.log.debug("Starting kernel: %s", kernel_cmd)
      self.kernel = self._launch_kernel(kernel_cmd, env=env, **kw)
      self.start_restarter()
      self._connect_control_socket()
  
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 20 for calling the KernelManager obj's underlying member method code with example usage: obj.start_kernel() without return types