<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_model(self, model):
 """ Add a model to the document """

        if model.identity not in self._models.keys():
            self._models[model.identity] = model
        else:
            raise ValueError("{} has already been defined".format(model.identity))