code: def test_kfold_requires_fold_column():
      ds = load_dataset(incl_foldc=True)
      te = H2OTargetEncoderEstimator(data_leakage_handling="kfold")
      try:
          te.train(y=ds.target, training_frame=ds.train)
          assert False, "should have raised"
      except Exception as e:
          assert (
              "Fold column is required when using KFold leakage handling strategy"
              in str(e)
          )
  
      te.train(
          y=ds.target, training_frame=ds.train, fold_column="foldc"
      )
      assert te.predict(ds.train) is not None
  
file_path: h2o-3/h2o-py/tests/testdir_algos/targetencoder/pyunit_targetencoder_data_leakage.py
imports: import itertools
  import os
  import sys
  import h2o
  from h2o.estimators import H2OTargetEncoderEstimator, H2OGradientBoostingEstimator
  from h2o.exceptions import H2OTypeError
  from tests import pyunit_utils
label_desc: Use image node_id 4 for calling a global function with example usage: test_kfold_requires_fold_column() without return types