code: def check_all(self, modname):
      names = {}
      with warnings_helper.check_warnings(
          (f".*{modname}", DeprecationWarning),
          (".* (module|package)", DeprecationWarning),
          (".* (module|package)", PendingDeprecationWarning),
          ("", ResourceWarning),
          quiet=True,
      ):
          try:
              exec("import %s" % modname, names)
          except:
              # Silent fail here seems the best route since some modules
              # may not be available or not initialize properly in all
              # environments.
              raise FailedImport(modname)
      if not hasattr(sys.modules[modname], "__all__"):
          raise NoAll(modname)
      names = {}
      with self.subTest(module=modname):
          with warnings_helper.check_warnings(
              ("", DeprecationWarning),
              ("", ResourceWarning),
              quiet=True,
          ):
              try:
                  exec("from %s import *" % modname, names)
              except Exception as e:
                  # Include the module name in the exception string
                  self.fail(
                      "__all__ failure in {}: {}: {}".format(
                          modname, e.__class__.__name__, e
                      )
                  )
              if "__builtins__" in names:
                  del names["__builtins__"]
              if "__annotations__" in names:
                  del names["__annotations__"]
              if "__warningregistry__" in names:
                  del names["__warningregistry__"]
              keys = set(names)
              all_list = sys.modules[modname].__all__
              all_set = set(all_list)
              self.assertCountEqual(
                  all_set, all_list, "in module {}".format(modname)
              )
              self.assertEqual(
                  keys, all_set, "in module {}".format(modname)
              )
  
file_path: cpython/Lib/test/test___all__.py
imports: import unittest
  from test import support
  from test.support import warnings_helper
  import os
  import sys
  import types
label_desc: Use image node_id 3 for calling the AllTest obj's underlying member method code with example usage: obj.check_all(modname) without return types