code: def get_deploy_kwargs(
      model_id: str,
      model_version: Optional[str] = None,
      region: Optional[str] = None,
      initial_instance_count: Optional[int] = None,
      instance_type: Optional[str] = None,
      serializer: Optional[BaseSerializer] = None,
      deserializer: Optional[BaseDeserializer] = None,
      accelerator_type: Optional[str] = None,
      endpoint_name: Optional[str] = None,
      tags: Optional[Tags] = None,
      kms_key: Optional[str] = None,
      wait: Optional[bool] = None,
      data_capture_config: Optional[DataCaptureConfig] = None,
      async_inference_config: Optional[AsyncInferenceConfig] = None,
      serverless_inference_config: Optional[
          ServerlessInferenceConfig
      ] = None,
      volume_size: Optional[int] = None,
      model_data_download_timeout: Optional[int] = None,
      container_startup_health_check_timeout: Optional[int] = None,
      inference_recommendation_id: Optional[str] = None,
      explainer_config: Optional[ExplainerConfig] = None,
      image_uri: Optional[Union[str, PipelineVariable]] = None,
      role: Optional[str] = None,
      predictor_cls: Optional[callable] = None,
      env: Optional[Dict[str, Union[str, PipelineVariable]]] = None,
      vpc_config: Optional[
          Dict[str, List[Union[str, PipelineVariable]]]
      ] = None,
      sagemaker_session: Optional[Session] = None,
      enable_network_isolation: Union[bool, PipelineVariable] = None,
      model_kms_key: Optional[str] = None,
      image_config: Optional[
          Dict[str, Union[str, PipelineVariable]]
      ] = None,
      source_dir: Optional[str] = None,
      code_location: Optional[str] = None,
      entry_point: Optional[str] = None,
      container_log_level: Optional[
          Union[int, PipelineVariable]
      ] = None,
      dependencies: Optional[List[str]] = None,
      git_config: Optional[Dict[str, str]] = None,
      tolerate_deprecated_model: Optional[bool] = None,
      tolerate_vulnerable_model: Optional[bool] = None,
      use_compiled_model: Optional[bool] = None,
      model_name: Optional[str] = None,
      training_instance_type: Optional[str] = None,
  ) -> JumpStartEstimatorDeployKwargs:
      """Returns kwargs required to call `deploy` on `sagemaker.estimator.Estimator` object."""
  
      model_deploy_kwargs: JumpStartModelDeployKwargs = model.get_deploy_kwargs(
          model_id=model_id,
          model_version=model_version,
          region=region,
          initial_instance_count=initial_instance_count,
          instance_type=instance_type,
          serializer=serializer,
          deserializer=deserializer,
          accelerator_type=accelerator_type,
          endpoint_name=endpoint_name,
          tags=format_tags(tags),
          kms_key=kms_key,
          wait=wait,
          data_capture_config=data_capture_config,
          async_inference_config=async_inference_config,
          serverless_inference_config=serverless_inference_config,
          volume_size=volume_size,
          model_data_download_timeout=model_data_download_timeout,
          container_startup_health_check_timeout=container_startup_health_check_timeout,
          inference_recommendation_id=inference_recommendation_id,
          explainer_config=explainer_config,
          tolerate_vulnerable_model=tolerate_vulnerable_model,
          tolerate_deprecated_model=tolerate_deprecated_model,
          sagemaker_session=sagemaker_session,
      )
  
      model_init_kwargs: JumpStartModelInitKwargs = (
          model.get_init_kwargs(
              model_id=model_id,
              model_from_estimator=True,
              model_version=model_version,
              instance_type=model_deploy_kwargs.instance_type
              if training_instance_type is None
              else None,
              region=region,
              image_uri=image_uri,
              source_dir=source_dir,
              entry_point=entry_point,
              env=env,
              predictor_cls=predictor_cls,
              role=role,
              name=model_name,
              vpc_config=vpc_config,
              sagemaker_session=model_deploy_kwargs.sagemaker_session,
              enable_network_isolation=enable_network_isolation,
              model_kms_key=model_kms_key,
              image_config=image_config,
              code_location=code_location,
              container_log_level=container_log_level,
              dependencies=dependencies,
              git_config=git_config,
              tolerate_vulnerable_model=tolerate_vulnerable_model,
              tolerate_deprecated_model=tolerate_deprecated_model,
              training_instance_type=training_instance_type,
              disable_instance_type_logging=True,
          )
      )
  
      estimator_deploy_kwargs: JumpStartEstimatorDeployKwargs = JumpStartEstimatorDeployKwargs(
          model_id=model_init_kwargs.model_id,
          model_version=model_init_kwargs.model_version,
          instance_type=model_init_kwargs.instance_type,
          initial_instance_count=model_deploy_kwargs.initial_instance_count,
          region=model_init_kwargs.region,
          image_uri=model_init_kwargs.image_uri,
          source_dir=model_init_kwargs.source_dir,
          entry_point=model_init_kwargs.entry_point,
          env=model_init_kwargs.env,
          predictor_cls=model_init_kwargs.predictor_cls,
          serializer=model_deploy_kwargs.serializer,
          deserializer=model_deploy_kwargs.deserializer,
          accelerator_type=model_deploy_kwargs.accelerator_type,
          endpoint_name=model_deploy_kwargs.endpoint_name,
          tags=model_deploy_kwargs.tags,
          kms_key=model_deploy_kwargs.kms_key,
          wait=model_deploy_kwargs.wait,
          data_capture_config=model_deploy_kwargs.data_capture_config,
          async_inference_config=model_deploy_kwargs.async_inference_config,
          serverless_inference_config=model_deploy_kwargs.serverless_inference_config,
          volume_size=model_deploy_kwargs.volume_size,
          model_data_download_timeout=model_deploy_kwargs.model_data_download_timeout,
          container_startup_health_check_timeout=(
              model_deploy_kwargs.container_startup_health_check_timeout
          ),
          inference_recommendation_id=model_deploy_kwargs.inference_recommendation_id,
          explainer_config=model_deploy_kwargs.explainer_config,
          role=model_init_kwargs.role,
          model_name=model_init_kwargs.name,
          vpc_config=model_init_kwargs.vpc_config,
          sagemaker_session=model_init_kwargs.sagemaker_session,
          enable_network_isolation=model_init_kwargs.enable_network_isolation,
          model_kms_key=model_init_kwargs.model_kms_key,
          image_config=model_init_kwargs.image_config,
          code_location=model_init_kwargs.code_location,
          container_log_level=model_init_kwargs.container_log_level,
          dependencies=model_init_kwargs.dependencies,
          git_config=model_init_kwargs.git_config,
          tolerate_vulnerable_model=model_init_kwargs.tolerate_vulnerable_model,
          tolerate_deprecated_model=model_init_kwargs.tolerate_deprecated_model,
          use_compiled_model=use_compiled_model,
      )
  
      return estimator_deploy_kwargs
  
