code: def test_extract_submodel_error_handling(self):
      prog = get_simple_program()
      mlmodel = ct.convert(prog, convert_to="neuralnetwork")
  
      invalid_outputs = set()
      with pytest.raises(
          ValueError,
          match="outputs must be of type list/tuple. Got <class 'set'>",
      ):
          extract_submodel(mlmodel, outputs=invalid_outputs)
  
      invalid_outputs = ["output_1", 1]
      with pytest.raises(
          ValueError,
          match="outputs must be a list of str. Got element 1 with type <class 'int'>.",
      ):
          extract_submodel(mlmodel, outputs=invalid_outputs)
  
      invalid_outputs = ["output_1", "output_1"]
      with pytest.raises(
          ValueError,
          match="outputs must be a list of unique elements. 'output_1' occurs 2 times",
      ):
          extract_submodel(mlmodel, outputs=invalid_outputs)
  
      invalid_outputs = ["error"]
      with pytest.raises(
          ValueError,
          match="outputs \['error'\] not found in the function.",
      ):
          extract_submodel(mlmodel, outputs=invalid_outputs)
  
      model_dir = tempfile.TemporaryDirectory()
      mlmodel_path = os.path.join(model_dir.name, "model.mlmodel")
      mlmodel.save(mlmodel_path)
      mlmodel = ct.models.MLModel(mlmodel_path)
      with pytest.raises(
          ValueError,
          match="NeuralNetwork model loaded from the disk is not supported by the extract_submodel util",
      ):
          extract_submodel(mlmodel, outputs=["output_0", "output_1"])
  
file_path: coremltools/coremltools/converters/mil/mil/tests/test_debug.py
imports: import itertools
  import os
  import tempfile
  import pytest
  import numpy
  import coremltools
  from coremltools.converters.mil import Builder
  from coremltools.converters.mil.debugging_utils import extract_submodel
  from coremltools.converters.mil.mil import get_new_symbol
  from coremltools.converters.mil.mil.types.symbolic import is_symbolic
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
label_desc: Use image node_id 1 for calling the TestExtractSubModel obj's underlying member method code with example usage: obj.test_extract_submodel_error_handling() without return types