code: def assert_smallest_z_removed(
      back_coef,
      z_values_backward,
      z_values_removed,
      coeff_backward,
      predictor_removed,
      x,
      y,
      df,
  ):
      glm_model = H2OGeneralizedLinearEstimator(
          seed=1234,
          remove_collinear_columns=True,
          lambda_=0.0,
          compute_p_values=True,
      )
      glm_model.train(x=x, y=y, training_frame=df)
      cat_predictors = extractCatCols(df, x)
      num_predictors = list(set(x).symmetric_difference(cat_predictors))
      # compare both models are the same model by comparing the z-values
      model_z_values = glm_model._model_json["output"][
          "coefficients_table"
      ]["z_value"]
      model_coeffs = glm_model._model_json["output"][
          "coefficients_table"
      ]["names"]
  
      assert_equal_z_values(
          back_coef,
          glm_model.coef(),
          z_values_backward,
          coeff_backward,
          model_z_values,
          model_coeffs,
      )
      min_z_value = min(z_values_removed)
      # check that predictor with smallest z-value magnitude is removed
      assert_smallest_z_value_numerical(
          num_predictors, min_z_value, model_coeffs, model_z_values
      )
      assert_smallest_z_value_categorical(
          cat_predictors, min_z_value, model_coeffs, model_z_values
      )
  
      for name in cat_predictors:
          for coeff_name in predictor_removed:
              if name in coeff_name:  # cat predictor is removed
                  x.remove(name)
                  return
      x.remove(predictor_removed[0])
  
file_path: h2o-3/h2o-py/tests/testdir_algos/modelselection/pyunit_PUBDEV_8675_modelselection_fail.py
imports: import sys
  import math
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.model_selection import H2OModelSelectionEstimator
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: assert_smallest_z_removed(back_coef, z_values_backward, z_values_removed, coeff_backward, predictor_removed, x, y, df) without return types