Set foldmethod for Python and PHP