* Upgrade pip dev packages * Fix formatting with black
* Automatic black fixes * Add conflicting rule exceptions between black and flake8
This is a separate function to chunked_qs to keep both functions simple and easy to read. Both functions contain some inherent complexity since they are windowing functions and it's important to not hide that below multiple conditional branches.