code: def sagemaker_session():
      boto_mock = Mock(name="boto_session", region_name=REGION)
      session = Mock(
          name="sagemaker_session",
          boto_session=boto_mock,
          boto_region_name=REGION,
          config=None,
          local_mode=False,
          s3_resource=None,
          s3_client=None,
          default_bucket_prefix=None,
      )
      session.sagemaker_client.describe_endpoint = Mock(
          return_value=ENDPOINT_DESC
      )
      session.sagemaker_client.describe_endpoint_config = Mock(
          return_value=ENDPOINT_CONFIG_DESC
      )
      session.list_s3_files(
          bucket=S3_URL_SOURCE_BUCKET, key_prefix=S3_URL_SOURCE_PREFIX
      ).return_value = Mock()
      session.upload_data = Mock(
          name="upload_data",
          return_value=os.path.join(
              VALID_MULTI_MODEL_DATA_PREFIX, "mleap_model.tar.gz"
          ),
      )
      # For tests which doesn't verify config file injection, operate with empty config
      session.sagemaker_config = {}
  
      s3_mock = Mock()
      boto_mock.client("s3").return_value = s3_mock
      boto_mock.client("s3").get_paginator(
          "list_objects_v2"
      ).paginate.return_value = Mock()
      s3_mock.reset_mock()
  
      return session
  
imports: from __future__ import absolute_import
  import os
  import pytest
  from mock import MagicMock, Mock, call, patch
  from sagemaker.multidatamodel import MULTI_MODEL_CONTAINER_MODE
  from sagemaker.multidatamodel import MultiDataModel
  from sagemaker.mxnet import MXNetModel, MXNetPredictor
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: session