Unless it shall appear from the complaint itself, or from the documents thereto annexed, that the party can neither be discharged, admitted to pretrial release nor otherwise relieved, the court shall forthwith award relief by habeas corpus. Any judge empowered to grant relief by habeas corpus who shall corruptly refuse to grant the relief when legally applied for in a case where it may lawfully be granted, or who shall for the purpose of oppression unreasonably delay the granting of such relief shall, for every such offense, forfeit to the prisoner or party affected a sum not exceeding $1,000.
735 ILCS 5/10-106