code: def build_model(
      model_dir=MODEL_DIR,
      wide_columns=(),
      deep_columns=(),
      linear_optimizer="Ftrl",
      dnn_optimizer="Adagrad",
      dnn_hidden_units=(128, 128),
      dnn_dropout=0.0,
      dnn_batch_norm=True,
      log_every_n_iter=1000,
      save_checkpoints_steps=10000,
      seed=None,
  ):
      """Build wide-deep model.
  
      To generate wide model, pass wide_columns only.
      To generate deep model, pass deep_columns only.
      To generate wide_deep model, pass both wide_columns and deep_columns.
  
      Args:
          model_dir (str): Model checkpoint directory.
          wide_columns (list of tf.feature_column): Wide model feature columns.
          deep_columns (list of tf.feature_column): Deep model feature columns.
          linear_optimizer (str or tf.train.Optimizer): Wide model optimizer name or object.
          dnn_optimizer (str or tf.train.Optimizer): Deep model optimizer name or object.
          dnn_hidden_units (list of int): Deep model hidden units. E.g., [10, 10, 10] is three layers of 10 nodes each.
          dnn_dropout (float): Deep model's dropout rate.
          dnn_batch_norm (bool): Deep model's batch normalization flag.
          log_every_n_iter (int): Log the training loss for every n steps.
          save_checkpoints_steps (int): Model checkpoint frequency.
          seed (int): Random seed.
  
      Returns:
          tf.estimator.Estimator: Model
      """
      gpu_config = tf.compat.v1.ConfigProto()
      gpu_config.gpu_options.allow_growth = (
          True  # dynamic memory allocation
      )
  
      # TensorFlow training setup
      config = tf.estimator.RunConfig(
          tf_random_seed=seed,
          log_step_count_steps=log_every_n_iter,
          save_checkpoints_steps=save_checkpoints_steps,
          session_config=gpu_config,
      )
  
      if len(wide_columns) > 0 and len(deep_columns) == 0:
          model = tf.compat.v1.estimator.LinearRegressor(
              model_dir=model_dir,
              config=config,
              feature_columns=wide_columns,
              optimizer=linear_optimizer,
          )
      elif len(wide_columns) == 0 and len(deep_columns) > 0:
          model = tf.compat.v1.estimator.DNNRegressor(
              model_dir=model_dir,
              config=config,
              feature_columns=deep_columns,
              hidden_units=dnn_hidden_units,
              optimizer=dnn_optimizer,
              dropout=dnn_dropout,
              batch_norm=dnn_batch_norm,
          )
      elif len(wide_columns) > 0 and len(deep_columns) > 0:
          model = tf.compat.v1.estimator.DNNLinearCombinedRegressor(
              model_dir=model_dir,
              config=config,
              # wide settings
              linear_feature_columns=wide_columns,
              linear_optimizer=linear_optimizer,
              # deep settings
              dnn_feature_columns=deep_columns,
              dnn_hidden_units=dnn_hidden_units,
              dnn_optimizer=dnn_optimizer,
              dnn_dropout=dnn_dropout,
              batch_norm=dnn_batch_norm,
          )
      else:
          raise ValueError(
              "To generate wide model, set wide_columns.\n"
              "To generate deep model, set deep_columns.\n"
              "To generate wide_deep model, set both wide_columns and deep_columns."
          )
  
      return model
  
imports: import tensorflow
  from recommenders.utils.constants import DEFAULT_USER_COL, DEFAULT_ITEM_COL
  from recommenders.utils.tf_utils import MODEL_DIR
label_desc: Use image node_id 4 for calling a global function with example usage: build_model(model_dir, wide_columns, deep_columns, linear_optimizer, dnn_optimizer, dnn_hidden_units, dnn_dropout, dnn_batch_norm, log_every_n_iter, save_checkpoints_steps, seed) and returns: model