Kwajah Abdullah Ansari (1006-1089 CE) was a very important Sufi in the area of present day Afghanistan, and was known as the Pir of Herat. These verses are taken from his Book of Wisdom.
And he said (may God be pleased with him!):
Do not keep company
with anyone whose state does not inspire you
and whose speech does not lead you
You might be in a bad state; then,
associating with one who is in a worse state,
you see virtue in yourself.
No deed arising from a renouncing heart is small,
and no deed arising from an avaricious heart is fruitful.
are the result of good states.
arise from the stations wherein abide
those who have spiritual realisation.
Do not abandon the Invocation
because you do not feel the Presence of God therein.
For your forgetfulness of the Invocation of Him
is worse that your forgetfulness in the invocation of Him.
Perhaps He will take you from an Invocation with forgetfulness
to one with vigilance, and from one with vigilance
to one with the Presence of God, and from one with the Presence of God
to one wherein everything but the Invoked is absent.
“And that is not difficult for God.”
Kwaja Abdullah Ansari The Book of Wisdom
Tr. Victor Danner