code: def infer_uses_defaults_when_base_model_doesnt_support_distributions_test():
      train = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_train.csv")
      )
      test = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_test.csv")
      )
      x_reg = train.columns
      y_reg = "petal_wid"
      x_reg.remove(y_reg)
  
      nfolds = 2
      glm_reg = H2OGeneralizedLinearEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          family="tweedie",
      )
      glm_reg.train(x=x_reg, y=y_reg, training_frame=train)
  
      gbm_reg = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
          distribution="tweedie",
      )
      gbm_reg.train(x=x_reg, y=y_reg, training_frame=train)
  
      drf_reg = H2ORandomForestEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      drf_reg.train(x=x_reg, y=y_reg, training_frame=train)
  
      se_reg_0 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[glm_reg, gbm_reg],
          metalearner_algorithm="gbm",
      )
      se_reg_0.train(x_reg, y_reg, train)
  
      assert (
          se_reg_0.metalearner().actual_params.get("distribution")
          == "tweedie"
      ), "Expected distribution {} but got {}".format(
          "tweedie",
          se_reg_0.metalearner().actual_params.get("distribution"),
      )
  
      se_reg_1 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[glm_reg, gbm_reg, drf_reg],
          metalearner_algorithm="gbm",
      )
      se_reg_1.train(x_reg, y_reg, train)
  
      assert (
          se_reg_1.metalearner().actual_params.get("distribution")
          == "gaussian"
      ), "Expected distribution {} but got {}".format(
          "gaussian",
          se_reg_1.metalearner().actual_params.get("distribution"),
      )
  
      se_reg_2 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[drf_reg, glm_reg, gbm_reg],
          metalearner_algorithm="gbm",
      )
      se_reg_2.train(x_reg, y_reg, train)
  
      assert (
          se_reg_2.metalearner().actual_params.get("distribution")
          == "gaussian"
      ), "Expected distribution {} but got {}".format(
          "gaussian",
          se_reg_2.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 8 for calling a global function with example usage: infer_uses_defaults_when_base_model_doesnt_support_distributions_test() without return types