code: def run_kernel(**kwargs):
      """Context manager to create a kernel in a subprocess.
  
      The kernel is shut down when the context exits.
  
      Returns
      -------
      kernel_client: connected KernelClient instance
      """
      km, kc = start_new_kernel(**kwargs)
      try:
          yield kc
      finally:
          kc.stop_channels()
          km.shutdown_kernel(now=True)
  
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 2 for calling a global function with example usage: run_kernel() without return types