code: def shrink (self):
          
          trim = int(0.05*len(self))
          if trim:
              items = super(LFUCache, self).items()
              # sorting function for items
              keyfunc = lambda x: x[1][0]
              values = sorted(items, key=keyfunc)
              for item in values[0:trim]:
                  del self[item[0]]
docs: Shrink ca. 5% of entries.