

def add_term_data(output):
    print('adding commissioner term information')
    term_data = csv.reader(open('data/anc-terms.csv'), delimiter=',')
    con_data = csv.reader(open('data/anc-contestation.csv'), delimiter=',')
    for rec in term_data:
        smd = rec[1]
        output[smd[0]]['ancs'][smd[1]]['smds'][smd[2:]]['terms'] = rec[5]
    for rec in con_data:
        smd = rec[0]
        output[smd[0]]['ancs'][smd[1]]['smds'][smd[2:]]['contestation'] = rec[1]

dataset/ETHPy150Open codefordc/ancfinder/scripts/update_anc_database.py add_term_data/original