class_docstr: Tests for the `HyperbandBracket` class.
class_docstr_tok: ["Tests","for","the","`","HyperbandBracket","`","class","."]
docstr: Test to get the max resource R for a particular trial
docstr_tok: ["Test","to","get","the","max","resource","R","for","a","particular","trial"]
code: def test_get_trial_max_resource(
      self,
      hyperband: Hyperband,
      bracket: HyperbandBracket,
      rung_0: RungDict,
      rung_1: RungDict,
      rung_2: RungDict,
  ):
      """Test to get the max resource R for a particular trial"""
      assert bracket.owner is hyperband
      bracket.rungs[0] = rung_0
  
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 0.0))
          )
          == 1
      )
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 8.0))
          )
          == 1
      )
  
      bracket.rungs[1] = rung_1
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 0.0))
          )
          == 3
      )
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 8.0))
          )
          == 1
      )
  
      bracket.rungs[2] = rung_2
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 0.0))
          )
          == 9
      )
      assert (
          bracket.get_trial_max_resource(
              trial=create_trial_for_hb((1, 8.0))
          )
          == 1
      )
  
imports: from __future__ import annotations
  import copy
  import logging
  import typing
  from typing import Any, ClassVar, Sequence
  import numpy
  import pytest
  from orion.algo.hyperband import BudgetTuple, Hyperband, HyperbandBracket, RungDict, compute_budgets
  from orion.algo.space import Fidelity, Integer, Real, Space
  from orion.core.utils.flatten import flatten
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.core.worker.trial import Trial
  from orion.testing.algo import BaseAlgoTests, TestPhase
  from orion.testing.trial import compare_trials, create_trial
label_desc: Use image node_id 11 for calling the TestHyperbandBracket obj's underlying member method code with example usage: obj.test_get_trial_max_resource(hyperband, bracket, rung_0, rung_1, rung_2) without return types