code: def test_num_of_exemplars(target_exemplars, tol):
      """Test whether number of generated exemplars corresponds to expected number +/- tolerance"""
      df = h2o.create_frame(
          rows=10000,
          cols=2,
          categorical_fraction=0.1,
          integer_fraction=0.3,
          real_range=100,
          seed=1234,
      )
  
      agg = H2OAggregatorEstimator(
          target_num_exemplars=target_exemplars,
          rel_tol_num_exemplars=tol,
      )
      agg.train(training_frame=df)
      assert (
          agg.aggregated_frame is not None
      ), "Trained model should produce not empty aggregated frame"
      assert (
          (1 - tol) * target_exemplars
          <= agg.aggregated_frame.nrows
          <= (1 + tol) * target_exemplars
      ), "Final number of aggregated exemplars should be in equal to target number +/- tolerance"
  
file_path: h2o-3/h2o-py/tests/testdir_algos/aggregator/pyunit_num_exemplars.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 1 for calling a global function with example usage: test_num_of_exemplars(target_exemplars, tol) without return types