code: def test_multi(eager):
      """Test caching with multiple objects"""
      cache = _ObjectCache(may_keep_one=eager)
  
      # max(A) = 0, so we we only cache when eager caching
      assert cache.cache_object("A", 1) == eager
      assert cache.num_cached_objects == int(eager)
  
      # max(B) = 0, so no caching
      assert not cache.cache_object("B", 5)
      assert cache.num_cached_objects == int(eager)
  
      # Increase maximums levels
      cache.increase_max("A", 1)
      cache.increase_max("B", 1)
  
      # Cache objects (A is already cached if eager)
      assert cache.cache_object("A", 1) != eager
      assert cache.cache_object("B", 5)
  
      # No further objects can be cached
      assert not cache.cache_object("A", 2)
      assert not cache.cache_object("B", 6)
  
      assert cache.num_cached_objects == 2
  
      # Decrease
      cache.decrease_max("A", 1)
  
      # Evict A object
      assert list(cache.flush_cached_objects()) == [1]
  
      cache.decrease_max("B", 1)
  
      # If eager, keep B object, otherwise, evict B
      assert list(cache.flush_cached_objects()) == (
          [5] if not eager else []
      )
      assert cache.num_cached_objects == (0 if not eager else 1)
  
imports: import pytest
  from ray.tune.utils.object_cache import _ObjectCache
label_desc: Use image node_id 2 for calling a global function with example usage: test_multi(eager) without return types