code: def test_estimator_with_numpy_arrays(estimator_cls):
      estimator = estimator_cls(
          init_connection_args=init_connection_args,
          **_get_default_args(estimator_cls),
      )
  
      data = _get_data(format="numpy", n_classes=3)
      assert isinstance(data.X_train, np.ndarray)
  
      with estimator:
          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_numpy_arrays_in=res.as_data_frame().values
          )
  
          if _get_custom_behaviour(estimator_cls).get("predict", True):
              res_pred = estimator.predict(data.X_train)
              print(res_pred[:10])
              assert isinstance(res_pred, np.ndarray)
              assert np.allclose(res.as_data_frame().values, res_pred)
  
          res_ft = estimator.fit_transform(data.X_train)
          print(res_ft)
          assert isinstance(res_ft, h2o.H2OFrame)
          try:
              assert np.allclose(
                  res.as_data_frame().values,
                  res_ft.as_data_frame().values,
              )
          except AssertionError as e:
              if not _get_custom_behaviour(estimator_cls).get(
                  "idempotent", True
              ):
                  print(
                      "ERROR !!! Due to lack of idempotence, "
                      "{} gives different results on fit+transform and fit_transform with numpy arrays:".format(
                          estimator_cls.__name__
                      )
                      + str(e)
                  )
              else:
                  raise e
  
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 5 for calling a global function with example usage: test_estimator_with_numpy_arrays(estimator_cls) without return types