docs: def build_accumulate(function: Callable[[Any, Any], Tuple[Any, Any]] = None, *,
                       init: Any = NONE):
      """ Decorator to wrap a function to return an Accumulate operator.
  
      :param function: function to be wrapped
      :param init: optional initialization for state
      """
      _init = init
  
      def _build_accumulate(function: Callable[[Any, Any], Tuple[Any, Any]]):
          @wraps(function)
          def _wrapper(init=NONE) -> Accumulate:
              init = _init if init is NONE else init
              if init is NONE:
                  raise TypeError('"init" argument has to be defined')
              return Accumulate(function, init=init)
          return _wrapper
  
      if function:
          return _build_accumulate(function)
  
      return _build_accumulate