code: def sort_dict(d, desc=True):
  
      
  
      sort = sorted(d.items(), key=lambda x: x[1], reverse=desc)
      return OrderedDict(sort)
docs: Sort an ordered dictionary by value, descending.
  
      Args:
          d (OrderedDict): An ordered dictionary.
          desc (bool): If true, sort desc.
  
      Returns:
          OrderedDict: The sorted dictionary.