docstr: Load the modules, but include inherited methods in the classes.
docstr_tok: ["Load","the","modules",",","but","include","inherited","methods","in","the","classes","."]
code: def load(self) -> t.Iterable[docspec.Module]:
      """
      Load the modules, but include inherited methods in the classes.
      """
      # Load all haystack modules
      temp_loader = PythonLoader(search_path=["../../../haystack"])
      temp_loader.init(Context(directory="."))
      all_modules = list(temp_loader.load())
  
      # Collect all classes
      classes = {}
      for module in all_modules:
          for member in module.members:
              if isinstance(member, docspec.Class):
                  classes[member.name] = member
  
      # Load the modules specified in the search path
      modules = super().load()
  
      # Add inherited methods to the classes
      modules = self.include_inherited_methods(modules, classes)
  
      return modules
  
file_path: haystack/docs/pydoc/loaders.py
imports: import copy
  import typing
  import docspec
  from pydoc_markdown.interfaces import Context
  from pydoc_markdown.contrib.loaders.python import PythonLoader
label_desc: Use image node_id 1 for calling the CustomPythonLoader obj's underlying member method code with example usage: obj.load() and returns: modules