(a) If a party or a party's attorney in a district court action or a superior court action, civil or criminal, files an affidavit alleging under oath the belief that a fair and impartial trial cannot be obtained, the presiding district court or superior court judge, respectively, shall at once, and without requiring proof, assign the action to another judge of the appropriate court in that district, or if there is none, the chief justice of the supreme court shall assign a judge for the hearing or trial of the action. The affidavit must contain a statement that it is made in good faith and not for the purpose of delay.
(b) A judge or court may not punish a person for contempt for making, filing, or presenting the affidavit provided for in this section, or a motion founded on the affidavit.
(c) The affidavit shall be filed within five days after the case is at issue upon a question of fact, or within five days after the issue is assigned to a judge, whichever event occurs later, unless good cause is shown for the failure to file it within that time.
(d) A party or a party's attorney may not file more than one affidavit under this section in an action and no more than two affidavits in an action.