flake8 style conventions fixes

If you are interested in a subset of these changes - let me know and I'll be happy to make an appropriate commit/pull request.