code: 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 error_num > 0:
                          path = os.path.relpath(
                              os.path.join(dir, f), theano.__path__[0]
                          )
                          f_txt.write('"' + path + '",\n')
  
file_path: Theano/theano/tests/test_flake8.py
imports: from __future__ import absolute_import, print_function, division
  from nose.plugins.skip import SkipTest
  import os
  import sys
  from fnmatch import fnmatch
  import theano
label_desc: Use image node_id 4 for calling a global function with example usage: check_all_files(dir_path, pattern) without return types