def remove_junk_from_filestream(
    lines, banner="-----oOo-----", comment_chars=["#", "!", "*"]
):
    """
    Removes comments, headers, and whitespace from a list of strings,
    parsed from a lagrit.out file.
    """
    newlines = []
    in_banner = False

    for line in lines:
        stripped = line.strip()

        if stripped == "":
            continue
        elif stripped[0] in comment_chars:
            continue
        elif banner in stripped:
            in_banner = not in_banner
        elif "log file: " in stripped:
            continue

        if not in_banner:
            newlines.append(stripped)

    return newlines[1:]