Edit: My comment was enabled: https://juliareda.eu/2021/07/github-copilot-is-not-infringin...
Maybe fizzbuzz?
Let's try to auto generate some fizzbuzz code, see what we get :D
But Copilot doesn't exist to show you random code snippets for the sole purpose of showing them.
Using this copyrighted material to create derivative works is a completely different use case, and not covered at all by the Google Books ruling, or any other I'm aware of.
Google isnt making new books, or enabling people to make derivative copies; it is merely previewing a book.
Github search is a preview. Copilot is a copy/paste.
The research value actually turned activity that would be infringing into activity that was not infringing. Take away things like the ngram viewer and Google Books infringes.
[0] https://twitter.com/mitsuhiko/status/1410886329924194309