code: def _add_hyperparameters_to_kwargs(
      kwargs: JumpStartEstimatorInitKwargs,
  ) -> JumpStartEstimatorInitKwargs:
      """Sets hyperparameters in kwargs based on default or override, returns full kwargs."""
  
      kwargs.hyperparameters = (
          kwargs.hyperparameters.copy()
          if kwargs.hyperparameters is not None
          else {}
      )
  
      default_hyperparameters = hyperparameters_utils.retrieve_default(
          region=kwargs.region,
          model_id=kwargs.model_id,
          model_version=kwargs.model_version,
          tolerate_deprecated_model=kwargs.tolerate_deprecated_model,
          tolerate_vulnerable_model=kwargs.tolerate_vulnerable_model,
          sagemaker_session=kwargs.sagemaker_session,
          instance_type=kwargs.instance_type,
      )
  
      for key, value in default_hyperparameters.items():
          kwargs.hyperparameters = update_dict_if_key_not_present(
              kwargs.hyperparameters,
              key,
              value,
          )
  
      if kwargs.hyperparameters == {}:
          kwargs.hyperparameters = None
  
      return 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 17 for calling a global function with example usage: _add_hyperparameters_to_kwargs(kwargs) and returns: kwargs