def _score_slices(y_true, list_y_pred, scorer, score_mode, cv):
 scores_list = list()
 for y_pred in list_y_pred:
  scores = list()
  for (t, this_y_pred) in enumerate(y_pred):
   if (score_mode in ['mean-fold-wise', 'fold-wise']):
    scores_ = list()
    for (train, test) in cv:
     scores_.append(scorer(y_true[test], this_y_pred[test]))
    scores_ = np.array(scores_)
    if (score_mode == 'mean-fold-wise'):
     scores_ = np.mean(scores_, axis=0)
   elif (score_mode == 'mean-sample-wise'):
    scores_ = scorer(y_true, this_y_pred)
   scores.append(scores_)
  scores_list.append(scores)
 return scores_list

def _score_slices ( y_true , list_y_pred , scorer , score_mode , cv ) : scores_list = list ( ) for y_pred in list_y_pred : scores = list ( ) for ( t , this_y_pred ) in enumerate ( y_pred ) : if ( score_mode in [ 'mean-fold-wise' , 'fold-wise' ] ) : scores_ = list ( ) for ( train , test ) in cv : scores_ . append ( scorer ( y_true [ test ] , this_y_pred [ test ] ) ) scores_ = np . array ( scores_ ) if ( score_mode == 'mean-fold-wise' ) : scores_ = np . mean ( scores_ , axis = 0 ) elif ( score_mode == 'mean-sample-wise' ) : scores_ = scorer ( y_true , this_y_pred ) scores . append ( scores_ ) scores_list . append ( scores ) return scores_list
loop across chunks of testing slices .