def compare_two_files(file1, file2, except_l2_has=None, verbose=False):
    """ Compare 2 files, line by line
    Parameters
    ----------
    file1 : str
    file2 : str
    except_l2_has : str, optional
        String in line of file2 that make the test to be skipped
        Default is None

    Returns
    -------
    test : bool
      True if all lines are identical
    """
    f1 = open(file1, 'r')
    f2 = open(file2, 'r')
    lines1 = f1.readlines()
    lines2 = f2.readlines()
    q = 1
    test = True
    for l1, l2 in zip(lines1, lines2):
        if except_l2_has is not None:
            if except_l2_has in l2:
                continue
        sub_test = l1 == l2
        test &= sub_test
        if verbose & ~sub_test:
            print(
                """Line {} in file1 different than corresponding line {} in file2, details as follows:
{}different than:
{}
"""
                .format(q, q, l1, l2))
        q += 1
    f1.close()
    f2.close()
    return test
