Solving Ruff linting issues
Same as autosubmit#1403
$ ruff check --statistics
119 F401 [*] unused-import
61 E712 [*] true-false-comparison
34 F841 [*] unused-variable
14 E722 [ ] bare-except
10 E711 [*] none-comparison
8 F405 [ ] undefined-local-with-import-star-usage
7 E701 [ ] multiple-statements-on-one-line-colon
4 F541 [*] f-string-missing-placeholders
3 E721 [ ] type-comparison
3 F811 [ ] redefined-while-unused
2 F403 [ ] undefined-local-with-import-star