python version of MAnorm