87. All costs resulting from the presentation of a petition in contestation of an election and from the proceedings consequent thereon shall be payable by the petitioner or by the adverse parties, in such manner and in such proportion as the judge or court may determine.