If I’m not mistaken, it’s not mating. I’ve seen a lot of snake documentaries where they’re fighting to mate with a female cobra. In fighting, it’s against the rules to bite or inject venom.
It appears to be dancing, but it is actually one snake attempting to lower the head of the other without utilizing its venom. Actually, they aren’t dancing; they are battling for territory or mate, with the winner being the one who can force his opponent’s head to contact the ground. But the most astonishing part is that they are not allowed to bite.
My grandmother tells me that they are mating and joyful, and that no one should see them in this state because it will curse the person who sees them in this happy state.