code: def test_cache_gets_stored_value():
      my_cache = cache.LRUCache[int, Union[int, str]](
          max_cache_items=5,
          expiration_horizon=datetime.timedelta(hours=1),
          retrieval_function=retrieval_function,
      )
  
      for i in range(5):
          my_cache.put(i)
  
      my_cache._retrieval_function = MagicMock()
      my_cache.get(4)
      my_cache._retrieval_function.assert_not_called()
  
      my_cache._retrieval_function.reset_mock()
      my_cache.get(5)
      my_cache._retrieval_function.assert_called_with(key=5, value=None)
  
      my_cache._retrieval_function.reset_mock()
      my_cache.get(0)
      my_cache._retrieval_function.assert_called_with(key=0, value=None)
  
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 7 for calling a global function with example usage: test_cache_gets_stored_value() without return types