code: def _config_for_framework_and_scope(
      framework, image_scope, accelerator_type=None
  ):
      """Loads the JSON config for the given framework and image scope."""
      config = config_for_framework(framework)
  
      if accelerator_type:
          _validate_accelerator_type(accelerator_type)
  
          if image_scope not in ("eia", "inference"):
              logger.warning(
                  "Elastic inference is for inference only. Ignoring image scope: %s.",
                  image_scope,
              )
          image_scope = "eia"
  
      available_scopes = config.get("scope", list(config.keys()))
  
      if len(available_scopes) == 1:
          if image_scope and image_scope != available_scopes[0]:
              logger.warning(
                  "Defaulting to only supported image scope: %s. Ignoring image scope: %s.",
                  available_scopes[0],
                  image_scope,
              )
          image_scope = available_scopes[0]
  
      if (
          not image_scope
          and "scope" in config
          and set(available_scopes) == {"training", "inference"}
      ):
          logger.info(
              "Same images used for training and inference. Defaulting to image scope: %s.",
              available_scopes[0],
          )
          image_scope = available_scopes[0]
  
      _validate_arg(image_scope, available_scopes, "image scope")
      return config if "scope" in config else config[image_scope]
  
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 3 for calling a global function with example usage: _config_for_framework_and_scope(framework, image_scope, accelerator_type) and returns: unknown