ELECTIONS CODE
SECTION 15640-15642
15640.  (a) When requested by the board of supervisors or the grandjury, the district attorney may petition the superior court for anorder directing a public recount to be made of ballots tabulated by avoting system in any precincts in the county that it designates forany election occurring not over 25 days before the request. Therequest and petition shall be made only on one or more of thefollowing grounds, and the order may be issued only with a findingthat there is probable cause to believe that one or more of thegrounds exist: (1) Misconduct by anyone sufficient to make it likely that theresult of the election was affected as to the successful candidatesor propositions or tie holders, including any of the conductspecified in Section 16100. (2) Errors or failures, whether electronic, mechanical orotherwise, in the safekeeping, handling, tallying, counting,recording, or certification of the ballots or votes cast, sufficientto make it likely that the result of the election was affected as tothe successful candidates or propositions or tie holders, orsufficient to cast substantial doubt on the substantial accuracy ofthe results without regard to affecting any result. The petition shall be set for hearing and may be opposed by anyinterested party. (b) The court may order any further recounts that it may deemproper based on the results of the recounts provided for insubdivision (a) or in Section 15645, and shall declare the results ofall the recounts, and shall determine and order corrected theresults of any election affected by any recount. (c) The court may order payment of the costs of any such recountin whole or in just proportion by any person or any public agency, orboth, who petition for a recount. In the case of public agencies thecosts shall be provided for and paid pursuant to Section 19212.15641.  Section 15001 shall apply unless a court orders the programheld pending the conclusion of litigation challenging the outcome ofan election. If court action or an official recount is initiatedwhile the program is on deposit, the Secretary of State shall makethe program available to the court or the elections official in whosejurisdiction the court action or recount takes place, upon writtenrequest.15642.  Any tape, diskette, cartridge, or other magnetic orelectronic storage medium used in the programming of vote totalsshall be kept in a secure location and, if there is a recanvass ofvotes, the officer entrusted with the magnetic storage medium shallsubmit his or her affidavit stating that they are the true media usedin the election and have not been altered.