#NEWLINE# def hmt_parse( emit , csvfile ) : #NEWLINE# #INDENT# groups = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# with open ( csvfile , 'r' ) as fh : #NEWLINE# #INDENT# fh . readline ( ) #NEWLINE# for row in unicodecsv . DictReader ( fh ) : #NEWLINE# #INDENT# group = int ( float ( row . pop ( 'Group ID' ) ) ) #NEWLINE# if ( group not in groups ) : #NEWLINE# #INDENT# groups [ group ] = [ ] #NEWLINE# #UNINDENT# groups [ group ] . append ( row ) #NEWLINE# #UNINDENT# #UNINDENT# for ( group , rows ) in groups . items ( ) : #NEWLINE# #INDENT# parse_entry ( emit , group , rows )