Couldn't disagree more with the code examples.
Whenever I'm looking for answer that can be answered by the standard library I really do want to get the actual documentation of that language and not a random stackoverflow solution.
It depends for me. Sometimes I am simply after the documentation but often I want to make some weird plot and would like to see if anyone else has tried to make said weird plot using the same library before. I don't think there is any way to optimise for which to prioritise without including the word "documentation" in your query.