code: def test_doctest(self, module):
      # `snt` et al import all dependencies from `src`, however doctest does not
      # test imported deps so we must manually set `__test__` such that imported
      # symbols are tested.
      # See: docs.python.org/3/library/doctest.html#which-docstrings-are-examined
      if not hasattr(module, "__test__") or not module.__test__:
          module.__test__ = {}
      for name in module.__all__:
          value = getattr(module, name)
          if not inspect.ismodule(value):
              if (
                  inspect.isclass(value)
                  or isinstance(value, str)
                  or inspect.isfunction(value)
                  or inspect.ismethod(value)
              ):
                  module.__test__[name] = value
              elif hasattr(value, "__doc__"):
                  module.__test__[name] = value.__doc__
  
      num_failed, num_attempted = doctest.testmod(
          module,
          optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE,
          extraglobs={
              "snt": snt,
              "tf": tf,
              "tree": tree,
          },
      )
      if num_attempted == 0:
          self.skipTest("No doctests in %s" % module.__name__)
      self.assertEqual(
          num_failed, 0, "{} doctests failed".format(num_failed)
      )
  
file_path: sonnet/sonnet/src/conformance/doctest_test.py
imports: import doctest
  import inspect
  from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  import tensorflow
  import tree
label_desc: Use image node_id 2 for calling the DoctestTest obj's underlying member method code with example usage: obj.test_doctest(module) without return types