code: def test_remove_duplicate_ops_not_affect_others():
      """
      Test remove duplicated ops doesn't affect other ops. We add another `add` op here, but keep
      the input to remove_ops only restricted to the first `add` op. This test is for checking that
      the second add op doesn't get removed.
      """
  
      @mb.program(input_specs=[mb.TensorSpec(shape=(2, 4))])
      def prog(x0):
          x1 = mb.add(x=x0, y=x0)
          x2 = mb.add(x=x0, y=x0)
          return x1, x2
  
      block = prog.functions["main"]
      x0 = block.inputs["x0"]
      ops = [block.find_ops(op_type="add")[0]]
      block.set_outputs([x0])
      block.remove_ops(ops)
      # Deleting one add operation should not affect the other one.
      assert len(block.operations) == 1
      assert len(block.inputs) == 1
      assert len(block.outputs) == 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 6 for calling a global function with example usage: test_remove_duplicate_ops_not_affect_others() and returns: x1,  x2