It is narrated from Sayyiduna Abu al-Darda (may Allah be pleased with him) (the narrator says: I do not know whether he narrated this as marfu' from the Prophet (peace and blessings be upon him) or not) that he said: "A person's understanding, insight and wisdom are recognized from his walking about, his places of entering and his places of exit (that is, his company, his social dealings and his companionship)."
Ibn Abi Umar recorded this report (athar) in his Musnad.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب العلم / 3043
Hadith Gradingمحدثین:إسناده ضعيف، موقوف
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :موقوف، إسناده ضعيف. » «أخرجه مصنف ابن أبي شيبة برقم: 26104»