code: def test_columns_to_encode_can_be_listed_in_dedicated_param():
      ds = load_dataset(incl_test=True)
      categoricals = {
          n for n, t in ds.train.types.items() if t == "enum"
      } - {ds.target}
      to_encode = {c for i, c in enumerate(categoricals) if i % 2}
      assert len(to_encode) > 0
      te = H2OTargetEncoderEstimator(columns_to_encode=list(to_encode))
      te.train(y=ds.target, training_frame=ds.train)
      encoded = te.predict(ds.test)
      te_cols = [c for c in encoded.names if c.endswith("_te")]
      assert len(te_cols) == len(to_encode)
      assert {"{}_te".format(n) for n in to_encode} == set(te_cols)
  
file_path: h2o-3/h2o-py/tests/testdir_algos/targetencoder/pyunit_targetencoder_training.py
imports: import os
  import sys
  import h2o
  from h2o.estimators import H2OTargetEncoderEstimator
  from h2o.exceptions import H2OResponseError
  from tests import pyunit_utils
label_desc: Use image node_id 7 for calling a global function with example usage: test_columns_to_encode_can_be_listed_in_dedicated_param() without return types