code: def _store(
      results,
      key_name,
      array,
      n_splits,
      n_candidates,
      weights=None,
      splits=False,
      rank=False,
  ):
      """A small helper to store the scores/times to the cv_results_"""
      # When iterated first by n_splits and then by parameters
      array = (
          np.array(array, dtype=np.float64)
          .reshape(n_splits, n_candidates)
          .T
      )
      if splits:
          for split_i in range(n_splits):
              results["split%d_%s" % (split_i, key_name)] = array[
                  :, split_i
              ]
  
      array_means = np.average(array, axis=1, weights=weights)
      results["mean_%s" % key_name] = array_means
      # Weighted std is not directly available in numpy
      array_stds = np.sqrt(
          np.average(
              (array - array_means[:, np.newaxis]) ** 2,
              axis=1,
              weights=weights,
          )
      )
      results["std_%s" % key_name] = array_stds
  
      if rank:
          results["rank_%s" % key_name] = np.asarray(
              rankdata(-array_means, method="min"), dtype=np.int32
          )
  
imports: from __future__ import absolute_import, division, print_function
  import warnings
  from collections import defaultdict
  from threading import Lock
  from timeit import default_timer
  import numpy
  import packaging.version
  from dask.base import normalize_token
  from scipy import sparse
  from scipy.stats import rankdata
  from sklearn.exceptions import FitFailedWarning
  from sklearn.pipeline import FeatureUnion, Pipeline
  from sklearn.utils.validation import check_consistent_length
  from toolz import pluck
  from .._compat import Mapping
  from .utils import _index_param_value, _num_samples, _safe_indexing, copy_estimator
label_desc: Use image node_id 16 for calling a global function with example usage: _store(results, key_name, array, n_splits, n_candidates, weights, splits, rank) without return types