code: def test_p_value_for_maximum_likelihood():
      training_data = h2o.import_file(
          "http://h2o-public-test-data.s3.amazonaws.com/smalldata/glm_test/gamma_dispersion_factor_9_10kRows.csv"
      )
      weight = pyunit_utils.random_dataset_real_only(
          training_data.nrow, 1, realR=2, misFrac=0, randSeed=12345
      )
      weight = weight.abs()
      training_data = training_data.cbind(weight)
      Y = "resp"
      x = ["abs.C1.", "abs.C2.", "abs.C3.", "abs.C4.", "abs.C5."]
      model_ml = glm(
          family="gamma",
          lambda_=0,
          compute_p_values=True,
          dispersion_parameter_method="ml",
      )
      model_ml.train(training_frame=training_data, x=x, y=Y)
  
      try:
          model_ml_reg = glm(
              family="gamma",
              lambda_=0.0000000001,
              compute_p_values=True,
              dispersion_parameter_method="ml",
          )
          model_ml_reg.train(training_frame=training_data, x=x, y=Y)
          assert (
              False
          ), 'Regularization is not supported with dispersion_parameter_method="ML"'
      except (OSError, EnvironmentError):
          return
  
      dispersion_factor_ml_estimated = model_ml._model_json["output"][
          "dispersion"
      ]
      dispersion_factor_ml_reg_estimated = model_ml_reg._model_json[
          "output"
      ]["dispersion"]
      print(
          abs(
              dispersion_factor_ml_estimated
              - dispersion_factor_ml_reg_estimated
          )
      )
      assert (
          abs(
              dispersion_factor_ml_estimated
              - dispersion_factor_ml_reg_estimated
          )
          < 1e-4
      ), "Expected: {0}, Actual: {1}".format(
          dispersion_factor_ml_estimated,
          dispersion_factor_ml_reg_estimated,
      )
  
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 3 for calling a global function with example usage: test_p_value_for_maximum_likelihood() without return types