code: def check_items(
      all_dict, names, deprecated, others, module_name, dots=True
  ):
      """
      Check that `all_dict` is consistent with the `names` in `module_name`
      For instance, that there are no deprecated or extra objects.
  
      Parameters
      ----------
      all_dict : list
  
      names : set
  
      deprecated : list
  
      others : list
  
      module_name : ModuleType
  
      dots : bool
          Whether to print a dot for each check
  
      Returns
      -------
      list
          List of [(name, success_flag, output)...]
      """
      num_all = len(all_dict)
      num_ref = len(names)
  
      output = ""
  
      output += "Non-deprecated objects in __all__: %i\n" % num_all
      output += "Objects in refguide: %i\n\n" % num_ref
  
      only_all, only_ref, missing = compare(
          all_dict, others, names, module_name
      )
      dep_in_ref = only_ref.intersection(deprecated)
      only_ref = only_ref.difference(deprecated)
  
      if len(dep_in_ref) > 0:
          output += "Deprecated objects in refguide::\n\n"
          for name in sorted(deprecated):
              output += "    " + name + "\n"
  
      if len(only_all) == len(only_ref) == len(missing) == 0:
          if dots:
              output_dot(".")
          return [(None, True, output)]
      else:
          if len(only_all) > 0:
              output += (
                  "ERROR: objects in %s.__all__ but not in refguide::\n\n"
                  % module_name
              )
              for name in sorted(only_all):
                  output += "    " + name + "\n"
  
              output += "\nThis issue can be fixed by adding these objects to\n"
              output += "the function listing in __init__.py for this module\n"
  
          if len(only_ref) > 0:
              output += (
                  "ERROR: objects in refguide but not in %s.__all__::\n\n"
                  % module_name
              )
              for name in sorted(only_ref):
                  output += "    " + name + "\n"
  
              output += "\nThis issue should likely be fixed by removing these objects\n"
              output += "from the function listing in __init__.py for this module\n"
              output += "or adding them to __all__.\n"
  
          if len(missing) > 0:
              output += "ERROR: missing objects::\n\n"
              for name in sorted(missing):
                  output += "    " + name + "\n"
  
          if dots:
              output_dot("F")
          return [(None, False, output)]
  
imports: import copy
  import doctest
  import inspect
  import io
  import os
  import re
  import shutil
  import sys
  import tempfile
  import warnings
  import docutils.core
  from argparse import ArgumentParser
  from contextlib import contextmanager, redirect_stderr
  from doctest import NORMALIZE_WHITESPACE, ELLIPSIS, IGNORE_EXCEPTION_DETAIL
  from docutils.parsers.rst import directives
  import sphinx
  import numpy
  from numpydoc.docscrape_sphinx import get_doc_object
  from sphinx.directives.other import SeeAlso, Only
label_desc: Use image node_id 6 for calling a global function with example usage: check_items(all_dict, names, deprecated, others, module_name, dots) and returns: list, list