code: def _get_image_tag(
      container_version,
      distribution,
      final_image_scope,
      framework,
      inference_tool,
      instance_type,
      processor,
      py_version,
      tag_prefix,
      version,
  ):
      """Return image tag based on framework, container, and compute configuration(s)."""
      instance_type_family = utils.get_instance_type_family(
          instance_type
      )
      if framework in (XGBOOST_FRAMEWORK, SKLEARN_FRAMEWORK):
          if (
              instance_type_family
              and final_image_scope == INFERENCE_GRAVITON
          ):
              _validate_arg(
                  instance_type_family,
                  GRAVITON_ALLOWED_TARGET_INSTANCE_FAMILY,
                  "instance type",
              )
          if (
              instance_type_family
              in GRAVITON_ALLOWED_TARGET_INSTANCE_FAMILY
              or final_image_scope == INFERENCE_GRAVITON
          ):
              version_to_arm64_tag_mapping = {
                  "xgboost": {
                      "1.5-1": "1.5-1-arm64",
                      "1.3-1": "1.3-1-arm64",
                  },
                  "sklearn": {
                      "1.0-1": "1.0-1-arm64-cpu-py3",
                  },
              }
              tag = version_to_arm64_tag_mapping[framework][version]
          else:
              tag = _format_tag(
                  tag_prefix,
                  processor,
                  py_version,
                  container_version,
                  inference_tool,
              )
      else:
          tag = _format_tag(
              tag_prefix,
              processor,
              py_version,
              container_version,
              inference_tool,
          )
  
          if (
              instance_type is not None
              and _should_auto_select_container_version(
                  instance_type, distribution
              )
          ):
              container_versions = {
                  "tensorflow-2.3-gpu-py37": "cu110-ubuntu18.04-v3",
                  "tensorflow-2.3.1-gpu-py37": "cu110-ubuntu18.04",
                  "tensorflow-2.3.2-gpu-py37": "cu110-ubuntu18.04",
                  "tensorflow-1.15-gpu-py37": "cu110-ubuntu18.04-v8",
                  "tensorflow-1.15.4-gpu-py37": "cu110-ubuntu18.04",
                  "tensorflow-1.15.5-gpu-py37": "cu110-ubuntu18.04",
                  "mxnet-1.8-gpu-py37": "cu110-ubuntu16.04-v1",
                  "mxnet-1.8.0-gpu-py37": "cu110-ubuntu16.04",
                  "pytorch-1.6-gpu-py36": "cu110-ubuntu18.04-v3",
                  "pytorch-1.6.0-gpu-py36": "cu110-ubuntu18.04",
                  "pytorch-1.6-gpu-py3": "cu110-ubuntu18.04-v3",
                  "pytorch-1.6.0-gpu-py3": "cu110-ubuntu18.04",
              }
              key = "-".join([framework, tag])
              if key in container_versions:
                  tag = "-".join([tag, container_versions[key]])
  
      return tag
  
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 2 for calling a global function with example usage: _get_image_tag(container_version, distribution, final_image_scope, framework, inference_tool, instance_type, processor, py_version, tag_prefix, version) and returns: tag