core: flake8 fixes