code: def get_resource_reader(package):
      # type: (types.ModuleType) -> Optional[ResourceReader]
      """
      Return the package's loader if it's a ResourceReader.
      """
      # We can't use
      # a issubclass() check here because apparently abc.'s __subclasscheck__()
      # hook wants to create a weak reference to the object, but
      # zipimport.zipimporter does not support weak references, resulting in a
      # TypeError.  That seems terrible.
      spec = package.__spec__
      reader = getattr(spec.loader, "get_resource_reader", None)  # type: ignore
      if reader is None:
          return None
      return reader(spec.name)
  
file_path: catboost/contrib/tools/python3/src/Lib/importlib/resources/_common.py
imports: import os
  import pathlib
  import tempfile
  import functools
  import contextlib
  import types
  import importlib
  from typing import Union, Optional
  from .abc import ResourceReader, Traversable
  from ._adapters import wrap_spec
label_desc: Use image node_id 2 for calling a global function with example usage: get_resource_reader(package) and returns: reader, None