<human>: William Frederick "Buffalo Bill" Cody (February 26, 1846 - January 10, 1917) was an American scout, bison hunter, and showman. He was born in Le Claire, Iowa Territory (now the U.S. state of Iowa), but he lived for several years in his father's hometown in Toronto Township, Ontario, Canada, before the family returned to the Midwest and settled in the Kansas Territory. Buffalo Bill started working at the age of eleven, after his father's death, and became a rider for the Pony Express at age 14. During the American Civil War, he served the Union from 1863 to the end of the war in 1865.

In 1895, Cody was instrumental in the founding of the town of Cody, the seat of Park County, in northwestern Wyoming. Today the Old Trail Town museum is at the center of the community and commemorates the traditions of Western life. Cody first passed through the region in the 1870s. He was so impressed by the development possibilities from irrigation, rich soil, grand scenery, hunting, and proximity to Yellowstone Park that he returned in the mid-1890s to start a town. Streets in the town were named after his associates: Beck, Alger, Rumsey, Bleistein and Salsbury. The town was incorporated in 1901.  In November 1902, Cody opened the Irma Hotel, named after his daughter. He envisioned a growing number of tourists coming to Cody on the recently opened Burlington rail line. He expected that they would proceed up Cody Road, along the north fork of the Shoshone River, to visit Yellowstone Park. To accommodate travelers, Cody completed construction of the Wapiti Inn and Pahaska Tepee in 1905 along Cody Road  with the assistance of the artist and rancher Abraham Archibald Anderson.  Cody established the TE Ranch, located on the south fork of the Shoshone River about thirty-five miles from Cody. When he acquired the TE property, he stocked it with cattle sent from Nebraska and South Dakota. The new herd carried the TE brand. The late 1890s were relatively prosperous years for the Wild West show, and he bought more land to add to the ranch. He eventually held around 8,000 acres (32 km2) of private land for grazing operations and ran about 1,000 head of cattle. He operated a dude ranch, pack-horse camping trips, and big-game hunting business at and from the TE Ranch. In his spacious ranch house, he entertained notable guests from Europe and America.  Cody published his autobiography, The Life and Adventures of Buffalo Bill, in 1879. Another autobiography, The Great West That Was: "Buffalo Bill's" Life Story, was serialized in Hearst's International Magazine from August 1916 to July 1917. and ghostwritten by James J. Montague. It contained a number of errors, in part because it was completed after Cody's death in January 1917. CANNOTANSWERAnswer this question using a quote from the following article:

How long did he stay in Cody, Wyoming?
<bot>: CANNOTANSWER