parameters: (self, file_path)
docstring: Return the file type corresponding to the given file.
docstring_summary: Return the file type corresponding to the given file.
docstring_tokens: Return the file type corresponding to the given file .
function: def _file_type(self, file_path):
          """Return the file type corresponding to the given file."""
          file_extension = self._file_extension(file_path)
  
          if (file_extension in _CPP_FILE_EXTENSIONS) or (file_path == '-'):
              # FIXME: Do something about the comment below and the issue it
              #        raises since cpp_style already relies on the extension.
              #
              # Treat stdin as C++. Since the extension is unknown when
              # reading from stdin, cpp_style tests should not rely on
              # the extension.
              return FileType.CPP
          elif file_extension == _JSON_FILE_EXTENSION:
              return FileType.JSON
          elif file_extension == _PYTHON_FILE_EXTENSION:
              return FileType.PYTHON
          elif file_extension in _XML_FILE_EXTENSIONS:
              return FileType.XML
          elif file_extension == _XCODEPROJ_FILE_EXTENSION:
              return FileType.XCODEPROJ
          elif file_extension == _PNG_FILE_EXTENSION:
              return FileType.PNG
          elif ((not file_extension and os.path.join("Tools", "Scripts") in file_path) or
                file_extension in _TEXT_FILE_EXTENSIONS or os.path.basename(file_path) == 'TestExpectations'):
              return FileType.TEXT
          else:
              return FileType.NONE
function_tokens: def _file_type ( self , file_path ) : file_extension = self . _file_extension ( file_path ) if ( file_extension in _CPP_FILE_EXTENSIONS ) or ( file_path == '-' ) : # FIXME: Do something about the comment below and the issue it #        raises since cpp_style already relies on the extension. # # Treat stdin as C++. Since the extension is unknown when # reading from stdin, cpp_style tests should not rely on # the extension. return FileType . CPP elif file_extension == _JSON_FILE_EXTENSION : return FileType . JSON elif file_extension == _PYTHON_FILE_EXTENSION : return FileType . PYTHON elif file_extension in _XML_FILE_EXTENSIONS : return FileType . XML elif file_extension == _XCODEPROJ_FILE_EXTENSION : return FileType . XCODEPROJ elif file_extension == _PNG_FILE_EXTENSION : return FileType . PNG elif ( ( not file_extension and os . path . join ( "Tools" , "Scripts" ) in file_path ) or file_extension in _TEXT_FILE_EXTENSIONS or os . path . basename ( file_path ) == 'TestExpectations' ) : return FileType . TEXT else : return FileType . NONE