Lecture code doubt in Video

In the Video of Stochasttic & Mini Batch Gradient Descent,
I am not be able to Understand the code of gradient_descent function ,that code is directly shown in the video not clearly clarify
some statements not understanble,
why we took
de = e
itr <=400 (why ?)
plz could u explain it ?