nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:attr; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""Sort the ratings based on an attribute"""; 11, assignment; 12, identifier:self; 13, attribute; 14, call; 15, identifier:self; 16, identifier:entries; 17, attribute; 18, argument_list; 19, call; 20, identifier:sort_entries; 21, identifier:Sorter; 22, argument_list; 23, attribute; 24, attribute; 25, identifier:attr; 26, identifier:self; 27, identifier:entries; 28, identifier:self; 29, identifier:category
code: def sort(self, attr):
          """Sort the ratings based on an attribute"""
          self.entries = Sorter(self.entries, self.category, attr).sort_entries()
          return self