def wait_until_ready(self, timeout):
        """
        Waits (blocking) until the WebLab instance responds, or until the timeout expires. If the timeout
        expires without being ready a TimeoutError exception is thrown.
        :param timeout: Number of seconds to wait at most.
        :raises TimeoutError: In case of timeout.
        :return:
        """
        # Wait until we are ready.
        began = time.time()
        while True:
            if time.time() - began >= timeout:
                raise TimeoutError()
            if self.is_ready():
                print("[DBG]: Instance is ready")
                break
            else:
                # print("[DBG]: Instance not ready yet")
                pass

            time.sleep(0.5)
dataset/ETHPy150Open weblabdeusto/weblabdeusto/server/src/test/selenium/base.py/TestWeblabInstanceRunner.wait_until_ready/original