def handle_output(stream, log_file):
    """
    Continuously reads lines from a given stream and writes them to both
    standard output and a log file until the stream is exhausted.

    Args:
        stream (io.TextIOBase): The input stream to read lines from.
        log_file (io.TextIOBase): The log file to write lines to.

    Returns:
        None
    """
    while True:
        line = stream.readline()
        if not line:
            break
        sys.stdout.write(line)
        sys.stdout.flush()
        log_file.write(line)
        log_file.flush()

    Continuously reads lines from a given stream and writes them to both
    standard output and a log file until the stream is exhausted.

    Args:
        stream (io.TextIOBase): The input stream to read lines from.
        log_file (io.TextIOBase): The log file to write lines to.

    Returns:
        None
    
src/autotrain/cli/run_app.py