code: def assert_smallest_z_value_categorical(
      cat_predictors, min_z_value, model_coeffs, model_z_values
  ):
      for name in cat_predictors:
          model_z = []
          for coeff_name in model_coeffs:
              if name in coeff_name:
                  z_val = model_z_values[model_coeffs.index(coeff_name)]
                  if math.isnan(z_val):
                      model_z.append(0)
                  else:
                      model_z.append(abs(z_val))
          assert max(model_z) >= min_z_value, (
              "predictor ({0}) with wrong z value is removed: {1} has smaller magnitude "
              "than mininum_z_values {2}".format(
                  name, model_z, min_z_value
              )
          )
  
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 3 for calling a global function with example usage: assert_smallest_z_value_categorical(cat_predictors, min_z_value, model_coeffs, model_z_values) without return types