#NEWLINE# def _minor_reduce( X , ufunc ) : #NEWLINE# #INDENT# major_index = np . flatnonzero ( np . diff ( ufunc . indptr ) ) #NEWLINE# if ( ( X . data . size == 0 ) and ( major_index . size == 0 ) ) : #NEWLINE# #INDENT# value = np . zeros_like ( X . data ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# value = ufunc . reduceat ( X . data , X . indptr [ major_index ] ) #NEWLINE# #UNINDENT# return ( major_index , value )