class_docstr: Wrapper that makes the algo "multi-task" by adding a task id to the inputs.
class_docstr_tok: ["Wrapper","that","makes","the","algo","``","multi-task","''","by","adding","a","task","id","to","the","inputs","."]
code: def _add_task_id(self, trial: Trial, task_id: int) -> Trial:
      params = trial.params.copy()
      params["task_id"] = task_id
      trial_with_task_id = dict_to_trial(params, self.algorithm.space)
      trial_with_task_id = _copy_status_and_results(
          trial_with_status=trial, trial=trial_with_task_id
      )
      return trial_with_task_id
  
imports: from __future__ import annotations
  import copy
  from collections import defaultdict
  from contextlib import contextmanager
  from logging import getLogger
  from orion.algo.space import Categorical, Space
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.worker.algo_wrappers.algo_wrapper import AlgoT
  from orion.core.worker.algo_wrappers.transform_wrapper import TransformWrapper, _copy_status_and_results
  from orion.core.worker.experiment_config import ExperimentConfig
  from orion.core.worker.trial import Trial
  from orion.core.worker.warm_start.knowledge_base import KnowledgeBase
  from orion.core.worker.warm_start.warm_starteable import WarmStarteable
label_desc: Use image node_id 16 for calling the MultiTaskWrapper obj's underlying member method code with example usage: obj._add_task_id(trial, task_id) and returns: trial_with_task_id