code: def test_files_format(self):
      for file in list_all_py_files():
          try:
              print(file)
              code = _read_utf_8_file(file)
  
              # https://pypi.python.org/pypi/yapf/0.20.2#example-as-a-module
              diff, changed = FormatCode(
                  code,
                  filename=file,
                  style_config="setup.cfg",
                  print_diff=True,
              )
  
              if changed:
                  print(diff)
                  self.badly_formatted_files.append(file)
          except Exception as e:
              print(
                  "Error while processing file: `%s`\n"
                  "Error: %s" % (file, str(e))
              )
  
      with self.assertNotRaises(Exception):
          str_err = ""
  
          if self.badly_formatted_files:
              for filename in self.badly_formatted_files:
                  str_err += "yapf -i --style=setup.cfg %s\n" % filename
  
              str_err = (
                  "\n======================================================================================\n"
                  "Bad Coding Style: %d file(s) need to be formatted, run the following commands to fix: \n%s"
                  "======================================================================================"
                  % (len(self.badly_formatted_files), str_err)
              )
  
              raise Exception(str_err)
  
file_path: TensorLayer/tests/pending/test_yapf_format.py
imports: import sys
  import unittest
  from yapf.yapflib.yapf_api import FormatCode
  from tests.utils import CustomTestCase, list_all_py_files
label_desc: Use image node_id 2 for calling the YAPF_Style_Test obj's underlying member method code with example usage: obj.test_files_format() without return types