code: def test_right_size_invalid_hyperparameter_ranges(
      sagemaker_session, model_package
  ):
      with pytest.raises(
          ValueError,
          match="instance_type must be defined as a hyperparameter_range",
      ):
          model_package.right_size(
              sample_payload_url=IR_SAMPLE_PAYLOAD_URL,
              supported_content_types=IR_SUPPORTED_CONTENT_TYPES,
              framework="SAGEMAKER-SCIKIT-LEARN",
              job_duration_in_seconds=7200,
              hyperparameter_ranges=IR_SAMPLE_INVALID_HYPERPARAMETERS_RANGES,
              phases=IR_SAMPLE_PHASES,
              traffic_type="PHASES",
              max_invocations=100,
              model_latency_thresholds=IR_SAMPLE_MODEL_LATENCY_THRESHOLDS,
              max_tests=5,
              max_parallel_tests=5,
          )
  
imports: from __future__ import absolute_import
  from unittest.mock import patch, MagicMock, ANY
  from sagemaker.model import Model, ModelPackage
  from sagemaker.parameter import CategoricalParameter
  from sagemaker.inference_recommender.inference_recommender_mixin import Phase, ModelLatencyThreshold
  from sagemaker.async_inference import AsyncInferenceConfig
  from sagemaker.serverless import ServerlessInferenceConfig
  from sagemaker.explainer import ExplainerConfig
  import pytest
label_desc: Use image node_id 12 for calling a global function with example usage: test_right_size_invalid_hyperparameter_ranges(sagemaker_session, model_package) without return types