code: def test(
      x,
      y,
      output_test,
      strip_part,
      algo_name,
      generic_algo_name,
      family,
  ):
      # GLM
      airlines = h2o.import_file(
          path=pyunit_utils.locate(
              "smalldata/testng/airlines_train.csv"
          )
      )
      glm = H2OGeneralizedLinearEstimator(
          nfolds=2, family=family, max_iterations=2
      )  # alpha = 1, lambda_ = 1, bad values, use default
      glm.train(
          x=x,
          y=y,
          training_frame=airlines,
          validation_frame=airlines,
      )
      with H2OTableDisplay.pandas_rendering_enabled(
          False
      ), capture_output() as (original_output, _):
          glm.show()
      print(original_output.getvalue())
      original_model_filename = tempfile.mkdtemp()
      original_model_filename = glm.download_mojo(
          original_model_filename
      )
  
      generic_mojo_model_from_file = H2OGenericEstimator.from_file(
          original_model_filename
      )
      assert generic_mojo_model_from_file is not None
      with H2OTableDisplay.pandas_rendering_enabled(
          False
      ), capture_output() as (generic_output, _):
          generic_mojo_model_from_file.show()
      print(generic_output.getvalue())
      compare_params(glm, generic_mojo_model_from_file)
  
      output_test(
          original_output.getvalue(),
          generic_output.getvalue(),
          strip_part,
          algo_name,
          generic_algo_name,
      )
      predictions = generic_mojo_model_from_file.predict(airlines)
      assert predictions is not None
      assert predictions.nrows == 24421
      assert (
          generic_mojo_model_from_file._model_json["output"][
              "model_summary"
          ]
          is not None
      )
      assert (
          len(
              generic_mojo_model_from_file._model_json["output"][
                  "model_summary"
              ]._cell_values
          )
          > 0
      )
      assert (
          generic_mojo_model_from_file._model_json["output"][
              "variable_importances"
          ]
          is not None
      )
      assert (
          len(
              generic_mojo_model_from_file._model_json["output"][
                  "variable_importances"
              ]._cell_values
          )
          > 0
      )
  
      generic_mojo_filename = tempfile.mkdtemp("zip", "genericMojo")
      generic_mojo_filename = (
          generic_mojo_model_from_file.download_mojo(
              path=generic_mojo_filename
          )
      )
      assert os.path.getsize(generic_mojo_filename) == os.path.getsize(
          original_model_filename
      )
  
file_path: h2o-3/h2o-py/tests/testdir_generic_model/pyunit_generic_model_mojo_glm.py
imports: import tempfile
  import os
  import sys
  import h2o
  from h2o.display import H2OTableDisplay, capture_output
  from h2o.estimators import H2OGeneralizedLinearEstimator, H2OGenericEstimator
  from tests import pyunit_utils
  from tests.testdir_generic_model import compare_output, compare_params
label_desc: Use image node_id 1 for calling a global function with example usage: test(x, y, output_test, strip_part, algo_name, generic_algo_name, family) without return types