<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(self, *args, **kwargs):
 """Manually cancel all tasks assigned to this event loop."""

        # Because remove all futures will trigger `set_result`,
        # we cancel itself first.
        super().cancel()
        for future in self.traverse():
            # All cancelled futures should have callbacks to removed itself
            # from this linked list. However, these callbacks are scheduled in
            # an event loop, so we could still find them in our list.
            if not future.cancelled():
                future.cancel()