Any judge empowered by this chapter to issue writs of habeas corpus, who corruptly shall refuse to issue such writ when legally applied to, in a case in which such writ may issue lawfully, or who, for the purpose of oppression, shall delay unreasonably the issuing of such writ, shall forfeit to the prisoner or party aggrieved a sum not exceeding five hundred dollars for every such offense.
N.D.C.C. § 32-22-37