fix syntax of python code block
python2.5 compatibility
pep8 for contrib