I was looking at the question How to output to an XML file in Python?, and to me it clearly seems to be off-topic, but I wanted some second opinions.
In a nutshell, the program takes data from an input file (the filename is hardcoded) and then runs a solver that generates an output in an array format. The asker wants to know how to convert that output array into an XML file, programmatically. Normally this would be a clear case of "code not working as intended", since the asker wants an XML output and they are not getting it. However, at the very end of the program, the asker has already hardcoded some lines to produce an XML file that just happens to match the array output from the solver. For this reason (or because they misunderstood the question), they claimed that the code was "working as intended" when asked.
My judgement is that the code is not working as intended, and therefore off-topic, because the output would become wrong if the asker fed the program a different input file. Do you agree? More generally, if we're given code with a lot of hardcoding in it, what criteria should we use to judge whether or not it's "working as intended"?