code: def wait_for(wait_func, data_store=None, timeout=10):
      """
      block until wait_func is true
      """
      for i in range(timeout):
          if data_store:
              data_store.load_from_store()
  
          if wait_func():
              return
          time.sleep(10)
  
      # one last time
      if wait_func():
          return
  
      raise ValueError(
          ("Waited {timeout} seconds, but condition timed out").format(
              timeout=timeout,
          )
      )
  
file_path: coach/rl_coach/rollout_worker.py
imports: import time
  import os
  from rl_coach.base_parameters import TaskParameters, DistributedCoachSynchronizationType
  from rl_coach.checkpoint import CheckpointStateFile, CheckpointStateReader
  from rl_coach.data_stores.data_store import SyncFiles
  from rl_coach.core_types import RunPhase
label_desc: Use image node_id 1 for calling a global function with example usage: wait_for(wait_func, data_store, timeout) without return types