fix coding style according to pep8

I used pylint to check errors on the changes, so I think there will be no regression.