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