code: def wait_for_trainer_ready(
      checkpoint_dir, data_store=None, timeout=10
  ):
      """
      Block until trainer is ready
      """
  
      def wait():
          return os.path.exists(
              os.path.join(
                  checkpoint_dir, SyncFiles.TRAINER_READY.value
              )
          )
  
      wait_for(wait, data_store, 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 2 for calling a global function with example usage: wait_for_trainer_ready(checkpoint_dir, data_store, timeout) and returns: os