flake8 part 2 + style changes

in two parts because I’m too lazy and using the one-file-at-once GitHub online editor.