Cal. Civ. Proc. Code § 128
(a) Every court shall have the power to do all of the following:
(8) To amend and control its process and orders so as to make them conform to law and justice. An appellate court shall not reverse or vacate a duly entered judgment upon an agreement or stipulation of the parties unless the court finds both of the following:
(c) Notwithstanding Section 1211 or any other law, if an order of contempt is made affecting a public safety employee acting within the scope of employment for reason of the employee’s failure to comply with a duly issued subpoena or subpoena duces tecum, the execution of any sentence shall be stayed pending the filing within three judicial days of a petition for extraordinary relief testing the lawfulness of the court’s order, a violation of which is the basis for the contempt.
As used in this subdivision, “public safety employee” includes any peace officer, firefighter, paramedic, or any other employee of a public law enforcement agency whose duty is either to maintain official records or to analyze or present evidence for investigative or prosecutorial purposes.
(d) Notwithstanding Section 1211 or any other law, if an order of contempt is made affecting the victim of a sexual assault, where the contempt consists of refusing to testify concerning that sexual assault, the execution of any sentence shall be stayed pending the filing within three judicial days of a petition for extraordinary relief testing the lawfulness of the court’s order, a violation of which is the basis for the contempt.
As used in this subdivision, “sexual assault” means any act made punishable by Section 261, 262, 264.1, 285, 286, 287, 288, or 289 of, or former Section 288a of, the Penal Code.
(e) Notwithstanding Section 1211 or any other law, if an order of contempt is made affecting the victim of domestic violence, where the contempt consists of refusing to testify concerning that domestic violence, the execution of any sentence shall be stayed pending the filing within three judicial days of a petition for extraordinary relief testing the lawfulness of the court’s order, a violation of which is the basis for the contempt.
As used in this subdivision, the term “domestic violence” means “domestic violence” as defined in Section 6211 of the Family Code.
(f) Notwithstanding Section 1211 or any other provision of law, no order of contempt shall be made affecting a county government or any member of its governing body acting pursuant to its constitutional or statutory authority unless the court finds, based on a review of evidence presented at a hearing conducted for this purpose, that either of the following conditions exist: