James Eichorn (defendant), a homeless resident of Santa Ana, California, was cited by a police officer for violating a city ordinance that prohibited sleeping in designated public areas. At the time of his citation, Eichorn was in a sleeping bag outside a building in the civic center. When the police officer asked Eichorn why he did not go to the National Guard Armory (Armory), which was used as a homeless shelter, Eichorn stated that he had tried to do so once, but it was consistently full. Prior to trial, Eichorn requested funds to hire an expert to testify about the harmful effects of sleep loss. Additionally, Eichorn asked to present a defense of necessity. The trial court denied both of Eichorn’s requests. At a bench trial, Eichorn presented several expert witnesses who testified about a significantly rising homelessness rate, a lack of available beds for homeless individuals at shelters, and the fact that the Armory was over capacity on the night Eichorn was cited. One expert witness testified that most homeless individuals were in their situations involuntarily because they could not obtain consistent employment, and that these individuals slept outside because they had no other alternative. The trial court concluded that Eichorn’s proof was inadequate to support a necessity defense. Eichorn was convicted, and he appealed. The appellate department affirmed the conviction and denied Eichorn’s request to transfer the cause. Eichorn petitioned for a writ of habeas corpus in the Court of Appeal of California.