def remove_comment_lines(stream, comment_char="#"):
    """Removes commented out lines from stream, e.g., those starting with '#'.

    Parameters
    ----------
    stream : iterable of str
        Lines from which comments should be excluded.
    comment_char : str
        Lines beginning with this character will be excluded.

    Returns
    -------
    list of str
        Lines that do not begin with comment_char.

    """
    lines = list(stream)
    lines = filter(lambda x: not x.startswith(comment_char), lines)
    rules = "".join(lines)
    return rules