Every person taken or charged as in the preceding section [§ 23-29] specified may, at any time after his arrest or imprisonment, petition the court from which the process issued on which he is arrested or imprisoned, for his discharge therefrom, on his compliance with this chapter.
N.C. Gen. Stat. § 23-30