def most_common(self, n=None):
        """Get the top *n* keys and counts as tuples. If *n* is omitted,
        returns all the pairs.
        """
        if n <= 0:
            return []
        ret = sorted(self.iteritems(), key=lambda x: x[1][0], reverse=True)
        if n is None or n >= len(ret):
            return ret
        return ret[:n]
dataset/ETHPy150Open mahmoud/boltons/boltons/cacheutils.py/ThresholdCounter.most_common/original