The Electoral Commission shall be entitled by leave of the Court of Disputed Returns to enter an appearance in any proceedings in which the validity of any election or return is disputed, and to be represented and heard thereon, and in such case shall be deemed to be a party respondent to the petition.