Fix some new pyflakes errors

New pyflakes version checks docstrings too. Fix all those erros and also make
the doctests prettier.

Change-Id: Ifb2b98209510103ee23c26f341cefb3ddf406adb