Imam Ali (peace be upon him) once was busy delivering a sermon from atop the pulpit in the city of Kufah when a python suddenly appeared from the side of the pulpit and slithered up the steps towards the Imam (peace be upon him).
Terrified, the people wanted to ward the reptile away from the Imam (peace be upon him) when he (peace be upon him) 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 (peace be upon him) had lowered himself a little while the python had raised its head and brought its mouth close to his (peace be upon him) ears. At that moment the python issued a loud sound, which was heard by most of those present; the Imam’s (peace be upon him) lips then moved as if in conversation while the python listened to his words.
After a short time had passed, the python glided down the pulpit and suddenly disappeared from sight. The Imam (peace be upon him) continued his sermon and upon completing it, descended from the pulpit.
As he (peace be upon him) did so, the people crowded around him and began questioning him about the python. The Imam (peace be upon him) 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 me and sought to know the verdict. I explained the judgment to him, whereupon he prayed for me and departed.( Al-Irshaad, pg. 183. )