update the current score by adding it the specified number of points
323783
def incScore(self, pts):
        
        self.score += pts
        if self.score > self.best_score:
            self.best_score = self.score
488729
protected void updateFoundCount() {
		SpiderScan sc = this.getSelectedScanner();
		if (sc != null) {
			this.getFoundCountValueLabel().setText(Integer.toString(sc.getNumberOfURIsFound()));
		} else {
			this.getFoundCountValueLabel().setText(ZERO_REQUESTS_LABEL_TEXT);
		}
	}
1315712
def __update_rating(uid, rating):
        '''
        
        '''
        entry = TabPost.update(
            rating=rating
        ).where(TabPost.uid == uid)
        entry.execute()
1017912
def _update_data(self, new_data):
        """"""

        log.debug("Adding %d data points to data for %s" %
                  (len(new_data), self.path))
        if self._data is None:
            self._data = new_data
        else:
            if self.data_type.nptype is not None:
                data_pos = (
                    self._data_insert_position,
                    self._data_insert_position + len(new_data))
                self._data_insert_position += len(new_data)
                self._data[data_pos[0]:data_pos[1]] = new_data
            else:
                self._data.extend(new_data)
632220
public void addNewKernelPoint()
    {
        KernelPoint source = points.get(0);
        KernelPoint toAdd = new KernelPoint(k, errorTolerance);
        toAdd.setMaxBudget(maxBudget);
        toAdd.setBudgetStrategy(budgetStrategy);
        
        standardMove(toAdd, source);
        toAdd.kernelAccel = source.kernelAccel;
        toAdd.vecs = source.vecs;
        toAdd.alpha = new DoubleList(source.alpha.size());
        for (int i = 0; i < source.alpha.size(); i++)
            toAdd.alpha.add(0.0);
        points.add(toAdd);
    }
510583
def append(self, new_points_len):
        '''

        '''
        new_points_len = int(new_points_len)
        assert new_points_len >= 1, "Must at least append one point!"

        # find out start and stop index of the new memory
        try:
            new_points_start = self._slice_for_run_nr[-1][-1]
        except IndexError:
            new_points_start = 0
        new_points_stop  = new_points_start + new_points_len

        # store slice for new_points
        self._slice_for_run_nr.append( (new_points_start , new_points_stop) )

        if self.memleft < new_points_len: #need to allocate new memory
            self.memleft = 0
            #careful: do not use self._points because this may include unused memory
            self._points  = _np.vstack(  (self[:],_np.empty((new_points_len, self.dim)))  )
        else: #have enough memory
            self.memleft -= new_points_len

        # return reference to the new points
        return self._points[new_points_start:new_points_stop]
1259305
public int add(T label,float score) {
		int i = 0;
		int ret = i;
		if (n != 0) {
			for (i = 0; i < n; i++) {
				if (score > scores[i])
					break;
			}
			if (i != n || n < scores.length) {
				for (int k = n - 2; k >= i; k--) {
					scores[k + 1] = scores[k];
					labels[k + 1] = labels[k];
				}
				ret = i;
			}else	 if (n < scores.length)	{

			}else	{
				ret = -1;
			}
		}
		if(ret!=-1){
			scores[i] = score;
			labels[i] = label;
		}
		if (n < scores.length)
			n++;
		return ret;
	}
90053
function (extraPoints) {
		var points = this._originalPoints,
			len = points ? points.length : 0;
		// Increment length by extraPoints if present
		len += extraPoints || 0;

		return !this._originalPoints || len <= 3;
	}
766754
private void addPoint(int pos, int flag)
    {
        Point point = new Point();

        int len = insertPoints.points.length;
        if (len == 0) {
            insertPoints.points = new Point[FIRSTALLOC];
            len = FIRSTALLOC;
        }
        if (insertPoints.size >= len) { /* no room for new point */
            Point[] savePoints = insertPoints.points;
            insertPoints.points = new Point[len * 2];
            System.arraycopy(savePoints, 0, insertPoints.points, 0, len);
        }
        point.pos = pos;
        point.flag = flag;
        insertPoints.points[insertPoints.size] = point;
        insertPoints.size++;
    }
