def check_all_files(dir_path=theano.__path__[0], pattern='*.py'):
    """
    List all .py files under dir_path (theano path), check if they follow
    flake8 format, save all the error-formatted files into
    theano_filelist.txt. This function is used for generating
    the "whitelist_flake8" in this file.
    """

    with open('theano_filelist.txt', 'a') as f_txt:
        for (dir, _, files) in os.walk(dir_path):
            for f in files:
                if fnmatch(f, pattern):
                    error_num = flake8.main.check_file(os.path.join(dir, f),
                                                       ignore=ignore)
                    if 0 > error_num:
                        path = os.path.relpath(os.path.join(dir, f),
                                               theano.__path__[0])
                        f_txt.write('"' + path + '",\n')
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/tests/test_flake8.py/check_all_files/swapped operands of `>`