code: def test_jumpstart_sklearn_image_uri(
      patched_get_model_specs, session
  ):
      patched_get_model_specs.side_effect = get_prototype_model_spec
  
      model_id, model_version = "sklearn-classification-linear", "*"
      instance_type = "ml.m2.xlarge"
      region = "us-west-2"
  
      model_specs = accessors.JumpStartModelsAccessor.get_model_specs(
          region, model_id, model_version
      )
  
      # inference
      uri = image_uris.retrieve(
          framework=None,
          region=region,
          image_scope="inference",
          model_id=model_id,
          model_version=model_version,
          instance_type=instance_type,
      )
  
      framework_class_uri = SKLearnModel(
          role="mock_role",
          model_data="mock_data",
          entry_point="mock_entry_point",
          framework_version=model_specs.hosting_ecr_specs.framework_version,
          py_version=model_specs.hosting_ecr_specs.py_version,
          sagemaker_session=session,
      ).serving_image_uri(region, instance_type)
  
      assert uri == framework_class_uri
      assert (
          uri
          == "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:0.23-1-cpu-py3"
      )
  
      # training
      uri = image_uris.retrieve(
          framework=None,
          region=region,
          image_scope="training",
          model_id=model_id,
          model_version=model_version,
          instance_type=instance_type,
      )
  
      framework_class_uri = SKLearn(
          role="mock_role",
          entry_point="mock_entry_point",
          framework_version=model_specs.training_ecr_specs.framework_version,
          py_version=model_specs.training_ecr_specs.py_version,
          instance_type=instance_type,
          instance_count=1,
          image_uri_region=region,
          sagemaker_session=session,
      ).training_image_uri(region=region)
  
      assert uri == framework_class_uri
      assert (
          uri
          == "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-scikit-learn:0.23-1-cpu-py3"
      )
  
      with pytest.raises(ValueError):
          image_uris.retrieve(
              framework=None,
              region="us-west-2",
              image_scope="training",
              model_id=model_id,
              model_version=model_version,
              instance_type="ml.p2.xlarge",
          )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/image_uris/jumpstart/test_sklearn.py
imports: from __future__ import absolute_import
  from mock.mock import patch
  import pytest
  from sagemaker import image_uris
  from sagemaker.jumpstart import accessors
  from sagemaker.sklearn.estimator import SKLearn
  from sagemaker.sklearn.model import SKLearnModel
  from tests.unit.sagemaker.jumpstart.utils import get_prototype_model_spec
label_desc: Use image node_id 1 for calling a global function with example usage: test_jumpstart_sklearn_image_uri(patched_get_model_specs, session) without return types