def with_retry(method, should_retry=None, steps=None, sleep=None):
 if (should_retry is None):
  should_retry = retry_always
 if (steps is None):
  steps = get_default_retry_steps()
 def method_with_retry(*a, **kw):
  name = _callable_repr(method)
  action_type = _TRY_UNTIL_SUCCESS
  with start_action(action_type=action_type, function=name):
   return _poll_until_success_returning_result(should_retry, steps, sleep, method, a, kw)
 return method_with_retry

def with_retry ( method , should_retry = None , steps = None , sleep = None ) : if ( should_retry is None ) : should_retry = retry_always if ( steps is None ) : steps = get_default_retry_steps ( ) def method_with_retry ( * a , ** kw ) : name = _callable_repr ( method ) action_type = _TRY_UNTIL_SUCCESS with start_action ( action_type = action_type , function = name ) : return _poll_until_success_returning_result ( should_retry , steps , sleep , method , a , kw ) return method_with_retry
return a new version of method that retries .