A python port of @holman's spark