def intervals(self, range_start=datetime.datetime.min, range_end=datetime.datetime.max):
<EOL>current_period = None<EOL>max_continuous_days = <NUM_LIT><EOL>range_start = self.to_timezone(range_start)<EOL>range_end = self.to_timezone(range_end)<EOL>for period in self._daily_periods(range_start.date(), range_end.date()):<EOL><INDENT>if period.end < range_start or period.start > range_end:<EOL><INDENT>continue<EOL><DEDENT>if current_period is None:<EOL><INDENT>current_period = period<EOL><DEDENT>else:<EOL><INDENT>if ( ((period.start < current_period.end)<EOL>or (period.start - current_period.end) <= datetime.timedelta(minutes=<NUM_LIT:1>))<EOL>and (current_period.end - current_period.start) < datetime.timedelta(days=max_continuous_days)):<EOL><INDENT>current_period = Period(current_period.start, period.end)<EOL><DEDENT>else:<EOL><INDENT>yield current_period<EOL>current_period = period<EOL><DEDENT><DEDENT><DEDENT>if current_period:<EOL><INDENT>yield current_period<EOL><DEDENT>
Returns an iterator of Period tuples for continuous stretches of time during
        which this event is in effect, between range_start and range_end.