code: def test_error_for_out_of_scope_usage():
      """A variable may not be used after its scope ends"""
  
      @T.prim_func
      def func():
          i = T.int32()
          with T.LetStmt(42, var=i):
              T.evaluate(i)
          T.evaluate(i)
  
      with pytest.raises(
          ValueError,
          match="Invalid use of undefined variable i at .* no longer in-scope.",
      ):
          tvm.tir.analysis.verify_well_formed(func)
  
file_path: tvm/tests/python/tir-analysis/test_tir_analysis_verify_well_formed.py
imports: import pytest
  import tvm
  import tvm.testing
  from tvm.script import ir, tir
label_desc: Use image node_id 3 for calling a global function with example usage: test_error_for_out_of_scope_usage() without return types