<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_for_futures(self):
 """ Wait for all futures to complete. This should be done at the end of an an invocation. """

        [future for future in futures.as_completed(self.futures)]
        self.futures = []