pep8 and pyflakes3 compilant

Passed through autopep8
Checked with pep8
Checked with pyflakes3 and corrected accordingly