Section 51. A county, city or town officer who embezzles or fraudulently converts, or who fraudulently takes or secretes with intent so to do, effects or property which belong to or are in possession of said county, city or town, shall be punished by imprisonment in the state prison for not more than ten years or by a fine of not more than one thousand dollars and imprisonment in jail for not more than two years.