code: def wait_for_gpus(world_size, timeout_secs=3600):
      n_gpus = int(ray.cluster_resources().get("GPU", 0))
      elapsed_time = 0
      while n_gpus < world_size:
          logging.warning(
              f"Not enough GPUs available ({n_gpus} available,"
              f"need {world_size}), waiting 10 seconds"
          )
          time.sleep(10)
          elapsed_time += 10
          if elapsed_time > timeout_secs:
              raise RuntimeError("Timeout: could not find enough GPUs")
          n_gpus = int(ray.cluster_resources().get("GPU", 0))
  
file_path: ClassyVision/classy_vision/distributed/launch_ray.py
imports: import logging
  import os
  import socket
  import subprocess
  import sys
  import time
  from argparse import ArgumentParser, REMAINDER
  from contextlib import closing
  import ray
label_desc: Use image node_id 1 for calling a global function with example usage: wait_for_gpus(world_size, timeout_secs) without return types