code: def check_model_property(
      model_names,
      prop_name,
      present=True,
      actual_value=None,
      default_value=None,
  ):
      for mn in model_names:
          model = h2o.get_model(mn)
          if present:
              assert (
                  prop_name in model.params.keys()
              ), "missing {prop} in model {model}".format(
                  prop=prop_name, model=mn
              )
              assert (
                  actual_value is None
                  or model.params[prop_name]["actual"] == actual_value
              ), "actual value for {prop} in model {model} is {val}, expected {exp}".format(
                  prop=prop_name,
                  model=mn,
                  val=model.params[prop_name]["actual"],
                  exp=actual_value,
              )
              assert (
                  default_value is None
                  or model.params[prop_name]["default"] == default_value
              ), "default value for {prop} in model {model} is {val}, expected {exp}".format(
                  prop=prop_name,
                  model=mn,
                  val=model.params[prop_name]["default"],
                  exp=default_value,
              )
          else:
              assert (
                  prop_name not in model.params.keys()
              ), "unexpected {prop} in model {model}".format(
                  prop=prop_name, model=mn
              )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_memory_cleanup.py
imports: import sys, os
  import re
  import h2o
  from h2o import H2OFrame
  from h2o.automl import H2OAutoML
  from tests import pyunit_utils
  from _automl_utils import import_dataset, get_partitioned_model_names
label_desc: Use image node_id 1 for calling a global function with example usage: check_model_property(model_names, prop_name, present, actual_value, default_value) without return types