<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def wait_stop(self):
 """ Stop the stream and wait for it to stop. See :meth:`stop` for the general stopping conditions. You can assume that :meth:`stop` is the first thing this coroutine calls. """

        if not self.running:
            return
        self.stop()
        try:
            yield from self._task
        except asyncio.CancelledError:
            pass