#NEWLINE# def handle_not_enriched_data( activity , policy ) : #NEWLINE# #INDENT# message = ( 'could not enrich field(s) %r for activity #%s' % ( activity . not_enriched_data , activity . get ( 'id' ) ) ) #NEWLINE# if ( policy == IGNORE ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( policy == FAIL ) : #NEWLINE# #INDENT# raise MissingDataException ( message ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( message == LOG ) : #NEWLINE# #INDENT# logger . warn ( message ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( ( '%s is not a valid missing_data_policy' % policy ) )