nodes: 0, module; 1, function_definition; 2, function_name:notes; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, if_statement; 11, expression_statement; 12, expression_statement; 13, return_statement; 14, identifier:public_only; 15, False; 16, comment:"""
          Retrieve a list of Note instances that should be shown for this
          release, grouped as either new features or known issues, and sorted
          first by sort_num highest to lowest and then by created date,
          which is applied to both groups,
          and then for new features we also sort by tag in the order specified
          by Note.TAGS, with untagged notes coming first, then finally moving
          any note with the fixed tag that starts with the release version to
          the top, for what we call "dot fixes".
          """; 17, assignment; 18, assignment; 19, identifier:public_only; 20, block; 21, assignment; 22, assignment; 23, expression_list; 24, identifier:tag_index; 25, call; 26, identifier:notes; 27, call; 28, expression_statement; 29, identifier:known_issues; 30, list_comprehension; 31, identifier:new_features; 32, call; 33, identifier:new_features; 34, identifier:known_issues; 35, identifier:dict; 36, generator_expression; 37, attribute; 38, argument_list; 39, assignment; 40, identifier:n; 41, for_in_clause; 42, if_clause; 43, identifier:sorted; 44, argument_list; 45, tuple; 46, for_in_clause; 47, attribute; 48, identifier:order_by; 49, string; 50, string; 51, identifier:notes; 52, call; 53, identifier:n; 54, identifier:notes; 55, call; 56, call; 57, keyword_argument; 58, keyword_argument; 59, identifier:tag; 60, identifier:i; 61, pattern_list; 62, call; 63, identifier:self; 64, identifier:note_set; 65, string_content:-sort_num; 66, string_content:created; 67, attribute; 68, argument_list; 69, attribute; 70, argument_list; 71, identifier:sorted; 72, argument_list; 73, identifier:key; 74, lambda; 75, identifier:reverse; 76, True; 77, identifier:i; 78, identifier:tag; 79, identifier:enumerate; 80, argument_list; 81, identifier:notes; 82, identifier:filter; 83, keyword_argument; 84, identifier:n; 85, identifier:is_known_issue_for; 86, identifier:self; 87, generator_expression; 88, keyword_argument; 89, lambda_parameters; 90, boolean_operator; 91, attribute; 92, identifier:is_public; 93, True; 94, identifier:n; 95, for_in_clause; 96, if_clause; 97, identifier:key; 98, lambda; 99, identifier:n; 100, comparison_operator:n.tag == 'Fixed'; 101, call; 102, identifier:Note; 103, identifier:TAGS; 104, identifier:n; 105, identifier:notes; 106, not_operator; 107, lambda_parameters; 108, call; 109, attribute; 110, string; 111, attribute; 112, argument_list; 113, call; 114, identifier:note; 115, attribute; 116, argument_list; 117, identifier:n; 118, identifier:tag; 119, string_content:Fixed; 120, attribute; 121, identifier:startswith; 122, attribute; 123, attribute; 124, argument_list; 125, identifier:tag_index; 126, identifier:get; 127, attribute; 128, integer:0; 129, identifier:n; 130, identifier:note; 131, identifier:self; 132, identifier:version; 133, identifier:n; 134, identifier:is_known_issue_for; 135, identifier:self; 136, identifier:note; 137, identifier:tag
code: def notes(self, public_only=False):
          """
          Retrieve a list of Note instances that should be shown for this
          release, grouped as either new features or known issues, and sorted
          first by sort_num highest to lowest and then by created date,
          which is applied to both groups,
          and then for new features we also sort by tag in the order specified
          by Note.TAGS, with untagged notes coming first, then finally moving
          any note with the fixed tag that starts with the release version to
          the top, for what we call "dot fixes".
          """
          tag_index = dict((tag, i) for i, tag in enumerate(Note.TAGS))
          notes = self.note_set.order_by('-sort_num', 'created')
          if public_only:
              notes = notes.filter(is_public=True)
          known_issues = [n for n in notes if n.is_known_issue_for(self)]
          new_features = sorted(
              sorted(
                  (n for n in notes if not n.is_known_issue_for(self)),
                  key=lambda note: tag_index.get(note.tag, 0)),
              key=lambda n: n.tag == 'Fixed' and n.note.startswith(self.version),
              reverse=True)
  
          return new_features, known_issues