def sort_dict(d, desc=True):
sort = sorted(d.items(), key=lambda x: x[<NUM_LIT:1>], reverse=desc)<EOL>return OrderedDict(sort)<EOL>
Sort an ordered dictionary by value, descending.

Args:
    d (OrderedDict): An ordered dictionary.
    desc (bool): If true, sort desc.

Returns:
    OrderedDict: The sorted dictionary.