code: def test_remove_ops_fail_for_block_output():
      """Block's output cannot be 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"]
      ops = block.find_ops(op_type="add")
      expected_err_str = "cannot delete op add_.* with output 0: add_.* that's block block.*'s output"
      with pytest.raises(ValueError, match=expected_err_str):
          block.remove_ops(ops)
      assert len(block.operations) == 2
      assert len(block.inputs) == 1
      assert len(block.outputs) == 2
  
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 7 for calling a global function with example usage: test_remove_ops_fail_for_block_output() and returns: x1,  x2