code: def sagemaker_session_custom_endpoint():
      boto_session = Mock("boto_session")
      resource_mock = Mock("resource")
      client_mock = Mock("client")
      boto_attrs = {"region_name": "us-east-1"}
      boto_session.configure_mock(**boto_attrs)
      boto_session.resource = Mock(
          name="resource", return_value=resource_mock
      )
      boto_session.client = Mock(
          name="client", return_value=client_mock
      )
  
      local_session = sagemaker.local.local_session.LocalSession(
          boto_session=boto_session, s3_endpoint_url=ENDPOINT_URL
      )
  
      local_session.default_bucket = Mock(
          name="default_bucket", return_value=BUCKET_NAME
      )
      return local_session
  
imports: from __future__ import absolute_import
  import jsonschema
  import pytest
  import urllib3
  import os
  from botocore.exceptions import ClientError
  from mock import Mock, patch
  from tests.unit import DATA_DIR, SAGEMAKER_CONFIG_SESSION
  import sagemaker
  from sagemaker.workflow.parameters import ParameterString
  from sagemaker.workflow.pipeline import Pipeline
  from tests.unit.sagemaker.workflow.helpers import CustomStep
  from sagemaker.local.local_session import LocalSession
  from sagemaker.local.entities import _LocalPipelineExecution
label_desc: Use image node_id 29 for calling a global function with example usage: sagemaker_session_custom_endpoint() and returns: local_session