Judging by Judge Alsup's ruling even if the codes were copyrighted it would most likely not be copyright infringement to train on them either, and as such even if they are copyrightable and they do own copyright on them it remains beyond their abilities to forbid training on them. (Also opinion, also not legal advice, I'm also not a lawyer and sort of doubt the person I'm responding to is).
If you buy the codes, yes. If you only license them (which is what the original comment claims is the only way to get them legally), and that license explicitly forbids training, that seems to be less clear-cut. I have no idea if such restrictions are legal or would hold up to challenge, but it's less clear than the case where you buy a book and can then do whatever you want with it.