code: def test_create_resource_unexpected_error():
      # _create_resource returns ClientError
      with pytest.raises(ClientError):
          sagemaker.session._create_resource(
              _raise_unexpected_client_error
          )
  
file_path: sagemaker-python-sdk/tests/unit/test_endpoint_from_model_data.py
imports: from __future__ import absolute_import
  import pytest
  from botocore.exceptions import ClientError
  from mock import MagicMock, Mock
  from mock import patch
  from .common import _raise_unexpected_client_error, _raise_does_already_exists_client_error, _raise_does_not_exist_client_error
  import sagemaker
label_desc: Use image node_id 7 for calling a global function with example usage: test_create_resource_unexpected_error() without return types