python re-implementations of cpi and clock