

def check_warm_start_equal_n_estimators(name):
    (X, y) = (hastie_X, hastie_y)
    ForestEstimator = FOREST_ESTIMATORS[name]
    clf = ForestEstimator(n_estimators=5, max_depth=3, warm_start=True, random_state=1)
    clf.fit(X, y)
    clf_2 = ForestEstimator(n_estimators=5, max_depth=3, warm_start=True, random_state=1)
    clf_2.fit(X, y)
    clf_2.set_params(random_state=2)
    assert_warns(UserWarning, clf_2.fit, X, y)
    assert_array_equal(clf.apply(X), clf_2.apply(X))

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_warm_start_equal_n_estimators/original