code: def _wait_for_exit_status(run, timeout=DEFAULT_EXIT_STATUS_TIMEOUT):
      stop_at = time.time() + timeout
      while True:
          if time.time() >= stop_at:
              log.warning("exit status for %s not written", run.id)
              break
          try:
              exit_status = run.get("exit_status")
          except Exception as e:
              log.debug("error reading exit status: %s", e)
              time.sleep(1.0)
          else:
              if exit_status is not None:
                  break
              time.sleep(0.1)
  
imports: import logging
  import os
  import re
  import sys
  import time
  import psutil
  from guild import cli
  from guild import run
  from guild import util
  from guild import var
  from .None import remote_impl_support
  from .None import runs_impl
label_desc: Use image node_id 19 for calling a global function with example usage: _wait_for_exit_status(run, timeout) without return types