imports: from __future__ import absolute_import
  from typing import Dict, List, Optional, Union
  from sagemaker import environment_variables, hyperparameters, image_uris, instance_types, metric_definitions, model_uris, script_uris
  from sagemaker.jumpstart.artifacts import _model_supports_incremental_training, _retrieve_model_package_model_artifact_s3_uri
  from sagemaker.jumpstart.artifacts.resource_names import _retrieve_resource_name_base
  from sagemaker.session import Session
  from sagemaker.async_inference.async_inference_config import AsyncInferenceConfig
  from sagemaker.base_deserializers import BaseDeserializer
  from sagemaker.base_serializers import BaseSerializer
  from sagemaker.debugger.debugger import DebuggerHookConfig, RuleBase, TensorBoardOutputConfig
  from sagemaker.debugger.profiler_config import ProfilerConfig
  from sagemaker.explainer.explainer_config import ExplainerConfig
  from sagemaker.inputs import FileSystemInput, TrainingInput
  from sagemaker.instance_group import InstanceGroup
  from sagemaker.jumpstart.artifacts import _retrieve_estimator_init_kwargs, _retrieve_estimator_fit_kwargs, _model_supports_training_model_uri
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_LOGGER, TRAINING_ENTRY_POINT_SCRIPT_NAME, SAGEMAKER_GATED_MODEL_S3_URI_TRAINING_ENV_VAR_KEY
  from sagemaker.jumpstart.enums import JumpStartScriptScope
  from sagemaker.jumpstart.factory import model
  from sagemaker.jumpstart.types import JumpStartEstimatorDeployKwargs, JumpStartEstimatorFitKwargs, JumpStartEstimatorInitKwargs, JumpStartKwargs, JumpStartModelDeployKwargs, JumpStartModelInitKwargs
  from sagemaker.jumpstart.utils import add_jumpstart_model_id_version_tags, update_dict_if_key_not_present, resolve_estimator_sagemaker_config_field, verify_model_region_and_return_specs
  from sagemaker.model_monitor.data_capture_config import DataCaptureConfig
  from sagemaker.serverless.serverless_inference_config import ServerlessInferenceConfig
  from sagemaker.utils import name_from_base, format_tags, Tags
  from sagemaker.workflow.entities import PipelineVariable
label_desc: Use image node_id 3 for calling a global function with example usage: get_deploy_kwargs(model_id, model_version, region, initial_instance_count, instance_type, serializer, deserializer, accelerator_type, endpoint_name, tags, kms_key, wait, data_capture_config, async_inference_config, serverless_inference_config, volume_size, model_data_download_timeout, container_startup_health_check_timeout, inference_recommendation_id, explainer_config, image_uri, role, predictor_cls, env, vpc_config, sagemaker_session, enable_network_isolation, model_kms_key, image_config, source_dir, code_location, entry_point, container_log_level, dependencies, git_config, tolerate_deprecated_model, tolerate_vulnerable_model, use_compiled_model, model_name, training_instance_type) and returns: estimator_deploy_kwargs