code: def test_cardinality_stop_uniform(algorithm: dict):
      """Test when algo needs to stop because all space is explored (discrete space)."""
      discrete_space = copy.deepcopy(space)
      discrete_space["x"] = "uniform(-10, 5, discrete=True)"
      exp = workon(
          rosenbrock, discrete_space, algorithm=algorithm, max_trials=30
      )
  
      trials = exp.fetch_trials()
      assert len(trials) == 16
      assert trials[-1].status == "completed"
  
imports: from __future__ import annotations
  import copy
  import os
  from pathlib import Path
  import numpy
  import pytest
  from orion.algo.pbt.pb2_utils import import_optional
  from orion.client import build_experiment, create_experiment, workon
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.utils.module_import import ImportOptional
  from orion.core.worker.algo_wrappers import AlgoWrapper
  from orion.core.worker.primary_algo import SpaceTransform
  from orion.core.worker.trial import Trial
  from orion.storage.base import BaseStorageProtocol
  from orion.benchmark.task.base import BenchmarkTask
label_desc: Use image node_id 6 for calling a global function with example usage: test_cardinality_stop_uniform(algorithm) without return types