code: def test_gbm_train_segments_parallel():
      prostate = h2o.import_file(
          path=pyunit_utils.locate("smalldata/logreg/prostate.csv")
      )
      prostate["CAPSULE"] = prostate["CAPSULE"].asfactor()
  
      prostate_gbm = H2OGradientBoostingEstimator(
          min_rows=2, ntrees=4, seed=42
      )
      models = prostate_gbm.train_segments(
          y="CAPSULE",
          ignored_columns=["ID"],
          training_frame=prostate,
          segments=["RACE"],
          parallelism=2,
      )
  
      models_list = models.as_frame()
      assert models_list.nrow == 3
  
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: test_gbm_train_segments_parallel() without return types