code: def sagemaker_session():
      boto_mock = MagicMock(name="boto_session", region_name=REGION)
      ims = sagemaker.Session(
          sagemaker_client=MagicMock(name="sagemaker_client"),
          boto_session=boto_mock,
      )
      ims.sagemaker_client.describe_training_job = Mock(
          name="describe_training_job",
          return_value=TRAINING_JOB_RESPONSE,
      )
  
      ims.endpoint_from_model_data = Mock(
          "endpoint_from_model_data",
          return_value=ENDPOINT_FROM_MODEL_RETURNED_NAME,
      )
      return ims
  
imports: from __future__ import absolute_import
  import pytest
  from mock import MagicMock, Mock
  import sagemaker
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: ims