parameters: (default_timeout, default_retries)
return_statement: return decorator
docstring: Returns a decorator that handles timeouts and retries.
  
    The provided |default_timeout| and |default_retries| values are used only
    if timeout and retries values are not provided.
  
    Args:
      default_timeout: The number of seconds to wait for the decorated function
                       to return. Only used if a 'timeout' kwarg is not passed
                       to the decorated function.
      default_retries: The number of times the decorated function should be
                       retried on failure. Only used if a 'retries' kwarg is not
                       passed to the decorated function.
    Returns:
      The actual decorator.
docstring_summary: Returns a decorator that handles timeouts and retries.
docstring_tokens: Returns a decorator that handles timeouts and retries .
function: def WithTimeoutAndRetriesDefaults(default_timeout, default_retries):
    """Returns a decorator that handles timeouts and retries.
  
    The provided |default_timeout| and |default_retries| values are used only
    if timeout and retries values are not provided.
  
    Args:
      default_timeout: The number of seconds to wait for the decorated function
                       to return. Only used if a 'timeout' kwarg is not passed
                       to the decorated function.
      default_retries: The number of times the decorated function should be
                       retried on failure. Only used if a 'retries' kwarg is not
                       passed to the decorated function.
    Returns:
      The actual decorator.
    """
    def decorator(f):
      get_timeout = lambda *a, **kw: kw.get('timeout', default_timeout)
      get_retries = lambda *a, **kw: kw.get('retries', default_retries)
      return _TimeoutRetryWrapper(f, get_timeout, get_retries, pass_values=True)
    return decorator
function_tokens: def WithTimeoutAndRetriesDefaults ( default_timeout , default_retries ) : def decorator ( f ) : get_timeout = lambda * a , * * kw : kw . get ( 'timeout' , default_timeout ) get_retries = lambda * a , * * kw : kw . get ( 'retries' , default_retries ) return _TimeoutRetryWrapper ( f , get_timeout , get_retries , pass_values = True ) return decorator