code: def sum(self, default=None):
          
          return numpy.asscalar(numpy.sum(self.values)) if self.values else default
docs: Calculate the sum of all the values in the times series.
  
          :param default: Value to return as a default should the calculation not be possible.
          :return: Float representing the sum or `None`.