code: def _get_prediction_method(clf):
      """Return prediction method.
  
      `decision_function` method of `clf` returned, if it
      exists, otherwise `predict_proba` method returned.
  
      Parameters
      ----------
      clf : Estimator instance
          Fitted classifier to obtain the prediction method from.
  
      Returns
      -------
      prediction_method : callable
          The prediction method.
      method_name : str
          The name of the prediction method.
      """
      if hasattr(clf, "decision_function"):
          method = getattr(clf, "decision_function")
          return method, "decision_function"
  
      if hasattr(clf, "predict_proba"):
          method = getattr(clf, "predict_proba")
          return method, "predict_proba"
  
imports: import warnings
  from functools import partial
  from inspect import signature
  from math import log
  from numbers import Integral, Real
  import numpy
  from scipy.optimize import fmin_bfgs
  from scipy.special import expit, xlogy
  from sklearn.utils import Bunch
  from .base import BaseEstimator, ClassifierMixin, MetaEstimatorMixin, RegressorMixin, _fit_context, clone
  from .isotonic import IsotonicRegression
  from .model_selection import check_cv, cross_val_predict
  from .preprocessing import LabelEncoder, label_binarize
  from .svm import LinearSVC
  from .utils import _safe_indexing, column_or_1d, indexable
  from .utils._param_validation import HasMethods, Hidden, Interval, StrOptions, validate_params
  from .utils._plotting import _BinaryClassifierCurveDisplayMixin
  from .utils.metadata_routing import MetadataRouter, MethodMapping, _routing_enabled, process_routing
  from .utils.multiclass import check_classification_targets
  from .utils.parallel import Parallel, delayed
  from .utils.validation import _check_fit_params, _check_pos_label_consistency, _check_sample_weight, _num_samples, check_consistent_length, check_is_fitted
label_desc: Use image node_id 2 for calling a global function with example usage: _get_prediction_method(clf) and returns: method,  str, method,  str