def filter_function(sections):
    d = {}
    for x in sections:
        if (x not in d.keys()):
            d.update({x: 1})
        else:
            d[x] += 1
    return sorted(list(d.items()), key=(lambda k: (k[0][1] + (semester_order.index(k[0][0]) / 10))))
def filter_function(sections):
    d = {}
    for x in sections:
        if (x not in d.keys()):
            d.update({x: 1})
        else:
            d[x] += 1
    return sorted(list(d.items()), key=(lambda k: (k[0][1] + (semester_order.index(k[0][0]) / 10))))