code: def sagemaker_session():
      boto_mock = MagicMock(name="boto_session", region_name=REGION)
      ims = sagemaker.Session(boto_session=boto_mock)
      ims.expand_role = Mock(return_value=EXPANDED_ROLE)
      return ims
  
file_path: sagemaker-python-sdk/tests/unit/test_create_deploy_entities.py
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