Non-copyrighted code, which is all code produced by AI by law, is defacto open to being Open Sourced, since there's no other option.
It doesn't matter what it was trained on. The law, right now, as has been proven repeatedly in court, is that all AI-produced products are not able to be copyrighted, but are legal to be generated, even when they are clearly trained on copyrighted data.
It would require a new law to stop it, and if that happens then all AI goes away and all previously released ai-produced code would still be legal since you cannot punish people retroactively.