<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def associate_model(model, field):
 """ Return the model associate to the ForeignKey or ManyToMany relation """

    class_field = model._meta.get_field(field)
    if hasattr(class_field, "field"):
        return class_field.field.related.related_model
    else:
        return class_field.related_model