    async def wait_for_death(self, timeout=10):
        """Wait for the single-user server to die, up to timeout seconds"""

        async def _wait_for_death():
            status = await self.poll()
            return status is not None

        try:
            r = await exponential_backoff(
                _wait_for_death,
                f'Process did not die in {timeout} seconds',
                start_wait=self.death_interval,
                timeout=timeout,
            )
            return r
        except AnyTimeoutError:
            return False
Wait for the single-user server to die, up to timeout seconds
jupyterhub/spawner.py