code: def default_right_sized_unregistered_base_model(
      sagemaker_session, cpu_instance_type
  ):
      with timeout(minutes=45):
          try:
              ir_job_name = unique_name_from_base(
                  "test-ir-right-size-job-name"
              )
              model_data = sagemaker_session.upload_data(
                  path=IR_SKLEARN_MODEL
              )
              payload_data = sagemaker_session.upload_data(
                  path=IR_SKLEARN_PAYLOAD
              )
              region = sagemaker_session._region_name
              image_uri = image_uris.retrieve(
                  framework="sklearn",
                  region=region,
                  version="1.0-1",
                  image_scope="inference",
              )
  
              iam_client = sagemaker_session.boto_session.client("iam")
              role_arn = iam_client.get_role(RoleName="SageMakerRole")[
                  "Role"
              ]["Arn"]
  
              model = Model(
                  model_data=model_data,
                  role=role_arn,
                  entry_point=IR_SKLEARN_ENTRY_POINT,
                  image_uri=image_uri,
              )
  
              return (
                  retry_and_back_off(
                      model.right_size(
                          job_name=ir_job_name,
                          sample_payload_url=payload_data,
                          supported_content_types=IR_SKLEARN_CONTENT_TYPE,
                          supported_instance_types=[cpu_instance_type],
                          framework=IR_SKLEARN_FRAMEWORK,
                          log_level="Quiet",
                      )
                  ),
                  ir_job_name,
              )
          except Exception:
              sagemaker_session.delete_model(model_name=model.name)
  
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 6 for calling a global function with example usage: default_right_sized_unregistered_base_model(sagemaker_session, cpu_instance_type) and returns: retry_and_back_off,  ir_job_name