Reading and remembering code is allowed under all the OSS licenses. It's the reproduction of the code that's restricted. The blurry question is always: how much does an expression have to change between it being classified as an exact reproduction, a derivative work, and a novel work?
CoPilot would definitely fail the clean room test, though
CoPilot would definitely fail the clean room test, though