pep8 and pyflakes applied

I didn't do anything with line length yet.
logger should not defined here as a built-in customized logger is injected to global namespace for capture the logs. So the CI broken.