Python assistants: fix some pep8 problems, remove unused imports, etc.