code: def test_deploy_generates_endpoint_name_each_time_from_base_name(
      production_variant,
      base_from_name,
      name_from_base,
      sagemaker_session,
  ):
      model = Model(
          MODEL_IMAGE,
          MODEL_DATA,
          role=ROLE,
          sagemaker_session=sagemaker_session,
      )
  
      base_name = "foo"
      model._base_name = base_name
  
      model.deploy(
          instance_type=INSTANCE_TYPE,
          initial_instance_count=INSTANCE_COUNT,
      )
      model.deploy(
          instance_type=INSTANCE_TYPE,
          initial_instance_count=INSTANCE_COUNT,
      )
  
      base_from_name.assert_not_called()
      name_from_base.assert_called_with(base_name)
      assert 2 == name_from_base.call_count
  
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 6 for calling a global function with example usage: test_deploy_generates_endpoint_name_each_time_from_base_name(production_variant, base_from_name, name_from_base, sagemaker_session) without return types