'Accept changes'

def accept_changes(self):

    for ((i, j), value) in list(self.model.changes.items()):
        self.data[(i, j)] = value
    if (self.old_data_shape is not None):
        self.data.shape = self.old_data_shape
