Every person who aids or abets in the commission of any of the offenses mentioned in Section 18566, 18567, or 18568 is punishable by imprisonment in the county jail for the period of six months or in the state prison for 16 months or two or three years.