yank shouldn't format buffer in python-mode. Defined <M-f12> to call whitespace-cleanup