Problem: Sentence1: She threw the invitation away.
Sentence2: She was an invitation to trouble.
Q: Does the term invitation mean the same thing in both these sentences?

Answer: different meanings

Problem: Sentence1: Halt in the name of the law.
Sentence2: He had no sons and there was no one to carry on his name.
Q: Does the term name mean the same thing in both these sentences?

Answer: different meanings

Problem: Sentence1: Put that light out!
Sentence2: He stopped the car and turned off the lights.
Q: Does the term light mean the same thing in both these sentences?

Answer: the same meaning

Problem: Sentence1: I demand an explanation.
Sentence2: This position demands a lot of personal sacrifice.
Q: Does the term demand mean the same thing in both these sentences?

Answer:
different meanings