conditional import and flake8