code: def buildModelCheckVarimp(training_frame, x_indices, y_index, family):
      model = H2OGeneralizedLinearEstimator(family=family)
      model.train(training_frame=training_frame, x=x_indices, y=y_index)
      varimp = model.varimp()
      print(varimp)
      standardized_coeff = model._model_json["output"][
          "standardized_coefficient_magnitudes"
      ]
      # check to make sure varimp and standardized coefficient magnitudes agree
      for ind in range(len(varimp)):
          assert (
              abs(
                  standardized_coeff.cell_values[ind][1]
                  - varimp[ind][1]
              )
              < 1e-6
          ), "Expected value: {0}, actual: {1}".format(
              standardized_coeff.cell_values[ind][1], varimp[ind][1]
          )
  
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: buildModelCheckVarimp(training_frame, x_indices, y_index, family) without return types