That's basically a single-function utility which can be used to iterate through all possible equivalent electron configurations, and co,pose them back into term types.
There are algorithms to do that much faster by hand. Regardless, I just wanted to code that algo, as it feels a perfect job for PC.
Oh yeah, and name is a YuruYuri reference, 'cause why not.