code: def _find_match_sketch_id(
      mod: IRModule,
      sketches: List[Schedule],
      expected_mod: IRModule,
      expected_decision: List[Tuple[str, List[int]]],
      *,
      debug_mask="all",
  ) -> Optional[int]:
      for sketch_id, sketch in enumerate(sketches):
          i = 0
          new_decisions = {}
          for inst in sketch.trace.insts:
              if not inst.kind.name.startswith("Sample"):
                  continue
              assert i < len(expected_decision)
              if inst.kind.name == expected_decision[i][0]:
                  new_decisions[inst] = expected_decision[i][1]
                  i += 1
          if len(new_decisions) != len(expected_decision):
              continue
          sch = Schedule(mod, debug_mask=debug_mask)
          Trace(
              insts=sketch.trace.insts,
              decisions=new_decisions,
          ).apply_to_schedule(sch, remove_postproc=True)
          if structural_equal_no_gs(sch.mod, expected_mod):
              verify_trace_roundtrip(
                  sch=sch,
                  mod=mod,
                  debug_mask=debug_mask,
                  text_format="json",
              )
              return sketch_id
      return None
  
file_path: tvm/python/tvm/meta_schedule/testing/space_generation.py
imports: from typing import List, Optional, Tuple, Union
  from typing_extensions import Literal
  from tvm import meta_schedule
  from tvm.ir import IRModule, structural_equal
  from tvm.target import Target
  from tvm.tir import Schedule
  from tvm.tir.schedule import Trace
  from tvm.tir.schedule.testing import verify_trace_roundtrip
label_desc: Use image node_id 4 for calling a global function with example usage: _find_match_sketch_id(mod, sketches, expected_mod, expected_decision) and returns: None, sketch_id