code: async def cancel_remaining(self):
          '''Cancel all remaining tasks.'''
          self._closed = True
          task_list = list(self._pending)
          for task in task_list:
              task.cancel()
          for task in task_list:
              with suppress(CancelledError):
                  await tasync def cancel_remaining(self):
          '''Cancel all remaining tasks.'''
          self._closed = True
          task_list = list(self._pending)
          for task in task_list:
              task.cancel()
          for task in task_list:
              with suppress(CancelledError):
                  await task
docs: Cancel all remaining tasks.