code: def test_jumpstart_variants_image_uri(
      patched_get_model_specs,
      patched_verify_model_region_and_return_specs,
  ):
      patched_verify_model_region_and_return_specs.side_effect = (
          verify_model_region_and_return_specs
      )
      patched_get_model_specs.side_effect = get_special_model_spec
  
      assert (
          "763104351884.dkr.ecr.us-west-2.amazonaws.com/"
          "huggingface-pytorch-inference:1.13.1-transformers4.26.0-gpu-py39-cu117-ubuntu20.04"
          == image_uris.retrieve(
              framework=None,
              region="us-west-2",
              image_scope="inference",
              model_id="variant-model",
              model_version="*",
              instance_type="ml.p2.xlarge",
          )
      )
  
      assert (
          "867930986793.dkr.us-west-2.amazonaws.com/cpu-blah"
          == image_uris.retrieve(
              framework=None,
              region="us-west-2",
              image_scope="inference",
              model_id="variant-model",
              model_version="*",
              instance_type="ml.c2.xlarge",
          )
      )
  
      assert (
          "763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-inference:1.5.0-cpu-py3"
          == image_uris.retrieve(
              framework=None,
              region="us-west-2",
              image_scope="inference",
              model_id="variant-model",
              model_version="*",
              instance_type="ml.c200000.xlarge",
          )
      )
  
      with pytest.raises(ValueError):
          image_uris.retrieve(
              framework=None,
              region="us-west-29",
              image_scope="inference",
              model_id="variant-model",
              model_version="*",
              instance_type="ml.c2.xlarge",
          )
  
      assert (
          "763104351884.dkr.ecr.us-west-2.amazonaws.com/pytorch-training:1.5.0-gpu-py3"
          == image_uris.retrieve(
              framework=None,
              region="us-west-2",
              image_scope="training",
              model_id="variant-model",
              model_version="*",
              instance_type="ml.g4dn.2xlarge",
          )
      )
  
imports: from __future__ import absolute_import
  from mock.mock import patch
  import pytest
  from sagemaker import image_uris
  from sagemaker.jumpstart.utils import verify_model_region_and_return_specs
  from tests.unit.sagemaker.jumpstart.utils import get_special_model_spec
label_desc: Use image node_id 1 for calling a global function with example usage: test_jumpstart_variants_image_uri(patched_get_model_specs, patched_verify_model_region_and_return_specs) without return types