code: def test_predict_step_function(make_whas500, forest_cls, func):
      whas500 = make_whas500(to_numeric=True)
  
      forest = forest_cls(n_estimators=10, random_state=2)
      forest.fit(whas500.x[10:], whas500.y[10:])
  
      pred_fn = getattr(forest, func)
  
      ret_array = pred_fn(whas500.x[:10], return_array=True)
      fn_array = pred_fn(whas500.x[:10], return_array=False)
  
      assert ret_array.shape[0] == fn_array.shape[0]
  
      for fn, arr in zip(fn_array, ret_array):
          assert_array_almost_equal(fn.x, forest.unique_times_)
          assert_array_almost_equal(fn.y, arr)
  
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 6 for calling a global function with example usage: test_predict_step_function(make_whas500, forest_cls, func) without return types