Update the accumulator with the current play
        
        :returns: new tally
        :rtype: dict, ``{ 'period': per, 'time': clock, 'team': cumul, 'play': play }``
193583
def update(self, play):
        
        new_tally = { }
        #if any(isinstance(play.event, te) for te in self.trigger_event_types):
        if self._count_play(play):
            # the team who made the play / triggered the event
    
            team = self._get_team(play)

            try:
                self.total[team] += 1
            except:
                self.total[team] = 1
                self.teams.append(team)
                for i in range(len(self.tally)):
                    self.tally[i][team] = 0
      
            try:
                new_tally = { k:v for k,v in self.tally[len(self.tally)-1].items() }
                new_tally['period'] = play.period
                new_tally['time'] = play.time
                new_tally[team] += 1
                new_tally['play'] = play
            except:
                new_tally = {
                    'period': play.period,
                    'time': play.time,
                    team: 1,
                    'play': play
                }
      
            self.tally.append(new_tally)
      
        return new_tally
4560
def update(self, **kwargs):
        
        data = kwargs.get('data')
        if data is not None:
            if (util.pd and isinstance(data, util.pd.DataFrame) and
                list(data.columns) != list(self.data.columns) and self._index):
                data = data.reset_index()
            self.verify(data)
            kwargs['data'] = self._concat(data)
            self._count += 1
        super(Buffer, self).update(**kwargs)
1096545
def update(self, item):
        
        if item.matrix not in self.data:
            self.data[item.matrix] = []

        result = Select(self.data[item.matrix]).where(
            lambda entry: entry.stage == item.stage).build()

        if len(result) > 0:
            stage = result[0]
            stage.status = item.status
            stage.add(item.timestamp, item.information)
        else:
            stage = CollectorStage(stage=item.stage, status=item.status)
            stage.add(item.timestamp, item.information)
            self.data[item.matrix].append(stage)
1352288
function AdjustPlayForHiLoCount(playerCards, dealerCard, handValue, handCount, dealerCheckedBlackjack, options)
{
    var canSplit = (playerCards[0] == playerCards[1]) && (playerCards.length == 2) && (handCount < options.maxSplitHands);
    var canDouble = ((playerCards.length == 2) && ((handCount == 1) || options.doubleAfterSplit)) &&
                        ((handValue.total < options.doubleRange[0]) || (handValue.total > options.doubleRange[1]));
    var canSurrender = ((options.surrender == "early") || (options.surrender == "late")) && (playerCards.length == 2) && (handCount == 1);
    var surrenderMatrix = [
            {player: 14, dealer: 10, count: 3},
            {player: 15, dealer: 10, count: 0},
            {player: 15, dealer: 9, count: 2},
            {player: 15, dealer: 1, count: 1}
        ];

    // We may take insurance!
    if ((dealerCard == 1) && !dealerCheckedBlackjack && options.offerInsurance && (options.count.trueCount >= 3))
    {
        return "insurance";   
    }
    else if ((handValue.total == 16) && (dealerCard == 10) && (options.count.trueCount > 0))
    {
        return "stand";
    }
    else if ((handValue.total == 15) && (dealerCard == 10) && (options.count.trueCount > 4))
    {
        return "stand";
    }
    else if (canSplit && (handValue.total == 20))
    {
        if ((dealerCard == 5) && (options.count.trueCount >= 5))
        {
            return "split";
        }
        else if ((dealerCard == 6) && (options.count.trueCount >= 4))
        {
            return "split";
        }
    }
    else if (canDouble && (handValue.total == 10) && (dealerCard == 10) && (options.count.trueCount >= 4))
    {
        return "double";
    }
    else if ((handValue.total == 12) && (dealerCard == 3) && (options.count.trueCount >= 2))
    {
        return "stand";
    }
    else if ((handValue.total == 12) && (dealerCard == 2) && (options.count.trueCount >= 3))
    {
        return "stand";
    }
    else if (canDouble && (handValue.total == 11) && (dealerCard == 1) && (options.count.trueCount >= 1))
    {
        return "double";
    }
    else if (canDouble && (handValue.total == 9) && (dealerCard == 2) && (options.count.trueCount >= 1))
    {
        return "double";
    }
    else if (canDouble && (handValue.total == 10) && (dealerCard == 1) && (options.count.trueCount >= 4))
    {
        return "double";
    }
    else if (canDouble && (handValue.total == 9) && (dealerCard == 7) && (options.count.trueCount >= 3))
    {
        return "double";
    }
    else if ((handValue.total == 16) && (dealerCard == 9) && (options.count.trueCount >= 5))
    {
        return "stand";
    }
    else if ((handValue.total == 13) && (dealerCard == 2) && (options.count.trueCount < -1))
    {
        return "hit";
    }
    else if ((handValue.total == 12) && (dealerCard == 4) && (options.count.trueCount < 0))
    {
        return "hit";
    }
    else if ((handValue.total == 12) && (dealerCard == 5) && (options.count.trueCount < -2))
    {
        return "hit";
    }
    else if ((handValue.total == 12) && (dealerCard == 6) && (options.count.trueCount < -1))
    {
        return "hit";
    }
    else if ((handValue.total == 13) && (dealerCard == 3) && (options.count.trueCount < -2))
    {
        return "hit";
    }
    else if (canSurrender)
    {
        for (var i = 0; i < surrenderMatrix.length; i++)
        {
            if ((handValue.total == surrenderMatrix[i].player) && (dealerCard == surrenderMatrix[i].dealer)
                && (options.count.trueCount >= surrenderMatrix[i].count))
            {
                return "surrender";
            }
        }
    }

    // Nope, no adjustment
    return null;
}
514852
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi1*con.tind)
32699
def calculate_current_value(self):
        
        # must be recursive
        total = Decimal(0)
        for ac in self.classes:
            self.__calculate_current_value(ac)
            total += ac.curr_value
        self.total_amount = total
