code: def before_func_accept_retry_state(fn):
      
      if not six.callable(fn):
          return fn
  
      if func_takes_retry_state(fn):
          return fn
  
      @_utils.wraps(fn)
      def wrapped_before_func(retry_state):
          # func, trial_number, trial_time_taken
          warn_about_non_retry_state_deprecation('before', fn, stacklevel=4)
          return fn(
              retry_state.fn,
              retry_state.attempt_number,
          )
      return wrapped_before_func
docs: Wrap "before" function to accept "retry_state".