code: def _partial_preds_to_scores(partial_preds, y_test, scoring_fn):
      scores = []
      for k, y_pred in partial_preds.items():
          if isinstance(y_pred, tuple):  # if constant model
              y_pred = np.ones_like(y_test) * y_pred[1]
          scores.append(scoring_fn(y_test, y_pred))
      return np.vstack(scores)
  
imports: import numpy
  import pandas
  from scipy.spatial.distance import pdist
  from functools import partial
  from .ppms import PartialPredictionModelBase, GenericRegressorPPM, GenericClassifierPPM
  from .block_transformers import _blocked_train_test_split
  from .ranking_stability import tauAP_b, rbo
label_desc: Use image node_id 1 for calling a global function with example usage: _partial_preds_to_scores(partial_preds, y_test, scoring_fn) and returns: np