1141289
private void updateValue() {
        if (list != null) {
            int oldCount = this.count;
            this.count = list.getSelectedIndices().length;
            maybeNotifyListeners(oldCount, count);
        }
    }
1353318
def _update(self, data):
        """"""
        for k, v in six.iteritems(data):
            new_value = v
            if isinstance(v, dict):
                new_value = type(self)(v)
            elif isinstance(v, list):
                new_value = [(type(self)(e) if isinstance(e, dict) else e)
                             for e in v]
            setattr(self, k, new_value)
255070
def update_results(self, results):
        '''
        
        '''

        if not results:
            raise PickerResultException('Results unavailable')

        if results['sequence'] != self.sequence or results['season'] != self.season:
            raise PickerResultException('Results not updated, wrong season or week')

        completed = {g['home']: g for g in results['games'] if g['status'].startswith('F')}
        if not completed:
            return (0, None)

        count = 0
        for game in self.games.incomplete(home__abbr__in=completed.keys()):
            result = completed.get(game.home.abbr, None)
            if result:
                winner = result['winner']
                game.winner = (
                    game.home if game.home.abbr == winner
                    else game.away if game.away.abbr == winner else None
                )
                count += 1

        last_game = self.last_game
        if not self.points and last_game.winner:
            now = datetime_now()
            if now > last_game.end_time:
                result = completed.get(last_game.home.abbr, None)
                if result:
                    self.points = result['home_score'] + result['away_score']
                    self.save()

        if count:
            self.update_pick_status()

        return (count, self.points)
531185
def updateQTable( self, reward, current_state ):
        """"""
        
        # retrieve the old action value from the Q-table (indexed by the previous state and the previous action)
        old_q = self.q_table[self.prev_s][self.prev_a]
        
        # TODO: what should the new action value be?
        new_q = old_q
        
        # assign the new action value to the Q-table
        self.q_table[self.prev_s][self.prev_a] = new_q
1287674
def _update(self):
        """"""
        # Update possible values in each row, column and box.
        for i, (row, col, box) in enumerate(zip(self.row_iter(), self.col_iter(), self.box_iter())):
            self._poss_rows[i] = set(self._values).difference(set(row))
            self._poss_cols[i] = set(self._values).difference(set(col))
            self._poss_box[i] = set(self._values).difference(set(box))

        # Iterate over the entire Sudoku and combine information about possible values
        # from rows, columns and boxes to get a set of possible values for each cell.
        for i in utils.range_(self.side):
            self._possibles[i] = {}
            for j in utils.range_(self.side):
                self._possibles[i][j] = set()
                if self[i][j] > 0:
                    continue
                this_box_index = ((i // self.order) * self.order) + (j // self.order)
                self._possibles[i][j] = self._poss_rows[i].intersection(
                    self._poss_cols[j]).intersection(self._poss_box[this_box_index])
603989
function addPoints (x1, y1, x2, y2, cb) {
	var xFinal = x1 + x2;
	var yFinal = y1 + y2;
	cb(xFinal, yFinal);
}
886020
private void updateRemoveR() {
        for( int i = 1; i < n+1; i++ ) {
            for( int j = 0; j < n; j++ ) {
                double sum = 0;
                for( int k = i-1; k <= j; k++ ) {
                    sum += U_tran.data[i*m+k] * R.data[k*n+j];
                }
                R.data[(i-1)*n+j] = sum;
            }
        }
    }
1362358
def modify_colorpoint(self, n, position=0.5, color1=[1.0,1.0,1.0], color2=[1.0,1.0,1.0]):
        
        if    n==0.0                         : position = 0.0
        elif  n==len(self._colorpoint_list)-1: position = 1.0
        else: position = max(self._colorpoint_list[n-1][0], position)

        self._colorpoint_list[n] = [position, color1, color2]
        self.update_image()
        self.save_colormap("Last Used")