code function

Extract the code from a model