666.
(a) Notwithstanding Section 490, a person who has been convicted three or more times of petty theft, shoplifting, grand theft, a conviction pursuant to subdivision (d) or (e) of Section 368, auto theft under Section 10851 of the Vehicle Code, burglary, carjacking, robbery, or a felony conviction of Section 496, and has served a term for that crime in any penal institution or has been imprisoned therein as a condition of probation for that offense, and who is subsequently convicted of petty theft or shoplifting, shall be punished by imprisonment in the county jail not exceeding one year, or imprisonment pursuant to subdivision (h) of Section 1170.(a) (b) (1) Notwithstanding Section 490, any a person described in subdivision (b) who, having paragraph (2) who has been convicted of petty theft, shoplifting, grand theft, a conviction pursuant to subdivision (d) or (e) of Section 368, auto theft under Section 10851 of the Vehicle Code, burglary, carjacking, robbery, or a felony violation of Section 496, and having has served a term of imprisonment therefor in any penal institution or having has been imprisoned therein as a condition of probation for that offense, and who is subsequently convicted of petty theft, is punishable theft or shoplifting, shall be punished by imprisonment in the county jail not exceeding one year, year or in the state prison.
(b) (2) Subdivision (a) Paragraph (1) shall apply to any person who is required to register pursuant to the Sex Offender Registration Act, or who has a prior violent or serious felony conviction, as specified in clause (iv) of subparagraph (C) of paragraph (2) of subdivision (e) of Section 667, or has a conviction pursuant to subdivision (d) or (e) of Section 368.
(c) This section shall not be construed to does not preclude prosecution or punishment pursuant to subdivisions (b) to (i), inclusive, of Section 667, 667 or Section 1170.12.