docs: def verify_scores(scores):
      """Ensures that scores is stored as a numpy array and checks that all
      values are finite.
      """
      scores = np.array(scores, copy=False)
      if np.any(~np.isfinite(scores)):
          raise ValueError("scores contains invalid values. " +
                           "Please check that all values are finite.")
      if scores.ndim == 1:
          scores = scores[:,np.newaxis]
      return scores