<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unsubscribe_all(self, callback=False):
 """Send an unsubscribe for all active subscriptions"""

        futures = ((f, r) for f, r in self._requests.items()
                   if isinstance(r, Subscribe)
                   and f not in self._pending_unsubscribes)
        if futures:
            for future, request in futures:
                if callback:
                    log.warn("Unsubscribing from %s", request.path)
                    cothread.Callback(self.unsubscribe, future)
                else:
                    self.unsubscribe(future)