Whenever the Attorney General or prosecuting attorney of any county is satisfied that a cause exists therefor he may, at his own instance, or at the relation of any person interested, apply by petition to the circuit court, or the judge thereof in vacation, of the county wherein the seat of government is, or of the county wherein the cause, or any part thereof, for the issuing of such writ arose, to have such writ issued, and shall state therein the reason therefor. Whenever such writ is issued at the relation of any person, the petition shall be to the circuit court, or the judge thereof in vacation, of the county wherein the seat of government is, or of the county wherein the cause, or any part thereof, for the issuing of such writ arose, as the relator may elect. Any such writ may be awarded either by the circuit court or by the judge thereof in vacation.