nodes: 0, module; 1, function_definition; 2, function_name:compare_report_print; 3, parameters; 4, block; 5, identifier:sorted_list; 6, identifier:scores; 7, identifier:best_name; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, for_statement; 17, if_statement; 18, return_statement; 19, comment:"""
      Return compare report.
  
      :param sorted_list: sorted list of cm's
      :type sorted_list: list
      :param scores: scores of cm's
      :type scores: dict
      :param best_name: best cm name
      :type best_name: str
      :return: printable result as str
      """; 20, assignment; 21, assignment; 22, assignment; 23, assignment; 24, augmented_assignment; 25, augmented_assignment; 26, assignment; 27, pattern_list; 28, call; 29, block; 30, comparison_operator:best_name is None; 31, block; 32, identifier:result; 33, identifier:title_items; 34, list; 35, identifier:class_scores_len; 36, call; 37, identifier:shifts; 38, list; 39, identifier:result; 40, string:""; 41, identifier:result; 42, binary_operator:"Best : " + str(best_name) + "\n\n"; 43, identifier:result; 44, binary_operator:("".join(shifts)
                 ) % tuple(title_items[:-1]) + title_items[-1] + "\n"; 45, identifier:prev_rank; 46, integer:0; 47, identifier:index; 48, identifier:cm; 49, identifier:enumerate; 50, argument_list; 51, expression_statement; 52, if_statement; 53, expression_statement; 54, expression_statement; 55, identifier:best_name; 56, None; 57, expression_statement; 58, string:"Rank"; 59, string:"Name"; 60, string:"Class-Score"; 61, string:"Overall-Score"; 62, identifier:map; 63, argument_list; 64, binary_operator:"%-" +
                str(len(sorted_list) +
                    4) +
                "s"; 65, binary_operator:"%-" +
                str(max(map(lambda x: len(str(x)), sorted_list)) +
                    4) +
                "s"; 66, binary_operator:"%-" +
                str(max(class_scores_len) + 11) + "s"; 67, binary_operator:"Best : " + str(best_name); 68, string:"\n\n"; 69, binary_operator:("".join(shifts)
                 ) % tuple(title_items[:-1]) + title_items[-1]; 70, string:"\n"; 71, identifier:sorted_list; 72, assignment; 73, comparison_operator:scores[sorted_list[rank]] == scores[sorted_list[prev_rank]]; 74, block; 75, augmented_assignment; 76, assignment; 77, augmented_assignment; 78, lambda; 79, call; 80, binary_operator:"%-" +
                str(len(sorted_list) +
                    4); 81, string:"s"; 82, binary_operator:"%-" +
                str(max(map(lambda x: len(str(x)), sorted_list)) +
                    4); 83, string:"s"; 84, binary_operator:"%-" +
                str(max(class_scores_len) + 11); 85, string:"s"; 86, string:"Best : "; 87, call; 88, binary_operator:("".join(shifts)
                 ) % tuple(title_items[:-1]); 89, subscript; 90, identifier:rank; 91, identifier:index; 92, subscript; 93, subscript; 94, expression_statement; 95, identifier:result; 96, binary_operator:("".join(shifts)) % (str(rank + 1), str(cm),
                                         str(scores[cm]["class"])) + str(scores[cm]["overall"]) + "\n"; 97, identifier:prev_rank; 98, identifier:rank; 99, identifier:result; 100, binary_operator:"\nWarning: " + COMPARE_RESULT_WARNING; 101, lambda_parameters; 102, call; 103, identifier:list; 104, argument_list; 105, string:"%-"; 106, call; 107, string:"%-"; 108, call; 109, string:"%-"; 110, call; 111, identifier:str; 112, argument_list; 113, parenthesized_expression; 114, call; 115, identifier:title_items; 116, unary_operator; 117, identifier:scores; 118, subscript; 119, identifier:scores; 120, subscript; 121, assignment; 122, binary_operator:("".join(shifts)) % (str(rank + 1), str(cm),
                                         str(scores[cm]["class"])) + str(scores[cm]["overall"]); 123, string:"\n"; 124, string:"\nWarning: "; 125, identifier:COMPARE_RESULT_WARNING; 126, identifier:x; 127, identifier:len; 128, argument_list; 129, call; 130, identifier:str; 131, argument_list; 132, identifier:str; 133, argument_list; 134, identifier:str; 135, argument_list; 136, identifier:best_name; 137, call; 138, identifier:tuple; 139, argument_list; 140, integer:1; 141, identifier:sorted_list; 142, identifier:rank; 143, identifier:sorted_list; 144, identifier:prev_rank; 145, identifier:rank; 146, identifier:prev_rank; 147, binary_operator:("".join(shifts)) % (str(rank + 1), str(cm),
                                         str(scores[cm]["class"])); 148, call; 149, call; 150, attribute; 151, argument_list; 152, binary_operator:len(sorted_list) +
                    4; 153, binary_operator:max(map(lambda x: len(str(x)), sorted_list)) +
                    4; 154, binary_operator:max(class_scores_len) + 11; 155, attribute; 156, argument_list; 157, subscript; 158, parenthesized_expression; 159, tuple; 160, identifier:str; 161, argument_list; 162, identifier:str; 163, argument_list; 164, identifier:scores; 165, identifier:values; 166, call; 167, integer:4; 168, call; 169, integer:4; 170, call; 171, integer:11; 172, string:""; 173, identifier:join; 174, identifier:shifts; 175, identifier:title_items; 176, slice; 177, call; 178, call; 179, call; 180, call; 181, subscript; 182, subscript; 183, identifier:len; 184, argument_list; 185, identifier:max; 186, argument_list; 187, identifier:max; 188, argument_list; 189, unary_operator; 190, attribute; 191, argument_list; 192, identifier:str; 193, argument_list; 194, identifier:str; 195, argument_list; 196, identifier:str; 197, argument_list; 198, subscript; 199, string:"overall"; 200, identifier:x; 201, string:"class"; 202, identifier:sorted_list; 203, call; 204, identifier:class_scores_len; 205, integer:1; 206, string:""; 207, identifier:join; 208, identifier:shifts; 209, binary_operator:rank + 1; 210, identifier:cm; 211, subscript; 212, identifier:scores; 213, identifier:cm; 214, identifier:map; 215, argument_list; 216, identifier:rank; 217, integer:1; 218, subscript; 219, string:"class"; 220, lambda; 221, identifier:sorted_list; 222, identifier:scores; 223, identifier:cm; 224, lambda_parameters; 225, call; 226, identifier:x; 227, identifier:len; 228, argument_list; 229, call; 230, identifier:str; 231, argument_list; 232, identifier:x
code: def compare_report_print(sorted_list, scores, best_name):
      """
      Return compare report.
  
      :param sorted_list: sorted list of cm's
      :type sorted_list: list
      :param scores: scores of cm's
      :type scores: dict
      :param best_name: best cm name
      :type best_name: str
      :return: printable result as str
      """
      title_items = ["Rank", "Name", "Class-Score", "Overall-Score"]
      class_scores_len = map(lambda x: len(
          str(x["class"])), list(scores.values()))
      shifts = ["%-" +
                str(len(sorted_list) +
                    4) +
                "s", "%-" +
                str(max(map(lambda x: len(str(x)), sorted_list)) +
                    4) +
                "s", "%-" +
                str(max(class_scores_len) + 11) + "s"]
      result = ""
      result += "Best : " + str(best_name) + "\n\n"
      result += ("".join(shifts)
                 ) % tuple(title_items[:-1]) + title_items[-1] + "\n"
      prev_rank = 0
      for index, cm in enumerate(sorted_list):
          rank = index
          if scores[sorted_list[rank]] == scores[sorted_list[prev_rank]]:
              rank = prev_rank
          result += ("".join(shifts)) % (str(rank + 1), str(cm),
                                         str(scores[cm]["class"])) + str(scores[cm]["overall"]) + "\n"
          prev_rank = rank
      if best_name is None:
          result += "\nWarning: " + COMPARE_RESULT_WARNING
      return result