code: def read_page_data(page_data, type):
      assert type in ["classes", "functions", "methods"]
      data = page_data.get(type, [])
      for module in page_data.get(f"all_module_{type}", []):
          module_data = []
          for name in dir(module):
              if name[0] == "_" or name in EXCLUDE:
                  continue
              module_member = getattr(module, name)
              if (
                  inspect.isclass(module_member)
                  and type == "classes"
                  or inspect.isfunction(module_member)
                  and type == "functions"
              ):
                  instance = module_member
                  if module.__name__ in instance.__module__:
                      if instance not in module_data:
                          module_data.append(instance)
          module_data.sort(key=lambda x: id(x))
          data += module_data
      return data
  
file_path: hyperopt/docs/autogen.py
imports: import re
  import inspect
  import os
  import shutil
label_desc: Use image node_id 13 for calling a global function with example usage: read_page_data(page_data, type) and returns: data