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)
      assert len(varimp) == len(x_indices), (
          "expected varimp length: {0}, actual varimp length:"
          " {1}".format(len(x_indices), len(varimp))
      )
  
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