human
I wrote the below code

    assert (initialRetryDelaySec > 0), str(initialRetryDelaySec)
    assert (timeoutSec >= 0), str(timeoutSec)
    assert (maxRetryDelaySec >= initialRetryDelaySec), ('%r    <    %r' % (maxRetryDelaySec, initialRetryDelaySec))
    assert isinstance(retryExceptions, tuple), ('retryExceptions    must    be    tuple,    but    got    %r' % (type(retryExceptions),))
    if (logger is None):
        logger = logging.getLogger(__name__)
    def retryDecorator(func):
        @functools.wraps(func)
        def retryWrap(*args, **kwargs):
            numAttempts = 0
            delaySec = initialRetryDelaySec
            startTime = time.time()
            while True:
                numAttempts += 1
                try:
                    result = func(*args, **kwargs)
                except retryExceptions as e:
                    if (not retryFilter(e, args, kwargs)):
                        if logger.isEnabledFor(logging.DEBUG):
                            logger.debug('[%s]    Failure    in    %r.
   retries    aborted    by    custom    retryFilter.    Caller    stack:\n%s', clientLabel, func, ''.join(traceback.format_stack()), exc_info=True)
                        raise
                    now = time.time()
                    if (now < startTime):
                        startTime = now
                    if ((now - startTime) >= timeoutSec):
                        logger.exception('[%s]    Exhausted    retry    timeout    (%s    sec..
   %s    attempts)    for    %r.    Caller    stack:\n%s', clientLabel, timeoutSec, numAttempts, func, ''.join(traceback.format_stack()))
                        raise
                    if (numAttempts == 1):
                        logger.warning('[%s]    First    failure    in    %r.
   initial    retry    in    %s    sec..
   timeoutSec=%s.    Caller    stack:\n%s', clientLabel, func, delaySec, timeoutSec, ''.join(traceback.format_stack()), exc_info=True)
                    else:
                        logger.debug('[%s]    %r    failed    %s    times.
   retrying   ...

What's a good function header?
assistant
#Here's a good function header.

def retry(timeoutSec, initialRetryDelaySec, maxRetryDelaySec, retryExceptions=(Exception,), retryFilter=(lambda e, args, kwargs: True), logger=None, clientLabel=''):