Rewrite the thing in Python.