def update(self, value):
        """
        Adds a value to the sample.

        :type value: C{int} or C{float}
        :param value: the value to be added
        """
        if self.size == 0:
            return
        self._rescale_if_necessary()
        priority = self._weight(
            self.start_time - self.clock.time()) / random.random()
        new_counter = self.counter + 1
        self.counter = new_counter

        if new_counter <= self.size:
            self.values[priority] = value
            heapq.heappush(self.priorities, priority)
        else:
            first = heapq.heappop(self.priorities)
            if first < priority:
                if priority not in self.values:
                    self.values[priority] = value
                    heapq.heappush(self.priorities, priority)
                    while first not in self.values:
                        first = heapq.heappop(self.priorities)
                    del self.values[first]
            else:
                heapq.heappush(self.priorities, first)
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pyformance-0.3.2/pyformance/stats/samples.py/ExpDecayingSample.update/swapped operands of `-`