code: def _is_pairwise(estimator):
      """Returns True if estimator is pairwise.
  
      - If the `_pairwise` attribute and the tag are present and consistent,
        then use the value and not issue a warning.
      - If the `_pairwise` attribute and the tag are present and not
        consistent, use the `_pairwise` value and issue a deprecation
        warning.
      - If only the `_pairwise` attribute is present and it is not False,
        issue a deprecation warning and use the `_pairwise` value.
  
      Parameters
      ----------
      estimator : object
          Estimator object to test.
  
      Returns
      -------
      out : bool
          True if the estimator is pairwise and False otherwise.
      """
      with warnings.catch_warnings():
          warnings.filterwarnings("ignore", category=FutureWarning)
          has_pairwise_attribute = hasattr(estimator, "_pairwise")
          pairwise_attribute = getattr(estimator, "_pairwise", False)
      pairwise_tag = _safe_tags(estimator, key="pairwise")
  
      if has_pairwise_attribute:
          if pairwise_attribute != pairwise_tag:
              warnings.warn(
                  "_pairwise was deprecated in 0.24 and will be removed in 1.1 "
                  "(renaming of 0.26). Set the estimator tags of your estimator "
                  "instead",
                  FutureWarning,
                  stacklevel=1,
              )
          return pairwise_attribute
  
      # use pairwise tag when the attribute is not present
      return pairwise_tag
  
imports: import functools
  import logging
  import numbers
  import time
  import warnings
  from collections import Counter
  from contextlib import suppress
  from itertools import compress
  from traceback import format_exc
  import numpy
  import scipy.sparse
  from catboost import CatBoostClassifier, CatBoostRegressor
  from joblib import Parallel, logger
  from scipy.sparse import issparse
  from sklearn import config_context, get_config
  from sklearn.base import clone, is_classifier
  from sklearn.exceptions import FitFailedWarning, NotFittedError
  from sklearn.metrics import check_scoring
  from sklearn.metrics._scorer import _MultimetricScorer
  from sklearn.model_selection import check_cv
  from sklearn.utils.fixes import np_version, parse_version
  from sklearn.utils.validation import indexable
label_desc: Use image node_id 10 for calling a global function with example usage: _is_pairwise(estimator) and returns: pairwise_tag, pairwise_attribute