code: def get_base_python_image_uri(region, py_version="310") -> str:
      """Retrieves the image URI for base python image.
  
      Args:
          region (str): The AWS region to use for image URI.
          py_version (str): The python version to use for the image. Can be 310 or 38
          Default to 310
  
      Returns:
          str: The image URI string.
      """
  
      framework = "sagemaker-base-python"
      version = "1.0"
      endpoint_data = utils._botocore_resolver().construct_endpoint(
          "ecr", region
      )
      if region == "il-central-1" and not endpoint_data:
          endpoint_data = {
              "hostname": "ecr.{}.amazonaws.com".format(region)
          }
      hostname = endpoint_data["hostname"]
      config = config_for_framework(framework)
      version_config = config["versions"][
          _version_for_config(version, config)
      ]
  
      registry = _registry_from_region(
          region, version_config["registries"]
      )
  
      repo = version_config["repository"] + "-" + py_version
      repo_and_tag = repo + ":" + version
  
      return ECR_URI_TEMPLATE.format(
          registry=registry, hostname=hostname, repository=repo_and_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 21 for calling a global function with example usage: get_base_python_image_uri(region, py_version) and returns: ECR_URI_TEMPLATE