939952
def update_counter(period_type)
      column_from, column_to = self.class.columns_to_shift(period_type)
      return unless column_from && column_to

      self.update_attributes({
        column_to => self[column_from],
        column_from => 0
      })
    end
137801
def update(self):
        """"""
        # Init new stats
        stats = self.get_init_value()

        if self.input_method == 'local':
            for k, v in iteritems(self.glances_amps.update()):
                stats.append({'key': k,
                              'name': v.NAME,
                              'result': v.result(),
                              'refresh': v.refresh(),
                              'timer': v.time_until_refresh(),
                              'count': v.count(),
                              'countmin': v.count_min(),
                              'countmax': v.count_max()})
        else:
            # Not available in SNMP mode
            pass

        # Update the stats
        self.stats = stats

        return self.stats
180844
def compute_stats(self):
        
        if not self.__have_stats:
            if self.init_cs_teams and self.cum_stats:
                self.__init_cs_teams()
            
            for play in self._rep_reader.parse_plays_stream():
                p = Play(**play)
                self.__wrapped_plays.append(p)
                if self.cum_stats:
                    self.__process(p, self.cum_stats, 'update')
                self.__have_stats = True
                
        return self.cum_stats
336864
def update_total(self, n=1):
    """"""
    with self._lock:
      self._pbar.total += n
      self.refresh()
1234444
private Long computeUpdatedAmount(@Nullable Long currentAmount, @Nullable Long newAmount) {

        currentAmount = currentAmount == null ? 0L : currentAmount;
        newAmount = newAmount == null ? 0L : newAmount;

        if (usage.getUsageType() == UsageType.CAPACITY) {
            return Math.max(currentAmount, newAmount);
        } else /* UsageType.CONSUMABLE */ {
            return currentAmount + newAmount;
        }
    }
237649
def _get_consumed(self, time):
        
        minutes_from_last_update = self._get_minutes_from_last_update(time)
        if minutes_from_last_update < 0:
            raise ConsumptionDetailCalculateError('Cannot calculate consumption if time < last modification date.')
        _consumed = {}
        for consumable_item in set(list(self.configuration.keys()) + list(self.consumed_before_update.keys())):
            after_update = self.configuration.get(consumable_item, 0) * minutes_from_last_update
            before_update = self.consumed_before_update.get(consumable_item, 0)
            _consumed[consumable_item] = after_update + before_update
        return _consumed
76619
def print_tally(self):
        
        self.update_count = self.upload_count - self.create_count
        if self.test_run:
            print("Test run complete with the following results:")
        print("Skipped {0}. Created {1}. Updated {2}. Deleted {3}.".format(
            self.skip_count, self.create_count, self.update_count, self.delete_count))
1274602
def update_count(self):
        
        node_rating_count = self.node.rating_count
        node_rating_count.rating_count = self.node.rating_set.count()
        node_rating_count.rating_avg = self.node.rating_set.aggregate(rate=Avg('value'))['rate']

        # if all ratings are deleted the value will be None!
        if node_rating_count.rating_avg is None:
            # set to 0 otherwise we'll get an exception
            node_rating_count.rating_avg = 0

        node_rating_count.save()
425805
def update(self, name):
        

        if name is None:
            return

        if name not in self._names:
            # add the name if it isn't already tracked
            self._names[name] = len(self._names)

        result = self._names[name] - self._current
        self._current = self._names[name]
        return result
991821
def update(self):
        
        pos = self._amp * numpy.sin(self._freq * 2.0 * numpy.pi * self.elapsed_time +
                                    self._phase * numpy.pi / 180.0) + self._offset

        for m in self.motor_list:
            m.goal_position = pos
744320
def update_claim(self, claim, ttl=None, grace=None):
        
        return self._claim_manager.update(claim, ttl=ttl, grace=grace)