code: def test_balanced_random_forest_attributes(imbalanced_dataset):
      X, y = imbalanced_dataset
      n_estimators = 10
      brf = BalancedRandomForestClassifier(
          n_estimators=n_estimators,
          random_state=0,
          sampling_strategy="all",
          replacement=True,
          bootstrap=False,
      )
      brf.fit(X, y)
  
      for idx in range(n_estimators):
          X_res, y_res = brf.samplers_[idx].fit_resample(X, y)
          X_res_2, y_res_2 = (
              brf.pipelines_[idx]
              .named_steps["randomundersampler"]
              .fit_resample(X, y)
          )
          assert_allclose(X_res, X_res_2)
          assert_array_equal(y_res, y_res_2)
  
          y_pred = brf.estimators_[idx].fit(X_res, y_res).predict(X)
          y_pred_2 = brf.pipelines_[idx].fit(X, y).predict(X)
          assert_array_equal(y_pred, y_pred_2)
  
          y_pred = (
              brf.estimators_[idx].fit(X_res, y_res).predict_proba(X)
          )
          y_pred_2 = brf.pipelines_[idx].fit(X, y).predict_proba(X)
          assert_array_equal(y_pred, y_pred_2)
  
imports: import numpy
  import pytest
  import sklearn
  from sklearn.datasets import load_iris, make_classification
  from sklearn.model_selection import GridSearchCV, train_test_split
  from sklearn.utils._testing import assert_allclose, assert_array_equal
  from sklearn.utils.fixes import parse_version
  from imblearn.ensemble import BalancedRandomForestClassifier
label_desc: Use image node_id 4 for calling a global function with example usage: test_balanced_random_forest_attributes(imbalanced_dataset) without return types