Main
In my use case, I need a way to delete runners that have been marked offline, usually because they were registered on an EC2/GCP instance that no longer exists. By adding an option to specify a scope to the runner list this becomes possible.
Because it's an optional argument and no "all" scope exists, I had to modify the way parameters are passed, and use a kwargs dict instead. I've tested this with project runners, but not group or instance runners.
I also added a shebang line at the top, unpinned the python-gitlab version (it was quite behind and the current python-gitlab-3.9.0 seems to work), and marked the script executable, but those are personal preferences I generally find useful.
Thanks for the script by the way, it's proving very useful when registering runners as part of a pool when this happens automatically as part of the boot process. I otherwise end up with an unmanageable number of dead runners when those machines are cycled out.