code: def test_str_metadata():
      # This test is to check we reuse the existing metadata element for the same tir.StringImm
      # So metadata["tir.StringImm"][0] will occur in the printed script for three times
      str_imm = T.StringImm("aaa\nbbb\n")
  
      @I.ir_module
      class Module:
          @T.prim_func
          def foo() -> None:
              A = str_imm
              B = str_imm
  
          @T.prim_func
          def foo1() -> None:
              A = str_imm
  
      printed_str = Module.script(verbose_expr=True)
      assert (
          printed_str.count('metadata["tir.StringImm"][0]') == 3
          and printed_str.count('metadata["tir.StringImm"][1]') == 0
      )
  
imports: import tvm.testing
  from tvm.script.parser import ir
  from tvm.script.parser import tir
label_desc: Use image node_id 1 for calling a global function with example usage: test_str_metadata() without return types