Imam Ali (a) once was busy delivering a sermon from atop the pulpit in the city of Kufa when a python suddenly appeared from the side of the pulpit and slithered up the steps towards the Imam (a).
Terrified, the people wanted to ward the reptile away from the Imam (a) when he signaled them to stay away. As the python reached the last step of the pulpit, the people, in a state of silence and bewilderment, observed that Imam Ali (a) had lowered himself a little while the python had raised its head and brought its mouth close to his ears.
At that moment the python issued aloud sound, which was heard by most of those present; the Imam’s lips then moved as if in conversation while the python listened to his words. After a short time had passed, the python glided down thepulpit and suddenly disappeared from sight. Imam (a) continued his sermon and upon completing it, descended from the pulpit. As he did so, the people crowded around him and began questioning him about the python.
Imam (a) explained: The issue is not what you had thought it to be. He was one of the judges from amongst the Jinn and he had found himself confused in connection with a judgment; so he approached meand sought to know the verdict. I explained the judgment to him,whereupon he prayed for me and departed.1
1 Uyunul Mojizaat, Pg. 91.