code: def test_removing_no_longer_compatible_cache_entries(
      tmp_path: Path,
      monkeypatch: MonkeyPatch,
      local_cache_creator: Callable[..., LocalTrainingCache],
      default_model_storage: ModelStorage,
  ):
      cache = local_cache_creator(tmp_path)
  
      # Cache an entry including serialized output which will be incompatible later
      fingerprint_key1 = uuid.uuid4().hex
      output1 = TestCacheableOutput({"something to cache": "dasdaasda"})
      output_fingerprint1 = uuid.uuid4().hex
      cache.cache_output(
          fingerprint_key1,
          output1,
          output_fingerprint1,
          default_model_storage,
      )
  
      # Cache an entry without serialized output which will be incompatible later
      fingerprint_key2 = uuid.uuid4().hex
      output_fingerprint2 = uuid.uuid4().hex
      cache.cache_output(
          fingerprint_key2,
          None,
          output_fingerprint2,
          default_model_storage,
      )
  
      # Cache a second entry with a newer Rasa version
      monkeypatch.setattr(rasa, "__version__", "99999.9.5")
      fingerprint_key3 = uuid.uuid4().hex
      output3 = TestCacheableOutput(
          {"something to cache2": "dasdaasda"}
      )
      output_fingerprint3 = uuid.uuid4().hex
  
      cache.cache_output(
          fingerprint_key3,
          output3,
          output_fingerprint3,
          default_model_storage,
      )
  
      # Pretend we updated Rasa Open Source to a no longer compatible version
      monkeypatch.setattr(
          rasa.engine.caching,
          "MINIMUM_COMPATIBLE_VERSION",
          "99999.8.10",
      )
  
      cache_run_by_future_rasa = LocalTrainingCache()
  
      # Cached fingerprints can no longer be retrieved
      assert (
          cache_run_by_future_rasa.get_cached_output_fingerprint(
              fingerprint_key1
          )
          is None
      )
      assert (
          cache_run_by_future_rasa.get_cached_output_fingerprint(
              fingerprint_key2
          )
          is None
      )
  
      assert (
          cache_run_by_future_rasa.get_cached_result(
              output_fingerprint1, "some_node", default_model_storage
          )
          is None
      )
      assert (
          cache_run_by_future_rasa.get_cached_result(
              output_fingerprint2, "some_node", default_model_storage
          )
          is None
      )
  
      # Entry 3 wasn't deleted from cache as it's still compatible
      assert (
          cache_run_by_future_rasa.get_cached_output_fingerprint(
              fingerprint_key3
          )
          == output_fingerprint3
      )
      restored = cache_run_by_future_rasa.get_cached_result(
          output_fingerprint3, "some_node", default_model_storage
      )
      assert isinstance(restored, TestCacheableOutput)
      assert restored == output3
  
      # Cached output of no longer compatible stuff was deleted from disk
      assert set(tmp_path.glob("*")) == {
          tmp_path / DEFAULT_CACHE_NAME,
          restored.cache_dir,
      }
  
imports: import dataclasses
  import logging
  import shutil
  import uuid
  from pathlib import Path
  from typing import Dict, Text, Optional, Any, Callable
  from unittest.mock import Mock
  import pytest
  from _pytest.logging import LogCaptureFixture
  from _pytest.monkeypatch import MonkeyPatch
  from sqlalchemy.exc import OperationalError
  import rasa.shared.utils.io
  import rasa.shared.utils.common
  from rasa.engine.caching import LocalTrainingCache, CACHE_LOCATION_ENV, DEFAULT_CACHE_NAME, CACHE_SIZE_ENV, CACHE_DB_NAME_ENV, TrainingCache
  import tests.conftest
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  from rasa.engine.storage.resource import Resource
  from rasa.engine.storage.storage import ModelStorage
label_desc: Use image node_id 9 for calling a global function with example usage: test_removing_no_longer_compatible_cache_entries(tmp_path, monkeypatch, local_cache_creator, default_model_storage) without return types