-351(1) by virtue of lawful process issued by a court or judge in a case where the court or judge has jurisdiction; or (2) by virtue of a warrant or final judgment or decree of a competent court of criminal jurisdiction, or of process issued upon such a warrant, judgment or decree. § 1588. Discharge of person detained by virtue of process If it appears on the return of the writ that the prisoner is in custody by virtue of process from a court of the Canal Zone, or judge or officer thereoi, the prisoner may be discharged in any of the following cases, notwithstanding the provisions of section 1587 of this title: (1) when the jurisdiction of the court or officer has been exceeded; (2) when the imprisonment was at first lawful, yet by some act, omission, or event which has taken place afterwards, the party has become entitled to a discharge; (3) when the process is defective in a matter of substance required by law, rendering the process void; (4) when the process, though proper in form, has been issued in a case not allowed by law; (5) when the person having custody of the prisoner is not the person allowed by law to detain him; (6) where the process is not authorized by an order, judgment or decree of a court, nor by a provision of law; or (7) where a person has been committed on a criminal charge without reasonable or probable cause. § 1589. Defect of form in warrant of commitment If a person is committed to prison, or is in custody of an officer on a criminal charge, by virtue of a warrant of commitment of a court, the person may not be discharged on the ground of a mere defect of form in the warrant of commitment. § 1590. Writ for person committed on criminal charge A person who has been committed on a criminal charge may be brought before the district judge on a writ of habeas corpus. § 1591. Hearing and disposition where charge or process
If it appears to the court or judge by affidavit or otherwise or upon the inspection of the process or warrant of commitment and such other papers in the proceedings as may be shown to the court or judge, that the person is guilty of a criminal offense or ought not to be discharged, although the charge is defective or not substantially set forth in the process or warrant of commitment, the court or judge shall cause the complainant or other necessary witnesses to be subpoenaed to attend at such time as ordered, to testify before the court or judge; and upon the examination he may discharge the prisoner, admit him to bail if the offense is bailable, or recommit him to custody, as may be just and legal. § 1592. Remand to custody If a person brought before the court or judge on the return of the writ is not entitled to his discharge, and is not bailed, where bail is allowable, the court or judge shall remand him to custody or place him under the restraint from which he was taken, if the person under whose custody or restraint he was is legally entitled thereto.