code: def sagemaker_session():
      boto_mock = Mock(name="boto_session", region_name=REGION)
      session_mock = Mock(
          name="sagemaker_session",
          boto_session=boto_mock,
          boto_region_name=REGION,
          config=None,
          local_mode=False,
          default_bucket_prefix=None,
      )
      session_mock.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      session_mock.upload_data = Mock(
          name="upload_data",
          return_value="mocked_s3_uri_from_upload_data",
      )
      session_mock.download_data = Mock(name="download_data")
      session_mock.describe_monitoring_schedule = Mock(
          name="describe_monitoring_schedule",
          return_value=MONITORING_SCHEDULE_DESC,
      )
      session_mock.list_monitoring_alerts = Mock(
          name="list_monitoring_alerts",
          return_value={
              "MonitoringAlertSummaries": [
                  MONITORING_ALERT_SUMMARY,
              ],
              "NextToken": "next-token",
          },
      )
      session_mock.list_monitoring_alert_history = Mock(
          nam="list_monitoring_alert_history",
          return_value={
              "MonitoringAlertHistory": [
                  MONITORING_ALERT_HISTORY_SUMMARY,
              ],
              "NextToken": "next-token",
          },
      )
      session_mock.expand_role.return_value = ROLE
  
      # For tests which doesn't verify config file injection, operate with empty config
      session_mock.sagemaker_config = {}
      session_mock._append_sagemaker_config_tags = Mock(
          name="_append_sagemaker_config_tags",
          side_effect=lambda tags, config_path_to_tags: tags,
      )
      return session_mock
  
imports: from __future__ import absolute_import
  import copy
  import time
  from typing import Union
  import sagemaker
  import pytest
  from mock import Mock, patch, MagicMock
  from sagemaker.model_monitor import ModelMonitor, Constraints, CronExpressionGenerator, DefaultModelMonitor, EndpointInput, BatchTransformInput, ModelQualityMonitor, Statistics, MonitoringOutput, DataQualityMonitoringConfig, DataQualityDistributionConstraints
  from sagemaker.model_monitor.monitoring_alert import MonitoringAlertSummary, MonitoringAlertHistorySummary, MonitoringAlertActions, ModelDashboardIndicatorAction
  from sagemaker.network import NetworkConfig
  from sagemaker.model_monitor.dataset_format import MonitoringDatasetFormat, DatasetFormat
  from tests.unit import SAGEMAKER_CONFIG_MONITORING_SCHEDULE
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: session_mock