code: def checkIteration(model):
      if model._model_json["output"]["scoring_history"] != None:
          epochList = pyunit_utils.extract_scoring_history_field(
              model, "iterations"
          )
          if (epochList == None) or len(
              epochList
          ) == 0:  # return the scoring history length as number of iteration estimate
              return len(
                  model._model_json["output"][
                      "scoring_history"
                  ].cell_values
              )
          return epochList[-1]
      elif "epochs" in model._model_json["output"]:
          return model._model_json["output"]["epochs"]
      else:
          return 0
  
file_path: h2o-3/h2o-py/tests/testdir_jira/pyunit_pubdev_4702_algo_max_runtime_secs_large.py
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.deeplearning import H2ODeepLearningEstimator
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
  from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
  from h2o.estimators.kmeans import H2OKMeansEstimator
  from h2o.estimators.pca import H2OPrincipalComponentAnalysisEstimator
  from h2o.estimators.random_forest import H2ORandomForestEstimator
  from h2o.estimators.word2vec import H2OWord2vecEstimator
label_desc: Use image node_id 3 for calling a global function with example usage: checkIteration(model) and returns: epochList, len, model, int