code: def test_scores_w_folds():
      """[SuperLearner] test scoring with folds."""
  
      scores = {
          "null-1": [],
          "offs-1": [],
          "sc.offs-2": [],
          "sc.null-2": [],
      }
  
      for _, tei in FoldIndex(FOLDS, X1).generate(as_array=True):
          col = 0
          for case in sorted(PREPROCESSING):
              for est_name, _ in sorted(ESTIMATORS[case]):
                  s = rmse(y1[tei], F1[tei][:, col])
                  if case != "no":
                      scores["%s.%s-2" % (case, est_name)].append(s)
                  else:
                      scores["%s-1" % est_name].append(s)
  
                  col += 1
  
      for k in scores:
          scores[k] = np.mean(scores[k])
  
      for k in scores:
          assert scores[k] == ens1.data["score-m"]["layer-1/%s" % k]
  
file_path: mlens/mlens/ensemble/tests/test_super_learner.py
imports: import numpy
  from mlens.metrics import rmse
  from mlens.utils.exceptions import MetricWarning
  from mlens.index import FoldIndex
  from mlens.testing.dummy import Data, OLS, PREPROCESSING, ESTIMATORS, ECM
  from mlens.ensemble import SuperLearner
  import os
label_desc: Use image node_id 8 for calling a global function with example usage: test_scores_w_folds() without return types