nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, return_statement; 10, comment:"""
          return beam-labelings, sorted by probability
          """; 11, assignment; 12, assignment; 13, list_comprehension; 14, identifier:beams; 15, list_comprehension; 16, identifier:sortedBeams; 17, call; 18, attribute; 19, for_in_clause; 20, identifier:v; 21, for_in_clause; 22, identifier:sorted; 23, argument_list; 24, identifier:x; 25, identifier:labeling; 26, identifier:x; 27, identifier:sortedBeams; 28, tuple_pattern; 29, call; 30, identifier:beams; 31, keyword_argument; 32, keyword_argument; 33, identifier:_; 34, identifier:v; 35, attribute; 36, argument_list; 37, identifier:reverse; 38, True; 39, identifier:key; 40, lambda; 41, attribute; 42, identifier:items; 43, lambda_parameters; 44, binary_operator:x.prTotal*x.prText; 45, identifier:self; 46, identifier:entries; 47, identifier:x; 48, attribute; 49, attribute; 50, identifier:x; 51, identifier:prTotal; 52, identifier:x; 53, identifier:prText
code: def sort(self):
          """
          return beam-labelings, sorted by probability
          """
          beams = [v for (_, v) in self.entries.items()]
          sortedBeams = sorted(beams, reverse=True, key=lambda x: x.prTotal*x.prText)
          return [x.labeling for x in sortedBeams]