code: def test_mil_enumerated_image_with_default(self):
      enumerated_shapes = tuple(
          [(1, 3, 10, 10), (1, 3, 10, 20), (1, 3, 10, 30)]
      )
      input_shape = [
          ct.ImageType(
              name="x",
              shape=ct.EnumeratedShapes(
                  shapes=enumerated_shapes, default=(1, 3, 10, 30)
              ),
          )
      ]
      mlmodel = ct.convert(
          self.basic_network,
          source="milinternal",
          convert_to="mlprogram",
          inputs=input_shape,
      )
      input_spec = mlmodel.get_spec().description.input
      assert (
          len(input_spec) == 1
      ), "1 input expected, got {} instead".format(len(input_spec))
      assert (
          input_spec[0].name == "x"
      ), "input name in MLModel is {}, 'x' is expected".format(
          input_spec[0].name
      )
      assert (
          input_spec[0].type.WhichOneof("Type") == "imageType"
      ), "Expected imageType, got {}".format(
          input_spec[0].type.WhichOneof("Type")
      )
      assert (
          input_spec[0].type.imageType.WhichOneof("SizeFlexibility")
          == "enumeratedSizes"
      ), "Expected enumeratedShapes in ShapeFlexibility"
  
      spec_H = input_spec[0].type.imageType.height
      spec_W = input_spec[0].type.imageType.width
      assert (
          spec_H == 10 and spec_W == 30
      ), "expected [H, W] == [10, 30], got [{}, {}] instead".format(
          spec_H, spec_W
      )
  
      spec_enumerated_shapes = set()
      for enumerated in input_spec[
          0
      ].type.imageType.enumeratedSizes.sizes:
          spec_enumerated_shapes.add(
              tuple([1, 3, enumerated.height, enumerated.width])
          )
      assert spec_enumerated_shapes == set(
          enumerated_shapes
      ), "Enumerated shape mismatch"
  
file_path: coremltools/coremltools/converters/mil/backend/mil/test_model_input_params.py
imports: import numpy
  import coremltools
  from coremltools.converters.mil.mil.builder import Builder
  from coremltools.converters.mil.mil.program import Symbol
  from coremltools.models.utils import _macos_version
label_desc: Use image node_id 5 for calling the TestMILFlexibleShapes obj's underlying member method code with example usage: obj.test_mil_enumerated_image_with_default() without return types