Using flake8 code F401, unused imports are output as lint errors from
acanist.
flake8 is preferred here over pylint because it offers more feature for
the long-term improvement. It could also throw pep8 errors but will not
fix them like autopep8 does, so better use both.
Based on core PR11835