This is similar to copilot-import [0] which in turn was based on stack-overflow-import [1]. I'd be interested to see whether ChatGPT/GPT-3 or Codex/Copilot is better at generating function bodies.
[0]: https://github.com/MythicManiac/copilot-import [1]: https://github.com/drathier/stack-overflow-import