code: def _copy_status_and_results(
      *, trial_with_status: Trial, trial: Trial
  ) -> Trial:
      """Copies the results, status, and other data from `trial_with_status` onto `trial`.
  
      NOTE: The `.parent` attribute of the resulting trial is `trial_with_params.parent`.
  
      Returns a new Trial.
      """
      # TODO: Copy all the attributes of interest explicitly, rather than copying everything.
      new_transformed_trial = copy.deepcopy(trial_with_status)
      new_transformed_trial.parent = trial.parent
      # pylint: disable=protected-access
      new_transformed_trial._params = copy.deepcopy(trial._params)
      return new_transformed_trial
  
imports: from __future__ import annotations
  import copy
  import typing
  from abc import ABC, abstractmethod
  from logging import getLogger
  from typing import Any, Callable
  from orion.algo.base.registry import Registry, RegistryMapping
  from orion.algo.space import Space
  from orion.core.worker.algo_wrappers.algo_wrapper import AlgoT, AlgoWrapper
  from orion.core.worker.transformer import ReshapedSpace, TransformedSpace
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 2 for calling a global function with example usage: _copy_status_and_results() and returns: new_transformed_trial