python codes for olg models