code: def test_balanced_random_forest_oob_binomial(ratio):
      # Regression test for #655: check that the oob score is closed to 0.5
      # a binomial experiment.
      rng = np.random.RandomState(42)
      n_samples = 1000
      X = np.arange(n_samples).reshape(-1, 1)
      y = rng.binomial(1, ratio, size=n_samples)
  
      erf = BalancedRandomForestClassifier(
          oob_score=True,
          random_state=42,
          sampling_strategy="not minority",
          replacement=False,
          bootstrap=True,
      )
      erf.fit(X, y)
      assert np.abs(erf.oob_score_ - 0.5) < 0.1
  
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 10 for calling a global function with example usage: test_balanced_random_forest_oob_binomial(ratio) without return types