code: def test_dict_methods():
      hps = hp_module.HyperParameters()
      hps.Int("a", 0, 10, default=3)
      hps.Choice("b", [1, 2], default=2)
      with hps.conditional_scope("b", 1):
          hps.Float("c", -10, 10, default=3)
          # Don't allow access of a non-active param within its scope.
          with pytest.raises(ValueError, match="is currently inactive"):
              hps["c"]
      with hps.conditional_scope("b", 2):
          hps.Float("c", -30, -20, default=-25)
  
      assert hps["a"] == 3
      assert hps["b"] == 2
      # Ok to access 'c' here since there is an active 'c'.
      assert hps["c"] == -25
      with pytest.raises(KeyError, match="does not exist"):
          hps["d"]
  
      assert "a" in hps
      assert "b" in hps
      assert "c" in hps
      assert "d" not in hps
  
imports: import pytest
  from keras_tuner import protos
  from keras_tuner.backend import keras
  from keras_tuner.engine import hyperparameters
label_desc: Use image node_id 18 for calling a global function with example usage: test_dict_methods() without return types