Code once submited before got 7 , now showing unusual errors

i had submitted gridworld code some days back at i had gotten 7 on that. now i did all the theory / implementation questions part of it and decided to submit. but now its showing some error? can you see whats happening. unlikely to be because of the code cuz i am getting 1 on the public data now also.
here is the link to my collab file

Download Execute In Colab
Notebook