code: def match_models(self):
      for model in self.manual_gam_models:
          alpha = model.actual_params["alpha"]
          lambda_ = model.actual_params["lambda"]
          scale = model.actual_params["scale"]
          num_knots = model.actual_params["num_knots"]
          for grid_search_model in self.h2o_model.models:
              if (
                  grid_search_model.actual_params["alpha"] == alpha
                  and grid_search_model.actual_params["lambda"]
                  == lambda_
                  and grid_search_model.actual_params["scale"] == scale
                  and grid_search_model.actual_params["num_knots"]
                  == num_knots
              ):
                  self.num_grid_models += 1
                  assert (
                      grid_search_model.coef() == model.coef()
                  ), "coefficients should be equal"
                  break
  
      assert (
          self.num_grid_models == self.num_expected_models
      ), "Grid search model parameters incorrect or incorrect number of models generated"
  
file_path: h2o-3/h2o-py/tests/testdir_algos/gam/pyunit_PUBDEV_7367_gridsearch_specific.py
imports: from past.utils import old_div
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator
  from h2o.grid.grid_search import H2OGridSearch
label_desc: Use image node_id 4 for calling the test_gam_gridsearch_specific obj's underlying member method code with example usage: obj.match_models() without return types