code: def _preferred_filetype(self, filetypes):
          
          if not isinstance(filetypes, list):
              filetypes = [filetypes]
  
          # look through the file types and use the first one that we have loaded
          for filetype in filetypes:
              if filetype in self.file_handlers:
                  return filetype
          return None
docs: Get the preferred filetype out of the *filetypes* list.
  
          At the moment, it just returns the first filetype that has been loaded.