code: def test_replace_nonreplaceable_vars_force():
      """
      The conversion should not error out if the replace_uses_of_vars_after_op is executed with
      force_replace=True Also we test that, the new nonreplaceable_vars_upstream is propagated
      after the code exist `with block`.
      """
      constexpr_op = "constexpr_sparse_to_dense"
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(4, 2))])
      def prog(x):
          constexpr = CONSTEXPR_FUNCS[constexpr_op]((4, 2))
          return mb.add(x=x, y=constexpr)
  
      block = prog.functions["main"]
      constexpr_op = block.find_ops(op_type=constexpr_op)[0]
      add_op = block.find_ops(op_type="add")[0]
  
      assert len(add_op.outputs[0].nonreplaceable_vars_upstream) == 1
  
      with block:
          const = mb.const(
              val=np.random.rand(4, 2), before_op=constexpr_op
          )
          block.replace_uses_of_var_after_op(
              anchor_op=constexpr_op,
              old_var=constexpr_op.outputs[0],
              new_var=const,
              force_replace=True,
          )
          block.remove_ops([constexpr_op])
  
      assert len(add_op.outputs[0].nonreplaceable_vars_upstream) == 0
  
imports: import copy
  import numpy
  import pytest
  from coremltools.converters.mil.mil import Builder
  from coremltools.converters.mil.mil.passes.tests.test_passes import CONSTEXPR_FUNCS
  from coremltools.converters.mil.testing_utils import assert_same_output_names, assert_same_output_shapes, get_op_types_in_program
label_desc: Use image node_id 10 for calling a global function with example usage: test_replace_nonreplaceable_vars_force() and returns: mb