2-phase commit implemented in Python