code: def test_all_categoricals_are_encoded_by_default():
      ds = load_dataset(incl_test=True)
      categoricals = {
          n for n, t in ds.train.types.items() if t == "enum"
      } - {ds.target}
      assert len(categoricals) > 0
      te = H2OTargetEncoderEstimator()
      te.train(y=ds.target, training_frame=ds.train)
      encoded = te.predict(ds.test)
      assert {"{}_te".format(n) for n in categoricals} < set(
          encoded.names
      ), "some categoricals haven't been encoded"
      assert set(ds.train.names) < set(
          encoded.names
      ), "some original columns have been removed from predictions"
  
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 2 for calling a global function with example usage: test_all_categoricals_are_encoded_by_default() without return types