#NEWLINE# def everypolitician_parse( emit , json_file ) : #NEWLINE# #INDENT# with open ( json_file , 'r' ) as fh : #NEWLINE# #INDENT# data = json . load ( fh ) #NEWLINE# #UNINDENT# for policitian in data . get ( 'politicians' ) : #NEWLINE# #INDENT# country = normalize_country ( policitian . get ( 'country_code' ) ) #NEWLINE# entity = { #NEWLINE# #INDENT# 'uid' : make_id ( 'evpo' , policitian . get ( 'id' ) . split ( '-' ) [ ( - 1 ) ] ) , #NEWLINE# 'name' : policitian . get ( 'name' ) , #NEWLINE# 'type' : 'individual' , #NEWLINE# 'addresses' : [ { #NEWLINE# #INDENT# 'country' : country , #NEWLINE# #UNINDENT# } ] , #NEWLINE# 'updated_at' : parse_ts ( policitian . get ( 'legislature_lastmod' ) ) , #NEWLINE# 'source_url' : policitian . get ( 'source_url' ) , #NEWLINE# #UNINDENT# } #NEWLINE# entity . update ( PUBLISHER ) #NEWLINE# emit . entity ( entity )