code: def tests_from_manifest(testdir_from_ns):
      """Return a list of `testlib.Test` instances for each test found in
      the manifest.
  
      There will be a test for
      (a) each "test*" function of
      (b) each TestCase-subclass in
      (c) each "test_*" Python module in
      (d) each test dir in the manifest.
  
      If a "test_*" module has a top-level "test_suite_class", it will later
      be used to group all test cases from that module into an instance of that
      TestSuite subclass. This allows for overriding of test running behaviour.
      """
      for ns, testdir in testdir_from_ns.items():
          for testmod in testmods_from_testdir(testdir):
              if hasattr(testmod, "test_suite_class"):
                  testsuite_class = testmod.test_suite_class
                  if not issubclass(
                      testsuite_class, unittest.TestSuite
                  ):
                      testmod_path = testmod.__file__
                      if testmod_path.endswith(".pyc"):
                          testmod_path = testmod_path[:-1]
                      log.warning(
                          "'test_suite_class' of '%s' module is not a "
                          "subclass of 'unittest.TestSuite': ignoring",
                          testmod_path,
                      )
              else:
                  testsuite_class = None
              for testcase in testcases_from_testmod(testmod):
                  yield Test(
                      ns,
                      testmod,
                      testcase,
                      testcase._testMethodName,
                      testsuite_class,
                  )
  
imports: import os
  from os.path import join, basename, abspath, splitext, isfile, isdir, normpath, exists
  import sys
  import getopt
  import glob
  import time
  import unittest
  import importlib
  import logging
  import textwrap
  import traceback
label_desc: Use image node_id 6 for calling a global function with example usage: tests_from_manifest(testdir_from_ns) without return types