<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_collection(self, collection):
 """Reset sort state, set collection and emit resetModel signal"""

        self.beginResetModel()
        self.collection = collection
        self.sort_state = (-1, False)
        self.endResetModel()