def _clean_rerp_input(X, data, reject, flat, decim, info, tstep):
 has_val = np.unique(X.nonzero()[0])
 if (reject is not None):
  (_, inds) = _reject_data_segments(data, reject, flat, decim=None, info=info, tstep=tstep)
  for (t0, t1) in inds:
   has_val = np.setdiff1d(has_val, range(t0, t1))
 return (X.tocsr()[has_val], data[:, has_val])

def _clean_rerp_input ( X , data , reject , flat , decim , info , tstep ) : has_val = np . unique ( X . nonzero ( ) [ 0 ] ) if ( reject is not None ) : ( _ , inds ) = _reject_data_segments ( data , reject , flat , decim = None , info = info , tstep = tstep ) for ( t0 , t1 ) in inds : has_val = np . setdiff1d ( has_val , range ( t0 , t1 ) ) return ( X . tocsr ( ) [ has_val ] , data [ : , has_val ] )
remove empty and contaminated points from data & predictor matrices .