B.G 6.09
suhr̥nmitrāryudāsīnamadhyasthadveṣyabandhuṣu। sādhuṣvapi ca pāpeṣu samabudidharviśiṣyate ॥9॥
One who treats with equanimous-intellect the well-wishers, the friends, the enemies, the indifferent, the neutrals, the hated, the relatives, the virtuous, and also the sinful, excels.
Gīta Tātparya 6.09
The person who behaves in tune with his role for the given context as prescribed is said to be knowledgeable and having equanimous-intellect ('samabuddhiḥ'). Who behaves differently is not equanimous and ignorant.
"yasya yatra yathā vr̥ttirvihitā vartanaṁ tathā। jñānaṁ vāpi samatvaṁ tadviṣamatvamato'nyathā॥"
"He, whose behavior is as per one's occupation or role, in tune with the context of time and place, is said to be knowledgeable, and also equanimous. That which is different from it is otherwise (i.e. not knowledgeable)."
iti mahāviṣṇupurāṇe।
- stated thus in the Mahā Viṣṇu Purāṇa.
"animittasnehavāṁstu suhr̥d jñātvopakārakr̥t। mitraṁ vadhādikr̥dariḥ dveṣyastvapriyamātrakr̥t। udāsīnaḥ snehavato'pyasnehī tatkr̥tānukr̥t। madhyastha iti vijñeyaḥ suhr̥deṣu viśiṣyate॥"
"Even without a cause, one who is affectionate is the wellwisher. The one who does good, knowing the consequences, is a friend. One who causes harm is an enemy. The person one who does only unpleasant things is the hater. The indifferent is one who is not affectionate, even with those who are affectionate. One who appreciates the good deeds is the middle. Thus, the people with hearts should be distinguished."
iti nāradīye ॥9॥
- stated thus in the Nārada Purāṇa.