code: def flatten_numpy(trials_array, flattened_space):
      """Flatten dimensions"""
  
      flattened_points = numpy.array(
          [
              format_trials.trial_to_tuple(
                  flattened_space.transform(
                      format_trials.tuple_to_trial(
                          point[:-1], flattened_space.original
                      )
                  ),
                  flattened_space,
              )
              for point in trials_array
          ]
      )
  
      return numpy.concatenate(
          (flattened_points, trials_array[:, -1:]), axis=1
      )
  
file_path: orion/src/orion/analysis/base.py
imports: import itertools
  from functools import reduce
  import numpy
  import pandas
  from sklearn.ensemble import AdaBoostRegressor, BaggingRegressor, ExtraTreesRegressor, GradientBoostingRegressor, RandomForestRegressor
  from orion.core.utils import format_trials
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 5 for calling a global function with example usage: flatten_numpy(trials_array, flattened_space) and returns: numpy