code: def testmod_paths_from_testdir(testdir):
      """Generate test module paths in the given dir."""
      for path in glob.glob(join(testdir, "test_*.py")):
          yield path
  
      for path in glob.glob(join(testdir, "test_*")):
          if not isdir(path):
              continue
          if not isfile(join(path, "__init__.py")):
              continue
          yield path
  
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 3 for calling a global function with example usage: testmod_paths_from_testdir(testdir) without return types