def wait(self, timeout=None, wait_interval=5, wait_callback=None, callback=None):
        """Sleep until the job has been finished

        Params:
            timeout (int): Timeout in seconds. No timeout by default.
            wait_interval (int): wait interval in second. Default 5 seconds.
            wait_callback (callable): A callable to be called on every tick of wait interval.
        """
        started_at = time.time()
        while not self.finished():
            if timeout is None or timeout < abs(time.time() - started_at):
                time.sleep(wait_interval)
                cb = wait_callback if callable(wait_callback) else callback
                if callable(cb):
                    cb(self)
            else:
                raise RuntimeError("timeout") # TODO: throw proper error
        self.update()
dataset/ETHPy150Open treasure-data/td-client-python/tdclient/job_model.py/Job.wait/swapped operands of `<`