42 Pa. C.S. § 6502 : Consolidated Statutes — JUDICIARY AND JUDICIAL PROCEDURE — ACTIONS, PROCEEDINGS AND OTHER MATTERS GENERALLY — HABEAS CORPUS — Power to issue writ
(a) General ruleAny judge of a court of record may issue the writ of habeas corpus to inquire into the cause of detention of any person or for any other lawful purpose.
(b) VenueThe venue of matters brought under this chapter shall be as prescribed by general rule.