Can we rewrite this function as:

Although, the output of the function is same, when ran alone this function.
But when ran with all other functions given in the lab like my_sequential and my_predict functions, the error is encountered with the X_tst:

X_tst = np.array([

Can anyone tell me what I am missing or misunderstanding anything!