code: def test_replace_block_in_opaque_block():
      s = replace_ir_builder_with_opaque()
      root_hash = s.mod["main"].__hash__()
      for_loop = (
          s.mod["main"]
          .body.block.body.body.block.body[1]
          .then_case.block.body
      )
      sref = s.get_sref(for_loop)
      new_for_loop = tir.For(
          loop_var=for_loop.loop_var,
          min=0,
          extent=128,
          kind=tir.ForKind.SERIAL,
          body=tir.Evaluate(0),
          thread_binding=None,
          annotations=None,
      )
      s.replace(sref, new_for_loop)
      assert root_hash == s.mod["main"].__hash__()
      tvm.ir.assert_structural_equal(sref.stmt, new_for_loop)
  
imports: import gc
  import sys
  import pytest
  import tvm
  import tvm.testing
  from tvm import tir
  from tvm.ir import IRModule
  from tvm.script import tir
label_desc: Use image node_id 18 for calling a global function with example usage: test_replace_block_in_opaque_block() without return types