class_docstr: Lineages of trials for workers in PBT
  
  This class regroup all lineages of trials generated by PBT for a given experiment.
  
  Each lineage is a path from a leaf trial (highest fidelity level) up to the root
  (lowest fidelity level). Multiple lineages can fork from the same root, forming a tree.
  A Lineages object may reference multiple trees of lineages. Iterating a Lineages object will
  iterate on the roots of these trees.
docstr: Returns the trials of all lineages at a given depth
  
  Parameters
  ----------
  trial_or_depth: int or ``orion.core.worker.trial.Trial``
      If an int, this represents the depth directly. If a trial, the depth will be inferred
      from it. This trial should be in the Lineages.
  
  Raises
  ------
  KeyError
      If depth is inferred from trial but trial is not already registered in the Lineages
docstr_tok: ["Returns","the","trials","of","all","lineages","at","a","given","depth","Parameters","--","--","--","--","--","trial_or_depth",":","int","or","``","orion.core.worker.trial.Trial","``","If","an","int",",","this","represents","the","depth","directly",".","If","a","trial",",","the","depth","will","be","inferred","from","it",".","This","trial","should","be","in","the","Lineages",".","Raises","--","--","--","KeyError","If","depth","is","inferred","from","trial","but","trial","is","not","already","registered","in","the","Lineages"]
code: def get_trials_at_depth(
      self, trial_or_depth: int | Trial
  ) -> list[Trial]:
      """Returns the trials of all lineages at a given depth
  
      Parameters
      ----------
      trial_or_depth: int or ``orion.core.worker.trial.Trial``
          If an int, this represents the depth directly. If a trial, the depth will be inferred
          from it. This trial should be in the Lineages.
  
      Raises
      ------
      KeyError
          If depth is inferred from trial but trial is not already registered in the Lineages
  
      """
      if isinstance(trial_or_depth, int):
          depth = trial_or_depth
      else:
          depth = self.get_lineage(trial_or_depth).node_depth
  
      trials: list[Trial] = []
      for lineage in self._lineage_roots:
          for trial_node in lineage.get_nodes_at_depth(depth):
              trials.append(trial_node.item)
  
      return trials
  
imports: from __future__ import annotations
  import copy
  import logging
  import time
  from typing import Any, ClassVar, Iterable, Sequence
  import numpy
  from orion.algo.base import BaseAlgorithm
  from orion.algo.pbt.exploit import exploit_factory
  from orion.algo.pbt.explore import explore_factory
  from orion.algo.random import Random
  from orion.algo.space import Fidelity, Space
  from orion.core.utils.flatten import flatten
  from orion.core.utils.tree import TreeNode
  from orion.core.worker.transformer import TransformedDimension
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 10 for calling the Lineages obj's underlying member method code with example usage: obj.get_trials_at_depth(trial_or_depth) and returns: trials