def texts_are_equivalent(texta, textb):
    """Compares two program texts by removing all identation and
    blank lines first."""

    def normalized_lines(text):
        for l in text.splitlines():
            l = l.strip()
            if l:
                yield l

    texta = "\n".join(normalized_lines(texta))
    textb = "\n".join(normalized_lines(textb))
    return texta == textb