To enable the defendant to make proof of the matter set up as grounds for setting aside the indictment, or information, the defendant may file his application before any court of record in the county, setting out and alleging that he is being proceeded against in a certain court, naming it, and setting out a copy of his motion and alleging, all under oath, that he is acting in good faith, and praying for an order to examine witnesses in support thereof. The court shall thereupon issue subpoenas to compel any or all witnesses desired to appear before him at the time named, and shall compel the witnesses to testify fully in regard to the matter and reduce the examination to writing, and certify to the same, and it may be used to support the motion. The mover shall pay the costs of the proceeding. He shall notify the district attorney at least two clear days before he proceeds, of the time and place of taking such testimony, and the district attorney may be present and cross-examine the witnesses and if need be the case in the district court must be adjourned for that purpose.
R.L. 1910, § 5781.