<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(self, future):
 """Terminates the subscription given by a future Args: future (Future):
 The future of the original subscription """

        assert future not in self._pending_unsubscribes, \
            "%r has already been unsubscribed from" % \
            self._pending_unsubscribes[future]
        subscribe = self._requests[future]
        self._pending_unsubscribes[future] = subscribe
        # Clear out the subscription
        self._subscriptions.pop(subscribe.id)
        request = Unsubscribe(subscribe.id)
        request.set_callback(self._q.put)
        try:
            controller = self.get_controller(subscribe.path[0])
        except ValueError:
            # Controller has already gone, probably during tearDown
            pass
        else:
            self.handle_request(controller, request)