nodes: 0, module; 1, function_definition; 2, function_name:__doc_cmp; 3, parameters; 4, block; 5, identifier:self; 6, identifier:other; 7, expression_statement; 8, if_statement; 9, if_statement; 10, if_statement; 11, comment:"""
          Comparison function. Can be used to sort docs alphabetically.
          """; 12, comparison_operator:other is None; 13, block; 14, boolean_operator; 15, block; 16, comparison_operator:self.__docid < other.__docid; 17, block; 18, elif_clause; 19, else_clause; 20, identifier:other; 21, None; 22, return_statement; 23, attribute; 24, attribute; 25, return_statement; 26, attribute; 27, attribute; 28, return_statement; 29, comparison_operator:self.__docid == other.__docid; 30, block; 31, block; 32, unary_operator; 33, identifier:self; 34, identifier:is_new; 35, identifier:other; 36, identifier:is_new; 37, integer:0; 38, identifier:self; 39, identifier:__docid; 40, identifier:other; 41, identifier:__docid; 42, unary_operator; 43, attribute; 44, attribute; 45, return_statement; 46, return_statement; 47, integer:1; 48, integer:1; 49, identifier:self; 50, identifier:__docid; 51, identifier:other; 52, identifier:__docid; 53, integer:0; 54, integer:1
code: def __doc_cmp(self, other):
          """
          Comparison function. Can be used to sort docs alphabetically.
          """
          if other is None:
              return -1
          if self.is_new and other.is_new:
              return 0
          if self.__docid < other.__docid:
              return -1
          elif self.__docid == other.__docid:
              return 0
          else:
              return 1