Such person must cause a notice in writing to be given to the plaintiff, his agent or attorney, that at a certain time and place he will apply to the judge of the district court of the county in which such person may be confined, or, in case of his absence or inability to act, to a magistrate of the county in which such person may be imprisoned, for the purpose of obtaining a discharge from his imprisonment.
Idaho Code § 8-202