If its a couple lines of generic code, of course. That's also an indefensible copyright, btw. But if its hundreds of very specific likes of code written to do one thing under a license you don't follow, that's something else.
This isn't just an issue of code. You can write a program that combines songs, or combines novels creating a different work that has sections that are essentially the original protected work. I don't think the authors of those novels are going to be OK with you selling or giving away a version of their work just because an AI edited it or combined it somehow.
This isn't just an issue of code. You can write a program that combines songs, or combines novels creating a different work that has sections that are essentially the original protected work. I don't think the authors of those novels are going to be OK with you selling or giving away a version of their work just because an AI edited it or combined it somehow.