code: def infer_distribution_helper(
      dist, expected_dist, kwargs1={}, kwargs2={}
  ):
      train = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_train.csv")
      )
      test = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_test.csv")
      )
      if dist == "multinomial":
          y = "species"
      elif dist == "bernoulli":
          train["response"] = (
              train["species"] == "Iris-versicolor"
          ).asfactor()
          test["response"] = (
              test["species"] == "Iris-versicolor"
          ).asfactor()
          y = "response"
      elif dist == "quasibinomial":
          train["response"] = train["species"] == "Iris-versicolor"
          test["response"] = test["species"] == "Iris-versicolor"
          y = "response"
      else:
          y = "petal_wid"
  
      x = train.columns
      x.remove(y)
  
      nfolds = 2
      gbm = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          distribution=dist,
          **kwargs1,
      )
      gbm.train(x=x, y=y, training_frame=train)
  
      gbm2 = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          distribution=dist,
          **kwargs2,
      )
      gbm2.train(x=x, y=y, training_frame=train)
  
      se = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[gbm, gbm2],
          metalearner_algorithm="gbm",
      )
      se.train(x, y, train)
      assert (
          se.metalearner().actual_params.get("distribution")
          == expected_dist
      ), "Expected distribution {} but got {}".format(
          expected_dist,
          se.metalearner().actual_params.get("distribution"),
      )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_distributions.py
imports: import sys
  import h2o
  from h2o.estimators.random_forest import H2ORandomForestEstimator
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.estimators.stackedensemble import H2OStackedEnsembleEstimator
  from h2o.estimators.naive_bayes import H2ONaiveBayesEstimator
  from tests import pyunit_utils
label_desc: Use image node_id 1 for calling a global function with example usage: infer_distribution_helper(dist, expected_dist, kwargs1, kwargs2) without return types