Fix flake8

ran "autopep8 --in-place --aggressive" on each file + manual fixes