code: def test_replace_partial_copy1():
      s, target = replace_ir_builder(deep_copy=True)
      func_old_hash = s.mod["main"].__hash__()
      hold_ref = s.mod["main"].body.block.body[0].body
      stmt_old_hash = s.mod["main"].body.block.body[0].__hash__()
      sref = s.get_sref(
          s.mod["main"].body.block.body[0].body.body.block
      )
      other_part_hash = s.mod["main"].body.block.body[1].__hash__()
      s.replace(sref, target)
      # The parent stmt will change since there is only one reference
      assert (
          stmt_old_hash == s.mod["main"].body.block.body[0].__hash__()
      )
      assert not tvm.ir.structural_equal(hold_ref.body, target)
      # The function and the other part stmt can be directly written
      assert func_old_hash == s.mod["main"].__hash__()
      assert (
          other_part_hash == s.mod["main"].body.block.body[1].__hash__()
      )
      # Check the replaced part is equal to the target
      tvm.ir.assert_structural_equal(
          s.mod["main"].body.block.body[0].body.body.block, target
      )
      # The replaced AST node will be deleted, so the ref will be None
      assert sref.stmt is None
  
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 11 for calling a global function with example usage: test_replace_partial_copy1() without return types