Cal. Penal Code § 1001.51
(a) This chapter shall apply whenever a case is before any court upon an accusatory pleading concerning the commission of a misdemeanor, except a misdemeanor specified in subdivision (b), and it appears to the court that all of the following apply to the defendant:
(c) This chapter shall not apply whenever the accusatory pleading charges the commission of a misdemeanor: