code: def buildModelCheckCoeff(train_data, y, gamX, family):
      numKnots = [3, 4, 5]
      scale = [0.001, 0.001, 0.001]
      bs_type = [0, 0, 0]
      x = ["C1", "C2"]
      frames = train_data.split_frame(ratios=[0.9])
      train_part = frames[0]
      test_part = frames[1]
      # building multiple models with same training / test datasets to make sure it works
      h2o_model = H2OGeneralizedAdditiveEstimator(
          family=family,
          gam_columns=gamX,
          scale=scale,
          bs=bs_type,
          num_knots=numKnots,
      )
      h2o_model.train(
          x=x,
          y=y,
          training_frame=train_part,
          validation_frame=test_part,
      )
  
      h2o_model2 = H2OGeneralizedAdditiveEstimator(
          family=family,
          gam_columns=gamX,
          scale=scale,
          bs=bs_type,
          num_knots=numKnots,
      )
      h2o_model2.train(
          x=x,
          y=y,
          training_frame=train_part,
          validation_frame=test_part,
      )
      coef1 = h2o_model.coef()
      coef2 = h2o_model2.coef()
      if family == "multinomial":
          allKeys = coef1.keys()
          for oneKey in allKeys:
              pyunit_utils.assertCoefDictEqual(
                  coef1[oneKey], coef2[oneKey]
              )
      else:
          pyunit_utils.assertCoefDictEqual(coef1, coef2)
  
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: buildModelCheckCoeff(train_data, y, gamX, family) without return types