code: def test_weakref_lru_cache(self):
      @weakref_lru_cache
      def example_cached_fn(key):
          return object()
  
      class Key:
          def __init__(self):
              # Make a GC loop.
              self.ref_loop = [self]
  
      stable_keys = [Key() for _ in range(2049)]
      for i in range(10000):
          example_cached_fn(stable_keys[i % len(stable_keys)])
          example_cached_fn(Key())
  
file_path: jax/tests/util_test.py
imports: import operator
  from absl.testing import absltest
  from jax._src import linear_util
  from jax._src import test_util
  from jax._src import util
  from jax import config
  from jax._src.util import weakref_lru_cache
label_desc: Use image node_id 2 for calling the UtilTest obj's underlying member method code with example usage: obj.test_weakref_lru_cache() and returns: object