check the init args only when the given frames are in `__init__` method. (#21227)
* check the init args only when the given frames are in `__init__` method.
* chlog
* add additional testing.
---------
Co-authored-by: jirka <jirka.borovec@seznam.cz>
Co-authored-by: Nicki Skafte Detlefsen <skaftenicki@gmail.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
Co-authored-by: Deependu <deependujha21@gmail.com>