degenerate_sets method is moved into the new module degeneracy.py