docs: def aggregate(self, reducer, seed=default, result_selector=identity):
          '''Apply a function over a sequence to produce a single result.
  
          Apply a binary function cumulatively to the elements of the source
          sequence so as to reduce the iterable to a single value.
  
          Note: This method uses immediate execution.
  
          Args:
              reducer: A binary function the first positional argument of which
                  is an accumulated value and the second is the update value from
                  the source sequence. The return value should be the new
                  accumulated value after the update value has been incorporated.
  
              seed: An optional value used to initialise the accumulator before
                   iteration over the source sequence. If seed is omitted the
                   and the source sequence contains only one item, then that item
                   is returned.
  
              result_selector: An optional unary function applied to the final
                  accumulator value to produce the result. If omitted, defaults
                  to the identity function.
  
          Raises:
              ValueError: If called on an empty sequence with no seed value.
              TypeError: If reducer is not callable.
              TypeError: If result_selector is not callable.
          '''
          if self.closed():
              raise ValueError("Attempt to call aggregate() on a "
                               "closed Queryable.")
  
          if not is_callable(reducer):
              raise TypeError("aggregate() parameter reducer={0} is "
                              "not callable".format(repr(reducer)))
  
          if not is_callable(result_selector):
              raise TypeError("aggregate() parameter result_selector={0} is "
                              "not callable".format(repr(result_selector)))
  
          if seed is default:
              try:
                  return result_selector(fold(reducer, self))
              except TypeError as e:
                  if 'empty sequence' in str(e):
                      raise ValueError("Cannot aggregate() empty sequence with "
                                       "no seed value")
          return result_selector(fold(reducer, self, seed))