code: def test_jumpstart_default_hyperparameters(patched_get_model_specs):
      patched_get_model_specs.side_effect = get_spec_from_base_spec
  
      model_id = "pytorch-eqa-bert-base-cased"
      region = "us-west-2"
  
      params = hyperparameters.retrieve_default(
          region=region,
          model_id=model_id,
          model_version="*",
          sagemaker_session=mock_session,
      )
      assert params == {
          "adam-learning-rate": "0.05",
          "batch-size": "4",
          "epochs": "3",
      }
  
      patched_get_model_specs.assert_called_once_with(
          region=region,
          model_id=model_id,
          version="*",
          s3_client=mock_client,
      )
  
      patched_get_model_specs.reset_mock()
  
      params = hyperparameters.retrieve_default(
          region=region,
          model_id=model_id,
          model_version="1.*",
          sagemaker_session=mock_session,
      )
      assert params == {
          "adam-learning-rate": "0.05",
          "batch-size": "4",
          "epochs": "3",
      }
  
      patched_get_model_specs.assert_called_once_with(
          region=region,
          model_id=model_id,
          version="1.*",
          s3_client=mock_client,
      )
  
      patched_get_model_specs.reset_mock()
  
      params = hyperparameters.retrieve_default(
          region=region,
          model_id=model_id,
          model_version="1.*",
          include_container_hyperparameters=True,
          sagemaker_session=mock_session,
      )
      assert params == {
          "adam-learning-rate": "0.05",
          "batch-size": "4",
          "epochs": "3",
          "sagemaker_container_log_level": "20",
          "sagemaker_program": "transfer_learning.py",
          "sagemaker_submit_directory": "/opt/ml/input/data/code/sourcedir.tar.gz",
      }
  
      patched_get_model_specs.assert_called_once_with(
          region=region,
          model_id=model_id,
          version="1.*",
          s3_client=mock_client,
      )
  
      patched_get_model_specs.reset_mock()
  
      with pytest.raises(KeyError):
          hyperparameters.retrieve_default(
              region=region,
              model_id="blah",
              model_version="*",
          )
  
      with pytest.raises(ValueError):
          hyperparameters.retrieve_default(
              region="mars-south-1",
              model_id=model_id,
              model_version="*",
          )
  
      with pytest.raises(ValueError):
          hyperparameters.retrieve_default(
              model_version="*",
          )
  
      with pytest.raises(ValueError):
          hyperparameters.retrieve_default(
              model_id=model_id,
          )
  
imports: from __future__ import absolute_import
  import boto3
  from mock.mock import patch, Mock
  import pytest
  from sagemaker import hyperparameters
  from tests.unit.sagemaker.jumpstart.utils import get_spec_from_base_spec, get_special_model_spec
label_desc: Use image node_id 1 for calling a global function with example usage: test_jumpstart_default_hyperparameters(patched_get_model_specs) without return types