def retry_with_delay(f, delay=60):
    @wraps(f)
    def inner(*args, **kwargs):
        kwargs['timeout'] = 5
        remaining = get_retries() + 1
        while remaining:
            remaining -= 1
            try:
                return f(*args, **kwargs)
            except (requests.ConnectionError, requests.Timeout):
                if not remaining:
                    raise
                gevent.sleep(delay)
    return inner
Retry the wrapped requests.request function in case of ConnectionError.
dataset/ETHPy150Open iancmcc/ouimeaux/ouimeaux/utils.py/retry_with_delay