code: def test_estimator_with_h2o_frames(estimator_cls):
      estimator = estimator_cls(
          init_connection_args=init_connection_args,
          **_get_default_args(estimator_cls),
      )
  
      data = _get_data(format="h2o", n_classes=3)
      assert isinstance(data.X_train, h2o.H2OFrame)
  
      estimator.fit(data.X_train)
      # estimator.show()
      res = estimator.transform(data.X_train)
      print(res)
      assert isinstance(res, h2o.H2OFrame)
      assert res.dim == list(
          _get_custom_behaviour(estimator_cls).get("result_shape")
      )
      results[estimator_cls].update(
          with_h2o_frames=res.as_data_frame().values
      )
  
      res_ft = estimator.fit_transform(data.X_train)
      print(res)
      assert isinstance(res, h2o.H2OFrame)
      assert np.allclose(
          res.as_data_frame().values, res_ft.as_data_frame().values
      )
  
file_path: h2o-3/h2o-py/tests/testdir_sklearn/pyunit_sklearn_estimators_as_transformers.py
imports: from collections import defaultdict
  from functools import partial
  import gc, inspect, os, sys
  import numpy
  from sklearn.datasets import make_classification, make_regression
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import train_test_split
  import h2o
  from h2o.sklearn.wrapper import H2OConnectionMonitorMixin
  from tests import pyunit_utils, Namespace
label_desc: Use image node_id 4 for calling a global function with example usage: test_estimator_with_h2o_frames(estimator_cls) without return types