nodes: 0, module; 1, function_definition; 2, function_name:order; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, comment:# non-GA releases should appear before GA releases; 8, comment:# Order: tp -> beta -> rc -> GA; 9, if_statement; 10, return_statement; 11, comment:"""Return a representation that allows this object to be sorted
          correctly with the default comparator.
          """; 12, attribute; 13, block; 14, else_clause; 15, binary_operator:(int(self.major), int(self.minor), int(self.patch)) + stage; 16, identifier:self; 17, identifier:stage; 18, for_statement; 19, block; 20, tuple; 21, identifier:stage; 22, identifier:st; 23, identifier:STAGES; 24, block; 25, expression_statement; 26, call; 27, call; 28, call; 29, if_statement; 30, assignment; 31, identifier:int; 32, argument_list; 33, identifier:int; 34, argument_list; 35, identifier:int; 36, argument_list; 37, comparison_operator:st in self.stage; 38, block; 39, identifier:stage; 40, tuple; 41, attribute; 42, attribute; 43, attribute; 44, identifier:st; 45, attribute; 46, expression_statement; 47, break_statement; 48, call; 49, identifier:self; 50, identifier:major; 51, identifier:self; 52, identifier:minor; 53, identifier:self; 54, identifier:patch; 55, identifier:self; 56, identifier:stage; 57, assignment; 58, identifier:len; 59, argument_list; 60, identifier:stage; 61, tuple; 62, identifier:STAGES; 63, call; 64, attribute; 65, attribute; 66, argument_list; 67, identifier:self; 68, identifier:stage; 69, identifier:STAGES; 70, identifier:index; 71, identifier:st
code: def order(self):
          """Return a representation that allows this object to be sorted
          correctly with the default comparator.
          """
          # non-GA releases should appear before GA releases
          # Order: tp -> beta -> rc -> GA
          if self.stage:
              for st in STAGES:
                  if st in self.stage:
                      stage = (STAGES.index(st), self.stage)
                      break
          else:
              stage = (len(STAGES),)
  
          return (int(self.major), int(self.minor), int(self.patch)) + stage