code: def _score(estimator, X_test, y_test, scorer):
      """Compute the score of an estimator on a given test set."""
      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
      if not isinstance(score, numbers.Number):
          raise ValueError(
              "scoring must return a number, got %s (%s) instead."
              % (str(score), type(score))
          )
      return score
  
imports: from __future__ import print_function
  from __future__ import division
  import warnings
  import numbers
  import time
  import numpy
  import scipy.sparse
  from ..base import is_classifier, clone
  from ..utils import indexable, check_random_state, safe_indexing
  from ..utils.fixes import astype
  from ..utils.validation import _is_arraylike, _num_samples
  from ..utils.metaestimators import _safe_split
  from ..externals.joblib import Parallel, delayed, logger
  from ..metrics.scorer import check_scoring
  from ..exceptions import FitFailedWarning
  from ._split import check_cv
label_desc: Use image node_id 3 for calling a global function with example usage: _score(estimator, X_test, y_test, scorer) and returns: score