Le Deutéronome 12:30 Midrash : Mekhilta DeRabbi Shimon Ben Yochai & Sifrei Devarim

הִשָּׁ֣מֶר לְךָ֗ פֶּן־תִּנָּקֵשׁ֙ אַחֲרֵיהֶ֔ם אַחֲרֵ֖י הִשָּׁמְדָ֣ם מִפָּנֶ֑יךָ וּפֶן־תִּדְרֹ֨שׁ לֵֽאלֹהֵיהֶ֜ם לֵאמֹ֨ר אֵיכָ֨ה יַעַבְד֜וּ הַגּוֹיִ֤ם הָאֵ֙לֶּה֙ אֶת־אֱלֹ֣הֵיהֶ֔ם וְאֶעֱשֶׂה־כֵּ֖ן גַּם־אָֽנִי׃

prends garde de te fourvoyer sur leurs traces, après les avoir vus périr; ne va pas t’enquérir de leurs divinités et dire: "Comment ces peuples servaient-ils leurs dieux? Je veux faire comme eux, moi aussi."

Mekhilta DeRabbi Shimon Ben Yochai

..."Visiting (poked)" - visiting is always to remember. And so it states (Genesis 21:1), "And the Lord visited Sarah"; and it states (Exodus 3:16), "I will surely visit you." R. Yehudah says, "I gather together the iniquities with me, and suspend them until the fourth generation; as with Jehu, the son of Nimshi. Accordingly, it states [about him] (II Kings 15:12), "Four generations of your descendants shall occupy the throne of Israel." And so it was for him...

Sifrei Devarim

(Devarim 12:30) "Take heed unto yourselves": a negative commandment. "lest they be a stumbling block to you": a negative commandment.