code: def _prune_entries(self, num):
          "Pop entries from our access log until we popped ``num`` valid ones."
          while num > 0:
              self.access_log_lock.acquire()
              p = self.access_log.pop()
              self.access_log_lock.release()
  
              if not p.is_valid:
                  continue # Invalidated entry, skip
  
              dict.pop(self, p.key, None)
              self.access_lookup.pop(p.key, None)
              num -= f _prune_entries(self, num):
          "Pop entries from our access log until we popped ``num`` valid ones."
          while num > 0:
              self.access_log_lock.acquire()
              p = self.access_log.pop()
              self.access_log_lock.release()
  
              if not p.is_valid:
                  continue # Invalidated entry, skip
  
              dict.pop(self, p.key, None)
              self.access_lookup.pop(p.key, None)
              num -= 1
docs: Pop entries from our access log until we popped ``num`` valid ones.