class_docstr: Bracket of rungs for the algorithm ASHA.
  
  Parameters
  ----------
  asha: `ASHA` algorithm
      The asha algorithm object which this bracket will be part of.
  budgets: list of tuple
      Each tuple gives the (n_trials, resource_budget) for the respective rung.
  repetition_id: int
      The id of hyperband execution this bracket belongs to
docstr: Get a candidate for promotion
  
  Raises
  ------
  TypeError
      If get_candidates is called before the entire rung is completed.
docstr_tok: ["Get","a","candidate","for","promotion","Raises","--","--","--","TypeError","If","get_candidates","is","called","before","the","entire","rung","is","completed","."]
code: def get_candidates(self, rung_id: int) -> list[Trial]:
      """Get a candidate for promotion
  
      Raises
      ------
      TypeError
          If get_candidates is called before the entire rung is completed.
      """
      rung_results = self.rungs[rung_id]["results"]
      next_rung = self.rungs[rung_id + 1]["results"]
  
      rung = list(
          sorted(
              (
                  (objective, trial)
                  for objective, trial in rung_results.values()
                  if objective is not None
              ),
              key=lambda item: item[0],
          )
      )
      k = len(rung) // self.owner.reduction_factor
      k = min(k, len(rung))
  
      candidates: list[Trial] = []
      for i in range(k):
          trial = rung[i][1]
          _id = self.owner.get_id(trial, ignore_fidelity=True)
          if _id not in next_rung:
              candidates.append(trial)
  
      return candidates
  
imports: from __future__ import annotations
  import copy
  import logging
  from collections import defaultdict
  from typing import Sequence
  import numpy
  from orion.algo.hyperband import BudgetTuple, Hyperband, HyperbandBracket, display_budgets
  from orion.algo.space import Space
  from orion.core.utils.flatten import flatten
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 2 for calling the ASHABracket obj's underlying member method code with example usage: obj.get_candidates(rung_id) and returns: candidates