Simplify the python example as with the Scala example