class_docstr: Adapt loaders to provide TraversableResources and other
  compatibility.
  
  Used primarily for Python 3.9 and earlier where the native
  loaders do not yet implement TraversableResources.
class_docstr_tok: ["Adapt","loaders","to","provide","TraversableResources","and","other","compatibility",".","Used","primarily","for","Python","3.9","and","earlier","where","the","native","loaders","do","not","yet","implement","TraversableResources","."]
code: def get_resource_reader(self, name):
      from . import readers, _adapters
  
      def _zip_reader(spec):
          with suppress(AttributeError):
              return readers.ZipReader(spec.loader, spec.name)
  
      def _namespace_reader(spec):
          with suppress(AttributeError, ValueError):
              return readers.NamespaceReader(
                  spec.submodule_search_locations
              )
  
      def _available_reader(spec):
          with suppress(AttributeError):
              return spec.loader.get_resource_reader(spec.name)
  
      def _native_reader(spec):
          reader = _available_reader(spec)
          return reader if hasattr(reader, "files") else None
  
      def _file_reader(spec):
          try:
              path = pathlib.Path(self.path)
          except TypeError:
              return None
          if path.exists():
              return readers.FileReader(self)
  
      return (
          # native reader if it supplies 'files'
          _native_reader(self.spec)
          or
          # local ZipReader if a zip module
          _zip_reader(self.spec)
          or
          # local NamespaceReader if a namespace module
          _namespace_reader(self.spec)
          or
          # local FileReader
          _file_reader(self.spec)
          # fallback - adapt the spec ResourceReader to TraversableReader
          or _adapters.CompatibilityFiles(self.spec)
      )
  
file_path: catboost/contrib/python/setuptools/py3/pkg_resources/_vendor/importlib_resources/_compat.py
imports: import abc
  import os
  import sys
  import pathlib
  from contextlib import suppress
  from typing import Union
label_desc: Use image node_id 3 for calling the TraversableResourcesLoader obj's underlying member method code with example usage: obj.get_resource_reader(name) and returns: unknown, unknown, readers, readers, spec, readers, None