code: def test_missing_value_is_predictive():
      """Check that the forest learns when missing values are only present for
      a predictive feature."""
      rng = np.random.RandomState(0)
      n_samples = 300
  
      X_non_predictive = rng.standard_normal(size=(n_samples, 10))
      y = rng.randint(0, high=2, size=n_samples)
  
      # Create a predictive feature using `y` and with some noise
      X_random_mask = rng.choice(
          [False, True], size=n_samples, p=[0.95, 0.05]
      )
      y_mask = y.astype(bool)
      y_mask[X_random_mask] = ~y_mask[X_random_mask]
  
      predictive_feature = rng.standard_normal(size=n_samples)
      predictive_feature[y_mask] = np.nan
      assert np.isnan(predictive_feature).any()
  
      X_predictive = X_non_predictive.copy()
      X_predictive[:, 5] = predictive_feature
  
      (
          X_predictive_train,
          X_predictive_test,
          X_non_predictive_train,
          X_non_predictive_test,
          y_train,
          y_test,
      ) = train_test_split(
          X_predictive, X_non_predictive, y, random_state=0
      )
      forest_predictive = BalancedRandomForestClassifier(
          sampling_strategy="all",
          replacement=True,
          bootstrap=False,
          random_state=0,
      ).fit(X_predictive_train, y_train)
      forest_non_predictive = BalancedRandomForestClassifier(
          sampling_strategy="all",
          replacement=True,
          bootstrap=False,
          random_state=0,
      ).fit(X_non_predictive_train, y_train)
  
      predictive_test_score = forest_predictive.score(
          X_predictive_test, y_test
      )
  
      assert predictive_test_score >= 0.75
      assert predictive_test_score >= forest_non_predictive.score(
          X_non_predictive_test, y_test
      )
  
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 15 for calling a global function with example usage: test_missing_value_is_predictive() without return types