The court to which the petition is presented shall grant a rule to show cause why the petitioner shall not be discharged from arrest, returnable at some convenient time, and shall discharge the petitioner, pending the hearing of the said rule, upon his entering such security for his appearance, surrender, and compliance with the decree of the court as the court shall deem requisite.
39 P.S. § 10