7.0: fix most flake8 errors

I did not work on the __unported__ modules
There's still an unused local variable but I don't think this is too bad. 
ok I tested this with raw flake8, so this was needed to remove the warning. Please undo the change if you dislike it.