code: def assertCorrectAddedDeletedPreds(
      best_predictors, added_predictors, removed_predictors, mode
  ):
      numRow = len(best_predictors)
      for index in range(numRow):
          if not (
              mode == "backward"
          ):  # assert predictors are added correctly
              add_pred = added_predictors[index]
              if index == 0:
                  for indexB in range(len(add_pred)):
                      assert (
                          add_pred[indexB] in best_predictors[index]
                      ), (
                          "Current model predictors: {0}, predictor: {1} is added "
                          "incorrectly".format(
                              best_predictors[index], add_pred[indexB]
                          )
                      )
              else:
                  for indexB in range(len(add_pred)):
                      assert not (
                          add_pred[indexB] in best_predictors[index - 1]
                      ) and (
                          add_pred[indexB] in best_predictors[index]
                      ), (
                          "Smaller model predictors: {0}, current model predictors: {1}, predictor: {2} is added "
                          "incorrectly.".format(
                              best_predictors[index - 1],
                              best_predictors[index],
                              add_pred[indexB],
                          )
                      )
  
          del_pred = removed_predictors[index]
          if index > 0:
              for indexB in range(len(del_pred)):
                  if not (del_pred[indexB] == ""):
                      if mode == "backward":
                          assert (
                              del_pred[indexB] in best_predictors[index]
                          ) and not (
                              del_pred[indexB]
                              in best_predictors[index - 1]
                          ), (
                              "Smaller model predictors: {0}, current model predictors: {1}, predictor: {2} is removed "
                              "incorrectly.".format(
                                  best_predictors[index - 1],
                                  best_predictors[index],
                                  del_pred[indexB],
                              )
                          )
                      else:
                          assert (
                              del_pred[indexB]
                              in best_predictors[index - 1]
                          ) and not (
                              del_pred[indexB] in best_predictors[index]
                          ), (
                              "Smaller model predictors: {0}, current model predictors: {1}, predictor: {2} is removed "
                              "incorrectly.".format(
                                  best_predictors[index - 1],
                                  best_predictors[index],
                                  del_pred[indexB],
                              )
                          )
  
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.model_selection import H2OModelSelectionEstimator
label_desc: Use image node_id 3 for calling a global function with example usage: assertCorrectAddedDeletedPreds(best_predictors, added_predictors, removed_predictors, mode) without return types