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, 288, 288a, or 289 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:
(1) That the county has the resources necessary to comply with the order of the court.
(2) That the county has the authority, without recourse to voter approval or without incurring additional indebtedness, to generate the additional resources necessary to comply with the order of the court, that compliance with the order of the court will not expose the county, any member of its governing body, or any other county officer to liability for failure to perform other constitutional or statutory duties, and that compliance with the order of the court will not deprive the county of resources necessary for its reasonable support and maintenance.
128.5. (a) Every trial court may order a party, the party's attorney, or both to pay any reasonable expenses, including attorney' s fees, incurred by another party as a result of bad-faith actions or tactics that are frivolous or solely intended to cause unnecessary delay. This section also applies to judicial arbitration proceedings under Chapter 2.5 (commencing with Section 1141.10) of Title 3 of Part 3.
(b) For purposes of this section:
(1) "Actions or tactics" include, but are not limited to, the making or opposing of motions or the filing and service of a complaint or cross-complaint only if the actions or tactics arise from a complaint filed, or a proceeding initiated, on or before December 31, 1994. The mere filing of a complaint without service thereof on an opposing party does not constitute "actions or tactics" for purposes of this section.
(2) "Frivolous" means (A) totally and completely without merit or (B) for the sole purpose of harassing an opposing party.
(c) Expenses pursuant to this section shall not be imposed except on notice contained in a party's moving or responding papers; or the court's own motion, after notice and opportunity to be heard. An order imposing expenses shall be in writing and shall recite in detail the conduct or circumstances justifying the order.
(d) In addition to any award pursuant to this section for conduct described in subdivision (a), the court may assess punitive damages against the plaintiff upon a determination by the court that the plaintiff's action was an action maintained by a person convicted of a felony against the person's victim, or the victim's heirs, relatives, estate, or personal representative, for injuries arising from the acts for which the person was convicted of a felony, and that the plaintiff is guilty of fraud, oppression, or malice in maintaining the action.
(e) The liability imposed by this section is in addition to any other liability imposed by law for acts or omissions within the purview of this section.
128.7. (a) Every pleading, petition, written notice of motion, or other similar paper shall be signed by at least one attorney of record in the attorney's individual name, or, if the party is not represented by an attorney, shall be signed by the party. Each paper shall state the signer's address and telephone number, if any. Except when otherwise provided by law, pleadings need not be verified or accompanied by affidavit. An unsigned paper shall be stricken unless omission of the signature is corrected promptly after being called to the attention of the attorney or party.
(b) By presenting to the court, whether by signing, filing, submitting, or later advocating, a pleading, petition, written notice of motion, or other similar paper, an attorney or unrepresented party is certifying that to the best of the person's knowledge, information, and belief, formed after an inquiry reasonable under the circumstances, all of the following conditions are met:
(1) It is not being presented primarily for an improper purpose, such as to harass or to cause unnecessary delay or needless increase in the cost of litigation.
(2) The claims, defenses, and other legal contentions therein are warranted by existing law or by a nonfrivolous argument for the extension, modification, or reversal of existing law or the establishment of new law.
(3) The allegations and other factual contentions have evidentiary support or, if specifically so identified, are likely to have evidentiary support after a reasonable opportunity for further investigation or discovery.
(4) The denials of factual contentions are warranted on the evidence or, if specifically so identified, are reasonably based on a lack of information or belief.
(c) If, after notice and a reasonable opportunity to respond, the court determines that subdivision (b) has been violated, the court may, subject to the conditions stated below, impose an appropriate sanction upon the attorneys, law firms, or parties that have violated subdivision (b) or are responsible for the violation. In determining what sanctions, if any, should be ordered, the court shall consider whether a party seeking sanctions has exercised due diligence.
(1) A motion for sanctions under this section shall be made separately from other motions or requests and shall describe the specific conduct alleged to violate subdivision (b). Notice of motion shall be served as provided in Section 1010, but shall not be filed with or presented to the court unless, within 21 days after service of the motion, or any other period as the court may prescribe, the challenged paper, claim, defense, contention, allegation, or denial is not withdrawn or appropriately corrected. If warranted, the court may award to the party prevailing on the motion the reasonable expenses and attorney's fees incurred in presenting or opposing the motion. Absent exceptional circumstances, a law firm shall be held jointly responsible for violations committed by its partners, associates, and employees.
(2) On its own motion, the court may enter an order describing the specific conduct that appears to violate subdivision (b) and directing an attorney, law firm, or party to show cause why it has not violated subdivision (b), unless, within 21 days of service of the order to show cause, the challenged paper, claim, defense, contention, allegation, or denial is withdrawn or appropriately corrected.
(d) A sanction imposed for violation of subdivision (b) shall be limited to what is sufficient to deter repetition of this conduct or comparable conduct by others similarly situated. Subject to the limitations in paragraphs (1) and (2), the sanction may consist of, or include, directives of a nonmonetary nature, an order to pay a penalty into court, or, if imposed on motion and warranted for effective deterrence, an order directing payment to the movant of some or all of the reasonable attorney's fees and other expenses incurred as a direct result of the violation.
(1) Monetary sanctions may not be awarded against a represented party for a violation of paragraph (2) of subdivision (b).
(2) Monetary