nodes: 0, module; 1, function_definition; 2, function_name:sort_dict; 3, parameters; 4, block; 5, identifier:d; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, identifier:desc; 11, True; 12, comment:"""
      Sort an ordered dictionary by value, descending.
  
      Args:
          d (OrderedDict): An ordered dictionary.
          desc (bool): If true, sort desc.
  
      Returns:
          OrderedDict: The sorted dictionary.
      """; 13, assignment; 14, call; 15, identifier:sort; 16, call; 17, identifier:OrderedDict; 18, argument_list; 19, identifier:sorted; 20, argument_list; 21, identifier:sort; 22, call; 23, keyword_argument; 24, keyword_argument; 25, attribute; 26, argument_list; 27, identifier:key; 28, lambda; 29, identifier:reverse; 30, identifier:desc; 31, identifier:d; 32, identifier:items; 33, lambda_parameters; 34, subscript; 35, identifier:x; 36, identifier:x; 37, integer:1
code: def sort_dict(d, desc=True):
  
      """
      Sort an ordered dictionary by value, descending.
  
      Args:
          d (OrderedDict): An ordered dictionary.
          desc (bool): If true, sort desc.
  
      Returns:
          OrderedDict: The sorted dictionary.
      """
  
      sort = sorted(d.items(), key=lambda x: x[1], reverse=desc)
      return OrderedDict(sort)