code: def _assign_targets_to_primfuncs_irmodule(mod, target):
      """helper to assign target for PrimFunc in a IRModule"""
      ret = tvm.IRModule()
      for global_var, basefunc in mod.functions.items():
          if isinstance(basefunc, tvm.tir.PrimFunc):
              ret[global_var] = basefunc.with_attr("target", target)
      return ret
  
imports: import pytest
  import sys
  import tvm
  from tvm import tir, script
  from tvm.ir import Range
  from tvm.script import tir
  from tvm.tir import stmt_functor
  from tvm.tir import PrimFunc
  from tvm.tir.usmp import utils
  from tvm.target import Target
  from tvm import WorkspacePoolInfo, ConstantPoolInfo
label_desc: Use image node_id 6 for calling a global function with example usage: _assign_targets_to_primfuncs_irmodule(mod, target) and returns: ret