code: def plot_decision_function(X, y, clf, ax, title=None):
      plot_step = 0.02
      x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1
      y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1
      xx, yy = np.meshgrid(
          np.arange(x_min, x_max, plot_step),
          np.arange(y_min, y_max, plot_step),
      )
  
      Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])
      Z = Z.reshape(xx.shape)
      ax.contourf(xx, yy, Z, alpha=0.4)
      ax.scatter(X[:, 0], X[:, 1], alpha=0.8, c=y, edgecolor="k")
      if title is not None:
          ax.set_title(title)
  
file_path: imbalanced-learn/examples/under-sampling/plot_comparison_under_sampling.py
imports: import seaborn
  from sklearn.datasets import make_classification
  import numpy
  from sklearn.linear_model import LogisticRegression
  import matplotlib.pyplot
  from sklearn.cluster import MiniBatchKMeans
  from imblearn import FunctionSampler
  from imblearn.pipeline import make_pipeline
  from imblearn.under_sampling import ClusterCentroids
  from imblearn.under_sampling import RandomUnderSampler
  from imblearn.under_sampling import NearMiss
  from imblearn.under_sampling import AllKNN, EditedNearestNeighbours, RepeatedEditedNearestNeighbours
  from imblearn.under_sampling import CondensedNearestNeighbour, NeighbourhoodCleaningRule, OneSidedSelection
  from imblearn.under_sampling import InstanceHardnessThreshold
label_desc: Use image node_id 3 for calling a global function with example usage: plot_decision_function(X, y, clf, ax, title) without return types