Jérémie 9:2 Halakha : Mishneh Torah, Human Dispositions

וַֽיַּדְרְכ֤וּ אֶת־לְשׁוֹנָם֙ קַשְׁתָּ֣ם שֶׁ֔קֶר וְלֹ֥א לֶאֱמוּנָ֖ה גָּבְר֣וּ בָאָ֑רֶץ כִּי֩ מֵרָעָ֨ה אֶל־רָעָ֧ה ׀ יָצָ֛אוּ וְאֹתִ֥י לֹֽא־יָדָ֖עוּ נְאֻם־יְהוָֽה׃ (ס)

Comme un arc, ils tendent leur langue pour le mensonge; ce n’est pas par la loyauté qu’ils sont devenus maîtres dans le pays; car ils vont de méfait en méfait, et moi, ils ne veulent pas me connaître, dit l’Éternel.

Mishneh Torah, Human Dispositions

It is a natural tendency of man to be influenced in his ideas and conduct by his fellows and associates, and to follow the usage of the people of his state. Because thereof, it is necessary for man to be in the company of the righteous, and to sit near the wise, in order to learn from their conduct, and to distance himself from the evil-doers who follow the path of darkness, in order not to learn from their conduct; for of such Solomon said: "He that walketh with wise men shall be wise; but the companion of fools shall smart for it" (Prov. 13.20); and it is also said: "Happy is the man that hath not walked in the counsel of the wicked etc. (Ps. 1.1.). Likewise, if a man be in a state where evil customs prevail and where the people are not following the righteous ways, he should go to a place where the inhabitants are righteous and follow the way of the good. If all the states known to him, or of which intelligence reached him, be followers of a path which is not good, even as it is in our own times, or if he be unable to migrate to a state whose rules of conduct are good, either on account of military operations or on account of sickness, he should isolate himself and live in seclusion, even as it is said on the subject: "Let him sit alone and keep silence" (Lam. 3.28). And, if the inhabitants of his state be evildoers and sinners, who deny him the right of residence in the state unless he become assimilated with them, and follows their evil conduct, he should go forth and dwell in caves, or cliffs, or deserts, but not accustom himself in the way of the sinners, even as it is said on the subject: "Oh that I were in the wilderness,1See Berakot, 35b. G. in a lodging place of wayfaring men" (Jer. 9.1.).