code: def prepare_rerun(self) -> tuple[TestTuple, FilterDict]:
      tests: TestList = []
      match_tests_dict = {}
      for result in self.rerun_results:
          tests.append(result.test_name)
  
          match_tests = result.get_rerun_match_tests()
          # ignore empty match list
          if match_tests:
              match_tests_dict[result.test_name] = match_tests
  
      # Clear previously failed tests
      self.rerun_bad.extend(self.bad)
      self.bad.clear()
      self.env_changed.clear()
      self.rerun_results.clear()
  
      return (tuple(tests), match_tests_dict)
  
file_path: cpython/Lib/test/libregrtest/results.py
imports: import sys
  import trace
  from .runtests import RunTests
  from .result import State, TestResult, TestStats, Location
  from .utils import StrPath, TestName, TestTuple, TestList, FilterDict, printlist, count, format_duration
label_desc: Use image node_id 10 for calling the TestResults obj's underlying member method code with example usage: obj.prepare_rerun() and returns: tuple,  match_tests_dict