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.create_group = Mock(
          name="create_collection",
          return_value=CREATE_COLLECTION_RESPONSE,
      )
      session_mock.delete_resource_group = Mock(
          name="delete_resource_group", return_value=True
      )
      session_mock.list_group_resources = Mock(
          name="list_group_resources", return_value={}
      )
      session_mock.get_resource_group_query = Mock(
          name="get_resource_group_query",
          return_value=GROUP_QUERY_RESPONSE,
      )
      session_mock.sagemaker_client.describe_model_package_group = Mock(
          name="describe_model_package_group",
          return_value=DESCRIBE_MODEL_PACKAGE_GROUP,
      )
      return session_mock
  
file_path: sagemaker-python-sdk/tests/unit/test_collection.py
imports: from __future__ import absolute_import
  import pytest
  import json
  from mock import Mock
  from sagemaker.collection import Collection
label_desc: Use image node_id 1 for calling a global function with example usage: sagemaker_session() and returns: session_mock