rename apply() to applyCommit(); apply is a python builtin