<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def n_points(self, start=-inf, end=+inf, mask=None, include_start=True, include_end=False, normalized=False):
 """Calculate the number of points over the given time range from `start` to `end`. Args: start (orderable, optional):
 The lower time bound of when to calculate the distribution. By default, start is -infinity. end (orderable, optional):
 The upper time bound of when to calculate the distribution. By default, the end is +infinity. mask (:obj:`TimeSeries`, optional):
 A domain on which to calculate the distribution. Returns: `int` with the result """

        # just go ahead and return 0 if we already know it regarless
        # of boundaries
        if not self.n_measurements():
            return 0

        start, end, mask = self._check_boundaries(start, end, mask=mask)

        count = 0
        for start, end, _ in mask.iterperiods(value=True):

            if include_end:
                end_count = self._d.bisect_right(end)
            else:
                end_count = self._d.bisect_left(end)

            if include_start:
                start_count = self._d.bisect_left(start)
            else:
                start_count = self._d.bisect_right(start)

            count += (end_count - start_count)

        if normalized:
            count /= float(self.n_measurements())

        return count