code: def do_expire(self):
          
          # Deep copy to avoid RuntimeError: dictionary changed size during iteration
          _timeouts = deepcopy(self.timeouts)
          for key, value in _timeouts.items():
              if value - self.clock.now() < timedelta(0):
                  del self.timeouts[key]
                  # removing the expired key
                  if key in self.redis:
                      self.redis.pop(key, None)
docs: Expire objects assuming now == time