Sorry, did it try to predict the output, or did it only predict the output based on what it has seen people say about similar code online?
That doesn't change the fact that its predicting the output based on its knowledge of python though.
So, yes you're right, but at the same time it doesn't change anything IMO.
What would it do if the training data was only code? Only code+inputs+outputs? Only function signature+inputs/outputs? Only signature+comments?
Etc.