code: def test_info():
      seed(1234)  # random seed
  
      caches = [
          rr_cache,
          mru_cache,
          lru_cache,
          lfu_cache,
          inf_cache,
          no_cache,
      ]
  
      # clean-up
      if os.path.exists("cache.pkl"):
          os.remove("cache.pkl")
  
      # print ("WITHOUT ARCHIVE")
      results = [
          _test_hits(cache, maxsize=100, rangelimit=20, tries=100)
          for cache in caches
      ]
      x = results[0]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          16,
          84,
          0,
          100,
          84,
      )
      x = results[1]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          12,
          88,
          0,
          100,
          88,
      )
      x = results[2]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          11,
          89,
          0,
          100,
          89,
      )
      x = results[3]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          11,
          89,
          0,
          100,
          89,
      )
      x = results[4]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          11,
          89,
          0,
          None,
          89,
      )
      x = results[5]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          0,
          100,
          0,
          0,
          0,
      )
      # for cache in caches:
      #    msg = cache.__name__ + ":"
      #    msg += "%s" % str(_test_hits(cache, maxsize=100,
      #                                 rangelimit=20, tries=100))
      #    print (msg)
  
      # print ("\nWITH ARCHIVE")
      results = [
          _test_hits(
              cache,
              maxsize=100,
              rangelimit=20,
              tries=100,
              archived=True,
          )
          for cache in caches
      ]
      # clean-up
      if os.path.exists("cache.pkl"):
          os.remove("cache.pkl")
  
      x = results[0]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          11,
          89,
          0,
          100,
          89,
      )
      x = results[1]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          10,
          66,
          24,
          100,
          90,
      )
      x = results[2]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          10,
          58,
          32,
          100,
          90,
      )
      x = results[3]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          10,
          37,
          53,
          100,
          90,
      )
      x = results[4]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          5,
          37,
          58,
          None,
          95,
      )
      x = results[5]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          0,
          25,
          75,
          0,
          0,
      )
      # for cache in caches:
      #    msg = cache.__name__ + ":"
      #    msg += "%s" % str(_test_hits(cache, maxsize=100,
      #                                 rangelimit=20, tries=100, archived=True))
      #    print (msg)
  
      ### again, w/o purging ###
  
      # clean-up
      if os.path.exists("cache.pkl"):
          os.remove("cache.pkl")
  
      # print ("WITHOUT ARCHIVE")
      results = [
          _test_hits(cache, maxsize=50, rangelimit=20, tries=100)
          for cache in caches
      ]
      x = results[0]
      maxsize = x.maxsize
      assert x.size == x.maxsize  # skip due to hash randomization
      x = results[1]
      assert x.size == x.maxsize  # skip due to hash randomization
      x = results[2]
      assert x.size == x.maxsize  # skip due to hash randomization
      x = results[3]
      assert x.size <= x.maxsize  # skip due to hash randomization
      x = results[4]
      assert x.size > maxsize  # skip due to hash randomization
      x = results[5]
      assert (x.hit, x.miss, x.load, x.maxsize, x.size) == (
          0,
          100,
          0,
          0,
          0,
      )
      # for cache in caches:
      #    msg = cache.__name__ + ":"
      #    msg += "%s" % str(_test_hits(cache, maxsize=50,
      #                                 rangelimit=20, tries=100))
      #    print (msg)
  
      # print ("\nWITH ARCHIVE")
      results = [
          _test_hits(
              cache, maxsize=50, rangelimit=20, tries=100, archived=True
          )
          for cache in caches
      ]
      # clean-up
      if os.path.exists("cache.pkl"):
          os.remove("cache.pkl")
  
      x = results[0]
      assert x.size <= x.maxsize  # skip due to hash randomization
      x = results[1]
      assert x.size <= x.maxsize  # skip due to hash randomization
      x = results[2]
      assert x.size <= x.maxsize  # skip due to hash randomization
      x = results[3]
      assert x.size <= x.maxsize  # skip due to hash randomization
      x = results[4]
      assert x.size > maxsize  # skip due to hash randomization
      x = results[5]
      assert x.hit == x.maxsize == x.size
  
imports: from klepto.archives import file_archive
  from random import choice, seed
  import os
  import sys
  from klepto import *
label_desc: Use image node_id 2 for calling a global function with example usage: test_info() without return types