In order to stop before a crossroad or a pedestrian crossing where after a green signal unexpectedly for you the yellow signal of a traffic light was switched on.
Only for prevention of traffic accident.
In both listed cases.