Cleaned up code in anticipation of flake8.

Change-Id: Id710edb1a82110653e783fed13cd589cab75f38a
Migrate to flake8.

Fixes bug 1172444.

Change-Id: Icd6c41f9f5b799ed0b121dc3a3af9d4304fa0eff