Fix import and syntax errors
|Reported by:||Owned by:||nobody|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Remove (some) unused imports, add some needed ones. And fix two
syntax errors reported: one is trailing whitespace at EOF, the
other CRLF endings. The CRLF endings are due to a missing svn:eol-style "native"
entry in the SVN repo, but in git there is no such setting.
All errors were reported by the pyflakes checker.