code: def test_params_are_validated_in_setter():
      aml = H2OAutoML()
      try:
          aml.nfolds = 1
          assert False, "should have raised"
      except AssertionError as e:
          assert (
              aml.nfolds == -1
          ), "nfolds should have remained to default value"
          assert (
              "nfolds set to 1; use nfolds >=2 if you want cross-validated metrics and Stacked Ensembles or use nfolds = 0 to disable or nfolds = -1 to let h2o choose automatically."
              == str(e)
          )
      aml.nfolds = 3
      assert aml.nfolds == 3
  
file_path: h2o-3/h2o-py/tests/testdir_algos/automl/pyunit_automl_params_attributes.py
imports: import os
  import sys
  from h2o.exceptions import H2OValueError
  from h2o.automl import H2OAutoML
  from tests import pyunit_utils
  from _automl_utils import import_dataset
label_desc: Use image node_id 2 for calling a global function with example usage: test_params_are_validated_in_setter() without return types