Deleted trailing whitespace
Fixed pyflakes import errors
Fixed pyflakes warning regarding param being shadowed by loop variable