code: def test_estimator_with_numpy_arrays_as_result(estimator_cls):
      estimator = estimator_cls(
          data_conversion=True,
          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[:10])
          assert isinstance(res, np.ndarray)
          assert res.shape == _get_custom_behaviour(estimator_cls).get(
              "result_shape"
          )
          results[estimator_cls].update(with_numpy_arrays_inout=res)
  
          res_ft = estimator.fit_transform(data.X_train)
          print(res[:10])
          assert isinstance(res_ft, np.ndarray)
          try:
              assert np.allclose(res, res_ft)
          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
  
          if _get_custom_behaviour(estimator_cls).get("predict", True):
              res_fp = estimator.fit_predict(data.X_train)
              assert isinstance(res_fp, np.ndarray)
              assert np.allclose(res_ft, res_fp)
  
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 6 for calling a global function with example usage: test_estimator_with_numpy_arrays_as_result(estimator_cls) without return types