<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cancel_queue(self):
 """ Cancel all requests in the queue so we can exit. """

        q = list(self.queue)
        self.queue = []
        log.debug("Canceling requests: {}".format(q))
        for req in q:
            req.response = APIServerNotRunningErrorResponse()
        for req in q:
            req.signal()