code: def get_files(dir_to_check, kind="test"):
      files = dict()
      patterns = {
          "test": f"{dir_to_check}/**/test_*.py",
          "stub": f"{dir_to_check}/**/*.pyi",
      }
      for path in glob.glob(patterns[kind], recursive=True):
          relpath = os.path.relpath(path, dir_to_check)
          files[relpath] = path
  
      if sys.version_info >= (3, 12):
          files = {
              k: v
              for k, v in files.items()
              if not k.startswith("distutils")
          }
  
      return files
  
imports: import os
  import glob
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: get_files(dir_to_check, kind) and returns: files