code: def _check_boundary_response_method(estimator, response_method):
      """Return prediction method from the `response_method` for decision boundary.
  
      Parameters
      ----------
      estimator : object
          Fitted estimator to check.
  
      response_method : {'auto', 'predict_proba', 'decision_function', 'predict'}
          Specifies whether to use :term:`predict_proba`,
          :term:`decision_function`, :term:`predict` as the target response.
          If set to 'auto', the response method is tried in the following order:
          :term:`decision_function`, :term:`predict_proba`, :term:`predict`.
  
      Returns
      -------
      prediction_method: callable
          Prediction method of estimator.
      """
      has_classes = hasattr(estimator, "classes_")
      if has_classes and _is_arraylike_not_scalar(
          estimator.classes_[0]
      ):
          msg = "Multi-label and multi-output multi-class classifiers are not supported"
          raise ValueError(msg)
  
      if has_classes and len(estimator.classes_) > 2:
          if response_method not in {"auto", "predict"}:
              msg = (
                  "Multiclass classifiers are only supported when response_method is"
                  " 'predict' or 'auto'"
              )
              raise ValueError(msg)
          methods_list = ["predict"]
      elif response_method == "auto":
          methods_list = [
              "decision_function",
              "predict_proba",
              "predict",
          ]
      else:
          methods_list = [response_method]
  
      prediction_method = [
          getattr(estimator, method, None) for method in methods_list
      ]
      prediction_method = reduce(lambda x, y: x or y, prediction_method)
      if prediction_method is None:
          raise ValueError(
              f"{estimator.__class__.__name__} has none of the following attributes: "
              f"{', '.join(methods_list)}."
          )
  
      return prediction_method
  
file_path: catboost/contrib/python/scikit-learn/py3/sklearn/inspection/_plot/decision_boundary.py
imports: from functools import reduce
  import numpy
  from ...base import is_regressor
  from ...preprocessing import LabelEncoder
  from ...utils import _safe_indexing, check_matplotlib_support
  from ...utils.validation import _is_arraylike_not_scalar, _num_features, check_is_fitted
label_desc: Use image node_id 1 for calling a global function with example usage: _check_boundary_response_method(estimator, response_method) and returns: prediction_method