#NEWLINE# def run_row( self , headers , index , row ) : #NEWLINE# #INDENT# ( valid , is_dupe , is_empty , is_defective ) = ( True , False , False , False ) #NEWLINE# row_name = self . get_row_id ( row , headers ) #NEWLINE# _repset = frozenset ( row ) #NEWLINE# _rephash = hash ( _repset ) #NEWLINE# if ( not self . ignore_duplicate_rows ) : #NEWLINE# #INDENT# if ( _rephash in self . seen ) : #NEWLINE# #INDENT# if ( _repset == self . _repempty ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# previous_instances = list ( self . seen [ _rephash ] ) #NEWLINE# self . seen [ _rephash ] . append ( index ) #NEWLINE# valid = False #NEWLINE# is_dupe = True #NEWLINE# _type = RESULTS [ 'structure_004' ] #NEWLINE# entry = self . make_entry ( self . name , self . RESULT_CATEGORY_ROW , self . RESULT_LEVEL_ERROR , _type [ 'msg' ] , _type [ 'id' ] , _type [ 'name' ] , row , index , row_name ) #NEWLINE# self . report . write ( entry ) #NEWLINE# if self . fail_fast : #NEWLINE# #INDENT# return ( valid , headers , index , row ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . seen [ _rephash ] = [ index ] #NEWLINE# #UNINDENT# #UNINDENT# if ( not self . ignore_empty_rows ) : #NEWLINE# #INDENT# if ( ( len ( _repset ) == 1 ) and ( ( _repset == self . _repempty ) or self . empty_strings . intersection ( _repset ) ) ) : #NEWLINE# #INDENT# valid = False #NEWLINE# is_empty = True #NEWLINE# _type = RESULTS [ 'structure_005' ] #NEWLINE# entry = self . make_entry ( self . name , self . RESULT_CATEGORY_ROW , self . RESULT_LEVEL_ERROR , _type [ 'msg' ] , _type [ 'id' ] , _type [ 'name' ] , row , index , row_name ) #NEWLINE# self . report . write ( entry ) #NEWLINE# if self . fail_fast : #NEWLINE# #INDENT# return ( valid , headers , index , row ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( not self . ignore_defective_rows ) : #NEWLINE# #INDENT# if ( len ( headers ) != len ( row ) ) : #NEWLINE# #INDENT# valid = False #NEWLINE# is_defective = True #NEWLINE# _type = RESULTS [ 'structure_003' ] #NEWLINE# entry = self . make_entry ( self . name , self . RESULT_CATEGORY_ROW , self . RESULT_LEVEL_ERROR , _type [ 'msg' ] , _type [ 'id' ] , _type [ 'name' ] , row , index , row_name ) #NEWLINE# self . report . write ( entry ) #NEWLINE# if self . fail_fast : #NEWLINE# #INDENT# return ( valid , headers , index , row ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( self . transform and any ( [ is_dupe , is_empty , is_defective ] ) ) : #NEWLINE# #INDENT# row = None #NEWLINE# #UNINDENT# return ( valid , headers , index , row )