code: def _curate_params(data, space):
      dim = space[data.name]
      if isinstance(dim, Categorical):
          data = numpy.array(
              data.tolist()
          )  # To unpack lists if dim shape > 1
          shape = data.shape
          assert len(shape) <= 2
          idx = numpy.argmax(
              data.reshape(-1, 1) == numpy.array(dim.categories), axis=1
          )
          idx = idx.reshape(shape)
          if len(shape) > 1:
              return [list(idx[i]) for i in range(shape[0])]
          return idx
      return data
  
imports: import functools
  from collections.abc import Iterable
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  import orion.analysis
  import orion.analysis.base
  from orion.algo.space import Categorical, Fidelity
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 16 for calling a global function with example usage: _curate_params(data, space) and returns: data, idx, unknown