The court authorized to grant the writ, to whom a petition therefor is presented, shall grant the same without delay, if it appears that the writ ought to issue.