How to make the animation for countourf plots

can any one help me out to make the animation for the Python Sigmoid week where we have to create the animation for the countour plots.
This is the error

and this is the code for the error

please help me out.

Inside the defined function plot_sn, line 14, can you please try to replace plt.collections with matplotlib.collections.