If, when a boy or girl is brought before a juvenile court under the juvenile court law, it appears to the court, either before or after adjudication, that the person has a developmental disability, or if, on the conviction of any person of a crime by any court, it appears to the court that the person has a developmental disability, the court may adjourn the proceedings or suspend the sentence, as the case may be, and direct some suitable person to take proceedings under this article against the person before the court, and the court may order that, pending the preparation, filing, and hearing of the petition, the person before the court be detained in a place of safety, or be placed under the guardianship of some suitable person, on his entering into a recognizance for the appearance of the person upon trial or under conviction when required. If, upon the hearing of the petition, or upon a subsequent hearing, the person upon trial or under conviction is not found to have a developmental disability, the court may proceed with the trial or impose sentence, as the case may be.
Ca. Welf. and Inst. Code § 6512