docstr: Returns a dict mapping kernel names to kernelspecs.
  
  Returns a dict of the form::
  
      {
        'kernel_name': {
          'resource_dir': '/path/to/kernel_name',
          'spec': {"the spec itself": ...}
        },
        ...
      }
docstr_tok: ["Returns","a","dict","mapping","kernel","names","to","kernelspecs",".","Returns","a","dict","of","the","form",":",":","{","'kernel_name","'",":","{","'resource_dir","'",":","'\/path\/to\/kernel_name","'",",","'spec","'",":","{","``","the","spec","itself","''",":","...","}","}",",","...","}"]
code: def get_all_specs(self):
      """Returns a dict mapping kernel names to kernelspecs.
  
      Returns a dict of the form::
  
          {
            'kernel_name': {
              'resource_dir': '/path/to/kernel_name',
              'spec': {"the spec itself": ...}
            },
            ...
          }
      """
      d = self.find_kernel_specs()
      res = {}
      for kname, resource_dir in d.items():
          try:
              if self.__class__ is KernelSpecManager:
                  spec = self._get_kernel_spec_by_name(
                      kname, resource_dir
                  )
              else:
                  # avoid calling private methods in subclasses,
                  # which may have overridden find_kernel_specs
                  # and get_kernel_spec, but not the newer get_all_specs
                  spec = self.get_kernel_spec(kname)
  
              res[kname] = {
                  "resource_dir": resource_dir,
                  "spec": spec.to_dict(),
              }
          except Exception:
              self.log.warning(
                  "Error loading kernelspec %r", kname, exc_info=True
              )
      return res
  
imports: import errno
  import io
  import json
  import os
  import re
  import shutil
  import warnings
  from ipython_genutils.py3compat import PY3
  from traitlets import HasTraits, List, Unicode, Dict, Set, Bool, Type, CaselessStrEnum
  from traitlets.config import LoggingConfigurable
  from jupyter_core.paths import jupyter_data_dir, jupyter_path, SYSTEM_JUPYTER_PATH
label_desc: Use image node_id 8 for calling the KernelSpecManager obj's underlying member method code with example usage: obj.get_all_specs() and returns: res