Modify config.py for combining the same condition code

I read the config.py. I found a large number of duplicate conditions if / elif. So I combined that can be placed under a condition code