class_docstr: A class for managing multiple kernels.
class_docstr_tok: ["A","class","for","managing","multiple","kernels","."]
code: def _create_kernel_manager_factory(self):
      kernel_manager_ctor = import_item(self.kernel_manager_class)
  
      def create_kernel_manager(*args, **kwargs):
          if self.shared_context:
              if self.context.closed:
                  # recreate context if closed
                  self.context = self._context_default()
              kwargs.setdefault("context", self.context)
          km = kernel_manager_ctor(*args, **kwargs)
          return km
  
      return create_kernel_manager
  
imports: from __future__ import absolute_import
  import os
  import uuid
  import zmq
  from traitlets.config.configurable import LoggingConfigurable
  from ipython_genutils.importstring import import_item
  from traitlets import Any, Bool, Dict, DottedObjectName, Instance, Unicode, default, observe
  from ipython_genutils.py3compat import unicode_type
  from .kernelspec import NATIVE_KERNEL_NAME, KernelSpecManager
label_desc: Use image node_id 3 for calling the MultiKernelManager obj's underlying member method code with example usage: obj._create_kernel_manager_factory() and returns: create_kernel_manager, km