Reference implementation of the DNS-Class algorithm in Python