ספר המדות Improper Thoughts / Part I · יח
Sefer HaMiddot 749
יח. מִי שֶׁיּוֹשֵׁב בֵּין אַנְשֵׁי נִאוּף אוֹ בְּמָקוֹם שֶׁהָיָה בּוֹ נִאוּף, עַל־יְדֵי זֶה בָּא לְהִרְהוּרִים רָעִים.
18. One who sits among lewd people or in a place where there was lewdness, through this, he comes to evil thoughts.