def check_style(filename):
    '''check style of filename.
    '''

    p = pep8.StyleGuide(quiet=True)
    report = p.check_files([filename])

    # count errors/warning excluding
    # those to ignore
    take = [y for x, y
            in report.counters.items() if IGNORE not in x]
    found = ['%s:%i' % (x, y) for x, y
             in report.counters.items() if x not in IGNORE]
    total = sum(take)
    ok_(total == 0,
        'pep8 style violations: %s' % ','.join(found))
dataset/ETHPy150Open CGATOxford/cgat/tests/test_style.py/check_style/swapped operands of `not in`