Jami` at-Tirmidhi, Book 49, Hadith 223 (Tirmidhi 3920)

Narrated Ibn 'Abbas:

"The Messenger of Allah (ﷺ) supplicated for me that Allah should give me Al-Hukm (knowledge, understanding, judging justly, or understanding of the Qur'an) two times."