code: def test_format_flake8():
      # Test if flake8 is respected.
      if not flake8_available:
          raise SkipTest("flake8 is not installed")
      total_errors = 0
  
      files_to_checks = []
      for path in list_files():
          rel_path = os.path.relpath(path, theano.__path__[0])
          if sys.platform == "win32":
              rel_path = rel_path.replace("\\", "/")
          if rel_path in whitelist_flake8:
              continue
          else:
              files_to_checks.append(path)
  
      if new_flake8:
          guide = flake8.api.legacy.get_style_guide(ignore=ignore)
          r = guide.check_files(files_to_checks)
          total_errors = r.total_errors
      else:
          for path in files_to_checks:
              error_num = flake8.main.check_file(path, ignore=ignore)
              total_errors += error_num
  
      if total_errors > 0:
          raise AssertionError("FLAKE8 Format not respected")
  
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 2 for calling a global function with example usage: test_format_flake8() without return types