docstr: Find the resource directory of a named kernel spec
docstr_tok: ["Find","the","resource","directory","of","a","named","kernel","spec"]
code: def _find_spec_directory(self, kernel_name):
      """Find the resource directory of a named kernel spec"""
      for kernel_dir in self.kernel_dirs:
          try:
              files = os.listdir(kernel_dir)
          except OSError as e:
              if e.errno in (errno.ENOTDIR, errno.ENOENT):
                  continue
              raise
          for f in files:
              path = pjoin(kernel_dir, f)
              if f.lower() == kernel_name and _is_kernel_dir(path):
                  return path
  
      if kernel_name == NATIVE_KERNEL_NAME:
          try:
              from ipykernel.kernelspec import RESOURCES
          except ImportError:
              pass
          else:
              return RESOURCES
  
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 6 for calling the KernelSpecManager obj's underlying member method code with example usage: obj._find_spec_directory(kernel_name) and returns: RESOURCES, path