Any person committed or detained, imprisoned or restrained of his liberty, under any color or pretense whatever, civil or criminal, except as provided herein, may apply to the Supreme or circuit court, or any justice or judge thereof, for a writ of habeas corpus.

Source: CCrimP 1877, ยงยง 671, 672; CL 1887, ยงยง 7839, 7840; RCCrimP 1903, ยงยง 771, 772; RC 1919, ยงยง 4978, 4979; SDC 1939 & Supp 1960, ยง 37.5501; SL 1983, ch 169, ยง 1.