<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def mean(self, start=None, end=None, mask=None):
 """This calculated the average value of the time series over the given time range from `start` to `end`, when `mask` is truthy. """

        return self.distribution(start=start, end=end, mask=mask).mean()