def eq_ignore_whitespace(a, b, msg=None):
    a = re.sub(r'^\s+?|\n', "", a)
    a = re.sub(r' {2,}', " ", a)
    b = re.sub(r'^\s+?|\n', "", b)
    b = re.sub(r' {2,}', " ", b)

    assert a == b, msg or "%r != %r" % (a, b)
dataset/ETHPy150Open zzzeek/sqlalchemy/lib/sqlalchemy/testing/assertions.py/eq_ignore_whitespace/original