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,
          settings=SessionSettings(),
          default_bucket_prefix=None,
      )
  
      describe = {
          "ModelArtifacts": {"S3ModelArtifacts": "s3://m/m.tar.gz"}
      }
      describe_compilation = {
          "ModelArtifacts": {
              "S3ModelArtifacts": "s3://m/model_c5.tar.gz"
          },
          "InferenceImage": INFERENCE_IMAGE_URI,
      }
      session.sagemaker_client.create_model_package.side_effect = (
          MODEL_PKG_RESPONSE
      )
      session.sagemaker_client.describe_training_job = Mock(
          return_value=describe
      )
      session.sagemaker_client.describe_endpoint = Mock(
          return_value=ENDPOINT_DESC
      )
      session.sagemaker_client.describe_endpoint_config = Mock(
          return_value=ENDPOINT_CONFIG_DESC
      )
      session.sagemaker_client.list_tags = Mock(
          return_value=LIST_TAGS_RESULT
      )
      session.wait_for_compilation_job = Mock(
          return_value=describe_compilation
      )
      session.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      session.expand_role = Mock(name="expand_role", return_value=ROLE)
  
      # For tests which doesn't verify config file injection, operate with empty config
      session.sagemaker_config = {}
      return session
  
imports: from __future__ import absolute_import
  import logging
  import json
  import os
  import pytest
  from mock import MagicMock, Mock, ANY
  from mock import patch
  from pkg_resources import parse_version
  from sagemaker.fw_utils import UploadedCode
  from sagemaker.drift_check_baselines import DriftCheckBaselines
  from sagemaker.metadata_properties import MetadataProperties
  from sagemaker.model_metrics import FileSource, MetricsSource, ModelMetrics
  from sagemaker.mxnet import defaults
  from sagemaker.mxnet import MXNet
  from sagemaker.mxnet import MXNetPredictor, MXNetModel
  from sagemaker.session_settings import SessionSettings
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: session