code: def test_to_numpy(space):
      """Test that trials are correctly converted to numpy array"""
      array = to_numpy(data, space)
  
      assert array.shape == (3, 4)
      numpy.testing.assert_equal(array[:, 0], data["x"])
      numpy.testing.assert_equal(array[:, 1], data["y"])
      numpy.testing.assert_equal(array[:, 2], data["z"])
      numpy.testing.assert_equal(array[:, 3], data["objective"])
  
imports: import numpy
  import pandas
  import pytest
  from sklearn.ensemble import AdaBoostRegressor, BaggingRegressor, ExtraTreesRegressor, GradientBoostingRegressor, RandomForestRegressor
  from orion.analysis.base import average, flatten_numpy, flatten_params, ranking, to_numpy, train_regressor
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 6 for calling a global function with example usage: test_to_numpy(space) without return types