#NEWLINE# def _prep_precinct_result( self , row , office , district , primary_party , precinct , candidate , county , votes ) : #NEWLINE# #INDENT# kwargs = self . _base_kwargs ( row , office , district , candidate ) #NEWLINE# county_ocd_id = [ c for c in self . datasource . _jurisdictions ( ) if ( c [ 'county' ] . upper ( ) == county . upper ( ) ) ] [ 0 ] [ 'ocd_id' ] #NEWLINE# if ( precinct . upper ( ) == 'TOTALS' ) : #NEWLINE# #INDENT# jurisdiction = None #NEWLINE# ocd_id = county_ocd_id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# jurisdiction = precinct #NEWLINE# ocd_id = '{}/precinct:{}' . format ( county_ocd_id , ocd_type_id ( precinct ) ) #NEWLINE# #UNINDENT# kwargs . update ( { #NEWLINE# #INDENT# 'reporting_level' : 'precinct' , #NEWLINE# 'jurisdiction' : jurisdiction , #NEWLINE# 'parent_jurisdiction' : county , #NEWLINE# 'ocd_id' : ocd_id , #NEWLINE# 'primary_party' : primary_party , #NEWLINE# 'votes' : self . _votes ( votes ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# if primary_party : #NEWLINE# #INDENT# kwargs . update ( { #NEWLINE# #INDENT# 'party' : primary_party , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return RawResult ( ** kwargs )