def wait(func):
    @wraps(func)
    def wrapper(self, *args, **kwargs):
        i = settings.SELENIUM_DRIVER_TIMEOUT
        if 'timeout' in kwargs:
            i = kwargs.pop('timeout')
        res = func(self, *args, **kwargs)
        while not res and i:
            time.sleep(1)
            res = func(self, *args, **kwargs)
            i -= 1
        return res
    return wrapper
dataset/ETHPy150Open dragoon/django-selenium/django_selenium/testcases.py/wait/original