python implementation of ms compression algorithms