code: def check_doctests(
      module, verbose, ns=None, dots=True, doctest_warnings=False
  ):
      """
      Check code in docstrings of the module's public symbols.
  
      Parameters
      ----------
      module : ModuleType
          Name of module
      verbose : bool
          Should the result be verbose
      ns : dict
          Name space of module
      dots : bool
  
      doctest_warnings : bool
  
      Returns
      -------
      results : list
          List of [(item_name, success_flag, output), ...]
      """
      if ns is None:
          ns = dict(DEFAULT_NAMESPACE)
  
      # Loop over non-deprecated items
      results = []
  
      for name in get_all_dict(module)[0]:
          full_name = module.__name__ + "." + name
  
          if full_name in DOCTEST_SKIPDICT:
              skip_methods = DOCTEST_SKIPDICT[full_name]
              if skip_methods is None:
                  continue
          else:
              skip_methods = None
  
          try:
              obj = getattr(module, name)
          except AttributeError:
              import traceback
  
              results.append(
                  (
                      full_name,
                      False,
                      "Missing item!\n" + traceback.format_exc(),
                  )
              )
              continue
  
          finder = doctest.DocTestFinder()
          try:
              tests = finder.find(obj, name, globs=dict(ns))
          except Exception:
              import traceback
  
              results.append(
                  (
                      full_name,
                      False,
                      "Failed to get doctests!\n"
                      + traceback.format_exc(),
                  )
              )
              continue
  
          if skip_methods is not None:
              tests = [
                  i
                  for i in tests
                  if i.name.partition(".")[2] not in skip_methods
              ]
  
          success, output = _run_doctests(
              tests, full_name, verbose, doctest_warnings
          )
  
          if dots:
              output_dot("." if success else "F")
  
          results.append((full_name, success, output))
  
          if HAVE_MATPLOTLIB:
              import matplotlib.pyplot as plt
  
              plt.close("all")
  
      return results
  
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 11 for calling a global function with example usage: check_doctests(module, verbose, ns, dots, doctest_warnings) and returns: results