def walk(fil):
    line = fil.readline()
    in_header = False

    # allow the normal magic header lines (such as encoding), but
    # don't consider them part of the diffscuss file.
    while line.startswith("#") and not _is_diffscuss_line(line):
        line = fil.readline()

    while True:

        if not line:
            break

        if _is_diffscuss_line(line):
            if in_header:
                raise CommentInHeaderException()
            tagged_comment_lines, line = _read_comment(line, fil)
            for tag, comment_line in tagged_comment_lines:
                yield (tag, comment_line)
            # continue so we don't read another line at the bottom
            continue
        elif in_header or _is_not_diff_line(line):
            # check for non-diff line has to come second, since the
            # --- and +++ in the header will read as diff lines
            # otherwise
            yield (DIFF_HEADER, line)
            in_header = not _is_range_line(line)
        else:
            yield (DIFF, line)

        line = fil.readline()
Same as assert_true(isinstance(obj, cls)), with a nicer default
dataset/ETHPy150Open hut8labs/diffscuss/diffscuss/walker.py/walk--crossover with--dataset/ETHPy150Open JetBrains/python-skeletons/nose/tools/__init__.py/assert_is_instance