pep8: port script from master
pep8: W391 blank line at end of file
pep8: E703 statement ends with a semicolon
pep8: E111 indentation is not a multiple of four
pep8: W292 no newline at end of file
pep8: W293 blank line contains whitespace
pep8: E711 comparison to None should be 'if cond is None:'
pep8: E271 multiple spaces after keyword
pep8: E261 at least two spaces before inline comment
pep8: E222 multiple spaces after operator
pep8:  E713 test for membership should be 'not in'
pep8: E712 comparison to True should be 'if cond is True:' or 'if cond:'
pep8: E712 comparison to False should be 'if cond is False:' or 'if not cond:'
pep8: E225 missing whitespace around operator