If you don’t have a test case to show, you get to debug it all by yourself. As the message says, it looks like your
y is a tuple and not a variable.
With errors like this I usually add
print(type(var)) before the statement that throws the exception to debug.