code: def _build_model(hparams):
      # Note that CloudTuner does not support adding hyperparameters in
      # the model building function. Instead, the search space is configured
      # by passing a hyperparameters argument when instantiating (constructing)
      # the tuner.
      model = keras.Sequential()
      model.add(keras.layers.Flatten(input_shape=(28, 28)))
  
      # Build the model with number of layers from the hyperparameters
      for _ in range(hparams.get("num_layers")):
          model.add(keras.layers.Dense(units=64, activation="relu"))
      model.add(keras.layers.Dense(10, activation="softmax"))
  
      # Compile the model with learning rate from the hyperparameters
      model.compile(
          optimizer=keras.optimizers.Adam(
              lr=hparams.get("learning_rate")
          ),
          loss="sparse_categorical_crossentropy",
          metrics=["acc"],
      )
      return model
  
imports: import contextlib
  import io
  import os
  import re
  import keras_tuner
  import tensorflow
  from tensorflow import keras
  from tensorflow_cloud.tuner import vizier_client
  from tensorflow_cloud.tuner.tuner import DistributingCloudTuner
label_desc: Use image node_id 2 for calling a global function with example usage: _build_model(hparams) and returns: model