<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setup(self):
 """ Create mask list. Consists of all tuples between which this filter accepts lines. """

        # get start and end of the mask and set a start_limit
        if not self.mask_source.start:
            raise SystemExit("Can't parse format of %s. Is this a log file or "
                             "system.profile collection?"
                             % self.mlogfilter.args['mask'])

        self.mask_half_td = timedelta(seconds=self.mlogfilter.args
                                      ['mask_size'] / 2)

        # load filter mask file
        logevent_list = list(self.mask_source)

        # define start and end of total mask
        self.mask_start = self.mask_source.start - self.mask_half_td
        self.mask_end = self.mask_source.end + self.mask_half_td

        # consider --mask-center
        if self.mlogfilter.args['mask_center'] in ['start', 'both']:
            if logevent_list[0].duration:
                self.mask_start -= timedelta(milliseconds=logevent_list[0]
                                             .duration)

        if self.mlogfilter.args['mask_center'] == 'start':
            if logevent_list[-1].duration:
                self.mask_end -= timedelta(milliseconds=logevent_list[-1]
                                           .duration)

        self.start_limit = self.mask_start

        # different center points
        if 'mask_center' in self.mlogfilter.args:
            if self.mlogfilter.args['mask_center'] in ['start', 'both']:
                starts = ([(le.datetime - timedelta(milliseconds=le.duration))
                          if le.duration is not None else le.datetime
                          for le in logevent_list if le.datetime])

            if self.mlogfilter.args['mask_center'] in ['end', 'both']:
                ends = [le.datetime for le in logevent_list if le.datetime]

            if self.mlogfilter.args['mask_center'] == 'start':
                event_list = sorted(starts)
            elif self.mlogfilter.args['mask_center'] == 'end':
                event_list = sorted(ends)
            elif self.mlogfilter.args['mask_center'] == 'both':
                event_list = sorted(zip(starts, ends))

        mask_list = []

        if len(event_list) == 0:
            return

        start_point = end_point = None

        for e in event_list:
            if start_point is None:
                start_point, end_point = self._pad_event(e)
                continue

            next_start = (e[0] if type(e) == tuple else e) - self.mask_half_td
            if next_start <= end_point:
                end_point = ((e[1] if type(e) == tuple else e) +
                             self.mask_half_td)
            else:
                mask_list.append((start_point, end_point))
                start_point, end_point = self._pad_event(e)

        if start_point:
            mask_list.append((start_point, end_point))

        self.mask_list = mask_list