def googleRetry(f):
    """
    This decorator retries the wrapped function if google throws any angry service
    errors.

    It should wrap any function that makes use of the Google Client API
    """
    @wraps(f)
    def wrapper(*args, **kwargs):
        for attempt in retry(delays=truncExpBackoff(),
                             timeout=300,
                             predicate=googleRetryPredicate):
            with attempt:
                return f(*args, **kwargs)
    return wrapper
def googleRetry ( f ) : @ wraps ( f ) def wrapper ( * args , ** kwargs ) : for attempt in retry ( delays = truncExpBackoff ( ) , timeout = 300 , predicate = googleRetryPredicate ) : with attempt : return f ( * args , ** kwargs ) return wrapper
This decorator retries the wrapped function if google throws any angry service
    errors.

    It should wrap any function that makes use of the Google Client API