def retry(times, func, *args, **kwargs):

    for i in range(times):
        try:
            return func(*args, **kwargs)
        except Exception:
            if i == times - 1:
                raise
Try to execute multiple times function mitigating exceptions.
dataset/ETHPy150Open openstack/rally/rally/common/utils.py/retry