code: def test_target_encoded_frame_does_not_contain_fold_column():
      print(
          "Check that attached TargetEncoderModel is being used during training and scoring"
      )
      targetColumnName = "survived"
      foldColumnName = "kfold_column"
  
      teColumns = ["cabin", "embarked"]
      trainingFrame = h2o.import_file(
          pu.locate("smalldata/gbm_test/titanic.csv"), header=1
      )
  
      trainingFrame[targetColumnName] = trainingFrame[
          targetColumnName
      ].asfactor()
      trainingFrame[foldColumnName] = trainingFrame.kfold_column(
          n_folds=5, seed=1234
      )
  
      te = H2OTargetEncoderEstimator(
          inflection_point=0.7,
          smoothing=0.3,
          data_leakage_handling="KFold",
          fold_column=foldColumnName,
          seed=1234,
      )
      te.train(
          training_frame=trainingFrame, x=teColumns, y=targetColumnName
      )
      model_summary = te._model_json["output"][
          "model_summary"
      ].as_data_frame()
      encoded_column_names = model_summary["encoded_column_names"]
  
      # Checking that we don't have empty entries in TwoDim table
      assert len(model_summary) == 2
  
      encoded_columns_with_te_suffix = model_summary[
          encoded_column_names.str.contains("_te")
      ]
      assert len(encoded_columns_with_te_suffix) == 2
  
      transformed = te.transform(trainingFrame, as_training=True)
  
      # Checking that fold column is not being encoded.
      assert foldColumnName + "_te" not in transformed.col_names
  
file_path: h2o-3/h2o-py/tests/testdir_algos/targetencoder/pyunit_targetencoder_model.py
imports: import sys, os
  import tempfile
  import h2o
  from tests import pyunit_utils
  from h2o.estimators import H2OTargetEncoderEstimator
  from h2o.estimators import H2OGradientBoostingEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: test_target_encoded_frame_does_not_contain_fold_column() without return types