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. 
Should not be necessary