code: def test_jumpstart_validate_all_hyperparameters(
      patched_get_model_specs,
  ):
      patched_get_model_specs.side_effect = get_spec_from_base_spec
  
      model_id, model_version = "pytorch-eqa-bert-base-cased", "*"
      region = "us-west-2"
  
      hyperparameter_to_test = {
          "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",
      }
  
      hyperparameters.validate(
          region=region,
          model_id=model_id,
          model_version=model_version,
          hyperparameters=hyperparameter_to_test,
          validation_mode=HyperparameterValidationMode.VALIDATE_ALL,
          sagemaker_session=mock_session,
      )
  
      patched_get_model_specs.assert_called_once_with(
          region=region,
          model_id=model_id,
          version=model_version,
          s3_client=mock_client,
      )
  
      patched_get_model_specs.reset_mock()
  
      del hyperparameter_to_test["sagemaker_submit_directory"]
  
      with pytest.raises(JumpStartHyperparametersError) as e:
          hyperparameters.validate(
              region=region,
              model_id=model_id,
              model_version=model_version,
              hyperparameters=hyperparameter_to_test,
              validation_mode=HyperparameterValidationMode.VALIDATE_ALL,
          )
      assert (
          str(e.value)
          == "Cannot find hyperparameter for 'sagemaker_submit_directory'."
      )
  
      hyperparameter_to_test[
          "sagemaker_submit_directory"
      ] = "/opt/ml/input/data/code/sourcedir.tar.gz"
      del hyperparameter_to_test["epochs"]
  
      with pytest.raises(JumpStartHyperparametersError) as e:
          hyperparameters.validate(
              region=region,
              model_id=model_id,
              model_version=model_version,
              hyperparameters=hyperparameter_to_test,
              validation_mode=HyperparameterValidationMode.VALIDATE_ALL,
          )
      assert str(e.value) == "Cannot find hyperparameter for 'epochs'."
  
      hyperparameter_to_test["epochs"] = "3"
  
      hyperparameter_to_test["other_hyperparam"] = "blah"
      hyperparameters.validate(
          region=region,
          model_id=model_id,
          model_version=model_version,
          hyperparameters=hyperparameter_to_test,
          validation_mode=HyperparameterValidationMode.VALIDATE_ALL,
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/hyperparameters/jumpstart/test_validate.py
imports: from __future__ import absolute_import
  from mock.mock import patch, Mock
  import pytest
  import boto3
  from sagemaker import hyperparameters
  from sagemaker.jumpstart.enums import HyperparameterValidationMode
  from sagemaker.jumpstart.exceptions import JumpStartHyperparametersError
  from sagemaker.jumpstart.types import JumpStartHyperparameter
  from tests.unit.sagemaker.jumpstart.utils import get_spec_from_base_spec
label_desc: Use image node_id 3 for calling a global function with example usage: test_jumpstart_validate_all_hyperparameters(patched_get_model_specs) without return types