try to change prapmf into a python library