code: def test_match_effect_exactly_once():
      mod = tvm.IRModule()
      p = Prelude(mod)
      _, cons, nil = p.mod.get_type("List")
  
      # the list should be of length 1!
      # Unless we mistakenly execute the data clause more than once
      r = relay.Var("r")
      data = seq(
          relay.RefWrite(r, cons(relay.Tuple([]), relay.RefRead(r))),
          relay.RefRead(r),
      )
      match = relay.Let(
          r,
          relay.RefCreate(nil()),
          relay.Match(
              data,
              [
                  relay.Clause(
                      relay.PatternConstructor(nil, []), relay.const(0)
                  ),
                  relay.Clause(
                      relay.PatternConstructor(
                          cons,
                          [
                              relay.PatternWildcard(),
                              relay.PatternConstructor(nil, []),
                          ],
                      ),
                      relay.const(1),
                  ),
                  relay.Clause(relay.PatternWildcard(), relay.const(2)),
              ],
          ),
      )
  
      match_val = run_as_python(match, mod)
      assert_tensor_value(match_val, 1)
  
imports: import numpy
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay.testing import run_as_python
  from tvm.relay.prelude import Prelude
  from tvm.runtime.container import ADT
  from tvm.relay.backend.interpreter import RefValue, ConstructorValue
label_desc: Use image node_id 27 for calling a global function with example usage: test_match_effect_exactly_once() without return types