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. 
It should not be necessary to add `# noqa` here, `__init__.py` files don't check for unused imports.

I generally disapprove of adding `# noqa`