async def METHOD_NAME(self, process: asyncio.subprocess.Process) -> None:
    assert process.stdin
    assert process.stdout
    messages: List[str] = []
    async for line in process.stdout:
        logger.debug('Read line from helper: %s', line)
        command, _, value = line.strip().decode().partition(' ')
        # usually: PAM_PROMPT_ECHO_OFF Password: \n
        if command.startswith('PAM_PROMPT'):
            # Don't pass this to the UI if it's "Password" (the usual case),
            # so that superuser.py uses the translated default
            if value.startswith('Password'):
                value = ''
            # flush out accumulated info/error messages
            passwd = await self.responder.do_askpass('\n'.join(messages), value, '')
            messages.clear()
            if passwd is None:
                logger.debug('got PAM_PROMPT %s, but do_askpass returned None', value)
                raise asyncio.CancelledError('no password given')
            logger.debug('got PAM_PROMPT %s, do_askpass returned a password', value)
            process.stdin.write(passwd.encode())
            process.stdin.write(b'\n')
            del passwd  # don't keep this around longer than necessary
            await process.stdin.drain()
            logger.debug('got PAM_PROMPT, wrote password to helper')
        elif command in ('PAM_TEXT_INFO', 'PAM_ERROR'):
            messages.append(value)
        elif command == 'SUCCESS':
            logger.debug('Authentication succeeded')
            break
        elif command == 'FAILURE':
            logger.warning('Authentication failed')
            break
        else:
            logger.warning('Unknown line from helper, aborting: %s', line)
            process.terminate()
            break