code: def test_duplicate_outputs_substituion():
      """Replaces var that appears more than once in outputs."""
  
      @mb.program(
          input_specs=[
              mb.TensorSpec(shape=(2, 4)),
              mb.TensorSpec(shape=(2, 4)),
          ]
      )
      def prog(x0, y0):
          x1 = mb.add(x=x0, y=y0)
          z = mb.log(x=x1)
          return x1, x1, z
  
      block = prog.functions["main"]
      add = block.find_ops(op_type="add")[0]
      x0 = add.inputs["x"]
      y0 = add.inputs["y"]
      x1 = add.outputs[0]
  
      with block:
          x2 = mb.mul(x=x0, y=y0, before_op=add, name="new_output")
  
      block.replace_uses_of_var_after_op(
          anchor_op=x2.op, old_var=x1, new_var=x2
      )
      block.remove_ops([add])
      assert block.outputs[0].op.name == "new_output"
      assert block.outputs[1].op.name == "new_output"
      assert len(block.outputs[0].consuming_blocks) == 1
  
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 15 for calling a global function with example usage: test_duplicate_outputs_substituion() and returns: x1,  x1,  z