code: def test_deploy_optional_args(
      candidate_estimator, sagemaker_session, candidate_mock
  ):
      candidate_estimator.return_value = candidate_mock
  
      auto_ml = AutoML(
          role=ROLE,
          target_attribute_name=TARGET_ATTRIBUTE_NAME,
          sagemaker_session=sagemaker_session,
      )
      mock_pipeline = Mock(name="pipeline_model")
      mock_pipeline.deploy = Mock(name="model_deploy")
      auto_ml.best_candidate = Mock(
          name="best_candidate", return_value=CANDIDATE_DICT
      )
      auto_ml.create_model = Mock(
          name="create_model", return_value=mock_pipeline
      )
  
      auto_ml.deploy(
          initial_instance_count=INSTANCE_COUNT,
          instance_type=INSTANCE_TYPE,
          candidate=CANDIDATE_DICT,
          sagemaker_session=sagemaker_session,
          name=JOB_NAME,
          endpoint_name=JOB_NAME,
          tags=TAGS,
          wait=False,
          vpc_config=VPC_CONFIG,
          enable_network_isolation=True,
          model_kms_key=OUTPUT_KMS_KEY,
          predictor_cls=Predictor,
          inference_response_keys=None,
      )
  
      auto_ml.create_model.assert_called_once()
      auto_ml.create_model.assert_called_with(
          name=JOB_NAME,
          sagemaker_session=sagemaker_session,
          candidate=CANDIDATE_DICT,
          inference_response_keys=None,
          vpc_config=VPC_CONFIG,
          enable_network_isolation=True,
          model_kms_key=OUTPUT_KMS_KEY,
          predictor_cls=Predictor,
      )
  
      mock_pipeline.deploy.assert_called_once()
  
      mock_pipeline.deploy.assert_called_with(
          initial_instance_count=INSTANCE_COUNT,
          instance_type=INSTANCE_TYPE,
          serializer=None,
          deserializer=None,
          endpoint_name=JOB_NAME,
          kms_key=OUTPUT_KMS_KEY,
          volume_size=None,
          model_data_download_timeout=None,
          container_startup_health_check_timeout=None,
          tags=TAGS,
          wait=False,
      )
  
imports: from __future__ import absolute_import
  import copy
  import pytest
  from mock import Mock, patch
  from sagemaker import AutoML, AutoMLJob, AutoMLInput, CandidateEstimator, PipelineModel
  from sagemaker.predictor import Predictor
  from sagemaker.session_settings import SessionSettings
  from sagemaker.workflow.functions import Join
  from tests.unit import SAGEMAKER_CONFIG_AUTO_ML, SAGEMAKER_CONFIG_TRAINING_JOB, _test_default_bucket_and_prefix_combinations, DEFAULT_S3_BUCKET_NAME, DEFAULT_S3_OBJECT_KEY_PREFIX_NAME
label_desc: Use image node_id 25 for calling a global function with example usage: test_deploy_optional_args(candidate_estimator, sagemaker_session, candidate_mock) without return types