code: def get_header_from_base_header(
      _obj: JumpStartModelsCache = None,
      region: str = None,
      model_id: str = None,
      semantic_version_str: str = None,
      version: str = None,
  ) -> JumpStartModelHeader:
      if version and semantic_version_str:
          raise ValueError(
              "Cannot specify both `version` and `semantic_version_str` fields."
          )
  
      if all(
          [
              "pytorch" not in model_id,
              "tensorflow" not in model_id,
              "huggingface" not in model_id,
              "mxnet" not in model_id,
              "xgboost" not in model_id,
              "catboost" not in model_id,
              "lightgbm" not in model_id,
              "sklearn" not in model_id,
          ]
      ):
          raise KeyError("Bad model ID")
  
      if region is not None and region not in JUMPSTART_REGION_NAME_SET:
          raise ValueError(
              f"Region name {region} not supported. Please use one of the supported regions in "
              f"{JUMPSTART_REGION_NAME_SET}"
          )
  
      spec = copy.deepcopy(BASE_HEADER)
  
      spec["version"] = version or semantic_version_str
      spec["model_id"] = model_id
  
      return JumpStartModelHeader(spec)
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/jumpstart/utils.py
imports: from __future__ import absolute_import
  import copy
  from typing import List
  import boto3
  from sagemaker.jumpstart.cache import JumpStartModelsCache
  from sagemaker.jumpstart.constants import JUMPSTART_DEFAULT_REGION_NAME, JUMPSTART_LOGGER, JUMPSTART_REGION_NAME_SET
  from sagemaker.jumpstart.types import JumpStartCachedS3ContentKey, JumpStartCachedS3ContentValue, JumpStartModelSpecs, JumpStartS3FileType, JumpStartModelHeader
  from sagemaker.jumpstart.utils import get_formatted_manifest
  from tests.unit.sagemaker.jumpstart.constants import PROTOTYPICAL_MODEL_SPECS_DICT, BASE_MANIFEST, BASE_SPEC, BASE_HEADER, SPECIAL_MODEL_SPECS_DICT
label_desc: Use image node_id 1 for calling a global function with example usage: get_header_from_base_header(_obj, region, model_id, semantic_version_str, version) and returns: JumpStartModelHeader