python implementations in prml