code: def test_fit_warm_start(make_whas500, forest_cls):
      whas500 = make_whas500(to_numeric=True)
  
      forest = forest_cls(n_estimators=11, max_depth=2, random_state=2)
      forest.fit(whas500.x, whas500.y)
  
      assert len(forest.estimators_) == 11
      assert all(e.max_depth == 2 for e in forest.estimators_)
  
      forest.set_params(warm_start=True)
      with pytest.warns(
          UserWarning,
          match="Warm-start fitting without increasing n_estimators does not fit new trees.",
      ):
          forest.fit(whas500.x, whas500.y)
  
      forest.set_params(n_estimators=3)
      with pytest.raises(
          ValueError,
          match=r"n_estimators=3 must be larger or equal to len\(estimators_\)=11 when warm_start==True",
      ):
          forest.fit(whas500.x, whas500.y)
  
      forest.set_params(n_estimators=23)
      forest.fit(whas500.x, whas500.y)
  
      assert len(forest.estimators_) == 23
      assert all(e.max_depth == 2 for e in forest.estimators_)
  
imports: import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  import pytest
  from scipy import sparse
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import make_pipeline
  from sksurv.datasets import load_breast_cancer
  from sksurv.ensemble import ExtraSurvivalTrees, RandomSurvivalForest
  from sksurv.preprocessing import OneHotEncoder
  from sksurv.testing import assert_chf_properties, assert_cindex_almost_equal, assert_survival_function_properties
  from sksurv.tree import SurvivalTree
label_desc: Use image node_id 9 for calling a global function with example usage: test_fit_warm_start(make_whas500, forest_cls) without return types