code: def sagemaker_session():
      boto_mock = Mock(name="boto_session", region_name=REGION)
      sms = Mock(
          name="sagemaker_session",
          boto_session=boto_mock,
          region_name=REGION,
          config=None,
          local_mode=False,
          s3_client=None,
          s3_resource=None,
          settings=SessionSettings(),
          default_bucket_prefix=None,
      )
      sms.boto_region_name = REGION
      sms.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      sms.sagemaker_client.describe_training_job = Mock(
          name="describe_training_job",
          return_value=DESCRIBE_TRAINING_JOB_RESULT,
      )
      sms.sagemaker_client.describe_endpoint = Mock(
          return_value=ENDPOINT_DESC
      )
      sms.sagemaker_client.describe_endpoint_config = Mock(
          return_value=ENDPOINT_CONFIG_DESC
      )
      # For tests which doesn't verify config file injection, operate with empty config
      sms.sagemaker_config = {}
      return sms
  
imports: from __future__ import absolute_import
  import pytest
  from mock import Mock, patch
  from sagemaker import image_uris
  from sagemaker.amazon.knn import KNN, KNNPredictor
  from sagemaker.amazon.amazon_estimator import RecordSet
  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: sms