Section 17. A city or town clerk or an election commissioner who examines or permits to be examined, except as required by law, ballots cast at an election, which are received and retained by him under section one hundred and nine of chapter fifty-four, shall be punished by a fine of not more than two hundred dollars.