class_docstr: A kernel spec model object.
docstr: Convert the kernel spec to a dict.
docstr_tok: ["Convert","the","kernel","spec","to","a","dict","."]
code: def to_dict(self) -> dict[str, t.Any]:
      """Convert the kernel spec to a dict."""
      d = {
          "argv": self.argv,
          "env": self.env,
          "display_name": self.display_name,
          "language": self.language,
          "interrupt_mode": self.interrupt_mode,
          "metadata": self.metadata,
      }
  
      return d
  
imports: from __future__ import annotations
  import json
  import os
  import re
  import shutil
  import typing
  import warnings
  from jupyter_core.paths import SYSTEM_JUPYTER_PATH, jupyter_data_dir, jupyter_path
  from traitlets import Bool, CaselessStrEnum, Dict, HasTraits, List, Set, Type, Unicode, observe
  from traitlets.config import LoggingConfigurable
  from .provisioning import KernelProvisionerFactory
label_desc: Use image node_id 2 for calling the KernelSpec obj's underlying member method code with example usage: obj.to_dict() and returns: d