[Reviewer: Andy] Clean up almost all flake8 warnings from make verify

Andy, please can you review?

This is a pretty simple/tedious tidy-up of flake8 warnings (now done to just 2 remaining ones).  I've run UTs and live tests.

Matt