(a)
When requested by the board of supervisors or the grand jury, the district attorney may petition the superior court for an order directing a public recount to be made of ballots tabulated by a voting system in any precincts in the county that it designates for any election occurring not over 25 days before the request. The request and petition shall be made only on one or more of the following grounds, and the order may be issued only with a finding that there is probable cause to believe that one or more of the grounds exist:
(1)
Misconduct by anyone sufficient to make it likely that the result of the election was affected as to the successful candidates or propositions or tie holders, including any of the conduct specified in Section 16100.
(2)
Errors or failures, whether electronic, mechanical or otherwise, in the safekeeping, handling, tallying, counting, recording, or certification of the ballots or votes cast, sufficient to make it likely that the result of the election was affected as to the successful candidates or propositions or tie holders, or sufficient to cast substantial doubt on the substantial accuracy of the results without regard to affecting any result.
The petition shall be set for hearing and may be opposed by any interested party.
(b)
The court may order any further recounts that it may deem proper based on the results of the recounts provided for in subdivision (a) or in Section 15645, and shall declare the results of all the recounts, and shall determine and order corrected the results of any election affected by any recount.
(c)
The court may order payment of the costs of any such recount in whole or in just proportion by any person or any public agency, or both, who petition for a recount. In the case of public agencies the costs shall be provided for and paid pursuant to Section 19212.