code: def pipeline_session():
      client_mock = Mock()
      client_mock._client_config.user_agent = "Boto3/1.14.24 Python/3.8.5 Linux/5.4.0-42-generic Botocore/1.17.24 Resource"
      client_mock.describe_model.return_value = {
          "PrimaryContainer": {"Image": IMAGE_URI}
      }
      role_mock = Mock()
      type(role_mock).arn = PropertyMock(return_value=ROLE)
      resource_mock = Mock()
      resource_mock.Role.return_value = role_mock
      session_mock = Mock(region_name=REGION)
      session_mock.resource.return_value = resource_mock
      session_mock.client.return_value = client_mock
      return PipelineSession(
          boto_session=session_mock,
          sagemaker_client=client_mock,
          default_bucket=S3_BUCKET,
      )
  
imports: from __future__ import absolute_import
  import pytest
  from mock import MagicMock, Mock, patch, PropertyMock
  from sagemaker.session_settings import SessionSettings
  from sagemaker.transformer import _TransformJob, Transformer
  from sagemaker.workflow.pipeline_context import PipelineSession, _PipelineConfig
  from sagemaker.inputs import BatchDataCaptureConfig
  from sagemaker.workflow.pipeline_definition_config import PipelineDefinitionConfig
  from tests.integ import test_local_mode
  from tests.unit import SAGEMAKER_CONFIG_TRANSFORM_JOB
label_desc: Use image node_id 3 for calling a global function with example usage: pipeline_session() and returns: PipelineSession