<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, ignore_priority=False):
 """ method iterates over each reprocessing queues and re-submits UOW whose waiting time has expired """

        for process_name, q in self.reprocess_uows.items():
            self._flush_queue(q, ignore_priority)