The most recited myth is about the woman who had a pet python which had not eaten for weeks. In fairness there the story is constant everyone has their own adaptation of it but the premise is the same.
It starts off like this there was this woman in America/Dublin or my friend’s aunt, a friend of my mother and so on....... Well she had this snake which would not eat for her, one night she woke up to find the snake stretched out beside her in the bed it was her full body length. Needless to say she got a fierce fright and hoped out of the bed.
The next morning she brought her python to her vet explaining about the snake not eating and what had happened that night. The vet got a terrible shock and said “thank god you brought him in do you know how lucky you are, the snake was fasting to make room for you as his next meal”. “The reason he was stretched out beside you was that he was measuring you to make sure you would fit”. With this the vet put down the snake.
It is of course an urban legend. If a snake is hungry it hunts and eats. It will never look at a mouse and think "aah no must not stuff myself better leave room for a rabbit!" As for measuring its potential victim where would a snake get a ruler. As a rule if a snake tries to swallow an item of prey which is too long it will regurgitate and go look for something smaller.
As for eating humans snakes are not programmed to sense us as food though there may be rare exceptions to this. More than likely there is a reason for this to happen, it could be that the person was in contact with animals the snake perceives as food such as a rat, rabbit or deer. This has happened to me on a number of occasions when handling rodents where a snake will latch onto my hand or arm and try to swallow it, they usually let go once they realise the mistake they have made.