code: def test_binomial_with_loo():
      ds = load_dataset()
      te = H2OTargetEncoderEstimator(
          noise=0, data_leakage_handling="leave_one_out"
      )
      te.train(y=ds.target, training_frame=ds.train)
      encoded = te.transform(ds.train, as_training=True)
      print(encoded)
      col_te_golden = [0.726882, 0.190024, 0.729032, 0.191211, 0.729032]
      col_te = (
          encoded["sex_te"]
          .head(5)
          .as_data_frame()
          .values.reshape(-1)
          .tolist()
      )
      assert_allclose(col_te, col_te_golden, atol=1e-5)
  
      # with open("{}/golden/binomial_loo.csv".format(here), "w") as f:
      #     f.write(encoded.get_frame_data())
      golden = h2o.import_file(
          "{}/golden/binomial_loo.csv".format(here)
      )
      assert golden.names == encoded.names
      assert pu.compare_frames(golden, encoded, 0, tol_numeric=1e-5)
  
file_path: h2o-3/h2o-py/tests/testdir_algos/targetencoder/pyunit_targetencoder_binomial.py
imports: import os
  import sys
  from numpy.testing import assert_allclose
  import h2o
  from h2o.estimators import H2OTargetEncoderEstimator
  from tests import pyunit_utils
label_desc: Use image node_id 4 for calling a global function with example usage: test_binomial_with_loo() without return types