code: def apply_prim_func_arg_and_result_memory_constraints(
      func: PrimFunc,
      relay_func_type: Object,
      arg_and_result_memory_scopes: List[str],
  ) -> PrimFunc:
      """Returns func written to capture the memory (aka storage) scope constraints
      for each of the func's parameters given by arg_and_result_memory_scopes. However,
      arg_and_result_memory_scopes should be w.r.t. the func's representation as a Relay
      Function of relay_func_type before lowering and conversion to DPS.
  
      Visible for testing.
  
      CAUTION: This is experimental. The resulting PrimFunc may not have fully accounted
      for all new memory scopes.
  
      Parameters
      ----------
      func: tvm.tir.PrimFunc
          The function to retrieve constraints from.
  
      relay_func_type: tvm.relay.FuncType
          The type of the Relay Function from which the func was derived.
  
      arg_and_result_memory_scopes: Array[AnyStr]
          Memory constraints for funcs args and result in Relay form. The empty string denotes
          'no constraint'.
  
      Returns
      -------
      result: tvm.tir.PrimFunc
          The rewritten func.
      """
      return _ffi_api.ApplyPrimFuncArgAndResultMemoryConstraints(  # type: ignore # pylint: disable=no-member
          func, relay_func_type, arg_and_result_memory_scopes
      )
  
imports: from typing import Dict, List, Optional, Union
  import tvm
  from tvm import Object
  from tvm.ir import IRModule
  from tvm.tir.expr import Var
  from tvm.tir.stmt import Block, BufferRegion, PrimExpr
  from ..None import Buffer, Stmt
  from ..function import PrimFunc
  from .None import _ffi_api
label_desc: Use image node_id 14 for calling a global function with example usage: apply_prim_func_arg_and_result_memory_constraints(func, relay_func_type, arg_and_result_memory_scopes) and returns: _ffi_api