<s> from __future__ import unicode_literals <EOL> class Error ( object ) : <EOL> def __init__ ( self , error , traceback = None , row = None ) : <EOL> self . error = error <EOL> self . traceback = traceback <EOL> self . row = row <EOL> class RowResult ( object ) : <EOL> IMPORT_TYPE_UPDATE = '<STR_LIT>' <EOL> IMPORT_TYPE_NEW = '<STR_LIT>' <EOL> IMPORT_TYPE_DELETE = '<STR_LIT>' <EOL> IMPORT_TYPE_SKIP = '<STR_LIT>' <EOL> IMPORT_TYPE_ERROR = '<STR_LIT:error>' <EOL> def __init__ ( self ) : <EOL> self . errors = [ ] <EOL> self . diff = None <EOL> self . import_type = None <EOL> class Result ( object ) : <EOL> def __init__ ( self , * args , ** kwargs ) : <EOL> super ( Result , self ) . __init__ ( * args , ** kwargs ) <EOL> self . base_errors = [ ] <EOL> self . rows = [ ] <EOL> def row_errors ( self ) : <EOL> return [ ( i + <NUM_LIT:1> , row . errors ) <EOL> for i , row in enumerate ( self . rows ) if row . errors ] <EOL> def has_errors ( self ) : <EOL> return bool ( self . base_errors or self . row_errors ( ) ) <EOL> def __iter__ ( self ) : <EOL> return iter ( self . rows ) </s>
