CAL. PEN. CODE § 1367 : California Code - Section 1367

(a) A person cannot be tried or adjudged to punishment while that person is mentally incompetent. A defendant is mentally incompetent for purposes of this chapter if, as a result of mental disorder or developmental disability, the defendant is unable to understand the nature of the criminal proceedings or to assist counsel in the conduct of a defense in a rational manner.

(b) Section 1370 shall apply to a person who is charged with a felony and is incompetent as a result of a mental disorder. Sections 1367.1 and 1370.01 shall apply to a person who is charged with a misdemeanor or misdemeanors only, and the judge finds reason to believe that the defendant is mentally disordered, and may, as a result of the mental disorder, be incompetent to stand trial. Section 1370.1 shall apply to a person who is incompetent as a result of a developmental disability and shall apply to a person who is incompetent as a result of a mental disorder, but is also developmentally disabled.