nodes: 0, module; 1, function_definition; 2, function_name:__label_cmp; 3, parameters; 4, block; 5, identifier:self; 6, identifier:other; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, expression_statement; 11, if_statement; 12, if_statement; 13, comment:"""
          Comparaison function. Can be used to sort labels alphabetically.
          """; 14, comparison_operator:other is None; 15, block; 16, assignment; 17, assignment; 18, comparison_operator:label_name < other_name; 19, block; 20, elif_clause; 21, else_clause; 22, comparison_operator:self.get_color_str() < other.get_color_str(); 23, block; 24, elif_clause; 25, else_clause; 26, identifier:other; 27, None; 28, return_statement; 29, identifier:label_name; 30, call; 31, identifier:other_name; 32, call; 33, identifier:label_name; 34, identifier:other_name; 35, return_statement; 36, comparison_operator:label_name == other_name; 37, block; 38, block; 39, call; 40, call; 41, return_statement; 42, comparison_operator:self.get_color_str() == other.get_color_str(); 43, block; 44, block; 45, unary_operator; 46, attribute; 47, argument_list; 48, attribute; 49, argument_list; 50, unary_operator; 51, identifier:label_name; 52, identifier:other_name; 53, return_statement; 54, return_statement; 55, attribute; 56, argument_list; 57, attribute; 58, argument_list; 59, unary_operator; 60, call; 61, call; 62, return_statement; 63, return_statement; 64, integer:1; 65, call; 66, identifier:lower; 67, call; 68, identifier:lower; 69, integer:1; 70, integer:0; 71, integer:1; 72, identifier:self; 73, identifier:get_color_str; 74, identifier:other; 75, identifier:get_color_str; 76, integer:1; 77, attribute; 78, argument_list; 79, attribute; 80, argument_list; 81, integer:0; 82, integer:1; 83, identifier:strip_accents; 84, argument_list; 85, identifier:strip_accents; 86, argument_list; 87, identifier:self; 88, identifier:get_color_str; 89, identifier:other; 90, identifier:get_color_str; 91, attribute; 92, attribute; 93, identifier:self; 94, identifier:name; 95, identifier:other; 96, identifier:name
code: def __label_cmp(self, other):
          """
          Comparaison function. Can be used to sort labels alphabetically.
          """
          if other is None:
              return -1
  
          label_name = strip_accents(self.name).lower()
          other_name = strip_accents(other.name).lower()
          if label_name < other_name:
              return -1
          elif label_name == other_name:
              return 0
          else:
              return 1
  
          if self.get_color_str() < other.get_color_str():
              return -1
          elif self.get_color_str() == other.get_color_str():
              return 0
          else:
              return 1