async def iter_lines(self, response):
        """Asynchronously iterate through the lines of a response"""
        it = response.iter_lines()

        def _next():
            try:
                return next(it)
            except StopIteration:
                # asyncio Future cannot have StopIteration as a result
                return

        while True:
            line = await self._submit(_next)
            if line is None:
                break
            else:
                yield line
Asynchronously iterate through the lines of a response
binderhub/tests/utils.py