code: def test_state_dict(dumbalgo):
      """Check whether trials_info is in the state dict"""
  
      space = Space()
      dim = Integer("yolo2", "uniform", -3, 6)
      space.register(dim)
      dim = Real("yolo3", "alpha", 0.9)
      space.register(dim)
  
      nested_algo = {"DumbAlgo": dict(value=6, scoring=5)}
      algo = dumbalgo(space, value=(1, 1))
      algo.suggest(1)
      assert not algo.state_dict["registry"]["_trials"]
      backward.algo_observe(
          algo,
          [format_trials.tuple_to_trial((1, 2), space)],
          [dict(objective=3)],
      )
      assert len(algo.state_dict["registry"]["_trials"]) == 1
      backward.algo_observe(
          algo,
          [format_trials.tuple_to_trial((1, 2), space)],
          [dict(objective=3)],
      )
      assert len(algo.state_dict["registry"]["_trials"]) == 1
  
file_path: orion/tests/unittests/algo/test_base.py
imports: import pytest
  from orion.algo.base import BaseAlgorithm
  from orion.algo.space import Integer, Real, Space
  from orion.core.utils import backward, format_trials
label_desc: Use image node_id 3 for calling a global function with example usage: test_state_dict(dumbalgo) without return types