code: def _guess_type(self, full_path):
          
          magic = self._match_magic(full_path)
          if magic is not None:
              return (mimetypes.guess_type(magic.old_path(full_path))[0]
                      or 'text/plain')
          else:
              return mimetypes.guess_type(full_path)[0] or 'text/plain'
docs: Guess the mime type magically or using the mimetypes module.