It is narrated from Imam Ali (AS) who said:
the best wisdom is to know oneself. Therefore, if any person knows himself/herself is wise and rational, and the one who does not is misled [1].
[1] Sharh Qorarul Hekam wa Dorarul Kalam, Vol. 2, Page 442.
Source: en.shafaqna.com