Python code style fixes

Some PEP 8 and Pylint fixes

For now we can live with two empty lines in some generated Python files