Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias Expr Str ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore Call NameLoad orelse If CompareIn Str NameLoad body Assign NameStore Call NameLoad orelse Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Assign NameStore Call NameLoad Assign NameStore Call NameLoad ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Assign NameStore Call NameLoad ListLoad Str Str Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Str Str Str Str Str Str Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore ListLoad With AttributeLoad NameLoad attr NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Continue If CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str body Assign NameStore Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Assign NameStore SubscriptLoad SubscriptLoad ListComp NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Index Num Index Str Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr NameLoad Call AttributeLoad Str attr NameLoad Call NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareNotIn Call AttributeLoad SubscriptLoad NameLoad Index Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore ListLoad With AttributeLoad NameLoad attr NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Continue Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str body Expr Call AttributeLoad NameLoad attr Dict Str Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareNotIn Call AttributeLoad SubscriptLoad NameLoad Index Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Str Str Str Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Str Str Str Str Str Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore ListLoad With AttributeLoad NameLoad attr NameStore body Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword Str For NameStore NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Continue If CompareEq Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str body Assign NameStore Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad Call AttributeLoad Str attr SubscriptLoad AttributeLoad NameLoad attr Index Str Call NameLoad NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call NameLoad Call AttributeLoad SubscriptLoad NameLoad Index Str attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return CompareNotIn Call AttributeLoad SubscriptLoad NameLoad Index Str attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Dict Str Call AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list decorator_list
N/A N/A re N/A csv N/A unicodecsv openelex.base.load BaseLoader openelex.models RawResult openelex.lib.text ocd_type_id slugify datasource Datasource N/A 
Arizona elections have pre-processed CSV results files for elections beginning in 2000. These files contain
county-level data for all of the state's counties. Special election results are contained in office-specific
files. The CSV versions of those are contained in the https://github.com/openelections/openelections-data-az repository.

