def add(self, key):
        """Increment the count of *key* by 1, automatically adding it if it
        does not exist.

        Cache compaction is triggered every *1/threshold* additions.
        """
        self.total += 1
        try:
            self._count_map[key][0] += 1
        except KeyError:
            self._count_map[key] = [1, self._cur_bucket - 1]

        if self._thresh_count % self.total == 0:
            self._count_map = dict([(k, v) for k, v in self._count_map.items()
                                    if sum(v) > self._cur_bucket])
            self._cur_bucket += 1
        return
dataset/ETHPy150Open mahmoud/boltons/boltons/cacheutils.py/ThresholdCounter.add/swapped operands of `%`