Upon petition in writing, as hereinafter provided, of at least twenty registered electors of the senatorial district in case of a senator and of the legislative district in case of a representative in the General Assembly, complaining of an illegal primary or election or false return of any senator or representative, or upon petition in writing as hereinafter provided of at least twenty registered electors of the congressional district in case of a representative in Congress, complaining of an illegal primary or false return of any representative in Congress, the court shall immediately appoint a suitable time for the hearing in open court of such complaint; notice of which shall be given to the person returned, at least ten days before such hearing.
25 P.S. § 3402