code: def test_loo_requires_target_to_encode_training_frame():
      ds = load_dataset()
      te = H2OTargetEncoderEstimator(
          data_leakage_handling="leave_one_out"
      )
      te.train(y=ds.target, training_frame=ds.train)
  
      train_no_target = h2o.assign(
          ds.train.drop(ds.target), "train_no_target"
      )
      assert train_no_target is not None
      try:
          te.transform(train_no_target, as_training=True)
          assert False, "should have raised"
      except Exception as e:
          assert (
              "LeaveOneOut strategy requires a response column"
              in str(e)
          )
  
      assert te.predict(train_no_target) 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 5 for calling a global function with example usage: test_loo_requires_target_to_encode_training_frame() without return types