code: def test_documented():
      """Test that public functions and classes are documented."""
      doc_dir = (Path(__file__).parents[2] / "doc" / "api").absolute()
      doc_file = doc_dir / "python_reference.rst"
      if not doc_file.is_file():
          pytest.skip("Documentation file not found: %s" % doc_file)
      api_files = (
          "covariance",
          "creating_from_arrays",
          "datasets",
          "decoding",
          "events",
          "file_io",
          "forward",
          "inverse",
          "logging",
          "most_used_classes",
          "mri",
          "preprocessing",
          "reading_raw_data",
          "realtime",
          "report",
          "sensor_space",
          "simulation",
          "source_space",
          "statistics",
          "time_frequency",
          "visualization",
          "export",
      )
      known_names = list()
      for api_file in api_files:
          with open(doc_dir / f"{api_file}.rst", "rb") as fid:
              for line in fid:
                  line = line.decode("utf-8")
                  if not line.startswith("  "):  # at least two spaces
                      continue
                  line = line.split()
                  if len(line) == 1 and line[0] != ":":
                      known_names.append(line[0].split(".")[-1])
      known_names = set(known_names)
  
      missing = []
      for name in public_modules:
          with _record_warnings():  # traits warnings
              module = __import__(name, globals())
          for submod in name.split(".")[1:]:
              module = getattr(module, submod)
          classes = inspect.getmembers(module, inspect.isclass)
          functions = inspect.getmembers(module, inspect.isfunction)
          checks = list(classes) + list(functions)
          for this_name, cf in checks:
              if (
                  not this_name.startswith("_")
                  and this_name not in known_names
              ):
                  from_mod = inspect.getmodule(cf).__name__
                  if (
                      from_mod.startswith("mne")
                      and not any(
                          from_mod.startswith(x)
                          for x in documented_ignored_mods
                      )
                      and this_name not in documented_ignored_names
                      and not hasattr(cf, "_deprecated_original")
                  ):
                      missing.append(f"{name} : {from_mod}.{this_name}")
      missing = sorted(set(missing))
      if len(missing) > 0:
          raise AssertionError(
              f"{len(missing)} new public member{_pl(missing)} missing from "
              "doc/python_reference.rst:\n" + "\n".join(missing)
          )
  
file_path: mne-python/mne/tests/test_docstring_parameters.py
imports: import importlib
  import inspect
  import re
  from pathlib import Path
  from pkgutil import walk_packages
  import pytest
  import mne
  from mne.utils import _pl, _record_warnings
label_desc: Use image node_id 5 for calling a global function with example usage: test_documented() without return types