code: def replace_ir_builder(deep_copy=False, realize=False):
      new_func = tvm.script.from_source(elementwise.script())
      s = tir.ScheduleState(new_func, debug_mask="all")
      target = tvm.tir.Block(
          iter_vars=[],
          reads=[],
          writes=[],
          name_hint="target",
          body=s.mod["main"].body.block.body[1],
          init=None,
          alloc_buffers=None,
          match_buffers=None,
          annotations=None,
      )
      if realize:
          target = tvm.tir.BlockRealize(
              iter_values=[],
              predicate=True,
              block=target,
          )
      if deep_copy:
          target.__setstate__(target.__getstate__())
      gc.collect()
      return s, target
  
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 4 for calling a global function with example usage: replace_ir_builder(deep_copy, realize) and returns: s,  target