code: def test_cardinality_stop_loguniform(algorithm: dict):
      """Test when algo needs to stop because all space is explored (loguniform space)."""
      discrete_space = SpaceBuilder().build(
          {"x": "loguniform(0.1, 1, precision=1)"}
      )
  
      max_trials = 30
      exp = workon(
          rosenbrock,
          space=discrete_space,
          algorithm=algorithm,
          max_trials=max_trials,
      )
      algo_wrapper: SpaceTransform = exp.algorithm
      assert algo_wrapper.space == discrete_space
      assert algo_wrapper.algorithm.is_done
      assert algo_wrapper.is_done
  
      trials = exp.fetch_trials()
      if algo_wrapper.algorithm.space.cardinality == 10:
          # BUG: See https://github.com/Epistimio/orion/issues/865
          # The algo (e.g. GridSearch) believes it has exhausted the space cardinality and exits early
          # but that's incorrect! The transformed space should have a different cardinality than the
          # original space.
          assert len(trials) <= 10
      else:
          assert len(trials) == 10
      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 7 for calling a global function with example usage: test_cardinality_stop_loguniform(algorithm) without return types