Update to flake8 4.0.1. (#15636)
Discussion in #15299
Unblocks PR #15546
Summary of the issue:
The version of Flake8 we're using is extremely old. While it worked well up to now, it does not support some newer syntactic construct in recent versions of Python (in particular walrus operator). Unfortunately we cannot update to the latest release, since it does not support flake8-tabs, nor linting a diff (the latter can be achieved using external tools).
Description of user facing changes
None
Description of development approach
Flake8 is updated to the version 4.0.1. This is the last version which supports flake8-tabs, and it also recognizes various newer language constructs in Python, by the simple fact that it was released almost 2.5 years after the version we're using currently.