<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_image_size_range(spec, feature_name, size_range):
 """ Annotate an input or output Image feature in a Neural Network spec to to accommodate a range of image sizes :param spec: MLModel The MLModel spec containing the feature :param feature_name: str The name of the Image feature for which to add shape information. If the feature is not found in the input or output descriptions then an exception is thrown :param size_range: NeuralNetworkImageSizeRange A NeuralNetworkImageSizeRange object with the populated image size range information. Examples -------- .. sourcecode:: python :return: None. The spec object is updated """

    if not isinstance(size_range, NeuralNetworkImageSizeRange):
        raise Exception(
            'Shape ranges should be of type NeuralNetworkImageSizeRange')

    feature = _get_feature(spec, feature_name)
    if feature.type.WhichOneof('Type') != 'imageType':
        raise Exception('Trying to add size ranges for '
                        'a non-image feature type')

    feature.type.imageType.ClearField('SizeFlexibility')
    feature.type.imageType.imageSizeRange.heightRange.lowerBound = size_range.get_height_range().lowerBound
    feature.type.imageType.imageSizeRange.heightRange.upperBound = size_range.get_height_range().upperBound

    feature.type.imageType.imageSizeRange.widthRange.lowerBound = size_range.get_width_range().lowerBound
    feature.type.imageType.imageSizeRange.widthRange.upperBound = size_range.get_width_range().upperBound

    # Bump up specification version
    spec.specificationVersion = max(_MINIMUM_FLEXIBLE_SHAPES_SPEC_VERSION,
                                    spec.specificationVersion)