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. 
`, False` is redunant, and could be fit on one line as 

```python
if not context.get('active_model') or not context.get('active_id'):
```

Also, note that the max line length is set to 120