code: def test_balanced_random_forest_sample_weight(imbalanced_dataset):
      rng = np.random.RandomState(42)
      X, y = imbalanced_dataset
      sample_weight = rng.rand(y.shape[0])
      brf = BalancedRandomForestClassifier(
          n_estimators=5,
          random_state=0,
          sampling_strategy="all",
          replacement=True,
          bootstrap=False,
      )
      brf.fit(X, y, sample_weight)
  
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 5 for calling a global function with example usage: test_balanced_random_forest_sample_weight(imbalanced_dataset) without return types