code: def test_build_with_conditional_scope():
      def build_model(hp):
          model = hp.Choice("model", ["v1", "v2"])
          with hp.conditional_scope("model", "v1"):
              v1_params = {
                  "layers": hp.Int("layers", 1, 3),
                  "units": hp.Int("units", 16, 32),
              }
          with hp.conditional_scope("model", "v2"):
              v2_params = {
                  "layers": hp.Int("layers", 2, 4),
                  "units": hp.Int("units", 32, 64),
              }
  
          params = v1_params if model == "v1" else v2_params
          inputs = keras.Input(shape=(10,))
          x = inputs
          for _ in range(params["layers"]):
              x = keras.layers.Dense(params["units"])(x)
          outputs = keras.layers.Dense(1)(x)
          model = keras.Model(inputs, outputs)
          model.compile("sgd", "mse")
          return model
  
      hp = hp_module.HyperParameters()
      build_model(hp)
      assert hp.values == {
          "model": "v1",
          "layers": 1,
          "units": 16,
      }
  
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 9 for calling a global function with example usage: test_build_with_conditional_scope() and returns: model