code: def compare_coeffs_2_model(family, coeff1, coeff2, sameModel=False):
      if (
          family == "multinomial"
      ):  # special treatment, it contains a dict of dict
          assert len(coeff1) == len(coeff2), (
              "Coefficient dictionary lengths are different.  One has length {0} while"
              " the other one has length {1}.".format(
                  len(coeff1), len(coeff2)
              )
          )
          if (
              sameModel
          ):  # coef_norm return std_class_ and coef return class_.  Hence, need to change key here
              coeff2CoefKeyChanged = dict()
              for index in range(len(coeff2)):
                  key = "coefs_class_" + str(index)
                  coeff2CoefKeyChanged["std_" + key] = coeff2[key]
              coeff2 = coeff2CoefKeyChanged
  
          for name in coeff1.keys():
              pyunit_utils.equal_two_dicts(coeff1[name], coeff2[name])
      else:
          pyunit_utils.equal_two_dicts(coeff1, coeff2)
  
file_path: h2o-3/h2o-py/tests/testdir_algos/glm/pyunit_pubdev_7238_standardized_coeff_check.py
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
  import math
label_desc: Use image node_id 3 for calling a global function with example usage: compare_coeffs_2_model(family, coeff1, coeff2, sameModel) without return types