Fix Python files to be flake8-compliant