import re


def is_input(line):
    """
    Determines whether or not a read in line contains an 
uncommented out \input{} statement. Allows only spaces between 
start of line and '\input{}'. 
    """
    #tex_input_re = r"""^\s*\\input{[^}]*}""" # input only 
    tex_input_re = r"""(^[^\%]*\\input{[^}]*})|(^[^\%]*\\include{[^}]*})""" # input or include
    return re.search(tex_input_re, line)