def line_count(filename):
    """Returns a count of the number of lines in the file, not counting
    comments or blank lines, for supported source code files.

    """
    lang = language(filename)
    comment, begin_block_comment, end_block_comment = COMMENT_SYNTAX[lang]
    count = 0
    is_comment = False
    with open(filename) as source:
        for line in source:
            line = line.strip()
            # Are we in a block comment?
            if begin_block_comment and line.startswith(begin_block_comment):
                if end_block_comment not in line[len(begin_block_comment):]:
                    is_comment = True
            elif is_comment and line in end_block_comment:
                is_comment = False
                line = ''    # so the comment-ending line is not counted

            if comment and line.startswith(comment):
                pass
            elif line and not is_comment:
                count += 1
    return count
dataset/ETHPy150Open the-xkcd-community/the-red-spider-project/src/level_up.py/line_count/swapped operands of `in`