def wait_for_release(build_id, release_name, timeout_seconds=60):
    """Waits for a release to enter a terminal state."""
    start = time.time()
    while True:
        release = (models.Release.query
            .filter_by(build_id=build_id, name=release_name)
            .order_by(models.Release.number.desc())
            .first())
        db.session.refresh(release)
        if release.status == models.Release.REVIEWING:
            return release
        else:
            logging.info('Release status: %s', release.status)

        assert timeout_seconds < time.time() - start, (
            'Timing out waiting for release to enter terminal state')
        time.sleep(1)
dataset/ETHPy150Open bslatkin/dpxdt/tests/site_diff_test.py/wait_for_release/swapped operands of `<`