code: def test_cache_bad_retrieval_function():
      cache_no_retrieval_fx = cache.LRUCache[int, Union[int, str]](
          max_cache_items=5,
          expiration_horizon=datetime.timedelta(hours=1),
          retrieval_function=None,
      )
  
      with pytest.raises(TypeError):
          cache_no_retrieval_fx.put(1)
  
      cache_bad_retrieval_fx_signature = cache.LRUCache[
          int, Union[int, str]
      ](
          max_cache_items=5,
          expiration_horizon=datetime.timedelta(hours=1),
          retrieval_function=lambda: 1,
      )
  
      with pytest.raises(TypeError):
          cache_bad_retrieval_fx_signature.put(1)
  
      cache_retrieval_fx_throws = cache.LRUCache[int, Union[int, str]](
          max_cache_items=5,
          expiration_horizon=datetime.timedelta(hours=1),
          retrieval_function=lambda key, value: exec(
              "raise(RuntimeError())"
          ),
      )
  
      with pytest.raises(RuntimeError):
          cache_retrieval_fx_throws.put(1)
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/utilities/test_cache.py
imports: from __future__ import absolute_import
  from typing import Optional, Union
  from mock.mock import MagicMock, patch
  import pytest
  from sagemaker.utilities import cache
  import datetime
label_desc: Use image node_id 8 for calling a global function with example usage: test_cache_bad_retrieval_function() without return types