code: def test_is_done_cardinality(self):
      space = self.update_space(
          {
              # Increase fidelity to increase number of trials in first rungs
              "f": "fidelity(1, 100, base=2)",
              "x": "uniform(0, 4, discrete=True)",
              "y": "choices(['a', 'b', 'c'])",
              "z": "loguniform(1, 6, discrete=True)",
          }
      )
      space = self.create_space(space)
      assert space.cardinality == 5 * 3 * 6
  
      algo = self.create_algo(space=space)
      assert isinstance(algo.algorithm, Hyperband)
      assert algo.algorithm.brackets is not None
      for rung in range(len(algo.algorithm.brackets[0].rungs)):
          assert not algo.is_done
  
          trials: list[Trial] = []
          assert not algo.is_done
          n_sampled = algo.n_suggested
          n_trials = len(algo.algorithm.trial_to_brackets)
          new_trials = algo.suggest(100)
          if not new_trials:
              break
          trials += new_trials
          assert algo.n_suggested == n_sampled + len(new_trials)
          assert (
              len(algo.algorithm.trial_to_brackets) == space.cardinality
          )
  
          # We reached max number of trials we can suggest before observing any.
          assert algo.suggest(100) == []
  
          assert not algo.is_done
  
          for i, trial in enumerate(trials):
              trial.results = [dict(objective=i)]
              algo.observe([trial])
  
      assert algo.is_done
  
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 3 for calling the TestGenericHyperband obj's underlying member method code with example usage: obj.test_is_done_cardinality() without return types