code: def test_GLM_throws_ArrayOutOfBoundException():
      # everything in this test is important to cause the exception:
      # - GLEASON as a categorical
      # - lambda search enabled
      # - alphas    # - CV enabled
      df = h2o.import_file(
          path=pyunit_utils.locate("smalldata/prostate/prostate.csv")
      )
      target = "CAPSULE"
      nFold = 5
      for col in [target, "GLEASON"]:
          df[col] = df[col].asfactor()
          glm = H2OGeneralizedLinearEstimator(
              lambda_search=True,
              alpha=[0.0, 0.2, 0.4, 0.6, 0.8, 1.0],
              nfolds=nFold,
              seed=12345,
          )
          glm.train(y=target, training_frame=df)
  
          assert (
              len(glm._model_json["output"]["cross_validation_models"])
              == nFold
          ), (
              "expected number of cross_validation_model: {0}.  Actual number of cross_validation: "
              "{1}".format(
                  len(
                      glm._model_json["output"][
                          "cross_validation_models"
                      ]
                  ),
                  nFold,
              )
          )
  
imports: import sys, os
  import h2o
  import h2o.exceptions
  from tests import pyunit_utils
  from h2o.estimators import H2OGeneralizedLinearEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: test_GLM_throws_ArrayOutOfBoundException() without return types