Remove unused import of urlencode and fix PEP8 issue.