code: def _extract_pairwise(self, X, y, n, is_train=True):
      if self.cache is not None and (n, True, is_train) in self.cache:
          return self.cache[n, True, is_train]
  
      if not hasattr(X, "shape"):
          raise ValueError(
              "Precomputed kernels or affinity matrices have "
              "to be passed as arrays or sparse matrices."
          )
      if X.shape[0] != X.shape[1]:
          raise ValueError("X should be a square kernel matrix")
      train, test = self.splits[n]
      result = X[np.ix_(train if is_train else test, train)]
  
      if self.cache is not None:
          self.cache[n, True, is_train] = result
      return result
  
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 7 for calling the CVCache obj's underlying member method code with example usage: obj._extract_pairwise(X, y, n, is_train) and returns: result, self