code: def test_rusboost(imbalanced_dataset, algorithm):
      X, y = imbalanced_dataset
      X_train, X_test, y_train, y_test = train_test_split(
          X, y, stratify=y, random_state=1
      )
      classes = np.unique(y)
  
      n_estimators = 500
      rusboost = RUSBoostClassifier(
          n_estimators=n_estimators, algorithm=algorithm, random_state=0
      )
      rusboost.fit(X_train, y_train)
      assert_array_equal(classes, rusboost.classes_)
  
      # check that we have an ensemble of samplers and estimators with a
      # consistent size
      assert len(rusboost.estimators_) > 1
      assert len(rusboost.estimators_) == len(rusboost.samplers_)
      assert len(rusboost.pipelines_) == len(rusboost.samplers_)
  
      # each sampler in the ensemble should have different random state
      assert len(
          {sampler.random_state for sampler in rusboost.samplers_}
      ) == len(rusboost.samplers_)
      # each estimator in the ensemble should have different random state
      assert len(
          {est.random_state for est in rusboost.estimators_}
      ) == len(rusboost.estimators_)
  
      # check the consistency of the feature importances
      assert (
          len(rusboost.feature_importances_)
          == imbalanced_dataset[0].shape[1]
      )
  
      # check the consistency of the prediction outpus
      y_pred = rusboost.predict_proba(X_test)
      assert y_pred.shape[1] == len(classes)
      assert rusboost.decision_function(X_test).shape[1] == len(classes)
  
      score = rusboost.score(X_test, y_test)
      assert (
          score > 0.6
      ), f"Failed with algorithm {algorithm} and score {score}"
  
      y_pred = rusboost.predict(X_test)
      assert y_pred.shape == y_test.shape
  
file_path: imbalanced-learn/imblearn/ensemble/tests/test_weight_boosting.py
imports: import numpy
  import pytest
  import sklearn
  from sklearn.datasets import load_iris, make_classification
  from sklearn.model_selection import train_test_split
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils._testing import assert_array_equal
  from sklearn.utils.fixes import parse_version
  from imblearn.ensemble import RUSBoostClassifier
label_desc: Use image node_id 2 for calling a global function with example usage: test_rusboost(imbalanced_dataset, algorithm) without return types