docs: def average(self, selector=identity):
          '''Return the arithmetic mean of the values in the sequence..
  
          All of the source sequence will be consumed.
  
          Note: This method uses immediate execution.
  
          Args:
              selector: An optional single argument function which will be used
                  to project the elements of the sequence. If omitted, the
                  identity function is used.
  
          Returns:
              The arithmetic mean value of the projected sequence.
  
          Raises:
              ValueError: If the Queryable has been closed.
              ValueError: I the source sequence is empty.
          '''
          if self.closed():
              raise ValueError("Attempt to call average() on a "
                               "closed Queryable.")
  
          if not is_callable(selector):
              raise TypeError("average() parameter selector={0} is "
                              "not callable".format(repr(selector)))
  
          total = 0
          count = 0
          for item in self.select(selector):
              total += item
              count += 1
          if count == 0:
              raise ValueError("Cannot compute average() of an empty sequence.")
          return total / count