code: def get_trial_uid_and_exp(
      trial: Trial | None = None,
      uid: str | None = None,
      experiment_uid: str | int | None = None,
  ):
      """Return trial and experiment uid either from `trial` or directly uids.
  
      Parameters
      ----------
      trial: Trial, optional
         Object with .id attribute
  
      uid: str, optional
          str id representation of the trial
  
      experiment_uid: str or int, optional
          Id of the experiment.
  
      Raises
      ------
      UndefinedCall
          if both trial and (uid or experiment_uid) are not set
  
      AssertionError
          if both trial and (uid or experiment_uid) are provided and they do not match
  
      Returns
      -------
      (trial uid, experiment uid)
      """
  
      if trial is None and experiment_uid is None:
          raise MissingArguments(
              "Either `trial` or (`uid` and `experiment_uid`) should be set"
          )
  
      if trial is not None and experiment_uid:
          assert trial.experiment == experiment_uid
      elif trial is not None:
          experiment_uid = trial.experiment
  
      trial_uid = get_uid(trial, uid)
  
      return trial_uid, experiment_uid
  
imports: from __future__ import annotations
  import contextlib
  import copy
  import logging
  import typing
  from datetime import datetime
  from typing import Literal
  import orion.core
  from orion.core.io import resolve_config
  from orion.core.utils import GenericFactory
label_desc: Use image node_id 2 for calling a global function with example usage: get_trial_uid_and_exp(trial, uid, experiment_uid) and returns: trial_uid,  experiment_uid