code: def get_stabilityai_image_uri(
      session: Optional[Session] = None,
      region: Optional[str] = None,
      version: Optional[str] = None,
      image_scope: Optional[str] = "inference",
  ) -> str:
      """Very basic utility function to fetch image URI of StabilityAI images.
  
      Args:
          session (Session): SageMaker session.
          region (str): AWS region of image URI.
          version (str): Framework version. Latest version used if not specified.
          image_scope (str): Image type. e.g. inference, training
      Returns:
          Image URI string.
      """
  
      if region is None:
          if session is None:
              region = Session().boto_session.region_name
          else:
              region = session.boto_session.region_name
      return image_uris.retrieve(
          framework="stabilityai",
          region=region,
          version=version,
          image_scope=image_scope,
      )
  
imports: from __future__ import absolute_import
  from typing import Optional
  from sagemaker import image_uris
  from sagemaker.session import Session
label_desc: Use image node_id 1 for calling a global function with example usage: get_stabilityai_image_uri(session, region, version, image_scope) and returns: image_uris