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