code: def test_resource_with_model_storage(
      default_model_storage: ModelStorage,
      tmp_path: Path,
      temp_cache: TrainingCache,
  ):
      node_name = "some node"
      resource = Resource(node_name)
      test_filename = "persisted_model.json"
      test_content = {"epochs": 500}
  
      with default_model_storage.write_to(
          resource
      ) as temporary_directory:
          rasa.shared.utils.io.dump_obj_as_json_to_file(
              temporary_directory / test_filename, test_content
          )
  
      test_fingerprint_key = uuid.uuid4().hex
      test_output_fingerprint_key = uuid.uuid4().hex
      temp_cache.cache_output(
          test_fingerprint_key,
          resource,
          test_output_fingerprint_key,
          default_model_storage,
      )
  
      new_model_storage_location = tmp_path / "new_model_storage"
      new_model_storage_location.mkdir()
      new_model_storage = LocalModelStorage(new_model_storage_location)
      restored_resource = temp_cache.get_cached_result(
          test_output_fingerprint_key, node_name, new_model_storage
      )
  
      assert isinstance(restored_resource, Resource)
      assert restored_resource == restored_resource
  
      with new_model_storage.read_from(
          restored_resource
      ) as temporary_directory:
          cached_content = rasa.shared.utils.io.read_json_file(
              temporary_directory / test_filename
          )
          assert cached_content == test_content
  
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 15 for calling a global function with example usage: test_resource_with_model_storage(default_model_storage, tmp_path, temp_cache) without return types