Just trying to demonstrate a point- this analogy seems flawed.
The more I think about it, the more this all seems like another dimension of Jack and the Magic Beanstalk crossed with The Matrix.
Copilot is as much of a search engine as Stable Diffusion or DALL-e are, which is to say they aren't at all. If you want to compare it to a search engine, despite it being a tortured metaphor, the most apt comparison is not to Google, but to The Pirate Bay if TPB stored all of their copyrighted content and served it up themselves.
Stable Diffusion works on completely different principles and they can't exactly replicate a pixels from their training data.
Now, while you may be able to get it to reproduce one function. One file, and definitely the whole repository seems extremely unlikely.
It can also be modified to be opt-in-only (only peoples' code that they permit to be learned on, can use the product)
Could be, but isn’t. And that matters.