code: def await_model_by_query(self, query, timeout=60):
      start = time.time()
      status = None
      while (time.time() - start) < timeout:
          resp = self.sql_via_http(query, RESPONSE_TYPE.TABLE)
          status_index = [
              x.lower() for x in resp["column_names"]
          ].index("status")
          status = resp["data"][0][status_index]
          if status in ["complete", "error"]:
              break
          time.sleep(1)
      return status
  
file_path: mindsdb/tests/integration_tests/flows/http_test_helpers.py
imports: import requests
  import time
  from mindsdb.api.executor.data_types.response_type import RESPONSE_TYPE
  from .conftest import HTTP_API_ROOT
label_desc: Use image node_id 4 for calling the HTTPHelperMixin obj's underlying member method code with example usage: obj.await_model_by_query(query, timeout) and returns: status