It's a bit of a tricky question because you can have a beautiful snippet entangled in a mess of a codebase.
I think a much better question would be most beautifully structured codebase.
Code, as a snippet, or line, is constantly struggling between poetic conciseness and verbose clarity... To which I will always pick clarity (for "the next guy"), hence not necessarily elegant.