code: def test_high_cardinality_enum():
      df = h2o.create_frame(
          rows=10000,
          cols=10,
          categorical_fraction=0.6,
          integer_fraction=0,
          binary_fraction=0,
          real_range=100,
          integer_range=100,
          missing_fraction=0,
          factors=100,
          seed=1234,
      )
      params = {
          "target_num_exemplars": 2000,
          "rel_tol_num_exemplars": 0.5,
          "categorical_encoding": "enum",
      }
      agg = H2OAggregatorEstimator(**params)
      agg.train(training_frame=df)
      assert (
          agg.aggregated_frame is not None
      ), "Trained model should produce not empty aggregated frame"
      assert is_consistent(
          df.nrows, agg.aggregated_frame
      ), "Exemplar counts should sum up to number of training rows"
      assert correct_num_exemplars(
          agg.aggregated_frame, **params
      ), "Generated number of exemplars should match target value"
  
file_path: h2o-3/h2o-py/tests/testdir_algos/aggregator/pyunit_cat_encoding.py
imports: import h2o
  from tests import pyunit_utils
  from h2o.frame import H2OFrame
  from h2o.estimators.aggregator import H2OAggregatorEstimator
label_desc: Use image node_id 4 for calling a global function with example usage: test_high_cardinality_enum() without return types