Most usecases for contextualize are to change the leaf context, i.e., there's often a pattern that looks like this:
new_ctx = setleafcontext(model.context, new_leaf)
new_model = contextualize(model, new_ctx)
Probably easiest to define setleafcontext(model, new_leaf) that will do this.