<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_z(cls, offset):
 """ Parse %z offset into `timedelta` """

        assert len(offset) == 5, 'Invalid offset string format, must be "+HHMM"'
        return timedelta(hours=int(offset[:3]), minutes=int(offset[0] + offset[3:]))