The court, or a judge of the court in vacation, may, in such case, grant a habeas corpus, and discharge the party, if the party purges the contempt, upon such conditions in respect to the party's compliance with the decree as the judge thinks proper.