code: def clean_cache(self):
          
          now = int(time.time())
          t_to_del = []
          for timestamp in self.cache:
              if timestamp < now:
                  t_to_del.append(timestamp)
          for timestamp in t_to_del:
              del self.cache[timestamp]
  
          # same for the invalid cache
          t_to_del = []
          for timestamp in self.invalid_cache:
              if timestamp < now:
                  t_to_del.append(timestamp)
          for timestamp in t_to_del:
              del self.invalid_cache[timestamp]
docs: Clean cache with entries older than now because not used in future ;)
  
          :return: None