from heapq import nlargest
from application.lib import singleton


@singleton
class DictProvider(object):

    def top(self, obj, num):
        if num > len(obj):
            num = len(obj)
        return nlargest(num, obj, key=obj.get)

0a910926e24108b1c63d0aa6dd0b9885b392b6ba
<mask token>

<mask token>


@singleton
class DictProvider(object):
    <mask token>

<mask token>


@singleton
class DictProvider(object):

    def top(self, obj, num):
        if num > len(obj):
            num = len(obj)
        return nlargest(num, obj, key=obj.get)

from heapq import nlargest
from application.lib import singleton


@singleton
class DictProvider(object):

    def top(self, obj, num):
        if num > len(obj):
            num = len(obj)
        return nlargest(num, obj, key=obj.get)
