Changes format and indents for pep8

This is changes in code formating and indentation
to comply with pep8 standard.

It follows current setting in tox.ini for pep8 (flake8).

I skipped errors like:
* F821 undefined name
* H302 import only modules