def make_nonnegative(X, min_value=0):
 min_ = safe_min(X)
 if (min_ < min_value):
  if issparse(X):
   raise ValueError('Cannot make the data matrix nonnegative because it is sparse. Adding a value to every entry would make it no longer sparse.')
  X = (X + (min_value - min_))
 return X

def make_nonnegative ( X , min_value = 0 ) : min_ = safe_min ( X ) if ( min_ < min_value ) : if issparse ( X ) : raise ValueError ( 'Cannot make the data matrix nonnegative because it is sparse. Adding a value to every entry would make it no longer sparse.' ) X = ( X + ( min_value - min_ ) ) return X
ensure x .