code: def test_deploy_ir_with_incompatible_parameters(sagemaker_session):
      sagemaker_session.sagemaker_client.describe_inference_recommendations_job.return_value = (
          create_inference_recommendations_job_default_with_model_package_arn()
      )
      sagemaker_session.sagemaker_client.describe_model.return_value = (
          None
      )
  
      model = Model(
          MODEL_IMAGE,
          MODEL_DATA,
          sagemaker_session=sagemaker_session,
          role=ROLE,
      )
  
      with pytest.raises(
          ValueError,
          match="instance_type and initial_instance_count are mutually exclusive with"
          "recommendation id since they are in recommendation."
          "Please specify both of them if you want to override the recommendation.",
      ):
          model.deploy(
              instance_type=INSTANCE_TYPE,
              inference_recommendation_id=RECOMMENDATION_ID,
          )
  
      with pytest.raises(
          ValueError,
          match="instance_type and initial_instance_count are mutually exclusive with"
          "recommendation id since they are in recommendation."
          "Please specify both of them if you want to override the recommendation.",
      ):
          model.deploy(
              initial_instance_count=INSTANCE_COUNT,
              inference_recommendation_id=RECOMMENDATION_ID,
          )
  
      with pytest.raises(
          ValueError,
          match="accelerator_type is not compatible with inference_recommendation_id",
      ):
          model.deploy(
              accelerator_type=ACCELERATOR_TYPE,
              inference_recommendation_id=INFERENCE_RECOMMENDATION_ID,
          )
  
      with pytest.raises(
          ValueError,
          match="async_inference_config is not compatible with inference_recommendation_id",
      ):
          model.deploy(
              async_inference_config=AsyncInferenceConfig(),
              inference_recommendation_id=INFERENCE_RECOMMENDATION_ID,
          )
  
      with pytest.raises(
          ValueError,
          match="serverless_inference_config is not compatible with inference_recommendation_id",
      ):
          model.deploy(
              serverless_inference_config=ServerlessInferenceConfig(),
              inference_recommendation_id=INFERENCE_RECOMMENDATION_ID,
          )
  
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 20 for calling a global function with example usage: test_deploy_ir_with_incompatible_parameters(sagemaker_session) without return types