def _collapse_false(explanation):
    """Collapse expansions of False

    So this strips out any "assert False\n{where False = ...\n}"
    blocks.
    """
    where = 0
    while True:
        start = where = explanation.find("False\n{False = ", where)
        if where == -1:
            break
        level = 0
        for i, c in enumerate(explanation[start:]):
            if c == "{":
                level += 1
            elif c == "}":
                level -= 1
                if not level:
                    break
        else:
            raise AssertionError("unbalanced braces: %r" % (explanation,))
        end = start + i
        where = end
        if explanation[end - 1] == '\n':
            explanation = (explanation[:start] + explanation[start+15:end-1] +
                           explanation[end+1:])
            where -= 17
    return explanation