Reformat Python scripts
This is an automatic run of our scripts against the Ruff policy
in our repository at the time of this commit, applying fixes
Ruff was able to apply automatically.
Changes:
- conversion to modern f-strings
- conversion of f-strings without variables to static strings
- grouping and sorting imports
- removing of redundant parameters from open()
- adding consistent trailing commas at the end of lists
- removing trailing whitespaces
- formatting if-not clauses consistently
- deduplicating isinstance logic
- adding blank lines for consistent spacing
- removal of unused variables
- conversion of singleton comparisons to "is"
- adding consistent whitespaces before inline comments
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>