<s> import re <EOL> import csv <EOL> import xlrd <EOL> import unicodecsv <EOL> from openelex . base . load import BaseLoader <EOL> from openelex . models import RawResult <EOL> from openelex . lib . text import ocd_type_id , slugify <EOL> from . datasource import Datasource <EOL> """<STR_LIT>""" <EOL> class LoadResults ( object ) : <EOL> """<STR_LIT>""" <EOL> def run ( self , mapping ) : <EOL> loader = GABaseLoader ( ) <EOL> loader . run ( mapping ) <EOL> class GABaseLoader ( BaseLoader ) : <EOL> datasource = Datasource ( ) <EOL> target_offices = set ( [ ] ) <EOL> district_offices = set ( [ ] ) <EOL> def _skip_row ( self , row ) : <EOL> """<STR_LIT>""" <EOL> return False <EOL> def _votes ( self , val ) : <EOL> """<STR_LIT>""" <EOL> if type ( val ) is str : <EOL> if val . strip ( ) == '<STR_LIT>' : <EOL> return <NUM_LIT:0> <EOL> try : <EOL> return int ( float ( val ) ) <EOL> except ValueError : <EOL> return <NUM_LIT:0> <EOL> def _base_kwargs ( self , row ) : <EOL> "<STR_LIT>" <EOL> kwargs = self . _build_common_election_kwargs ( ) <EOL> return kwargs </s>
