code: def _validate_for_suppported_frameworks_and_instance_type(
      framework, instance_type
  ):
      """Validate if framework is supported for the instance_type"""
      # Validate for Trainium allowed frameworks
      if (
          instance_type is not None
          and "trn" in instance_type
          and framework not in TRAINIUM_ALLOWED_FRAMEWORKS
      ):
          _validate_framework(
              framework,
              TRAINIUM_ALLOWED_FRAMEWORKS,
              "framework",
              "Trainium",
          )
  
      # Validate for Graviton allowed frameowrks
      if (
          instance_type is not None
          and utils.get_instance_type_family(instance_type)
          in GRAVITON_ALLOWED_TARGET_INSTANCE_FAMILY
          and framework not in GRAVITON_ALLOWED_FRAMEWORKS
      ):
          _validate_framework(
              framework,
              GRAVITON_ALLOWED_FRAMEWORKS,
              "framework",
              "Graviton",
          )
  
imports: from __future__ import absolute_import
  import json
  import logging
  import os
  import re
  from typing import Optional
  from packaging.version import Version
  from sagemaker import utils
  from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION
  from sagemaker.jumpstart.utils import is_jumpstart_model_input
  from sagemaker.spark import defaults
  from sagemaker.jumpstart import artifacts
  from sagemaker.workflow import is_pipeline_variable
  from sagemaker.workflow.utilities import override_pipeline_parameter_var
  from sagemaker.fw_utils import GRAVITON_ALLOWED_TARGET_INSTANCE_FAMILY, GRAVITON_ALLOWED_FRAMEWORKS
label_desc: Use image node_id 5 for calling a global function with example usage: _validate_for_suppported_frameworks_and_instance_type(framework, instance_type) without return types