code: def test_update_endpoint_all_args(name_from_base, production_variant):
      new_endpoint_config_name = "new-endpoint-config"
      name_from_base.return_value = new_endpoint_config_name
  
      sagemaker_session = empty_sagemaker_session()
      existing_endpoint_config_name = "existing-endpoint-config"
  
      predictor = Predictor(
          ENDPOINT, sagemaker_session=sagemaker_session
      )
      predictor._endpoint_config_name = existing_endpoint_config_name
  
      new_instance_count = 2
      new_instance_type = "ml.c4.xlarge"
      new_accelerator_type = "ml.eia1.medium"
      new_model_name = "new-model"
      new_tags = [{"Key": "foo", "Value": "bar"}]
      new_kms_key = "new-key"
      new_data_capture_config_dict = {}
  
      predictor.update_endpoint(
          initial_instance_count=new_instance_count,
          instance_type=new_instance_type,
          accelerator_type=new_accelerator_type,
          model_name=new_model_name,
          tags=new_tags,
          kms_key=new_kms_key,
          data_capture_config_dict=new_data_capture_config_dict,
          wait=False,
      )
  
      assert [new_model_name] == predictor._model_names
      assert new_endpoint_config_name == predictor._endpoint_config_name
  
      production_variant.assert_called_with(
          new_model_name,
          new_instance_type,
          initial_instance_count=new_instance_count,
          accelerator_type=new_accelerator_type,
      )
      sagemaker_session.create_endpoint_config_from_existing.assert_called_with(
          existing_endpoint_config_name,
          new_endpoint_config_name,
          new_tags=new_tags,
          new_kms_key=new_kms_key,
          new_data_capture_config_dict=new_data_capture_config_dict,
          new_production_variants=[production_variant.return_value],
          endpoint_type=EndpointType.MODEL_BASED,
      )
      sagemaker_session.update_endpoint.assert_called_with(
          ENDPOINT, new_endpoint_config_name, wait=False
      )
  
imports: from __future__ import absolute_import
  import io
  import json
  import pytest
  from mock import Mock, call, patch
  from sagemaker.deserializers import CSVDeserializer, PandasDeserializer
  from sagemaker.enums import EndpointType
  from sagemaker.model_monitor.model_monitoring import DEFAULT_REPOSITORY_NAME
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import JSONSerializer, CSVSerializer
  from sagemaker.compute_resource_requirements.resource_requirements import ResourceRequirements
label_desc: Use image node_id 12 for calling a global function with example usage: test_update_endpoint_all_args(name_from_base, production_variant) without return types