call the method lineno_comment_map.setdefault with 2 arguments: t.lineno and an empty list, append t.contents to the result.
lineno_comment_map . setdefault ( t . lineno , [ ] ) . append ( t . contents )