code: def metalearner_obeys_metalearner_params_test():
      metalearner_params = dict(
          distribution="poisson", family="poisson"
      )
      for family in ["gaussian", "tweedie"]:
          infer_mixed_family_and_dist_helper(
              family,
              "poisson",
              False,
              metalearner_params=metalearner_params,
          )
          infer_mixed_family_and_dist_helper(
              family,
              "poisson",
              True,
              metalearner_params=metalearner_params,
          )
  
      # without metalearner_params it would revert to default
      infer_mixed_family_and_dist_helper(
          "gamma",
          "poisson",
          False,
          kwargs_glm=dict(family="tweedie"),
          metalearner_params=metalearner_params,
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "poisson",
          True,
          kwargs_glm=dict(family="tweedie"),
          metalearner_params=metalearner_params,
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "poisson",
          False,
          kwargs_gbm=dict(distribution="tweedie"),
          metalearner_params=metalearner_params,
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "poisson",
          True,
          kwargs_gbm=dict(distribution="tweedie"),
          metalearner_params=metalearner_params,
      )
  
      # without metalerarner_params could inherit the link if all GLMs share the same link
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gamma",
          False,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gamma", link="identity", distribution="gamma"
          ),
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gamma",
          True,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gamma", link="identity", distribution="gamma"
          ),
      )
  
      # don't propagate link from different family
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gaussian",
          False,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gaussian", distribution="gaussian"
          ),
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gaussian",
          True,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gaussian", distribution="gaussian"
          ),
      )
  
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gaussian",
          False,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gaussian",
              link="identity",
              distribution="gaussian",
          ),
      )
      infer_mixed_family_and_dist_helper(
          "gamma",
          "gaussian",
          True,
          expected_link="identity",
          kwargs_glm=dict(link="log"),
          metalearner_params=dict(
              family="gaussian",
              link="identity",
              distribution="gaussian",
          ),
      )
  
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 7 for calling a global function with example usage: metalearner_obeys_metalearner_params_test() without return types