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.create_model = Mock(name="create_model")
      ims.create_endpoint_config = Mock(name="create_endpoint_config")
      ims.create_endpoint = Mock(name="create_endpoint")
      return ims
  
file_path: sagemaker-python-sdk/tests/unit/test_endpoint_from_model_data.py
imports: from __future__ import absolute_import
  import pytest
  from botocore.exceptions import ClientError
  from mock import MagicMock, Mock
  from mock import patch
  from .common import _raise_unexpected_client_error, _raise_does_already_exists_client_error, _raise_does_not_exist_client_error
  import sagemaker
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: ims