code: def container_image(sagemaker_session):
      """Create a Multi-Model image since pre-built ones are not available yet."""
      algorithm_name = unique_name_from_base(
          "sagemaker-multimodel-integ-test"
      )
      ecr_image = _ecr_image_uri(sagemaker_session, algorithm_name)
  
      ecr_client = sagemaker_session.boto_session.client("ecr")
      username, password = _ecr_login(ecr_client)
  
      docker_client = docker.from_env()
  
      # Build and tag docker image locally
      image, build_log = docker_client.images.build(
          path=os.path.join(DATA_DIR, "multimodel", "container"),
          tag=algorithm_name,
          rm=True,
      )
      image.tag(ecr_image, tag="latest")
  
      # Create AWS ECR and push the local docker image to it
      create_repository(ecr_client, algorithm_name)
  
      # Retry docker image push
      for _ in retries(
          3, "Upload docker image to ECR repo", seconds_to_sleep=10
      ):
          try:
              docker_client.images.push(
                  ecr_image,
                  auth_config={
                      "username": username,
                      "password": password,
                  },
              )
              break
          except requests.exceptions.ConnectionError:
              # This can happen when we try to create multiple repositories in parallel, so we retry
              pass
  
      yield ecr_image
  
      # Delete repository after the multi model integration tests complete
      _delete_repository(ecr_client, algorithm_name)
  
imports: from __future__ import absolute_import
  import base64
  import os
  import requests
  import docker
  import numpy
  import pytest
  from tests.integ.utils import create_repository
  from sagemaker import utils
  from sagemaker.amazon.randomcutforest import RandomCutForest
  from sagemaker.deserializers import StringDeserializer
  from sagemaker.multidatamodel import MultiDataModel
  from sagemaker.mxnet import MXNet
  from sagemaker.predictor import Predictor
  from sagemaker.serializers import NumpySerializer
  from sagemaker.utils import sagemaker_timestamp, unique_name_from_base
  from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
  from tests.integ.retry import retries
  from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
label_desc: Use image node_id 1 for calling a global function with example usage: container_image(sagemaker_session) without return types