code: def dict_to_trial(data, space):
      """Create a `orion.core.worker.trial.Trial` object from `data`,
      filling only parameter information from `data`.
  
      :param data: A dict representing a sample point from `space`.
      :param space: Definition of problem's domain.
      :type space: `orion.algo.space.Space`
      """
      data = flatten(data)
      params = []
      for name, dim in space.items():
          if (
              name not in data
              and dim.default_value is dim.NO_DEFAULT_VALUE
          ):
              raise ValueError(
                  f"Dimension {name} not specified and does not have a default value."
              )
          value = data.get(name, dim.default_value)
  
          params.append(dict(name=dim.name, type=dim.type, value=value))
  
      trial = Trial(params=params)
  
      if trial not in space:
          error_msg = f"Parameters values {trial.params} are outside of space {space}"
          raise ValueError(error_msg)
  
      return trial
  
imports: from orion.core.utils.flatten import flatten
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: dict_to_trial(data, space) and returns: trial