code: def test_default_bucket_s3_custom_bucket_input(
      sagemaker_session, datetime_obj, caplog
  ):
      sagemaker_session._default_bucket_name_override = (
          "custom-bucket-override"
      )
      error = ClientError(
          error_response={
              "Error": {"Code": "403", "Message": "Forbidden"}
          },
          operation_name="foo",
      )
      sagemaker_session.boto_session.resource(
          "s3"
      ).meta.client.head_bucket.side_effect = error
      # bucket exists
      sagemaker_session.boto_session.resource("s3").Bucket(
          name=DEFAULT_BUCKET_NAME
      ).creation_date = datetime_obj
      # This should not raise ClientError as no head_bucket call is expected for custom bucket
      sagemaker_session.default_bucket()
      assert (
          sagemaker_session._default_bucket == "custom-bucket-override"
      )
  
file_path: sagemaker-python-sdk/tests/unit/test_default_bucket.py
imports: from __future__ import absolute_import
  import datetime
  import pytest
  from botocore.exceptions import ClientError
  from mock import MagicMock
  import sagemaker
label_desc: Use image node_id 6 for calling a global function with example usage: test_default_bucket_s3_custom_bucket_input(sagemaker_session, datetime_obj, caplog) without return types