Extracting code excerpts automatically