Fix linting errors in cosmos.py
I was annoyed by Pylint errors in the cosmos.py code. I also found an actual error, by the way. ANd I had to wait for pipelines anyways.
This is by no means an important MR and can wait until the second user test is started.