code: def test_advanced_right_size_and_deploy_registered_model_sklearn(
      advanced_right_sized_model, sagemaker_session
  ):
      endpoint_name = unique_name_from_base(
          "test-ir-right-size-advanced-sklearn"
      )
  
      (
          right_size_model_package,
          model_package_group_name,
      ) = advanced_right_sized_model
      with timeout(minutes=45):
          try:
              right_size_model_package.predictor_cls = SKLearnPredictor
              predictor = right_size_model_package.deploy(
                  endpoint_name=endpoint_name
              )
  
              payload = pd.read_csv(IR_SKLEARN_DATA, header=None)
  
              inference = predictor.predict(payload)
              assert inference is not None
              assert 26 == len(inference)
          finally:
              sagemaker_session.sagemaker_client.delete_model_package(
                  ModelPackageName=right_size_model_package.model_package_arn
              )
              sagemaker_session.sagemaker_client.delete_model_package_group(
                  ModelPackageGroupName=model_package_group_name
              )
              predictor.delete_model()
              predictor.delete_endpoint()
  
imports: from __future__ import absolute_import
  import os
  import time
  import pytest
  from botocore.exceptions import ClientError
  from sagemaker import image_uris
  from sagemaker.model import Model
  from sagemaker.sklearn.model import SKLearnModel, SKLearnPredictor
  from sagemaker.utils import unique_name_from_base
  from tests.integ import DATA_DIR
  from tests.integ.timeout import timeout
  import pandas
  from sagemaker.inference_recommender.inference_recommender_mixin import Phase, ModelLatencyThreshold
  from sagemaker.parameter import CategoricalParameter
  import logging
label_desc: Use image node_id 12 for calling a global function with example usage: test_advanced_right_size_and_deploy_registered_model_sklearn(advanced_right_sized_model, sagemaker_session) without return types