code: def test_caching(make_run: Callable[..., Run]) -> None:
      """
      Expects
      -------
      * Attempting to load the same predictions again will cause the result to be cached
      * Unloading the cache will cause it to reload and reread the predictions
      """
      run = make_run()
  
      assert len(run._cache) == 0
      first_load = run.predictions()  # Should cache result
      assert len(run._cache) == 1
  
      cache_load = run.predictions()  # Should use cache result
      assert len(run._cache) == 1
  
      # The should be the same object
      assert id(first_load) == id(cache_load)
  
      pickled_run = pickle.dumps(run)
      unpickled_run = pickle.loads(pickled_run)
  
      assert len(unpickled_run._cache) == 0
      unpickled_load = (
          unpickled_run.predictions()
      )  # Should have reloaded it
      assert len(unpickled_run._cache) == 1
  
      # Should not be the same object as before once pickled
      assert id(unpickled_load) != id(first_load)
  
file_path: auto-sklearn/test/test_ensemble_builder/test_run.py
imports: from __future__ import annotations
  from typing import Callable
  import pickle
  import time
  from pathlib import Path
  import numpy
  from autosklearn.ensemble_building import Run
  from pytest_cases import parametrize
label_desc: Use image node_id 6 for calling a global function with example usage: test_caching(make_run) without return types