mmlabpack.f90 but in python