nodes: 0, module; 1, function_definition; 2, function_name:set_collection; 3, parameters; 4, block; 5, identifier:self; 6, identifier:collection; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, comment:"""Reset sort state, set collection and emit resetModel signal"""; 13, call; 14, assignment; 15, assignment; 16, call; 17, attribute; 18, argument_list; 19, attribute; 20, identifier:collection; 21, attribute; 22, tuple; 23, attribute; 24, argument_list; 25, identifier:self; 26, identifier:beginResetModel; 27, identifier:self; 28, identifier:collection; 29, identifier:self; 30, identifier:sort_state; 31, unary_operator; 32, False; 33, identifier:self; 34, identifier:endResetModel; 35, integer:1
code: 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()