#NEWLINE# def check_non_negative( X , whom ) : #NEWLINE# #INDENT# X = ( X . data if sp . issparse ( X ) else whom ) #NEWLINE# if ( X < 0 ) . any ( ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Negative values in data passed to %s' % whom ) )