code: def _score(estimator, X_test, y_test, scorer):
      """Compute the score of an estimator on a given test set.
  
      This code is the same as sklearn.model_selection._validation._score
      but accepts to output arrays instead of floats.
      """
      if y_test is None:
          score = scorer(estimator, X_test)
      else:
          score = scorer(estimator, X_test, y_test)
      if hasattr(score, "item"):
          try:
              # e.g. unwrap memmapped scalars
              score = score.item()
          except ValueError:
              # non-scalar?
              pass
      return score
  
imports: import datetime
  import numbers
  import numpy
  from ..fixes import BaseEstimator, _check_fit_params, _get_check_scoring
  from ..parallel import parallel_func
  from ..utils import verbose, warn
label_desc: Use image node_id 7 for calling a global function with example usage: _score(estimator, X_test, y_test, scorer) and returns: score