#NEWLINE# def _clean_rerp_input( X , data , reject , flat , decim , info , tstep ) : #NEWLINE# #INDENT# 'Remove empty and contaminated points from data and predictor matrices,\n    for `linear_regression_raw`. See there for an explanation of parameters.' #NEWLINE# has_val = np . unique ( X . nonzero ( ) [ 0 ] ) #NEWLINE# if ( reject is not None ) : #NEWLINE# #INDENT# ( _ , inds ) = _reject_data_segments ( _ , reject , flat , decim = None , info = info , tstep = tstep ) #NEWLINE# for ( t0 , t1 ) in inds : #NEWLINE# #INDENT# has_val = np . setdiff1d ( has_val , range ( t0 , t1 ) ) #NEWLINE# #UNINDENT# #UNINDENT# return ( X . tocsr ( ) [ has_val ] , data [ : , has_val ] )