def counts(self,desc=None):
        '''Returns list of keys, sorted by values.
        Feed a 1 if you want a descending sort.'''
        i = map(lambda t: list(t),self.dict.items())
        map(lambda r: r.reverse(),i)
        i.sort()
        if desc:
            i.reverse()
        return i
Returns list of keys, sorted by values.
        Feed a 1 if you want a descending sort.
recipes/Python/52231_Count_items_sort/recipe-52231.py