code: def get_ntrees(model):
      return max(
          model._model_json["output"]["scoring_history"][
              "number_of_trees"
          ]
      )
  
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: get_ntrees(model) and returns: max