code: def check_doctests(
      module, verbose, ns=None, dots=True, doctest_warnings=False
  ):
      """Check code in docstrings of the module's public symbols.
  
      Returns: 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_SKIPLIST:
              continue
  
          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
  
          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 glob
  import inspect
  import io
  import os
  import re
  import shutil
  import sys
  import tempfile
  import warnings
  from argparse import ArgumentParser
  from contextlib import contextmanager, redirect_stderr
  from doctest import NORMALIZE_WHITESPACE, ELLIPSIS, IGNORE_EXCEPTION_DETAIL
  import docutils.core
  import numpy
  from docutils.parsers.rst import directives
  from numpydoc.docscrape_sphinx import get_doc_object
  from numpydoc.docscrape import NumpyDocString
  from scipy.stats._distr_params import distcont, distdiscrete
  from scipy import stats
  from sphinx.directives.other import SeeAlso, Only
label_desc: Use image node_id 12 for calling a global function with example usage: check_doctests(module, verbose, ns, dots, doctest_warnings) and returns: results