Actually, most of the cobras used in that dancing "activity" are spitting cobras, but sadly their mouths are sewn shut so they can not spit, and sadly eventually die of starvation and dehydration. However, it is true that eyes are painted on the flute so they "dance" to follow the eyes.
P.S. I only know this because I went to Cancun, Mexico for vacation and went into a non-tourist town and it was being done. It's a really sad thing to watch, or even see in person.