<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def ImportTrafficRestrictions(self, restrictions_file):
    "Reads the vb_regio.mdv file."
    ParseDate = lambda x: datetime.date(int(x[:4]), int(x[4:6]), int(x[6:8]))
    MonthNr = lambda x: int(x[:4]) * 12 + int(x[4:6])
    for schedule, id, bitmask, start_date, end_date in  \
    ReadCSV(restrictions_file,
            ['FPL_KUERZEL', 'VB', 'VB_DATUM', 'DATUM_VON', 'DATUM_BIS']):
      id = u"VB%s.%s" % (schedule, id)
      bitmask = bitmask.strip()
      dates = {}

      # This is ugly as hell, I know. I briefly explain what I do:
      # 8 characters in the bitmask equal a month ( 8 * 4bits = 32, no month has
      # more than 31 days, so it's ok).
      # Then I check if the current day of the month is in the bitmask (by
      # shifting the bit by x days and comparing it to the bitmask).
      # If so I calculate back what year month and actual day I am in
      # (very disgusting) and mark that date...
      for i in range(MonthNr(end_date) - MonthNr(start_date)+1):
        mask=int(bitmask[i*8:i*8+8], 16)
        for d in range(32):
          if 1 << d & mask:
            year=int(start_date[0:4])+ ((int(start_date[4:6]) + i -1 )) / 12
            month=((int(start_date[4:6]) + i-1 ) % 12) +1
            day=d+1
            cur_date = str(year)+("0"+str(month))[-2:]+("0"+str(day))[-2:]
            dates[int(cur_date)] = 1
      self.services[id] = dates.keys()
      self.services[id].sort()