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)
  
      for rung in range(len(algo.algorithm.brackets[0].rungs)):
          assert not algo.is_done
          n_sampled = len(algo.algorithm.sampled)
          n_trials = len(algo.algorithm.trial_to_brackets)
          trials = algo.suggest()
          if trials is None:
              break
          assert len(algo.algorithm.sampled) == n_sampled + len(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() is None
  
          assert not algo.is_done
  
          for i, trial in enumerate(trials):
              backward.algo_observe(algo, [trial], [dict(objective=i)])
  
      assert algo.is_done
  
imports: from __future__ import annotations
  import copy
  from typing import ClassVar
  import numpy
  import pytest
  from test_hyperband import create_rung_from_points, create_trial_for_hb
  from orion.algo.evolution_es import BracketEVES, BudgetTuple, EvolutionES, compute_budgets
  from orion.algo.hyperband import RungDict
  from orion.algo.space import Fidelity, Real, Space
  from orion.core.utils import backward
  from orion.core.worker.trial import Trial
  from orion.testing.algo import BaseAlgoTests, TestPhase, _are_equal
  from orion.testing.trial import create_trial
label_desc: Use image node_id 2 for calling the TestGenericEvolutionES obj's underlying member method code with example usage: obj.test_is_done_cardinality() without return types