code: def test_deploy_with_recommendation_id_with_model_pkg_arn_and_compilation(
      name_from_base, sagemaker_session
  ):
      sagemaker_session.sagemaker_client.describe_inference_recommendations_job.return_value = (
          create_inference_recommendations_job_default_with_model_package_arn_and_compilation()
      )
      sagemaker_session.sagemaker_client.describe_model_package.side_effect = (
          mock_describe_model_package
      )
      sagemaker_session.sagemaker_client.describe_model.return_value = (
          None
      )
  
      model_package = ModelPackage(
          role=ROLE,
          model_data=MODEL_DATA,
          model_package_arn=IR_MODEL_PACKAGE_VERSION_ARN,
      )
  
      model_package.sagemaker_session = sagemaker_session
  
      model_package.deploy(
          inference_recommendation_id=RECOMMENDATION_ID,
      )
  
      sagemaker_session.create_model.assert_called_with(
          IR_COMPILATION_IMAGE,
          ROLE,
          IR_COMPILATION_MODEL_PACKAGE_CONTAINER_DEF,
          vpc_config=None,
          enable_network_isolation=False,
          tags=None,
      )
  
      assert model_package.model_data == IR_COMPILATION_MODEL_DATA
      assert model_package.image_uri == IR_COMPILATION_IMAGE
  
imports: from __future__ import absolute_import
  import copy
  import pytest
  from mock import Mock, patch
  import sagemaker
  from sagemaker.model import Model, ModelPackage
  from sagemaker.async_inference import AsyncInferenceConfig
  from sagemaker.serverless import ServerlessInferenceConfig
  from sagemaker.explainer import ExplainerConfig
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
  from tests.unit.sagemaker.inference_recommender.constants import DESCRIBE_COMPILATION_JOB_RESPONSE, DESCRIBE_MODEL_PACKAGE_RESPONSE, DESCRIBE_MODEL_RESPONSE, MODEL_RECOMMENDATION_ENV, MODEL_RECOMMENDATION_ID, INVALID_RECOMMENDATION_ID, IR_COMPILATION_JOB_NAME, IR_ENV, IR_IMAGE, IR_MODEL_DATA, IR_MODEL_NAME, IR_MODEL_PACKAGE_VERSION_ARN, IR_COMPILATION_IMAGE, IR_COMPILATION_MODEL_DATA, NOT_EXISTED_MODEL_RECOMMENDATION_ID, RECOMMENDATION_ID, NOT_EXISTED_RECOMMENDATION_ID, IR_CONTAINER_DEF, DEPLOYMENT_RECOMMENDATION_CONTAINER_DEF, IR_COMPILATION_CONTAINER_DEF, IR_MODEL_PACKAGE_CONTAINER_DEF, IR_COMPILATION_MODEL_PACKAGE_CONTAINER_DEF
  from tests.unit.sagemaker.inference_recommender.constructs import create_inference_recommendations_job_default_with_model_name, create_inference_recommendations_job_default_with_model_name_and_compilation, create_inference_recommendations_job_default_with_model_package_arn, create_inference_recommendations_job_default_with_model_package_arn_and_compilation
label_desc: Use image node_id 26 for calling a global function with example usage: test_deploy_with_recommendation_id_with_model_pkg_arn_and_compilation(name_from_base, sagemaker_session) without return types