code: def test_jumpstart_inference_instance_type_variants(
      patched_get_model_specs,
  ):
      patched_get_model_specs.side_effect = get_special_model_spec
  
      mock_client = boto3.client("s3")
      mock_session = Mock(s3_client=mock_client)
      model_id, model_version = (
          "inference-instance-types-variant-model",
          "*",
      )
      region = "us-west-2"
  
      assert [
          "ml.inf1.2xlarge",
          "ml.inf1.xlarge",
      ] == instance_types.retrieve(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.trn1.xlarge",
      )
  
      assert [
          "ml.inf1.2xlarge",
          "ml.inf1.xlarge",
      ] == instance_types.retrieve(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.trn1.12xlarge",
      )
  
      assert [
          "ml.p2.xlarge",
          "ml.p3.xlarge",
          "ml.p5.xlarge",
      ] == instance_types.retrieve(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.p2.12xlarge",
      )
  
      assert ["ml.p4de.24xlarge"] == instance_types.retrieve(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.p29s.12xlarge",
      )
  
      assert "ml.inf1.xlarge" == instance_types.retrieve_default(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.trn1.xlarge",
      )
  
      assert "ml.inf1.xlarge" == instance_types.retrieve_default(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.trn1.12xlarge",
      )
  
      assert "ml.p5.xlarge" == instance_types.retrieve_default(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.p2.12xlarge",
      )
  
      assert "ml.p4de.24xlarge" == instance_types.retrieve_default(
          region=region,
          model_id=model_id,
          model_version=model_version,
          scope="inference",
          sagemaker_session=mock_session,
          training_instance_type="ml.p29s.12xlarge",
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/instance_types/jumpstart/test_instance_types.py
imports: from __future__ import absolute_import
  from unittest.mock import Mock
  import boto3
  from mock.mock import patch
  import pytest
  from sagemaker import instance_types
  from tests.unit.sagemaker.jumpstart.utils import get_spec_from_base_spec, get_special_model_spec
label_desc: Use image node_id 2 for calling a global function with example usage: test_jumpstart_inference_instance_type_variants(patched_get_model_specs) without return types