On topic or not? Reasoning?
What should I do with these kinds of questions, and why?
No, they haven't.
The OP has not demonstrated that they have put forth any effort to learn. Willingness means actual effort not randomly spamming us with code in the vague hope that others will explain it to you and do your work for you.
So, no, these sorts of "what does this code do?" questions are generally not valid, and they should be closed.
From the FAQ:
Has code? Check.
The OP doesn't understand code and is showing a willingness to learn. It's not a plz-send-me-the-codez question.
I don't see why it would be off-topic...
Nothing. Or answer it. No special mod actions necessary.
From How to Ask: