code: def get_api_items(api_doc_fd):
      """
      Yield information about all public API items.
  
      Parse api.rst file from the documentation, and extract all the functions,
      methods, classes, attributes... This should include all pandas public API.
  
      Parameters
      ----------
      api_doc_fd : file descriptor
          A file descriptor of the API documentation page, containing the table
          of contents with all the public API.
  
      Yields
      ------
      name : str
          The name of the object (e.g. 'pandas.Series.str.upper).
      func : function
          The object itself. In most cases this will be a function or method,
          but it can also be classes, properties, cython objects...
      section : str
          The name of the section in the API page where the object item is
          located.
      subsection : str
          The name of the subsection in the API page where the object item is
          located.
      """
      current_module = "pandas"
      previous_line = current_section = current_subsection = ""
      position = None
      for line in api_doc_fd:
          line_stripped = line.strip()
          if len(line_stripped) == len(previous_line):
              if set(line_stripped) == set("-"):
                  current_section = previous_line
                  continue
              if set(line_stripped) == set("~"):
                  current_subsection = previous_line
                  continue
  
          if line_stripped.startswith(".. currentmodule::"):
              current_module = line_stripped.replace(
                  ".. currentmodule::", ""
              ).strip()
              continue
  
          if line_stripped == ".. autosummary::":
              position = "autosummary"
              continue
  
          if position == "autosummary":
              if line_stripped == "":
                  position = "items"
                  continue
  
          if position == "items":
              if line_stripped == "":
                  position = None
                  continue
              if line_stripped in IGNORE_VALIDATION:
                  continue
              func = importlib.import_module(current_module)
              for part in line_stripped.split("."):
                  func = getattr(func, part)
  
              yield (
                  f"{current_module}.{line_stripped}",
                  func,
                  current_section,
                  current_subsection,
              )
  
          previous_line = line_stripped
  
imports: from __future__ import annotations
  import argparse
  import doctest
  import importlib
  import json
  import os
  import pathlib
  import subprocess
  import sys
  import tempfile
  import matplotlib
  import matplotlib.pyplot
  from numpydoc.docscrape import get_doc_object
  from numpydoc.validate import Validator, validate
label_desc: Use image node_id 2 for calling a global function with example usage: get_api_items(api_doc_fd) without return types