code: def test_columns_to_encode_can_be_specified_as_x():
      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()
      te.train(x=to_encode, y=ds.target, training_frame=ds.train)
      encoded = te.predict(ds.test)
      assert {"{}_te".format(n) for n in to_encode} < set(
          encoded.names
      ), "some provided categoricals haven't been encoded"
      not_encoded = categoricals - to_encode
      assert len(not_encoded) > 0
      assert not (
          {"{}_te".format(n) for n in not_encoded} & set(encoded.names)
      ), "some categoricals that were not provided to TargetEncoder have been encoded nonetheless"
  
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 3 for calling a global function with example usage: test_columns_to_encode_can_be_specified_as_x() without return types