<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def flush(self):
 """remove all stale clients from pool"""

        now = time.time()
        to_remove = []
        for k, entry in self.pool.items():
            if entry.timestamp < now:
                entry.client.close()
                to_remove.append(k)
        for k in to_remove:
            del self.pool[k]