Unofficial precinct-level data is published by the state through Clarity; counties also produce precinct-level
results files in different formats.
 LoadResults N/A object N/A N/A Entry point for data loading.

    Determines appropriate loader for file and triggers load process.

     run N/A N/A self mapping N/A N/A N/A election_id N/A mapping N/A generated_filename N/A N/A precinct election_id N/A N/A loader N/A AZPrecinctLoader N/A N/A N/A special election_id N/A N/A loader N/A AZSpecialLoader N/A N/A loader N/A AZCountyLoader N/A N/A N/A loader run mapping N/A N/A AZBaseLoader N/A BaseLoader N/A N/A datasource N/A Datasource N/A target_offices N/A set N/A President U.S. Senate U.S. House Governor Secretary of State Corporation Commissioner State Treasurer State Mine Inspector Superintendent of Public Instruction Attorney General State Senate State House N/A district_offices N/A set N/A U.S. House State Senate State House _skip_row N/A N/A self row N/A N/A N/A 
        Should this row be skipped?

        This should be implemented in subclasses.
         N/A False N/A N/A AZPrecinctLoader N/A AZBaseLoader N/A N/A 
    Loads Arizona precinct results.

    Format:

    Arizona has county-specific files that have been in varying formats, and also Clarity-provided unofficial results.
    Header rows are identical except for statewide offices that do not contain districts.
     load N/A N/A self N/A N/A N/A headers N/A candidate office district party county precinct votes winner N/A N/A self _common_kwargs N/A N/A self _build_common_election_kwargs N/A N/A N/A self _common_kwargs N/A reporting_level precinct N/A results N/A N/A N/A self _file_handle csvfile N/A N/A reader N/A N/A unicodecsv DictReader csvfile fieldnames headers encoding latin-1 N/A row reader N/A N/A N/A N/A self _skip_row row N/A N/A N/A N/A N/A N/A N/A row N/A precinct strip N/A N/A total_votes N/A int N/A N/A N/A row N/A votes strip N/A contest_winner N/A N/A N/A row N/A winner strip N/A N/A rr_kwargs N/A N/A N/A self _common_kwargs copy N/A N/A rr_kwargs N/A primary_party N/A N/A N/A row N/A party strip N/A N/A N/A rr_kwargs update N/A N/A self _build_contest_kwargs row N/A N/A N/A rr_kwargs update N/A N/A self _build_candidate_kwargs row N/A jurisdiction N/A N/A N/A row N/A precinct strip N/A county_ocd_id N/A N/A N/A c N/A c N/A N/A N/A self datasource _jurisdictions N/A N/A N/A N/A c N/A county upper N/A N/A N/A row N/A county upper N/A 0 N/A ocd_id N/A N/A N/A rr_kwargs update N/A party jurisdiction ocd_id office district votes N/A N/A N/A row N/A party strip jurisdiction N/A N/A {}/precinct:{} format county_ocd_id N/A ocd_type_id jurisdiction N/A N/A N/A row N/A office strip N/A N/A N/A row N/A district strip N/A int N/A N/A N/A row N/A votes strip N/A N/A N/A results append N/A RawResult rr_kwargs N/A N/A N/A N/A RawResult objects insert results N/A _skip_row N/A N/A self row N/A N/A N/A N/A N/A N/A N/A row N/A office strip N/A self target_offices N/A _build_contest_kwargs N/A N/A self row N/A N/A N/A N/A office district N/A N/A N/A row N/A office strip N/A N/A N/A row N/A district strip N/A _build_candidate_kwargs N/A N/A self row N/A N/A N/A N/A full_name N/A N/A N/A row N/A candidate strip N/A N/A AZCountyLoader N/A AZBaseLoader N/A N/A 
    Loads Arizona county-level results for 2000-2014 primary and general elections.

    Format:

    Arizona has PDF files that have been converted to CSV files for elections from 2000.
    Header rows are identical except that precinct is not present.
     load N/A N/A self N/A N/A N/A headers N/A county office district party candidate votes winner write-in notes N/A N/A self _common_kwargs N/A N/A self _build_common_election_kwargs N/A N/A N/A self _common_kwargs N/A reporting_level county N/A results N/A N/A N/A self _file_handle csvfile N/A N/A reader N/A N/A unicodecsv DictReader csvfile fieldnames headers encoding latin-1 N/A row reader N/A N/A N/A N/A self _skip_row row N/A N/A N/A rr_kwargs N/A N/A N/A self _common_kwargs copy N/A N/A N/A rr_kwargs update N/A N/A self _build_contest_kwargs row N/A N/A N/A rr_kwargs update N/A N/A self _build_candidate_kwargs row N/A N/A N/A N/A N/A row N/A county strip N/A N/A N/A N/A rr_kwargs update N/A contest_winner write_in notes N/A N/A N/A row N/A winner strip N/A row N/A write-in N/A row N/A notes N/A N/A N/A results append N/A RawResult rr_kwargs N/A N/A N/A N/A RawResult objects insert results N/A _skip_row N/A N/A self row N/A N/A N/A N/A N/A N/A N/A row N/A office strip N/A self target_offices N/A _build_contest_kwargs N/A N/A self row N/A N/A N/A N/A ocd_id jurisdiction office district N/A N/A {}/county:{} format N/A N/A self mapping N/A ocd_id N/A ocd_type_id N/A N/A N/A row N/A county strip N/A N/A N/A row N/A county strip N/A N/A N/A row N/A office strip N/A N/A N/A row N/A district strip N/A _build_candidate_kwargs N/A N/A self row N/A N/A N/A N/A full_name party votes N/A N/A N/A row N/A candidate strip N/A N/A N/A row N/A party strip N/A int N/A N/A N/A row N/A votes strip N/A N/A AZSpecialLoader N/A AZBaseLoader N/A N/A 
    Loads Arizona county-level results for 2012 special elections.

    Format:

    Arizona has PDF files that have been converted to CSV files for elections after 2000.
    Header rows are identical except that precinct and party are not present.
     load N/A N/A self N/A N/A N/A headers N/A county office district party candidate votes N/A N/A self _common_kwargs N/A N/A self _build_common_election_kwargs N/A N/A N/A self _common_kwargs N/A reporting_level county N/A results N/A N/A N/A self _file_handle csvfile N/A N/A reader N/A N/A unicodecsv DictReader csvfile fieldnames headers encoding latin-1 N/A row reader N/A N/A N/A N/A self _skip_row row N/A N/A N/A N/A N/A N/A N/A row N/A county strip N/A N/A total_votes N/A int N/A N/A N/A row N/A votes strip N/A N/A rr_kwargs N/A N/A N/A self _common_kwargs copy N/A N/A N/A rr_kwargs update N/A N/A self _build_contest_kwargs row N/A N/A N/A rr_kwargs update N/A N/A self _build_candidate_kwargs row N/A jurisdiction N/A N/A N/A row N/A county strip N/A N/A N/A rr_kwargs update N/A jurisdiction ocd_id office district votes jurisdiction N/A N/A {}/county:{} format N/A N/A self mapping N/A ocd_id N/A ocd_type_id jurisdiction N/A N/A N/A row N/A office strip N/A N/A N/A row N/A district strip N/A int N/A N/A N/A row N/A votes strip N/A N/A N/A results append N/A RawResult rr_kwargs N/A N/A N/A N/A RawResult objects insert results N/A _skip_row N/A N/A self row N/A N/A N/A N/A N/A N/A N/A row N/A office strip N/A self target_offices N/A _build_contest_kwargs N/A N/A self row N/A N/A N/A N/A office district N/A N/A N/A row N/A office strip N/A N/A N/A row N/A district strip N/A _build_candidate_kwargs N/A N/A self row N/A N/A N/A N/A full_name N/A N/A N/A row N/A candidate strip N/A N/A