def filter_by_date(data, year):
    """
    Filter the given data (list of dict) before the given year
    Date is in the 'mandature' columm
    """
    res_data = list()
    for item in data:
        date = item['mandature']
        b_date, e_date = date.split('-')
        if int(b_date) < int(year):
            res_data.append(item)
    return res_data