code: def wait_til(name, zone, state):
      while True:
          ret = check_tpu(name, zone)
  
          print("wait_til check")
          print(ret)
  
          matches = True
          for k, expected_v in state.items():
              if k not in ret:
                  matches = False
                  continue
              if ret[k] != expected_v:
                  matches = False
  
          if "error" in ret:
              return False
  
          if ret["state"] == "TERMINATED":
              return False
  
          if matches:
              return True
  
          time.sleep(1)
  
file_path: mesh-transformer-jax/ray_tpu.py
imports: import functools
  import os
  import subprocess
  import time
  import glob
  import requests
  from fabric import Connection
label_desc: Use image node_id 6 for calling a global function with example usage: wait_til(name, zone, state) and returns: False, False, True