flake corrections on hooks.py
complete correction on flake8