The proper court or judge shall have power to compel the attendance of any election officer or other person as a witness, and may also compel the production of all ballots, boxes, voting machines, books, papers, tally lists, returns of election, other documentary or record evidence, at discretion, for use at the trial, and may issue subpoenas and attachments for these purposes as in other proceedings in the courts of this Commonwealth, and all such books, papers, documents, ballots, boxes, voting machines and records, shall be returned to the proper custody.
25 P.S. § 3465