B.G 6.09
सुहृन्मित्रार्युदासीनमध्यस्थद्वेष्यबन्धुषु। साधुष्वपि च पापेषु समबुद्धिर्विशिष्यते ॥९॥
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.
"यस्य यत्र यथा वृत्तिर्विहिता वर्तनं तथा। ज्ञानं वापि समत्वं तद्विषमत्वमतोऽन्यथा॥"
"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)."
इति महाविष्णुपुराणे।
- stated thus in the Mahā Viṣṇu Purāṇa.
"अनिमित्तस्नेहवांस्तु सुहृद् ज्ञात्वोपकारकृत्। मित्रं वधादिकृदरिः द्वेष्यस्त्वप्रियमात्रकृत्। उदासीनः स्नेहवतोऽप्यस्नेही तत्कृतानुकृत्। मध्यस्थ इति विज्ञेयः सुहृदेषु विशिष्यते॥"
"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."
इति नारदीये ॥९॥
- stated thus in the Nārada Purāṇa.