<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def offset(self, offset):
 """ Offset the date range by the given amount of periods. This differs from :meth:`~spans.types.OffsetableRangeMixin.offset` on :class:`spans.types.daterange` by not accepting a ``timedelta`` object. Instead it expects an integer to adjust the typed date range by. The given value may be negative as well. :param offset: Number of periods to offset this range by. A period is either a day, week, american week, month, quarter or year, depending on this range's period type. :return: New offset :class:`~spans.types.PeriodRange` """


        span = self
        if offset > 0:
            for i in iter_range(offset):
                span = span.next_period()
        elif offset < 0:
            for i in iter_range(-offset):
                span = span.prev_period()
        return span