code: def check_rest(module, names, dots=True):
      """
      Check reStructuredText formatting of docstrings
  
      Parameters
      ----------
      module : ModuleType
  
      names : set
  
      Returns
      -------
      result : list
          List of [(module_name, success_flag, output),...]
      """
  
      try:
          skip_types = (dict, str, unicode, float, int)
      except NameError:
          # python 3
          skip_types = (dict, str, float, int)
  
      results = []
  
      if module.__name__[6:] not in OTHER_MODULE_DOCS:
          results += [
              (module.__name__,)
              + validate_rst_syntax(
                  inspect.getdoc(module), module.__name__, dots=dots
              )
          ]
  
      for name in names:
          full_name = module.__name__ + "." + name
          obj = getattr(module, name, None)
  
          if obj is None:
              results.append(
                  (
                      full_name,
                      False,
                      "%s has no docstring" % (full_name,),
                  )
              )
              continue
          elif isinstance(obj, skip_types):
              continue
  
          if inspect.ismodule(obj):
              text = inspect.getdoc(obj)
          else:
              try:
                  text = str(get_doc_object(obj))
              except Exception:
                  import traceback
  
                  results.append(
                      (
                          full_name,
                          False,
                          "Error in docstring format!\n"
                          + traceback.format_exc(),
                      )
                  )
                  continue
  
          m = re.search("([\x00-\x09\x0b-\x1f])", text)
          if m:
              msg = (
                  "Docstring contains a non-printable character %r! "
                  'Maybe forgot r"""?' % (m.group(1),)
              )
              results.append((full_name, False, msg))
              continue
  
          try:
              src_file = short_path(inspect.getsourcefile(obj))
          except TypeError:
              src_file = None
  
          if src_file:
              file_full_name = src_file + ":" + full_name
          else:
              file_full_name = full_name
  
          results.append(
              (full_name,)
              + validate_rst_syntax(text, file_full_name, dots=dots)
          )
  
      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 9 for calling a global function with example usage: check_rest(module, names, dots) and returns: results