The defendant in any proceeding for contempt of court arising out of matters covered by the provisions of this chapter may file with the court, prior to the hearing in such proceeding, a demand for the retirement of the judge sitting in the proceeding if:
Upon the filing of such demand, the judge shall proceed no further in the matter and another judge must be designated by the supreme court to hear the same.
N.D.C.C. § 34-08-12