code: def run(in_mod, expected_mod, max_outputs, allow_taps, compiler, map):
      expected_mod = tvm.relay.transform.InferType()(expected_mod)
  
      in_mod = tvm.relay.transform.InferType()(in_mod)
      in_mod = tvm.relay.transform.CapturePostDfsIndexInSpans()(in_mod)
  
      indexes = [i for l, iss in map.items() for i in iss]
      labels = [l for l, iss in map.items() for i in iss]
      actual_mod = partition_for_testing(
          max_outputs, allow_taps, compiler, indexes, labels
      )(in_mod)
  
      if not tvm.ir.structural_equal(actual_mod, expected_mod, True):
          # Print everything in full so we can see what's going on when things fail.
          print("Input module:")
          print(in_mod)
          print("Expected module:")
          print(expected_mod)
          print("Actual module:")
          print(actual_mod)
          # Assert again so as to see the actual disagreeing sub-expressions.
          tvm.ir.assert_structural_equal(
              actual_mod, expected_mod, map_free_vars=True
          )
  
file_path: tvm/tests/python/relay/collage/test_sub_graph.py
imports: import tvm
  import logging
  import tvm.testing
label_desc: Use image node_id 2 for calling a global function with example usage: run(in_mod, expected_mod, max_outputs, allow_taps, compiler, map) without return types