code: async def next_done(self):
          '''Returns the next completed task.  Returns None if no more tasks
          remain. A TaskGroup may also be used as an asynchronous iterator.
          '''
          if not self._done and self._pending:
              self._done_event.clear()
              await self._done_event.wait()
          if self._done:
              return self._done.popleft()
          return Nonync def next_done(self):
          '''Returns the next completed task.  Returns None if no more tasks
          remain. A TaskGroup may also be used as an asynchronous iterator.
          '''
          if not self._done and self._pending:
              self._done_event.clear()
              await self._done_event.wait()
          if self._done:
              return self._done.popleft()
          return None
docs: Returns the next completed task.  Returns None if no more tasks
          remain. A TaskGroup may also be used as an asynchronous iterator.