Update self.changes so that row numbers for edited rows are still correct.
        I.e., if row 4 was edited and then row 2 was deleted, row 4 becomes row 3.
        This function updates self.changes to reflect that.
962527
def update_changes_after_row_delete(self, row_num):
        
        if row_num in self.changes.copy():
            self.changes.remove(row_num)
        updated_rows = []
        for changed_row in self.changes:
            if changed_row == -1:
                updated_rows.append(-1)
            if changed_row > row_num:
                updated_rows.append(changed_row - 1)
            if changed_row < row_num:
                updated_rows.append(changed_row)
        self.changes = set(updated_rows)
1219621
private void update() {
                if (!uptodate) {
                        summary.clear();
                        distinctTraces.clear();
                        traces.clear();
                        addTraces(allTraces, false);
                        uptodate = true;
                }
        }
155957
def update(self, columns=(), by=(), where=(), **kwds):
        
        return self._seu('update', columns, by, where, kwds)
569491
private void updateValue() {
        if (table != null) {
            int oldCount = this.count;
            this.count = table.getRowCount();
            maybeNotifyListeners(oldCount, count);
        }
    }
1118297
def update_record(self, name, new_data, condition, update_only=False,
                      debug=False):
        
        # add numeric index column temporarily
        self.df['num'] = list(range(len(self.df)))
        df_data = self.df
        condition2 = (df_data.index == name)
        # edit first of existing data that meets condition
        if len(df_data[condition & condition2]) > 0:  #we have one or more records to update or delete
            # list of all rows where condition is true and index == name
            inds = df_data[condition & condition2]['num']
            #inds = df_data[condition]['num'] # list of all rows where condition is true
            existing_data = dict(df_data.iloc[inds.iloc[0]]) # get first record of existing_data from dataframe
            existing_data.update(new_data) # update existing data with new interpretations
            # update row
            self.update_row(inds.iloc[0], existing_data)
            # now remove all the remaining records of same condition
            if len(inds) > 1:
                for ind in inds[1:]:
                    print("deleting redundant records for:", name)
                    df_data = self.delete_row(ind)
        else:
            if update_only:
                print("no record found for that condition, not updating ", name)
            else:
                print('no record found - creating new one for ', name)
                # add new row
                df_data = self.add_row(name, new_data)
        # sort so that all rows for an item are together
        df_data.sort_index(inplace=True)
        # redo temporary index
        df_data['num'] = list(range(len(df_data)))
        self.df = df_data
        return df_data
462953
def _update_row_fields(self, form_name, row_id, attrs):
        '''
        
        '''
        if form_name not in self._forms or row_id >= len(self):
            return
        combined_row = self[row_id]
        form_row = combined_row.get_row_fields(form_name)

        for attr, value in attrs.items():
            setattr(form_row, attr, value)
        self.update(combined_row)
325805
@Override
	public void tableChanged(TableModelEvent e) {
		int rows = ((TableModel) e.getSource()).getRowCount();
		updateStatus(rows);
	}
127840
function updateDataTable() {
      var self = this;

      // Remove all data from the datatable.
      self.dataTable.removeRows(0, self.dataTable.getNumberOfRows());
      self.dataTable.removeColumns(0, self.dataTable.getNumberOfColumns());

      // Add
      _.each(self.columns, function (value) {
        self.dataTable.addColumn(value);
      });

      if (!_.isEmpty(self.rows)) {
        self.dataTable.addRows(self.rows);
      }
    }
688025
def ApplyEdit(self, row, col, grid):
        

        val = self._tc.GetValue()
        grid.GetTable().SetValue(row, col, val)  # update the table

        self.startValue = ''
        self._tc.SetValue('')
478494
def _convert_update_row(row):
    
    after_values = row['after_values']  # type: dict
    before_values = row['before_values']  # type: dict
    values = after_values
    return {
        'values': values,
        'updated_values': _get_updated_values(before_values, after_values)
    }
599907
def perform_update(self, data, instance):
        

        for key, val in data.items():
            setattr(instance, key, val)
307514
def number_of_changes(slots, events, original_schedule, X, **kwargs):
    
    changes = 0
    original_array = schedule_to_array(original_schedule, events=events,
                                       slots=slots)
    for row, event in enumerate(original_array):
        for col, slot in enumerate(event):
            if slot == 0:
                changes += X[row, col]
            else:
                changes += 1 - X[row, col]
    return changes
301736
def update(self, rows):
        
        if len(rows) == 0:
            return

        sql, sql_args = self.get_update_sql(rows)

        # get the cursor to execute the query
        cursor = self.get_cursor()

        # execute the query
        cursor.execute(sql, sql_args)
1094674
def _update_index(self):
         
        d = self.declaration
        self.index = self.view.model.index(d.row, d.column)
        if self.delegate:
            self._refresh_count += 1
            timed_call(self._loading_interval, self._update_delegate)
38032
def remove_row(self, row_num=None):
        
        #DeleteRows(self, pos, numRows, updateLabel
        if not row_num and row_num != 0:
            row_num = self.GetNumberRows() - 1
        label = self.GetCellValue(row_num, 0)
        self.DeleteRows(pos=row_num, numRows=1, updateLabels=True)

        # remove label from row_labels
        try:
            self.row_labels.remove(label)
        except ValueError:
            # if label name hasn't been saved yet, simply truncate row_labels
            self.row_labels = self.row_labels[:-1]
        self.row_items.pop(row_num)
        if not self.changes:
            self.changes = set()
        self.changes.add(-1)
        # fix #s for rows edited:
        self.update_changes_after_row_delete(row_num)
688122
def when_value_edited(self, *args, **kargs):
        
        if len(self.value) > self.instance_num:
            self.value.pop(-2)
            self.display()
1016250
public function updateTotals()
    {
        if (is_array($this->totals)) {
            foreach ($this->totals as $key => $val) {
                if (is_object($this->current_row[$key])) {
                    continue;
                }
                $this->totals[$key] = $val + $this->current_row[$key];
            }
        }
    }