code: def _wait_for_model_to_build(self, grid_id, model_count=1):
      grid_in_progress = None
      times_waited = 0
      while (times_waited < 20) and (
          grid_in_progress is None
          or len(grid_in_progress.model_ids) < model_count
      ):
          time.sleep(5)  # give it tome to train some models
          times_waited += 1
          try:
              grid_in_progress = h2o.get_grid(grid_id)
          except IndexError:
              print("no models trained yet")
          except H2OResponseError as e:
              print("grid not started yet " + e.args[0])
      print("done sleeping")
      return grid_in_progress.model_ids
  
file_path: h2o-3/h2o-hadoop-common/tests_fault_tolerance/python/test_grid_auto_recover.py
imports: import sys
  import os
  import time
  from tests import pyunit_utils
  import fault_tolerance_utils
  import h2o
  from h2o.grid.grid_search import H2OGridSearch
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.exceptions import H2OResponseError
  import unittest
  import threading
label_desc: Use image node_id 2 for calling the GridAutoRecoveryTest obj's underlying member method code with example usage: obj._wait_for_model_to_build(grid_id, model_count) and returns: grid_in_progress