nodes: 0, module; 1, function_definition; 2, function_name:sort_idxs; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:similarities; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, string:"Sorts `similarities` and return the indexes in pairs ordered by highest similarity."; 12, assignment; 13, assignment; 14, list_comprehension; 15, identifier:idxs; 16, call; 17, identifier:idxs; 18, list_comprehension; 19, identifier:e; 20, for_in_clause; 21, for_in_clause; 22, attribute; 23, argument_list; 24, tuple; 25, for_in_clause; 26, identifier:l; 27, identifier:idxs; 28, identifier:e; 29, identifier:l; 30, identifier:cls; 31, identifier:largest_indices; 32, identifier:similarities; 33, call; 34, subscript; 35, subscript; 36, identifier:i; 37, call; 38, identifier:len; 39, argument_list; 40, subscript; 41, identifier:i; 42, subscript; 43, identifier:i; 44, identifier:range; 45, argument_list; 46, identifier:similarities; 47, identifier:idxs; 48, integer:0; 49, identifier:idxs; 50, integer:1; 51, call; 52, identifier:len; 53, argument_list; 54, subscript; 55, identifier:idxs; 56, integer:0
code: def sort_idxs(cls, similarities):
          "Sorts `similarities` and return the indexes in pairs ordered by highest similarity."
          idxs = cls.largest_indices(similarities, len(similarities))
          idxs = [(idxs[0][i], idxs[1][i]) for i in range(len(idxs[0]))]
          return [e for l in idxs for e in l]