code: def test_is_done_cardinality(self):
      space = self.update_space(
          {
              "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(num_brackets=2, space=space)
  
      for rung in range(algo.algorithm.num_rungs):
          assert not algo.is_done
  
          trials = []
          while True:
              assert not algo.is_done
              n_sampled = len(algo.algorithm.sampled)
              n_trials = len(algo.algorithm.trial_to_brackets)
              new_trials = algo.suggest(1)
              if new_trials is None:
                  break
              trials += new_trials
              if rung == 0:
                  assert len(algo.algorithm.sampled) == n_sampled + 1
              else:
                  assert len(algo.algorithm.sampled) == n_sampled
              assert (
                  len(algo.algorithm.trial_to_brackets) == n_trials + 1
              )
  
          assert not algo.is_done
  
          for i, trial in enumerate(trials):
              algo.observe([trial], [dict(objective=i)])
  
      assert algo.is_done
  
imports: from __future__ import annotations
  import hashlib
  import logging
  from typing import ClassVar
  import numpy
  import pytest
  from test_hyperband import compare_registered_trial, create_rung_from_points, create_trial_for_hb, force_observe
  from orion.algo.asha import ASHA, ASHABracket, compute_budgets
  from orion.algo.hyperband import RungDict
  from orion.algo.space import Fidelity, Integer, Real, Space
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.testing.algo import BaseAlgoTests, TestPhase
  from orion.testing.trial import create_trial
label_desc: Use image node_id 2 for calling the TestGenericASHA obj's underlying member method code with example usage: obj.test_is_done_cardinality() without return types