Whenever it shall appear by affidavit that anyone is illegally held in custody or restraint, and that there is good reason to believe that such person will be carried out of the jurisdiction of the court or judge before whom the application is made, or will suffer some irreparable injury before compliance with the writ can be enforced, such court or judge may cause a warrant to be issued, reciting the facts, and directed to the sheriff or any constable of the county, commanding him to take the person thus held in custody or restraint, and forthwith bring him before the court or judge, to be dealt with according to law.
R.L. 1910, § 4899.