The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"The headstrong man."--This story was told by the Master while at Jetavana, about a certain headstrong Brother. For the Blessed One asked him whether the report was true that he was headstrong, and the Brother admitted that it was. "Brother," said the Master, "this is not the first time you have been headstrong: you were just as headstrong in former days. also,  and, as the result of your headstrong refusal to follow the advice of the wise and good, you met your end by the bite of a snake." And so saying, he told this story of the past.
Once on a time when Brahmadatta was reigning in Benares, the Bodhisatta was born into a wealthy family in the Kingdom of Kāsi. Having come to years of discretion, he saw how from passion springs pain and how true bliss comes by the abandonment of passion. So he put lusts from him, and going forth to the Himalayas became a hermit, winning by fulfilment of the ordained mystic meditations the five orders of the
[paragraph continues] Higher Knowledge and the eight Attainments. And as he lived his life in the rapture of Insight, he came in after times to have a large following of five hundred hermits, whose teacher he was.
Now one day a young poisonous viper, wandering about as vipers do, came to the hut of one of the hermits; and that Brother grew as fond of the creature as if it were his own child, housing it in a joint of bamboo and shewing kindness to it. And because it was lodged in a joint of bamboo, the viper was known by the name of "Bamboo." Moreover, because the hermit was as fond of the viper as if, it were his own child, they called him "Bamboo's Father."
Hearing that one of the Brethren was keeping a viper, the Bodhisatta sent for that Brother and asked whether the report was true. When told that it was true, the Bodhisatta said, "A viper can never be trusted; keep it no longer."
"But," urged the Brother, "my viper is dear to me as a pupil to a teacher;--I could not live without him." "Well then," answered the Bodhisatta, "know that this very snake will lose you your life." But heedless of the master's warning, that Brother still kept the pet he could not bear to part with. Only a very few days later all the Brethren went out to gather fruits, and coming to a spot where all kinds grew in plenty, they stayed there two or three days. With them went "Bamboo's Father," leaving his viper behind in its bamboo prison. Two or three days afterwards, when he came back, he bethought him of feeding the creature, and, opening the cane, stretched out his hand, saying, "Come, my son; you must be hungry." But angry with its long fast, the viper bit his outstretched hand, killing him on the spot, and made its escape into the forest.
Seeing him lying there dead, the Brethren came and told the Bodhisatta , who bade the body be burned. Then, seated in their midst, he exhorted the Brethren by repeating this stanza:--
Thus did the Bodhisatta exhort his followers; and he developed within himself the four Noble States, and at his death was re-born into the Brahma Realm.
Said the Master, "Brother, this is not the first time you have shewn yourself headstrong; you were no less headstrong in times gone by, and thereby met your death from a viper's bite." Having ended his lesson, the Master shewed the connexion and identified the Birth by saying, "In those days, this headstrong Brother was 'Bamboo's Father,' my disciples were the band of disciples, and I myself their teacher."