Ported to the new python KPI library