code: def test_objects_removed_after_keepalive(self):
      _cache = interfaces.cache._Cache()
  
      key = "the key"
  
      test_array = numpy.random.randn(16)
      obj = builders.fft(test_array)
      _cache.insert(obj, key)
  
      self.assertIs(_cache.lookup(key), obj)
  
      keepalive_time = _cache.keepalive_time
  
      if os.name == "nt" or sys.platform == "darwin":
          # increase sleep time to address random test failures on CI
          time.sleep(keepalive_time * 8)
      else:
          # Relax a bit more otherwise
          time.sleep(keepalive_time * 4)
  
      self.assertRaises(KeyError, _cache.lookup, key)
  
      _cache.insert(obj, key)
      old_keepalive_time = _cache.keepalive_time
      _cache.set_keepalive_time(old_keepalive_time * 4)
  
      self.assertIs(_cache.lookup(key), obj)
  
      time.sleep(old_keepalive_time * 3.5)
      # still should be there
      self.assertIs(_cache.lookup(key), obj)
  
      time.sleep(old_keepalive_time * 16)
  
      self.assertRaises(KeyError, _cache.lookup, key)
  
imports: import copy
  import sys
  from pyfftw import interfaces, builders
  import pyfftw
  import numpy
  import numpy
  import unittest
  from .test_pyfftw_base import run_test_suites, miss
  from .test_pyfftw_numpy_interface import InterfacesNumpyFFTTestFFT
  import threading
  import time
  import os
  import hashlib
label_desc: Use image node_id 7 for calling the CacheTest obj's underlying member method code with example usage: obj.test_objects_removed_after_keepalive() without return types